CbmRoot
CbmHadronAnalysis.cxx
Go to the documentation of this file.
1 // ------------------------------------------------------------------
2 // ----- CbmHadronAnalysis -----
3 // ----- Created 14/12/2012 by nh -----
4 // ------------------------------------------------------------------
5 #include <iostream>
6 using namespace std;
7 
8 #include "TClonesArray.h"
9 #include "TFile.h"
10 #include "TH1.h"
11 #include "TH1F.h"
12 #include "TH2F.h"
13 #include "TMath.h"
14 #include "TRandom.h"
15 #include "TString.h"
16 
17 #include "CbmCluster.h"
18 #include "CbmDigiManager.h"
19 #include "CbmEvent.h"
20 #include "CbmGlobalTrack.h"
21 #include "CbmHadron.h"
22 #include "CbmHadronAnalysis.h"
23 #include "CbmKFVertex.h"
24 #include "CbmLink.h"
25 #include "CbmMCDataArray.h"
26 #include "CbmMCDataManager.h"
27 #include "CbmMCTrack.h"
28 #include "CbmMatch.h"
29 #include "CbmStsCluster.h"
30 #include "CbmStsDigi.h"
31 #include "CbmStsHit.h"
32 #include "CbmStsKFTrackFitter.h"
33 #include "CbmStsPoint.h"
34 #include "CbmStsTrack.h"
35 #include "CbmTofCell.h"
36 #include "CbmTofDetectorId_v12b.h"
37 #include "CbmTofGeoHandler.h"
38 #include "CbmTofHit.h"
39 #include "CbmTofPoint.h"
40 #include "CbmTofTrack.h"
41 #include "CbmTrdHit.h"
42 #include "CbmTrdPoint.h"
43 #include "CbmVertex.h"
44 #include "FairLogger.h"
45 #include "FairMCEventHeader.h"
46 #include "FairMCPoint.h"
47 #include "FairRootManager.h"
48 
49 CbmDigiManager* fDigiMan; // TOF Input Digis
50 TClonesArray* fEventsColl; // CBMEvents (time based)
51 TClonesArray* fTofTracks; // CbmTofTrack array
52 TClonesArray* fTofHitsColl;
53 TClonesArray* fStsHitsColl;
54 
55 static Int_t iNbTs = 0;
56 
57 #define M2PI 0.019479835
58 #define M2KA 0.24371698
59 #define M2PROT 0.88035435
60 #define clight 29.9792
61 #define MinWallDist 550.
62 
63 Int_t nMCTracks = 0, nTofPoints = 0, nTofHits = 0;
64 Int_t nTofTracks = 0;
65 Int_t nStsHits = 0;
66 Int_t nGlobTracks = 0;
67 Int_t NMASS = 3;
68 Float_t refMass[3] = {0.139, 0.494, 0.938};
69 
70 //___________________________________________________________________
71 //
72 // CbmHadronAnalysis
73 //
74 // Task for analysis of hadron spectra
75 //
76 // ------------------------------------------------------------------
78  : FairTask("HadronAnalysis")
79  , fEvents(0)
80  , fBeamMomentum(10)
81  , fMidY(0.)
82  , fDY(0.)
83  , fFlowMinPtm(0.)
84  , fBSelMin(0.)
85  , fBSelMax(0.)
86  , fwxy2(0.)
87  , fWMax(0.)
88  , fVtxBMax(0.)
89  , fPdfFileName("")
90  , fFlowFileName("")
91  , fflowFile(NULL)
92  , fMCEventHeader(NULL)
93  , fGeoHandler(NULL)
94  , fCellInfo(NULL)
95  , fMCTracks(NULL)
96  , fStsPoints(NULL)
97  , fMCTracksColl(NULL)
98  , fStsPointsColl(NULL)
99  , fStsHits(NULL)
100  , fStsClusters(NULL)
101  , fStsTracks(NULL)
102  , fStsDigis(NULL)
103  , fStsDigiMatchColl(NULL)
104  , fTrdPoints(NULL)
105  , fTrdHits(NULL)
106  , fTofPoints(NULL)
107  , fTofHits(NULL)
108  , fTofDigis(NULL)
109  , fTofDigiMatchColl(NULL)
110  , fTofDigiMatchPointsColl(NULL)
111  , fGlobalTracks(NULL)
112  , fHadrons(NULL)
113  , fPrimVertex(NULL)
114  , fTrackFitter()
115  , fa_ptm_rap_gen_pip(NULL)
116  , fa_ptm_rap_gen_pim(NULL)
117  , fa_ptm_rap_gen_kp(NULL)
118  , fa_ptm_rap_gen_km(NULL)
119  , fa_ptm_rap_gen_p(NULL)
120  , fa_ptm_rap_gen_pbar(NULL)
121  , fa_ptm_rap_gen_d(NULL)
122  , fa_ptm_rap_gen_t(NULL)
123  , fa_ptm_rap_gen_h(NULL)
124  , fa_ptm_rap_gen_a(NULL)
125  , fa_ptm_rap_gen_imf(NULL)
126  , fa_plab_sts_pip(NULL)
127  , fa_plab_sts_pim(NULL)
128  , fa_plab_sts_kp(NULL)
129  , fa_plab_sts_km(NULL)
130  , fa_plab_sts_p(NULL)
131  , fa_plab_sts_pbar(NULL)
132  , fa_ptm_rap_sts_pip(NULL)
133  , fa_ptm_rap_sts_pim(NULL)
134  , fa_ptm_rap_sts_kp(NULL)
135  , fa_ptm_rap_sts_km(NULL)
136  , fa_ptm_rap_sts_p(NULL)
137  , fa_ptm_rap_sts_pbar(NULL)
138  , fa_ptm_rap_sts_d(NULL)
139  , fa_ptm_rap_sts_t(NULL)
140  , fa_ptm_rap_sts_h(NULL)
141  , fa_ptm_rap_sts_a(NULL)
142  , fa_ptm_rap_sts_imf(NULL)
143  , fa_ptm_rap_poi_pip(NULL)
144  , fa_ptm_rap_poi_pim(NULL)
145  , fa_ptm_rap_poi_kp(NULL)
146  , fa_ptm_rap_poi_km(NULL)
147  , fa_ptm_rap_poi_p(NULL)
148  , fa_ptm_rap_poi_pbar(NULL)
149  , fa_ptm_rap_poi_d(NULL)
150  , fa_ptm_rap_poi_t(NULL)
151  , fa_ptm_rap_poi_h(NULL)
152  , fa_ptm_rap_poi_a(NULL)
153  , fa_ptm_rap_poi_imf(NULL)
154  , fa_ptm_rap_hit_pip(NULL)
155  , fa_ptm_rap_hit_pim(NULL)
156  , fa_ptm_rap_hit_kp(NULL)
157  , fa_ptm_rap_hit_km(NULL)
158  , fa_ptm_rap_hit_p(NULL)
159  , fa_ptm_rap_hit_pbar(NULL)
160  , fa_ptm_rap_hit_d(NULL)
161  , fa_ptm_rap_hit_t(NULL)
162  , fa_ptm_rap_hit_h(NULL)
163  , fa_ptm_rap_hit_a(NULL)
164  , fa_ptm_rap_hit_imf(NULL)
165  , fa_ptm_rap_glo_pip(NULL)
166  , fa_ptm_rap_glo_pim(NULL)
167  , fa_ptm_rap_glo_kp(NULL)
168  , fa_ptm_rap_glo_km(NULL)
169  , fa_ptm_rap_glo_p(NULL)
170  , fa_ptm_rap_glo_pbar(NULL)
171  , fa_ptm_rap_glo_d(NULL)
172  , fa_ptm_rap_glo_t(NULL)
173  , fa_ptm_rap_glo_h(NULL)
174  , fa_ptm_rap_glo_a(NULL)
175  , fa_ptm_rap_glo_imf(NULL)
176  , fa_mul_b_gen(NULL)
177  , fa_mul_b_poi(NULL)
178  , fa_mul_b_hit(NULL)
179  , fa_mul_b_glo(NULL)
180  , fa_mul_b_had(NULL)
181  , fa_phirp_b_gen(NULL)
182  , fa_phgrp_b_gen(NULL)
183  , fa_phphrp_gen(NULL)
184  , fa_delrp_b_gen(NULL)
185  , fa_delrp_b_poi(NULL)
186  , fa_delrp_b_hit(NULL)
187  , fa_delrp_b_glo(NULL)
188  , fa_drp_b_gen(NULL)
189  , fa_cdrp_b_gen(NULL)
190  , fa_drp_b_poi(NULL)
191  , fa_cdrp_b_poi(NULL)
192  , fa_drp_b_hit(NULL)
193  , fa_cdrp_b_hit(NULL)
194  , fa_drp_b_glo(NULL)
195  , fa_cdrp_b_glo(NULL)
196  , fa_drp_b_had(NULL)
197  , fa_cdrp_b_had(NULL)
198  , fa_cdelrp_b_gen(NULL)
199  , fa_cdelrp_b_poi(NULL)
200  , fa_cdelrp_b_hit(NULL)
201  , fa_cdelrp_b_glo(NULL)
202  , fa_cdelrp_b_had(NULL)
203  , fa_phirp_gen(NULL)
204  , fa_phirp_poi(NULL)
205  , fa_phirp_hit(NULL)
206  , fa_phirp_glo(NULL)
207  , fa_phirp_had(NULL)
208  , fa_phirps_gen(NULL)
209  , fa_phirps_poi(NULL)
210  , fa_phirps_hit(NULL)
211  , fa_phirps_glo(NULL)
212  , fa_phirps_had(NULL)
213  , fa_v1_rap_gen_pip(NULL)
214  , fa_v1_rap_gen_pim(NULL)
215  , fa_v1_rap_gen_kp(NULL)
216  , fa_v1_rap_gen_km(NULL)
217  , fa_v1_rap_gen_p(NULL)
218  , fa_v1_rap_gen_pbar(NULL)
219  , fa_v1_rap_gen_d(NULL)
220  , fa_v1_rap_gen_t(NULL)
221  , fa_v1_rap_gen_h(NULL)
222  , fa_v1_rap_gen_a(NULL)
223  , fa_v1_rap_gen_imf(NULL)
224  , fa_v2_rap_gen_pip(NULL)
225  , fa_v2_rap_gen_pim(NULL)
226  , fa_v2_rap_gen_kp(NULL)
227  , fa_v2_rap_gen_km(NULL)
228  , fa_v2_rap_gen_p(NULL)
229  , fa_v2_rap_gen_pbar(NULL)
230  , fa_v2_rap_gen_d(NULL)
231  , fa_v2_rap_gen_t(NULL)
232  , fa_v2_rap_gen_h(NULL)
233  , fa_v2_rap_gen_a(NULL)
234  , fa_v2_rap_gen_imf(NULL)
235  , fa_v1_rap_poi_pip(NULL)
236  , fa_v1_rap_poi_pim(NULL)
237  , fa_v1_rap_poi_kp(NULL)
238  , fa_v1_rap_poi_km(NULL)
239  , fa_v1_rap_poi_p(NULL)
240  , fa_v1_rap_poi_pbar(NULL)
241  , fa_v1_rap_poi_d(NULL)
242  , fa_v1_rap_poi_t(NULL)
243  , fa_v1_rap_poi_h(NULL)
244  , fa_v1_rap_poi_a(NULL)
245  , fa_v1_rap_poi_imf(NULL)
246  , fa_v2_rap_poi_pip(NULL)
247  , fa_v2_rap_poi_pim(NULL)
248  , fa_v2_rap_poi_kp(NULL)
249  , fa_v2_rap_poi_km(NULL)
250  , fa_v2_rap_poi_p(NULL)
251  , fa_v2_rap_poi_pbar(NULL)
252  , fa_v2_rap_poi_d(NULL)
253  , fa_v2_rap_poi_t(NULL)
254  , fa_v2_rap_poi_h(NULL)
255  , fa_v2_rap_poi_a(NULL)
256  , fa_v2_rap_poi_imf(NULL)
257  , fa_v1_rap_hit_pip(NULL)
258  , fa_v1_rap_hit_pim(NULL)
259  , fa_v1_rap_hit_kp(NULL)
260  , fa_v1_rap_hit_km(NULL)
261  , fa_v1_rap_hit_p(NULL)
262  , fa_v1_rap_hit_pbar(NULL)
263  , fa_v1_rap_hit_d(NULL)
264  , fa_v1_rap_hit_t(NULL)
265  , fa_v1_rap_hit_h(NULL)
266  , fa_v1_rap_hit_a(NULL)
267  , fa_v1_rap_hit_imf(NULL)
268  , fa_v2_rap_hit_pip(NULL)
269  , fa_v2_rap_hit_pim(NULL)
270  , fa_v2_rap_hit_kp(NULL)
271  , fa_v2_rap_hit_km(NULL)
272  , fa_v2_rap_hit_p(NULL)
273  , fa_v2_rap_hit_pbar(NULL)
274  , fa_v2_rap_hit_d(NULL)
275  , fa_v2_rap_hit_t(NULL)
276  , fa_v2_rap_hit_h(NULL)
277  , fa_v2_rap_hit_a(NULL)
278  , fa_v2_rap_hit_imf(NULL)
279  , fa_v1_rap_glo_pip(NULL)
280  , fa_v1_rap_glo_pim(NULL)
281  , fa_v1_rap_glo_kp(NULL)
282  , fa_v1_rap_glo_km(NULL)
283  , fa_v1_rap_glo_p(NULL)
284  , fa_v1_rap_glo_pbar(NULL)
285  , fa_v1_rap_glo_d(NULL)
286  , fa_v1_rap_glo_t(NULL)
287  , fa_v1_rap_glo_h(NULL)
288  , fa_v1_rap_glo_a(NULL)
289  , fa_v1_rap_glo_imf(NULL)
290  , fa_v2_rap_glo_pip(NULL)
291  , fa_v2_rap_glo_pim(NULL)
292  , fa_v2_rap_glo_kp(NULL)
293  , fa_v2_rap_glo_km(NULL)
294  , fa_v2_rap_glo_p(NULL)
295  , fa_v2_rap_glo_pbar(NULL)
296  , fa_v2_rap_glo_d(NULL)
297  , fa_v2_rap_glo_t(NULL)
298  , fa_v2_rap_glo_h(NULL)
299  , fa_v2_rap_glo_a(NULL)
300  , fa_v2_rap_glo_imf(NULL)
301  , fa_xy_poi1(NULL)
302  , fa_xy_poi2(NULL)
303  , fa_xy_poi3(NULL)
304  , fa_xy_hit1(NULL)
305  , fa_xy_hit2(NULL)
306  , fa_xy_hit3(NULL)
307  , fa_xy_glo1(NULL)
308  , fa_xy_glo_pip(NULL)
309  , fa_xy_glo_pim(NULL)
310  , fa_xy_glo_kp(NULL)
311  , fa_xy_glo_km(NULL)
312  , fa_xy_glo_p(NULL)
313  , fa_xy_glo_pbar(NULL)
314  , fa_xy_glo_d(NULL)
315  , fa_xy_glo_t(NULL)
316  , fa_xy_glo_h(NULL)
317  , fa_xy_glo_a(NULL)
318  , fa_pv_poi(NULL)
319  , fa_tm_poi(NULL)
320  , fa_tm_poiprim(NULL)
321  , fa_dxx(NULL)
322  , fa_dxy(NULL)
323  , fa_dxz(NULL)
324  , fa_dyx(NULL)
325  , fa_dyy(NULL)
326  , fa_dyz(NULL)
327  , fa_dzx(NULL)
328  , fa_dzy(NULL)
329  , fa_dzz(NULL)
330  , fa_hit_ch(NULL)
331  , fa_dhit_ch(NULL)
332  , fa_tof_hit(NULL)
333  , fa_dtof_hit(NULL)
334  , fa_tof_hitprim(NULL)
335  , fa_pv_hit(NULL)
336  , fa_tm_hit(NULL)
337  , fa_tm_hitprim(NULL)
338  , fa_tn_hit(NULL)
339  , fa_t0_hit(NULL)
340  , fa_t0m_hit(NULL)
341  , fa_t0mn_hit(NULL)
342  , fa_t0m_b_hit(NULL)
343  , fa_t0mn_b_hit(NULL)
344  , fa_t0m_f_hit(NULL)
345  , fa_t0mn_f_hit(NULL)
346  , fa_t0m_f_b_hit(NULL)
347  , fa_t0mn_f_b_hit(NULL)
348  , fa_t0m_nf_hit(NULL)
349  , fa_t0mn_nf_hit(NULL)
350  , fa_t0m_nf_b_hit(NULL)
351  , fa_t0mn_nf_b_hit(NULL)
352  , fa_TofTrackMul(NULL)
353  , fa_VtxB(NULL)
354  , fa_chi2_mom_glo(NULL)
355  , fa_chi2_mom_gloprim(NULL)
356  , fa_len_mom_glo(NULL)
357  , fa_pv_glo(NULL)
358  , fa_tm_glo(NULL)
359  , fa_tm_glo_pip(NULL)
360  , fa_tm_glo_pim(NULL)
361  , fa_tm_glo_kp(NULL)
362  , fa_tm_glo_km(NULL)
363  , fa_tm_glo_p(NULL)
364  , fa_tm_glo_pbar(NULL)
365  , fa_tm_glo_d(NULL)
366  , fa_tm_glo_t(NULL)
367  , fa_tm_glo_h(NULL)
368  , fa_tm_glo_a(NULL)
369  , fa_tm_gloprim(NULL)
370  , fa_tm_glomis(NULL)
371  , fa_tm_glovtxb(NULL)
372  , fa_tm_gloprimvtxb(NULL)
373  , fa_m2mom_glo(NULL)
374  , fa_m2mom_glovtxb(NULL)
375  , fa_m2mom_gloprim(NULL)
376  , fa_m2mom_gloprimvtxb(NULL)
377  , fa_m2mom_glo_pip(NULL)
378  , fa_m2mom_glo_pim(NULL)
379  , fa_m2mom_glo_kp(NULL)
380  , fa_m2mom_glo_km(NULL)
381  , fa_m2mom_glo_p(NULL)
382  , fa_m2mom_glo_pbar(NULL)
383  , fa_m2mom_glo_d(NULL)
384  , fa_m2mom_glo_t(NULL)
385  , fa_m2mom_glo_h(NULL)
386  , fa_m2mom_glo_a(NULL)
387  , fa_pMCmom_glo(NULL)
388  , fa_pMCmom_glo_pip(NULL)
389  , fa_pMCmom_glo_pim(NULL)
390  , fa_pMCmom_glo_kp(NULL)
391  , fa_pMCmom_glo_km(NULL)
392  , fa_pMCmom_glo_p(NULL)
393  , fa_pMCmom_glo_pbar(NULL)
394  , fa_pMCmom_glo_d(NULL)
395  , fa_pMCmom_glo_t(NULL)
396  , fa_pMCmom_glo_h(NULL)
397  , fa_pMCmom_glo_a(NULL)
398  , fa_w_mom_glo(NULL)
399  , fa_w_mom_glo_pip(NULL)
400  , fa_w_mom_glo_pim(NULL)
401  , fa_w_mom_glo_kp(NULL)
402  , fa_w_mom_glo_km(NULL)
403  , fa_w_mom_glo_p(NULL)
404  , fa_w_mom_glo_pbar(NULL)
405  , fa_w_mom_glo_d(NULL)
406  , fa_w_mom_glo_t(NULL)
407  , fa_w_mom_glo_h(NULL)
408  , fa_w_mom_glo_a(NULL)
409  , fa_w_mom_gloprim(NULL)
410  , fa_w_mom_glomis(NULL)
411  , fa_LenDismom_glo(NULL)
412  , fa_LenDismom_glo_pip(NULL)
413  , fa_LenDismom_glo_pim(NULL)
414  , fa_LenDismom_glo_kp(NULL)
415  , fa_LenDismom_glo_km(NULL)
416  , fa_LenDismom_glo_p(NULL)
417  , fa_LenDismom_glo_pbar(NULL)
418  , fa_LenDismom_glo_d(NULL)
419  , fa_LenDismom_glo_t(NULL)
420  , fa_LenDismom_glo_h(NULL)
421  , fa_LenDismom_glo_a(NULL)
422  , fa_LenMcLenGlomom_glo(NULL)
423  , fa_LenMcDismom_glo(NULL)
424  , fhwdist(NULL)
425  , fhwmindelmass(NULL)
426  , fhwminlen(NULL)
427  , fhwdelp(NULL)
428  , fhTofTrkDx(NULL)
429  , fhTofTrkDy(NULL)
430  , fhTofTrkDxsel(NULL)
431  , fhTofTrkDysel(NULL)
432  , bRecSec(kFALSE)
433  , fdDistPrimLim(1.5)
434  , // Ext Parameter: Max Tof-Sts trans distance for primaries
435  fdDistPrimLim2(0.3)
436  , // Ext Parameter: Max Sts-Sts trans distance for primaries
437  fdDistSecLim2(0.5)
438  , // Ext Parameter: Max Sts-Sts trans distance from TOF direction for secondaries
439  fdD0ProtLim(0.4)
440  , // Ext Parameter: Min impact parameter for secondary proton
441  fdOpAngMin(0.01)
442  , // Ext Parameter: Min opening angle for accepting pair
443  fdDCALim(0.2)
444  , // Ext Parameter: Max DCA for accepting pair
445  fdVLenMin(5.)
446  , // Ext Parameter: Min Lambda flight path length for accepting pair
447  fdVLenMax(25.)
448  , // Ext Parameter: Max Lambda flight path length for accepting pair
449  fdDistTRD(10.)
450  , // max accepted distance of Trd Hit from STS-TOF line
451  fdTRDHmulMin(0.)
452  , // min associated Trd Hits to Track candidates
453  fNMixedEvents(1) {
455  cout << "CbmHadronAnalysis: Task started " << endl;
456 }
457 // ------------------------------------------------------------------
458 
459 // ------------------------------------------------------------------
460 CbmHadronAnalysis::CbmHadronAnalysis(const char* name, Int_t verbose)
461  : FairTask(name, verbose)
462  , fEvents(0)
463  , fBeamMomentum(10)
464  , fMidY(0.)
465  , fDY(0.)
466  , fFlowMinPtm(0.)
467  , fBSelMin(0.)
468  , fBSelMax(0.)
469  , fwxy2(0.)
470  , fWMax(0.)
471  , fVtxBMax(0.)
472  , fPdfFileName("")
473  , fFlowFileName("")
474  , fflowFile(NULL)
475  , fMCEventHeader(NULL)
476  , fGeoHandler(NULL)
477  , fCellInfo(NULL)
478  , fMCTracks(NULL)
479  , fStsPoints(NULL)
480  , fMCTracksColl(NULL)
481  , fStsPointsColl(NULL)
482  , fStsHits(NULL)
483  , fStsClusters(NULL)
484  , fStsTracks(NULL)
485  , fStsDigis(NULL)
486  , fStsDigiMatchColl(NULL)
487  , fTrdPoints(NULL)
488  , fTrdHits(NULL)
489  , fTofPoints(NULL)
490  , fTofHits(NULL)
491  , fTofDigis(NULL)
492  , fTofDigiMatchColl(NULL)
493  , fTofDigiMatchPointsColl(NULL)
494  , fGlobalTracks(NULL)
495  , fHadrons(NULL)
496  , fPrimVertex(NULL)
497  , fTrackFitter()
498  , fa_ptm_rap_gen_pip(NULL)
499  , fa_ptm_rap_gen_pim(NULL)
500  , fa_ptm_rap_gen_kp(NULL)
501  , fa_ptm_rap_gen_km(NULL)
502  , fa_ptm_rap_gen_p(NULL)
503  , fa_ptm_rap_gen_pbar(NULL)
504  , fa_ptm_rap_gen_d(NULL)
505  , fa_ptm_rap_gen_t(NULL)
506  , fa_ptm_rap_gen_h(NULL)
507  , fa_ptm_rap_gen_a(NULL)
508  , fa_ptm_rap_gen_imf(NULL)
509  , fa_plab_sts_pip(NULL)
510  , fa_plab_sts_pim(NULL)
511  , fa_plab_sts_kp(NULL)
512  , fa_plab_sts_km(NULL)
513  , fa_plab_sts_p(NULL)
514  , fa_plab_sts_pbar(NULL)
515  , fa_ptm_rap_sts_pip(NULL)
516  , fa_ptm_rap_sts_pim(NULL)
517  , fa_ptm_rap_sts_kp(NULL)
518  , fa_ptm_rap_sts_km(NULL)
519  , fa_ptm_rap_sts_p(NULL)
520  , fa_ptm_rap_sts_pbar(NULL)
521  , fa_ptm_rap_sts_d(NULL)
522  , fa_ptm_rap_sts_t(NULL)
523  , fa_ptm_rap_sts_h(NULL)
524  , fa_ptm_rap_sts_a(NULL)
525  , fa_ptm_rap_sts_imf(NULL)
526  , fa_ptm_rap_poi_pip(NULL)
527  , fa_ptm_rap_poi_pim(NULL)
528  , fa_ptm_rap_poi_kp(NULL)
529  , fa_ptm_rap_poi_km(NULL)
530  , fa_ptm_rap_poi_p(NULL)
531  , fa_ptm_rap_poi_pbar(NULL)
532  , fa_ptm_rap_poi_d(NULL)
533  , fa_ptm_rap_poi_t(NULL)
534  , fa_ptm_rap_poi_h(NULL)
535  , fa_ptm_rap_poi_a(NULL)
536  , fa_ptm_rap_poi_imf(NULL)
537  , fa_ptm_rap_hit_pip(NULL)
538  , fa_ptm_rap_hit_pim(NULL)
539  , fa_ptm_rap_hit_kp(NULL)
540  , fa_ptm_rap_hit_km(NULL)
541  , fa_ptm_rap_hit_p(NULL)
542  , fa_ptm_rap_hit_pbar(NULL)
543  , fa_ptm_rap_hit_d(NULL)
544  , fa_ptm_rap_hit_t(NULL)
545  , fa_ptm_rap_hit_h(NULL)
546  , fa_ptm_rap_hit_a(NULL)
547  , fa_ptm_rap_hit_imf(NULL)
548  , fa_ptm_rap_glo_pip(NULL)
549  , fa_ptm_rap_glo_pim(NULL)
550  , fa_ptm_rap_glo_kp(NULL)
551  , fa_ptm_rap_glo_km(NULL)
552  , fa_ptm_rap_glo_p(NULL)
553  , fa_ptm_rap_glo_pbar(NULL)
554  , fa_ptm_rap_glo_d(NULL)
555  , fa_ptm_rap_glo_t(NULL)
556  , fa_ptm_rap_glo_h(NULL)
557  , fa_ptm_rap_glo_a(NULL)
558  , fa_ptm_rap_glo_imf(NULL)
559  , fa_mul_b_gen(NULL)
560  , fa_mul_b_poi(NULL)
561  , fa_mul_b_hit(NULL)
562  , fa_mul_b_glo(NULL)
563  , fa_mul_b_had(NULL)
564  , fa_phirp_b_gen(NULL)
565  , fa_phgrp_b_gen(NULL)
566  , fa_phphrp_gen(NULL)
567  , fa_delrp_b_gen(NULL)
568  , fa_delrp_b_poi(NULL)
569  , fa_delrp_b_hit(NULL)
570  , fa_delrp_b_glo(NULL)
571  , fa_drp_b_gen(NULL)
572  , fa_cdrp_b_gen(NULL)
573  , fa_drp_b_poi(NULL)
574  , fa_cdrp_b_poi(NULL)
575  , fa_drp_b_hit(NULL)
576  , fa_cdrp_b_hit(NULL)
577  , fa_drp_b_glo(NULL)
578  , fa_cdrp_b_glo(NULL)
579  , fa_drp_b_had(NULL)
580  , fa_cdrp_b_had(NULL)
581  , fa_cdelrp_b_gen(NULL)
582  , fa_cdelrp_b_poi(NULL)
583  , fa_cdelrp_b_hit(NULL)
584  , fa_cdelrp_b_glo(NULL)
585  , fa_cdelrp_b_had(NULL)
586  , fa_phirp_gen(NULL)
587  , fa_phirp_poi(NULL)
588  , fa_phirp_hit(NULL)
589  , fa_phirp_glo(NULL)
590  , fa_phirp_had(NULL)
591  , fa_phirps_gen(NULL)
592  , fa_phirps_poi(NULL)
593  , fa_phirps_hit(NULL)
594  , fa_phirps_glo(NULL)
595  , fa_phirps_had(NULL)
596  , fa_v1_rap_gen_pip(NULL)
597  , fa_v1_rap_gen_pim(NULL)
598  , fa_v1_rap_gen_kp(NULL)
599  , fa_v1_rap_gen_km(NULL)
600  , fa_v1_rap_gen_p(NULL)
601  , fa_v1_rap_gen_pbar(NULL)
602  , fa_v1_rap_gen_d(NULL)
603  , fa_v1_rap_gen_t(NULL)
604  , fa_v1_rap_gen_h(NULL)
605  , fa_v1_rap_gen_a(NULL)
606  , fa_v1_rap_gen_imf(NULL)
607  , fa_v2_rap_gen_pip(NULL)
608  , fa_v2_rap_gen_pim(NULL)
609  , fa_v2_rap_gen_kp(NULL)
610  , fa_v2_rap_gen_km(NULL)
611  , fa_v2_rap_gen_p(NULL)
612  , fa_v2_rap_gen_pbar(NULL)
613  , fa_v2_rap_gen_d(NULL)
614  , fa_v2_rap_gen_t(NULL)
615  , fa_v2_rap_gen_h(NULL)
616  , fa_v2_rap_gen_a(NULL)
617  , fa_v2_rap_gen_imf(NULL)
618  , fa_v1_rap_poi_pip(NULL)
619  , fa_v1_rap_poi_pim(NULL)
620  , fa_v1_rap_poi_kp(NULL)
621  , fa_v1_rap_poi_km(NULL)
622  , fa_v1_rap_poi_p(NULL)
623  , fa_v1_rap_poi_pbar(NULL)
624  , fa_v1_rap_poi_d(NULL)
625  , fa_v1_rap_poi_t(NULL)
626  , fa_v1_rap_poi_h(NULL)
627  , fa_v1_rap_poi_a(NULL)
628  , fa_v1_rap_poi_imf(NULL)
629  , fa_v2_rap_poi_pip(NULL)
630  , fa_v2_rap_poi_pim(NULL)
631  , fa_v2_rap_poi_kp(NULL)
632  , fa_v2_rap_poi_km(NULL)
633  , fa_v2_rap_poi_p(NULL)
634  , fa_v2_rap_poi_pbar(NULL)
635  , fa_v2_rap_poi_d(NULL)
636  , fa_v2_rap_poi_t(NULL)
637  , fa_v2_rap_poi_h(NULL)
638  , fa_v2_rap_poi_a(NULL)
639  , fa_v2_rap_poi_imf(NULL)
640  , fa_v1_rap_hit_pip(NULL)
641  , fa_v1_rap_hit_pim(NULL)
642  , fa_v1_rap_hit_kp(NULL)
643  , fa_v1_rap_hit_km(NULL)
644  , fa_v1_rap_hit_p(NULL)
645  , fa_v1_rap_hit_pbar(NULL)
646  , fa_v1_rap_hit_d(NULL)
647  , fa_v1_rap_hit_t(NULL)
648  , fa_v1_rap_hit_h(NULL)
649  , fa_v1_rap_hit_a(NULL)
650  , fa_v1_rap_hit_imf(NULL)
651  , fa_v2_rap_hit_pip(NULL)
652  , fa_v2_rap_hit_pim(NULL)
653  , fa_v2_rap_hit_kp(NULL)
654  , fa_v2_rap_hit_km(NULL)
655  , fa_v2_rap_hit_p(NULL)
656  , fa_v2_rap_hit_pbar(NULL)
657  , fa_v2_rap_hit_d(NULL)
658  , fa_v2_rap_hit_t(NULL)
659  , fa_v2_rap_hit_h(NULL)
660  , fa_v2_rap_hit_a(NULL)
661  , fa_v2_rap_hit_imf(NULL)
662  , fa_v1_rap_glo_pip(NULL)
663  , fa_v1_rap_glo_pim(NULL)
664  , fa_v1_rap_glo_kp(NULL)
665  , fa_v1_rap_glo_km(NULL)
666  , fa_v1_rap_glo_p(NULL)
667  , fa_v1_rap_glo_pbar(NULL)
668  , fa_v1_rap_glo_d(NULL)
669  , fa_v1_rap_glo_t(NULL)
670  , fa_v1_rap_glo_h(NULL)
671  , fa_v1_rap_glo_a(NULL)
672  , fa_v1_rap_glo_imf(NULL)
673  , fa_v2_rap_glo_pip(NULL)
674  , fa_v2_rap_glo_pim(NULL)
675  , fa_v2_rap_glo_kp(NULL)
676  , fa_v2_rap_glo_km(NULL)
677  , fa_v2_rap_glo_p(NULL)
678  , fa_v2_rap_glo_pbar(NULL)
679  , fa_v2_rap_glo_d(NULL)
680  , fa_v2_rap_glo_t(NULL)
681  , fa_v2_rap_glo_h(NULL)
682  , fa_v2_rap_glo_a(NULL)
683  , fa_v2_rap_glo_imf(NULL)
684  , fa_xy_poi1(NULL)
685  , fa_xy_poi2(NULL)
686  , fa_xy_poi3(NULL)
687  , fa_xy_hit1(NULL)
688  , fa_xy_hit2(NULL)
689  , fa_xy_hit3(NULL)
690  , fa_xy_glo1(NULL)
691  , fa_xy_glo_pip(NULL)
692  , fa_xy_glo_pim(NULL)
693  , fa_xy_glo_kp(NULL)
694  , fa_xy_glo_km(NULL)
695  , fa_xy_glo_p(NULL)
696  , fa_xy_glo_pbar(NULL)
697  , fa_xy_glo_d(NULL)
698  , fa_xy_glo_t(NULL)
699  , fa_xy_glo_h(NULL)
700  , fa_xy_glo_a(NULL)
701  , fa_pv_poi(NULL)
702  , fa_tm_poi(NULL)
703  , fa_tm_poiprim(NULL)
704  , fa_dxx(NULL)
705  , fa_dxy(NULL)
706  , fa_dxz(NULL)
707  , fa_dyx(NULL)
708  , fa_dyy(NULL)
709  , fa_dyz(NULL)
710  , fa_dzx(NULL)
711  , fa_dzy(NULL)
712  , fa_dzz(NULL)
713  , fa_hit_ch(NULL)
714  , fa_dhit_ch(NULL)
715  , fa_tof_hit(NULL)
716  , fa_dtof_hit(NULL)
717  , fa_tof_hitprim(NULL)
718  , fa_pv_hit(NULL)
719  , fa_tm_hit(NULL)
720  , fa_tm_hitprim(NULL)
721  , fa_tn_hit(NULL)
722  , fa_t0_hit(NULL)
723  , fa_t0m_hit(NULL)
724  , fa_t0mn_hit(NULL)
725  , fa_t0m_b_hit(NULL)
726  , fa_t0mn_b_hit(NULL)
727  , fa_t0m_f_hit(NULL)
728  , fa_t0mn_f_hit(NULL)
729  , fa_t0m_f_b_hit(NULL)
730  , fa_t0mn_f_b_hit(NULL)
731  , fa_t0m_nf_hit(NULL)
732  , fa_t0mn_nf_hit(NULL)
733  , fa_t0m_nf_b_hit(NULL)
734  , fa_t0mn_nf_b_hit(NULL)
735  , fa_TofTrackMul(NULL)
736  , fa_VtxB(NULL)
737  , fa_chi2_mom_glo(NULL)
738  , fa_chi2_mom_gloprim(NULL)
739  , fa_len_mom_glo(NULL)
740  , fa_pv_glo(NULL)
741  , fa_tm_glo(NULL)
742  , fa_tm_glo_pip(NULL)
743  , fa_tm_glo_pim(NULL)
744  , fa_tm_glo_kp(NULL)
745  , fa_tm_glo_km(NULL)
746  , fa_tm_glo_p(NULL)
747  , fa_tm_glo_pbar(NULL)
748  , fa_tm_glo_d(NULL)
749  , fa_tm_glo_t(NULL)
750  , fa_tm_glo_h(NULL)
751  , fa_tm_glo_a(NULL)
752  , fa_tm_gloprim(NULL)
753  , fa_tm_glomis(NULL)
754  , fa_tm_glovtxb(NULL)
755  , fa_tm_gloprimvtxb(NULL)
756  , fa_m2mom_glo(NULL)
757  , fa_m2mom_glovtxb(NULL)
758  , fa_m2mom_gloprim(NULL)
759  , fa_m2mom_gloprimvtxb(NULL)
760  , fa_m2mom_glo_pip(NULL)
761  , fa_m2mom_glo_pim(NULL)
762  , fa_m2mom_glo_kp(NULL)
763  , fa_m2mom_glo_km(NULL)
764  , fa_m2mom_glo_p(NULL)
765  , fa_m2mom_glo_pbar(NULL)
766  , fa_m2mom_glo_d(NULL)
767  , fa_m2mom_glo_t(NULL)
768  , fa_m2mom_glo_h(NULL)
769  , fa_m2mom_glo_a(NULL)
770  , fa_pMCmom_glo(NULL)
771  , fa_pMCmom_glo_pip(NULL)
772  , fa_pMCmom_glo_pim(NULL)
773  , fa_pMCmom_glo_kp(NULL)
774  , fa_pMCmom_glo_km(NULL)
775  , fa_pMCmom_glo_p(NULL)
776  , fa_pMCmom_glo_pbar(NULL)
777  , fa_pMCmom_glo_d(NULL)
778  , fa_pMCmom_glo_t(NULL)
779  , fa_pMCmom_glo_h(NULL)
780  , fa_pMCmom_glo_a(NULL)
781  , fa_w_mom_glo(NULL)
782  , fa_w_mom_glo_pip(NULL)
783  , fa_w_mom_glo_pim(NULL)
784  , fa_w_mom_glo_kp(NULL)
785  , fa_w_mom_glo_km(NULL)
786  , fa_w_mom_glo_p(NULL)
787  , fa_w_mom_glo_pbar(NULL)
788  , fa_w_mom_glo_d(NULL)
789  , fa_w_mom_glo_t(NULL)
790  , fa_w_mom_glo_h(NULL)
791  , fa_w_mom_glo_a(NULL)
792  , fa_w_mom_gloprim(NULL)
793  , fa_w_mom_glomis(NULL)
794  , fa_LenDismom_glo(NULL)
795  , fa_LenDismom_glo_pip(NULL)
796  , fa_LenDismom_glo_pim(NULL)
797  , fa_LenDismom_glo_kp(NULL)
798  , fa_LenDismom_glo_km(NULL)
799  , fa_LenDismom_glo_p(NULL)
800  , fa_LenDismom_glo_pbar(NULL)
801  , fa_LenDismom_glo_d(NULL)
802  , fa_LenDismom_glo_t(NULL)
803  , fa_LenDismom_glo_h(NULL)
804  , fa_LenDismom_glo_a(NULL)
805  , fa_LenMcLenGlomom_glo(NULL)
806  , fa_LenMcDismom_glo(NULL)
807  , fhwdist(NULL)
808  , fhwmindelmass(NULL)
809  , fhwminlen(NULL)
810  , fhwdelp(NULL)
811  , fhTofTrkDx(NULL)
812  , fhTofTrkDy(NULL)
813  , fhTofTrkDxsel(NULL)
814  , fhTofTrkDysel(NULL)
815  , bRecSec(kFALSE)
816  , fdDistPrimLim(1.5)
817  , // Ext Parameter: Max Tof-Sts trans distance for primaries
818  fdDistPrimLim2(0.3)
819  , // Ext Parameter: Max Sts-Sts trans distance for primaries
820  fdDistSecLim2(0.5)
821  , // Ext Parameter: Max Sts-Sts trans distance from TOF direction for secondaries
822  fdD0ProtLim(0.4)
823  , // Ext Parameter: Min impact parameter for secondary proton
824  fdOpAngMin(0.01)
825  , // Ext Parameter: Min opening angle for accepting pair
826  fdDCALim(0.2)
827  , // Ext Parameter: Max DCA for accepting pair
828  fdVLenMin(5.)
829  , // Ext Parameter: Min Lambda flight path length for accepting pair
830  fdVLenMax(25.)
831  , // Ext Parameter: Max Lambda flight path length for accepting pair
832  fdDistTRD(10.)
833  , // max accepted distance of Trd Hit from STS-TOF line
834  fdTRDHmulMin(0.)
835  , // min associated Trd Hits to Track candidates
836  fNMixedEvents(1)
837 
838 {
840 }
841 // ------------------------------------------------------------------
842 
843 
844 // ------------------------------------------------------------------
846  // Destructor
847  fPrimVertex = NULL;
848 }
849 // ------------------------------------------------------------------
850 
851 
852 // ------------------------------------------------------------------
854  // Create histogramms
855 
856  Float_t ymin = -1.;
857  Float_t ymax = 4.;
858  Float_t ptmmax = 2.5;
859  Int_t ptm_nbx = 30;
860  Int_t ptm_nby = 30;
861 
862  // generator level
863 
864  fa_ptm_rap_gen_pip = new TH2F("ptm_rap_gen_pip",
865  "MCTrack-gen pi-plus; y; p_{T}/m",
866  ptm_nbx,
867  ymin,
868  ymax,
869  ptm_nby,
870  0.,
871  ptmmax);
872  fa_ptm_rap_gen_pim = new TH2F("ptm_rap_gen_pim",
873  "MCTrack-gen pi-minus;y; p_{T}/m",
874  ptm_nbx,
875  ymin,
876  ymax,
877  ptm_nby,
878  0.,
879  ptmmax);
880  fa_ptm_rap_gen_kp = new TH2F("ptm_rap_gen_kp",
881  "MCTrack-gen k-plus; y; p_{T}/m",
882  ptm_nbx,
883  ymin,
884  ymax,
885  ptm_nby,
886  0.,
887  ptmmax);
888  fa_ptm_rap_gen_km = new TH2F("ptm_rap_gen_km",
889  "MCTrack-gen k-minus; y; p_{T}/m",
890  ptm_nbx,
891  ymin,
892  ymax,
893  ptm_nby,
894  0.,
895  ptmmax);
896  fa_ptm_rap_gen_p = new TH2F("ptm_rap_gen_p",
897  "MCTrack-gen proton; y; p_{T}/m",
898  ptm_nbx,
899  ymin,
900  ymax,
901  ptm_nby,
902  0.,
903  ptmmax);
904  fa_ptm_rap_gen_pbar = new TH2F("ptm_rap_gen_pbar",
905  "MCTrack-gen antiproton;y;p_{T}/m",
906  ptm_nbx,
907  ymin,
908  ymax,
909  ptm_nby,
910  0.,
911  ptmmax);
912  fa_ptm_rap_gen_d = new TH2F("ptm_rap_gen_d",
913  "MCTrack-gen deuteron;y; p_{T}/m",
914  ptm_nbx,
915  ymin,
916  ymax,
917  ptm_nby,
918  0.,
919  ptmmax);
920  fa_ptm_rap_gen_t = new TH2F("ptm_rap_gen_t",
921  "MCTrack-gen triton; y; p_{T}/m",
922  ptm_nbx,
923  ymin,
924  ymax,
925  ptm_nby,
926  0.,
927  ptmmax);
928  fa_ptm_rap_gen_h = new TH2F("ptm_rap_gen_h",
929  "MCTrack-gen 3he; y; p_{T}/m",
930  ptm_nbx,
931  ymin,
932  ymax,
933  ptm_nby,
934  0.,
935  ptmmax);
936  fa_ptm_rap_gen_a = new TH2F("ptm_rap_gen_a",
937  "MCTrack-gen alpha; y; p_{T}/m",
938  ptm_nbx,
939  ymin,
940  ymax,
941  ptm_nby,
942  0.,
943  ptmmax);
944  fa_ptm_rap_gen_imf = new TH2F("ptm_rap_gen_imf",
945  "MCTrack-gen imf; y; p_{T}/m",
946  ptm_nbx,
947  ymin,
948  ymax,
949  ptm_nby,
950  0.,
951  ptmmax);
952 
953  Float_t v1_nbx = 20.;
954  Float_t v1_nby = 20.;
955  Float_t yvmax = 1.3;
956 
957  fa_v1_rap_gen_pip = new TH2F("v1_rap_gen_pip",
958  "MCTrack-gen pi-plus; y; v_{1}",
959  v1_nbx,
960  -yvmax,
961  yvmax,
962  v1_nby,
963  -1.,
964  1.);
965  fa_v1_rap_gen_pim = new TH2F("v1_rap_gen_pim",
966  "MCTrack-gen pi-minus;y; v_{1}",
967  v1_nbx,
968  -yvmax,
969  yvmax,
970  v1_nby,
971  -1.,
972  1.);
973  fa_v1_rap_gen_kp = new TH2F("v1_rap_gen_kp",
974  "MCTrack-gen k-plus; y; v_{1}",
975  v1_nbx,
976  -yvmax,
977  yvmax,
978  v1_nby,
979  -1.,
980  1.);
981  fa_v1_rap_gen_km = new TH2F("v1_rap_gen_km",
982  "MCTrack-gen k-minus; y; v_{1}",
983  v1_nbx,
984  -yvmax,
985  yvmax,
986  v1_nby,
987  -1.,
988  1.);
989  fa_v1_rap_gen_p = new TH2F("v1_rap_gen_p",
990  "MCTrack-gen proton; y; v_{1}",
991  v1_nbx,
992  -yvmax,
993  yvmax,
994  v1_nby,
995  -1.,
996  1.);
997  fa_v1_rap_gen_pbar = new TH2F("v1_rap_gen_pbar",
998  "MCTrack-gen antiproton;y; v_{1}",
999  v1_nbx,
1000  -yvmax,
1001  yvmax,
1002  v1_nby,
1003  -1.,
1004  1.);
1005  fa_v1_rap_gen_d = new TH2F("v1_rap_gen_d",
1006  "MCTrack-gen deuteron;y; v_{1}",
1007  v1_nbx,
1008  -yvmax,
1009  yvmax,
1010  v1_nby,
1011  -1.,
1012  1.);
1013  fa_v1_rap_gen_t = new TH2F("v1_rap_gen_t",
1014  "MCTrack-gen triton; y; v_{1}",
1015  v1_nbx,
1016  -yvmax,
1017  yvmax,
1018  v1_nby,
1019  -1.,
1020  1.);
1021  fa_v1_rap_gen_h = new TH2F("v1_rap_gen_h",
1022  "MCTrack-gen 3he; y; v_{1}",
1023  v1_nbx,
1024  -yvmax,
1025  yvmax,
1026  v1_nby,
1027  -1.,
1028  1.);
1029  fa_v1_rap_gen_a = new TH2F("v1_rap_gen_a",
1030  "MCTrack-gen alpha; y; v_{1}",
1031  v1_nbx,
1032  -yvmax,
1033  yvmax,
1034  v1_nby,
1035  -1.,
1036  1.);
1037  fa_v1_rap_gen_imf = new TH2F("v1_rap_gen_imf",
1038  "MCTrack-gen imf; y; v_{1}",
1039  v1_nbx,
1040  -yvmax,
1041  yvmax,
1042  v1_nby,
1043  -1.,
1044  1.);
1045 
1046  fa_v2_rap_gen_pip = new TH2F("v2_rap_gen_pip",
1047  "MCTrack-gen pi-plus; y; v_{2}",
1048  v1_nbx,
1049  -yvmax,
1050  yvmax,
1051  v1_nby,
1052  -1.,
1053  1.);
1054  fa_v2_rap_gen_pim = new TH2F("v2_rap_gen_pim",
1055  "MCTrack-gen pi-minus;y; v_{2}",
1056  v1_nbx,
1057  -yvmax,
1058  yvmax,
1059  v1_nby,
1060  -1.,
1061  1.);
1062  fa_v2_rap_gen_kp = new TH2F("v2_rap_gen_kp",
1063  "MCTrack-gen k-plus; y; v_{2}",
1064  v1_nbx,
1065  -yvmax,
1066  yvmax,
1067  v1_nby,
1068  -1.,
1069  1.);
1070  fa_v2_rap_gen_km = new TH2F("v2_rap_gen_km",
1071  "MCTrack-gen k-minus; y; v_{2}",
1072  v1_nbx,
1073  -yvmax,
1074  yvmax,
1075  v1_nby,
1076  -1.,
1077  1.);
1078  fa_v2_rap_gen_p = new TH2F("v2_rap_gen_p",
1079  "MCTrack-gen proton; y; v_{2}",
1080  v1_nbx,
1081  -yvmax,
1082  yvmax,
1083  v1_nby,
1084  -1.,
1085  1.);
1086  fa_v2_rap_gen_pbar = new TH2F("v2_rap_gen_pbar",
1087  "MCTrack-gen antiproton;y; v_{2}",
1088  v1_nbx,
1089  -yvmax,
1090  yvmax,
1091  v1_nby,
1092  -1.,
1093  1.);
1094  fa_v2_rap_gen_d = new TH2F("v2_rap_gen_d",
1095  "MCTrack-gen deuteron;y; v_{2}",
1096  v1_nbx,
1097  -yvmax,
1098  yvmax,
1099  v1_nby,
1100  -1.,
1101  1.);
1102  fa_v2_rap_gen_t = new TH2F("v2_rap_gen_t",
1103  "MCTrack-gen triton; y; v_{2}",
1104  v1_nbx,
1105  -yvmax,
1106  yvmax,
1107  v1_nby,
1108  -1.,
1109  1.);
1110  fa_v2_rap_gen_h = new TH2F("v2_rap_gen_h",
1111  "MCTrack-gen 3he; y; v_{2}",
1112  v1_nbx,
1113  -yvmax,
1114  yvmax,
1115  v1_nby,
1116  -1.,
1117  1.);
1118  fa_v2_rap_gen_a = new TH2F("v2_rap_gen_a",
1119  "MCTrack-gen alpha; y; v_{2}",
1120  v1_nbx,
1121  -yvmax,
1122  yvmax,
1123  v1_nby,
1124  -1.,
1125  1.);
1126  fa_v2_rap_gen_imf = new TH2F("v2_rap_gen_imf",
1127  "MCTrack-gen imf; y; v_{2}",
1128  v1_nbx,
1129  -yvmax,
1130  yvmax,
1131  v1_nby,
1132  -1.,
1133  1.);
1134 
1135  // TofPoint level
1136 
1137  fa_ptm_rap_poi_pip = new TH2F("ptm_rap_poi_pip",
1138  "MCTrack-poi pi-plus; y; p_{T}/m",
1139  ptm_nbx,
1140  ymin,
1141  ymax,
1142  ptm_nby,
1143  0.,
1144  ptmmax);
1145  fa_ptm_rap_poi_pim = new TH2F("ptm_rap_poi_pim",
1146  "MCTrack-poi pi-minus;y; p_{T}/m",
1147  ptm_nbx,
1148  ymin,
1149  ymax,
1150  ptm_nby,
1151  0.,
1152  ptmmax);
1153  fa_ptm_rap_poi_kp = new TH2F("ptm_rap_poi_kp",
1154  "MCTrack-poi k-plus; y; p_{T}/m",
1155  ptm_nbx,
1156  ymin,
1157  ymax,
1158  ptm_nby,
1159  0.,
1160  ptmmax);
1161  fa_ptm_rap_poi_km = new TH2F("ptm_rap_poi_km",
1162  "MCTrack-poi k-minus; y; p_{T}/m",
1163  ptm_nbx,
1164  ymin,
1165  ymax,
1166  ptm_nby,
1167  0.,
1168  ptmmax);
1169  fa_ptm_rap_poi_p = new TH2F("ptm_rap_poi_p",
1170  "MCTrack-poi proton; y; p_{T}/m",
1171  ptm_nbx,
1172  ymin,
1173  ymax,
1174  ptm_nby,
1175  0.,
1176  ptmmax);
1177  fa_ptm_rap_poi_pbar = new TH2F("ptm_rap_poi_pbar",
1178  "MCTrack-poi antiproton;y;p_{T}/m",
1179  ptm_nbx,
1180  ymin,
1181  ymax,
1182  ptm_nby,
1183  0.,
1184  ptmmax);
1185  fa_ptm_rap_poi_d = new TH2F("ptm_rap_poi_d",
1186  "MCTrack-poi deuteron;y; p_{T}/m",
1187  ptm_nbx,
1188  ymin,
1189  ymax,
1190  ptm_nby,
1191  0.,
1192  ptmmax);
1193  fa_ptm_rap_poi_t = new TH2F("ptm_rap_poi_t",
1194  "MCTrack-poi triton; y; p_{T}/m",
1195  ptm_nbx,
1196  ymin,
1197  ymax,
1198  ptm_nby,
1199  0.,
1200  ptmmax);
1201  fa_ptm_rap_poi_h = new TH2F("ptm_rap_poi_h",
1202  "MCTrack-poi 3he; y; p_{T}/m",
1203  ptm_nbx,
1204  ymin,
1205  ymax,
1206  ptm_nby,
1207  0.,
1208  ptmmax);
1209  fa_ptm_rap_poi_a = new TH2F("ptm_rap_poi_a",
1210  "MCTrack-poi alpha; y; p_{T}/m",
1211  ptm_nbx,
1212  ymin,
1213  ymax,
1214  ptm_nby,
1215  0.,
1216  ptmmax);
1217  fa_ptm_rap_poi_imf = new TH2F("ptm_rap_poi_imf",
1218  "MCTrack-poi imf; y; p_{T}/m",
1219  ptm_nbx,
1220  ymin,
1221  ymax,
1222  ptm_nby,
1223  0.,
1224  ptmmax);
1225 
1226  fa_v1_rap_poi_pip = new TH2F("v1_rap_poi_pip",
1227  "MCTrack-poi pi-plus; y; v_{1}",
1228  v1_nbx,
1229  -yvmax,
1230  yvmax,
1231  v1_nby,
1232  -1.,
1233  1.);
1234  fa_v1_rap_poi_pim = new TH2F("v1_rap_poi_pim",
1235  "MCTrack-poi pi-minus;y; v_{1}",
1236  v1_nbx,
1237  -yvmax,
1238  yvmax,
1239  v1_nby,
1240  -1.,
1241  1.);
1242  fa_v1_rap_poi_kp = new TH2F("v1_rap_poi_kp",
1243  "MCTrack-poi k-plus; y; v_{1}",
1244  v1_nbx,
1245  -yvmax,
1246  yvmax,
1247  v1_nby,
1248  -1.,
1249  1.);
1250  fa_v1_rap_poi_km = new TH2F("v1_rap_poi_km",
1251  "MCTrack-poi k-minus; y; v_{1}",
1252  v1_nbx,
1253  -yvmax,
1254  yvmax,
1255  v1_nby,
1256  -1.,
1257  1.);
1258  fa_v1_rap_poi_p = new TH2F("v1_rap_poi_p",
1259  "MCTrack-poi proton; y; v_{1}",
1260  v1_nbx,
1261  -yvmax,
1262  yvmax,
1263  v1_nby,
1264  -1.,
1265  1.);
1266  fa_v1_rap_poi_pbar = new TH2F("v1_rap_poi_pbar",
1267  "MCTrack-poi antiproton;y; v_{1}",
1268  v1_nbx,
1269  -yvmax,
1270  yvmax,
1271  v1_nby,
1272  -1.,
1273  1.);
1274  fa_v1_rap_poi_d = new TH2F("v1_rap_poi_d",
1275  "MCTrack-poi deuteron;y; v_{1}",
1276  v1_nbx,
1277  -yvmax,
1278  yvmax,
1279  v1_nby,
1280  -1.,
1281  1.);
1282  fa_v1_rap_poi_t = new TH2F("v1_rap_poi_t",
1283  "MCTrack-poi triton; y; v_{1}",
1284  v1_nbx,
1285  -yvmax,
1286  yvmax,
1287  v1_nby,
1288  -1.,
1289  1.);
1290  fa_v1_rap_poi_h = new TH2F("v1_rap_poi_h",
1291  "MCTrack-poi 3he; y; v_{1}",
1292  v1_nbx,
1293  -yvmax,
1294  yvmax,
1295  v1_nby,
1296  -1.,
1297  1.);
1298  fa_v1_rap_poi_a = new TH2F("v1_rap_poi_a",
1299  "MCTrack-poi alpha; y; v_{1}",
1300  v1_nbx,
1301  -yvmax,
1302  yvmax,
1303  v1_nby,
1304  -1.,
1305  1.);
1306  fa_v1_rap_poi_imf = new TH2F("v1_rap_poi_imf",
1307  "MCTrack-poi imf; y; v_{1}",
1308  v1_nbx,
1309  -yvmax,
1310  yvmax,
1311  v1_nby,
1312  -1.,
1313  1.);
1314 
1315  fa_v2_rap_poi_pip = new TH2F("v2_rap_poi_pip",
1316  "MCTrack-poi pi-plus; y; v_{2}",
1317  v1_nbx,
1318  -yvmax,
1319  yvmax,
1320  v1_nby,
1321  -1.,
1322  1.);
1323  fa_v2_rap_poi_pim = new TH2F("v2_rap_poi_pim",
1324  "MCTrack-poi pi-minus;y; v_{2}",
1325  v1_nbx,
1326  -yvmax,
1327  yvmax,
1328  v1_nby,
1329  -1.,
1330  1.);
1331  fa_v2_rap_poi_kp = new TH2F("v2_rap_poi_kp",
1332  "MCTrack-poi k-plus; y; v_{2}",
1333  v1_nbx,
1334  -yvmax,
1335  yvmax,
1336  v1_nby,
1337  -1.,
1338  1.);
1339  fa_v2_rap_poi_km = new TH2F("v2_rap_poi_km",
1340  "MCTrack-poi k-minus; y; v_{2}",
1341  v1_nbx,
1342  -yvmax,
1343  yvmax,
1344  v1_nby,
1345  -1.,
1346  1.);
1347  fa_v2_rap_poi_p = new TH2F("v2_rap_poi_p",
1348  "MCTrack-poi proton; y; v_{2}",
1349  v1_nbx,
1350  -yvmax,
1351  yvmax,
1352  v1_nby,
1353  -1.,
1354  1.);
1355  fa_v2_rap_poi_pbar = new TH2F("v2_rap_poi_pbar",
1356  "MCTrack-poi antiproton;y; v_{2}",
1357  v1_nbx,
1358  -yvmax,
1359  yvmax,
1360  v1_nby,
1361  -1.,
1362  1.);
1363  fa_v2_rap_poi_d = new TH2F("v2_rap_poi_d",
1364  "MCTrack-poi deuteron;y; v_{2}",
1365  v1_nbx,
1366  -yvmax,
1367  yvmax,
1368  v1_nby,
1369  -1.,
1370  1.);
1371  fa_v2_rap_poi_t = new TH2F("v2_rap_poi_t",
1372  "MCTrack-poi triton; y; v_{2}",
1373  v1_nbx,
1374  -yvmax,
1375  yvmax,
1376  v1_nby,
1377  -1.,
1378  1.);
1379  fa_v2_rap_poi_h = new TH2F("v2_rap_poi_h",
1380  "MCTrack-poi 3he; y; v_{2}",
1381  v1_nbx,
1382  -yvmax,
1383  yvmax,
1384  v1_nby,
1385  -1.,
1386  1.);
1387  fa_v2_rap_poi_a = new TH2F("v2_rap_poi_a",
1388  "MCTrack-poi alpha; y; v_{2}",
1389  v1_nbx,
1390  -yvmax,
1391  yvmax,
1392  v1_nby,
1393  -1.,
1394  1.);
1395  fa_v2_rap_poi_imf = new TH2F("v2_rap_poi_imf",
1396  "MCTrack-poi imf; y; v_{2}",
1397  v1_nbx,
1398  -yvmax,
1399  yvmax,
1400  v1_nby,
1401  -1.,
1402  1.);
1403 
1404  // TofHit level
1405 
1406  fa_ptm_rap_hit_pip = new TH2F("ptm_rap_hit_pip",
1407  "MCTrack-hit pi-plus; y; p_{T}/m",
1408  ptm_nbx,
1409  ymin,
1410  ymax,
1411  ptm_nby,
1412  0.,
1413  ptmmax);
1414  fa_ptm_rap_hit_pim = new TH2F("ptm_rap_hit_pim",
1415  "MCTrack-hit pi-minus;y; p_{T}/m",
1416  ptm_nbx,
1417  ymin,
1418  ymax,
1419  ptm_nby,
1420  0.,
1421  ptmmax);
1422  fa_ptm_rap_hit_kp = new TH2F("ptm_rap_hit_kp",
1423  "MCTrack-hit k-plus; y; p_{T}/m",
1424  ptm_nbx,
1425  ymin,
1426  ymax,
1427  ptm_nby,
1428  0.,
1429  ptmmax);
1430  fa_ptm_rap_hit_km = new TH2F("ptm_rap_hit_km",
1431  "MCTrack-hit k-minus; y; p_{T}/m",
1432  ptm_nbx,
1433  ymin,
1434  ymax,
1435  ptm_nby,
1436  0.,
1437  ptmmax);
1438  fa_ptm_rap_hit_p = new TH2F("ptm_rap_hit_p",
1439  "MCTrack-hit proton; y; p_{T}/m",
1440  ptm_nbx,
1441  ymin,
1442  ymax,
1443  ptm_nby,
1444  0.,
1445  ptmmax);
1446  fa_ptm_rap_hit_pbar = new TH2F("ptm_rap_hit_pbar",
1447  "MCTrack-hit antiproton;y;p_{T}/m",
1448  ptm_nbx,
1449  ymin,
1450  ymax,
1451  ptm_nby,
1452  0.,
1453  ptmmax);
1454  fa_ptm_rap_hit_d = new TH2F("ptm_rap_hit_d",
1455  "MCTrack-hit deuteron;y; p_{T}/m",
1456  ptm_nbx,
1457  ymin,
1458  ymax,
1459  ptm_nby,
1460  0.,
1461  ptmmax);
1462  fa_ptm_rap_hit_t = new TH2F("ptm_rap_hit_t",
1463  "MCTrack-hit triton; y; p_{T}/m",
1464  ptm_nbx,
1465  ymin,
1466  ymax,
1467  ptm_nby,
1468  0.,
1469  ptmmax);
1470  fa_ptm_rap_hit_h = new TH2F("ptm_rap_hit_h",
1471  "MCTrack-hit 3he; y; p_{T}/m",
1472  ptm_nbx,
1473  ymin,
1474  ymax,
1475  ptm_nby,
1476  0.,
1477  ptmmax);
1478  fa_ptm_rap_hit_a = new TH2F("ptm_rap_hit_a",
1479  "MCTrack-hit alpha; y; p_{T}/m",
1480  ptm_nbx,
1481  ymin,
1482  ymax,
1483  ptm_nby,
1484  0.,
1485  ptmmax);
1486  fa_ptm_rap_hit_imf = new TH2F("ptm_rap_hit_imf",
1487  "MCTrack-hit imf; y; p_{T}/m",
1488  ptm_nbx,
1489  ymin,
1490  ymax,
1491  ptm_nby,
1492  0.,
1493  ptmmax);
1494 
1495  fa_v1_rap_hit_pip = new TH2F("v1_rap_hit_pip",
1496  "MCTrack-hit pi-plus; y; v_{1}",
1497  v1_nbx,
1498  -yvmax,
1499  yvmax,
1500  v1_nby,
1501  -1.,
1502  1.);
1503  fa_v1_rap_hit_pim = new TH2F("v1_rap_hit_pim",
1504  "MCTrack-hit pi-minus;y; v_{1}",
1505  v1_nbx,
1506  -yvmax,
1507  yvmax,
1508  v1_nby,
1509  -1.,
1510  1.);
1511  fa_v1_rap_hit_kp = new TH2F("v1_rap_hit_kp",
1512  "MCTrack-hit k-plus; y; v_{1}",
1513  v1_nbx,
1514  -yvmax,
1515  yvmax,
1516  v1_nby,
1517  -1.,
1518  1.);
1519  fa_v1_rap_hit_km = new TH2F("v1_rap_hit_km",
1520  "MCTrack-hit k-minus; y; v_{1}",
1521  v1_nbx,
1522  -yvmax,
1523  yvmax,
1524  v1_nby,
1525  -1.,
1526  1.);
1527  fa_v1_rap_hit_p = new TH2F("v1_rap_hit_p",
1528  "MCTrack-hit proton; y; v_{1}",
1529  v1_nbx,
1530  -yvmax,
1531  yvmax,
1532  v1_nby,
1533  -1.,
1534  1.);
1535  fa_v1_rap_hit_pbar = new TH2F("v1_rap_hit_pbar",
1536  "MCTrack-hit antiproton;y; v_{1}",
1537  v1_nbx,
1538  -yvmax,
1539  yvmax,
1540  v1_nby,
1541  -1.,
1542  1.);
1543  fa_v1_rap_hit_d = new TH2F("v1_rap_hit_d",
1544  "MCTrack-hit deuteron;y; v_{1}",
1545  v1_nbx,
1546  -yvmax,
1547  yvmax,
1548  v1_nby,
1549  -1.,
1550  1.);
1551  fa_v1_rap_hit_t = new TH2F("v1_rap_hit_t",
1552  "MCTrack-hit triton; y; v_{1}",
1553  v1_nbx,
1554  -yvmax,
1555  yvmax,
1556  v1_nby,
1557  -1.,
1558  1.);
1559  fa_v1_rap_hit_h = new TH2F("v1_rap_hit_h",
1560  "MCTrack-hit 3he; y; v_{1}",
1561  v1_nbx,
1562  -yvmax,
1563  yvmax,
1564  v1_nby,
1565  -1.,
1566  1.);
1567  fa_v1_rap_hit_a = new TH2F("v1_rap_hit_a",
1568  "MCTrack-hit alpha; y; v_{1}",
1569  v1_nbx,
1570  -yvmax,
1571  yvmax,
1572  v1_nby,
1573  -1.,
1574  1.);
1575  fa_v1_rap_hit_imf = new TH2F("v1_rap_hit_imf",
1576  "MCTrack-hit imf; y; v_{1}",
1577  v1_nbx,
1578  -yvmax,
1579  yvmax,
1580  v1_nby,
1581  -1.,
1582  1.);
1583 
1584  fa_v2_rap_hit_pip = new TH2F("v2_rap_hit_pip",
1585  "MCTrack-hit pi-plus; y; v_{2}",
1586  v1_nbx,
1587  -yvmax,
1588  yvmax,
1589  v1_nby,
1590  -1.,
1591  1.);
1592  fa_v2_rap_hit_pim = new TH2F("v2_rap_hit_pim",
1593  "MCTrack-hit pi-minus;y; v_{2}",
1594  v1_nbx,
1595  -yvmax,
1596  yvmax,
1597  v1_nby,
1598  -1.,
1599  1.);
1600  fa_v2_rap_hit_kp = new TH2F("v2_rap_hit_kp",
1601  "MCTrack-hit k-plus; y; v_{2}",
1602  v1_nbx,
1603  -yvmax,
1604  yvmax,
1605  v1_nby,
1606  -1.,
1607  1.);
1608  fa_v2_rap_hit_km = new TH2F("v2_rap_hit_km",
1609  "MCTrack-hit k-minus; y; v_{2}",
1610  v1_nbx,
1611  -yvmax,
1612  yvmax,
1613  v1_nby,
1614  -1.,
1615  1.);
1616  fa_v2_rap_hit_p = new TH2F("v2_rap_hit_p",
1617  "MCTrack-hit proton; y; v_{2}",
1618  v1_nbx,
1619  -yvmax,
1620  yvmax,
1621  v1_nby,
1622  -1.,
1623  1.);
1624  fa_v2_rap_hit_pbar = new TH2F("v2_rap_hit_pbar",
1625  "MCTrack-hit antiproton;y; v_{2}",
1626  v1_nbx,
1627  -yvmax,
1628  yvmax,
1629  v1_nby,
1630  -1.,
1631  1.);
1632  fa_v2_rap_hit_d = new TH2F("v2_rap_hit_d",
1633  "MCTrack-hit deuteron;y; v_{2}",
1634  v1_nbx,
1635  -yvmax,
1636  yvmax,
1637  v1_nby,
1638  -1.,
1639  1.);
1640  fa_v2_rap_hit_t = new TH2F("v2_rap_hit_t",
1641  "MCTrack-hit triton; y; v_{2}",
1642  v1_nbx,
1643  -yvmax,
1644  yvmax,
1645  v1_nby,
1646  -1.,
1647  1.);
1648  fa_v2_rap_hit_h = new TH2F("v2_rap_hit_h",
1649  "MCTrack-hit 3he; y; v_{2}",
1650  v1_nbx,
1651  -yvmax,
1652  yvmax,
1653  v1_nby,
1654  -1.,
1655  1.);
1656  fa_v2_rap_hit_a = new TH2F("v2_rap_hit_a",
1657  "MCTrack-hit alpha; y; v_{2}",
1658  v1_nbx,
1659  -yvmax,
1660  yvmax,
1661  v1_nby,
1662  -1.,
1663  1.);
1664  fa_v2_rap_hit_imf = new TH2F("v2_rap_hit_imf",
1665  "MCTrack-hit imf; y; v_{2}",
1666  v1_nbx,
1667  -yvmax,
1668  yvmax,
1669  v1_nby,
1670  -1.,
1671  1.);
1672 
1673  // GlobalTrack level
1674 
1675  fa_plab_sts_pip = new TH1F(
1676  "plab_sts_pip", "MCTrack-sts pi-plus; p_{Lab}(GeV/c)", 100, 0., 10.);
1677  fa_plab_sts_pim = new TH1F(
1678  "plab_sts_pim", "MCTrack-sts pi-minus; p_{Lab}(GeV/c)", 100, 0., 10.);
1679  fa_plab_sts_kp =
1680  new TH1F("plab_sts_kp", "MCTrack-sts k-plus; p_{Lab}(GeV/c)", 100, 0., 10.);
1681  fa_plab_sts_km = new TH1F(
1682  "plab_sts_km", "MCTrack-sts k-minus; p_{Lab}(GeV/c)", 100, 0., 10.);
1683  fa_plab_sts_p =
1684  new TH1F("plab_sts_p", "MCTrack-sts proton; p_{Lab}(GeV/c)", 100, 0., 10.);
1686  new TH1F("plab_sts_pbar", "MCTrack-sts pbar; p_{Lab}(GeV/c)", 100, 0., 10.);
1687 
1688  fa_ptm_rap_sts_pip = new TH2F("ptm_rap_sts_pip",
1689  "MCTrack-sts pi-plus; y; p_{T}/m",
1690  ptm_nbx,
1691  ymin,
1692  ymax,
1693  ptm_nby,
1694  0.,
1695  ptmmax);
1696  fa_ptm_rap_sts_pim = new TH2F("ptm_rap_sts_pim",
1697  "MCTrack-sts pi-minus;y; p_{T}/m",
1698  ptm_nbx,
1699  ymin,
1700  ymax,
1701  ptm_nby,
1702  0.,
1703  ptmmax);
1704  fa_ptm_rap_sts_kp = new TH2F("ptm_rap_sts_kp",
1705  "MCTrack-sts k-plus; y; p_{T}/m",
1706  ptm_nbx,
1707  ymin,
1708  ymax,
1709  ptm_nby,
1710  0.,
1711  ptmmax);
1712  fa_ptm_rap_sts_km = new TH2F("ptm_rap_sts_km",
1713  "MCTrack-sts k-minus; y; p_{T}/m",
1714  ptm_nbx,
1715  ymin,
1716  ymax,
1717  ptm_nby,
1718  0.,
1719  ptmmax);
1720  fa_ptm_rap_sts_p = new TH2F("ptm_rap_sts_p",
1721  "MCTrack-sts proton; y; p_{T}/m",
1722  ptm_nbx,
1723  ymin,
1724  ymax,
1725  ptm_nby,
1726  0.,
1727  ptmmax);
1728  fa_ptm_rap_sts_pbar = new TH2F("ptm_rap_sts_pbar",
1729  "MCTrack-sts antiproton;y;p_{T}/m",
1730  ptm_nbx,
1731  ymin,
1732  ymax,
1733  ptm_nby,
1734  0.,
1735  ptmmax);
1736  fa_ptm_rap_sts_d = new TH2F("ptm_rap_sts_d",
1737  "MCTrack-sts deuteron;y; p_{T}/m",
1738  ptm_nbx,
1739  ymin,
1740  ymax,
1741  ptm_nby,
1742  0.,
1743  ptmmax);
1744  fa_ptm_rap_sts_t = new TH2F("ptm_rap_sts_t",
1745  "MCTrack-sts triton; y; p_{T}/m",
1746  ptm_nbx,
1747  ymin,
1748  ymax,
1749  ptm_nby,
1750  0.,
1751  ptmmax);
1752  fa_ptm_rap_sts_h = new TH2F("ptm_rap_sts_h",
1753  "MCTrack-sts 3he; y; p_{T}/m",
1754  ptm_nbx,
1755  ymin,
1756  ymax,
1757  ptm_nby,
1758  0.,
1759  ptmmax);
1760  fa_ptm_rap_sts_a = new TH2F("ptm_rap_sts_a",
1761  "MCTrack-sts alpha; y; p_{T}/m",
1762  ptm_nbx,
1763  ymin,
1764  ymax,
1765  ptm_nby,
1766  0.,
1767  ptmmax);
1768  fa_ptm_rap_sts_imf = new TH2F("ptm_rap_sts_imf",
1769  "MCTrack-sts imf; y; p_{T}/m",
1770  ptm_nbx,
1771  ymin,
1772  ymax,
1773  ptm_nby,
1774  0.,
1775  ptmmax);
1776 
1777  fa_ptm_rap_glo_pip = new TH2F("ptm_rap_glo_pip",
1778  "MCTrack-glo pi-plus; y; p_{T}/m",
1779  ptm_nbx,
1780  ymin,
1781  ymax,
1782  ptm_nby,
1783  0.,
1784  ptmmax);
1785  fa_ptm_rap_glo_pim = new TH2F("ptm_rap_glo_pim",
1786  "MCTrack-glo pi-minus;y; p_{T}/m",
1787  ptm_nbx,
1788  ymin,
1789  ymax,
1790  ptm_nby,
1791  0.,
1792  ptmmax);
1793  fa_ptm_rap_glo_kp = new TH2F("ptm_rap_glo_kp",
1794  "MCTrack-glo k-plus; y; p_{T}/m",
1795  ptm_nbx,
1796  ymin,
1797  ymax,
1798  ptm_nby,
1799  0.,
1800  ptmmax);
1801  fa_ptm_rap_glo_km = new TH2F("ptm_rap_glo_km",
1802  "MCTrack-glo k-minus; y; p_{T}/m",
1803  ptm_nbx,
1804  ymin,
1805  ymax,
1806  ptm_nby,
1807  0.,
1808  ptmmax);
1809  fa_ptm_rap_glo_p = new TH2F("ptm_rap_glo_p",
1810  "MCTrack-glo proton; y; p_{T}/m",
1811  ptm_nbx,
1812  ymin,
1813  ymax,
1814  ptm_nby,
1815  0.,
1816  ptmmax);
1817  fa_ptm_rap_glo_pbar = new TH2F("ptm_rap_glo_pbar",
1818  "MCTrack-glo antiproton;y;p_{T}/m",
1819  ptm_nbx,
1820  ymin,
1821  ymax,
1822  ptm_nby,
1823  0.,
1824  ptmmax);
1825  fa_ptm_rap_glo_d = new TH2F("ptm_rap_glo_d",
1826  "MCTrack-glo deuteron;y; p_{T}/m",
1827  ptm_nbx,
1828  ymin,
1829  ymax,
1830  ptm_nby,
1831  0.,
1832  ptmmax);
1833  fa_ptm_rap_glo_t = new TH2F("ptm_rap_glo_t",
1834  "MCTrack-glo triton; y; p_{T}/m",
1835  ptm_nbx,
1836  ymin,
1837  ymax,
1838  ptm_nby,
1839  0.,
1840  ptmmax);
1841  fa_ptm_rap_glo_h = new TH2F("ptm_rap_glo_h",
1842  "MCTrack-glo 3he; y; p_{T}/m",
1843  ptm_nbx,
1844  ymin,
1845  ymax,
1846  ptm_nby,
1847  0.,
1848  ptmmax);
1849  fa_ptm_rap_glo_a = new TH2F("ptm_rap_glo_a",
1850  "MCTrack-glo alpha; y; p_{T}/m",
1851  ptm_nbx,
1852  ymin,
1853  ymax,
1854  ptm_nby,
1855  0.,
1856  ptmmax);
1857  fa_ptm_rap_glo_imf = new TH2F("ptm_rap_glo_imf",
1858  "MCTrack-glo imf; y; p_{T}/m",
1859  ptm_nbx,
1860  ymin,
1861  ymax,
1862  ptm_nby,
1863  0.,
1864  ptmmax);
1865 
1866  fa_v1_rap_glo_pip = new TH2F("v1_rap_glo_pip",
1867  "MCTrack-glo pi-plus; y; v_{1}",
1868  v1_nbx,
1869  -yvmax,
1870  yvmax,
1871  v1_nby,
1872  -1.,
1873  1.);
1874  fa_v1_rap_glo_pim = new TH2F("v1_rap_glo_pim",
1875  "MCTrack-glo pi-minus;y; v_{1}",
1876  v1_nbx,
1877  -yvmax,
1878  yvmax,
1879  v1_nby,
1880  -1.,
1881  1.);
1882  fa_v1_rap_glo_kp = new TH2F("v1_rap_glo_kp",
1883  "MCTrack-glo k-plus; y; v_{1}",
1884  v1_nbx,
1885  -yvmax,
1886  yvmax,
1887  v1_nby,
1888  -1.,
1889  1.);
1890  fa_v1_rap_glo_km = new TH2F("v1_rap_glo_km",
1891  "MCTrack-glo k-minus; y; v_{1}",
1892  v1_nbx,
1893  -yvmax,
1894  yvmax,
1895  v1_nby,
1896  -1.,
1897  1.);
1898  fa_v1_rap_glo_p = new TH2F("v1_rap_glo_p",
1899  "MCTrack-glo proton; y; v_{1}",
1900  v1_nbx,
1901  -yvmax,
1902  yvmax,
1903  v1_nby,
1904  -1.,
1905  1.);
1906  fa_v1_rap_glo_pbar = new TH2F("v1_rap_glo_pbar",
1907  "MCTrack-glo antiproton;y; v_{1}",
1908  v1_nbx,
1909  -yvmax,
1910  yvmax,
1911  v1_nby,
1912  -1.,
1913  1.);
1914  fa_v1_rap_glo_d = new TH2F("v1_rap_glo_d",
1915  "MCTrack-glo deuteron;y; v_{1}",
1916  v1_nbx,
1917  -yvmax,
1918  yvmax,
1919  v1_nby,
1920  -1.,
1921  1.);
1922  fa_v1_rap_glo_t = new TH2F("v1_rap_glo_t",
1923  "MCTrack-glo triton; y; v_{1}",
1924  v1_nbx,
1925  -yvmax,
1926  yvmax,
1927  v1_nby,
1928  -1.,
1929  1.);
1930  fa_v1_rap_glo_h = new TH2F("v1_rap_glo_h",
1931  "MCTrack-glo 3he; y; v_{1}",
1932  v1_nbx,
1933  -yvmax,
1934  yvmax,
1935  v1_nby,
1936  -1.,
1937  1.);
1938  fa_v1_rap_glo_a = new TH2F("v1_rap_glo_a",
1939  "MCTrack-glo alpha; y; v_{1}",
1940  v1_nbx,
1941  -yvmax,
1942  yvmax,
1943  v1_nby,
1944  -1.,
1945  1.);
1946  fa_v1_rap_glo_imf = new TH2F("v1_rap_glo_imf",
1947  "MCTrack-glo imf; y; v_{1}",
1948  v1_nbx,
1949  -yvmax,
1950  yvmax,
1951  v1_nby,
1952  -1.,
1953  1.);
1954 
1955  fa_v2_rap_glo_pip = new TH2F("v2_rap_glo_pip",
1956  "MCTrack-glo pi-plus; y; v_{2}",
1957  v1_nbx,
1958  -yvmax,
1959  yvmax,
1960  v1_nby,
1961  -1.,
1962  1.);
1963  fa_v2_rap_glo_pim = new TH2F("v2_rap_glo_pim",
1964  "MCTrack-glo pi-minus;y; v_{2}",
1965  v1_nbx,
1966  -yvmax,
1967  yvmax,
1968  v1_nby,
1969  -1.,
1970  1.);
1971  fa_v2_rap_glo_kp = new TH2F("v2_rap_glo_kp",
1972  "MCTrack-glo k-plus; y; v_{2}",
1973  v1_nbx,
1974  -yvmax,
1975  yvmax,
1976  v1_nby,
1977  -1.,
1978  1.);
1979  fa_v2_rap_glo_km = new TH2F("v2_rap_glo_km",
1980  "MCTrack-glo k-minus; y; v_{2}",
1981  v1_nbx,
1982  -yvmax,
1983  yvmax,
1984  v1_nby,
1985  -1.,
1986  1.);
1987  fa_v2_rap_glo_p = new TH2F("v2_rap_glo_p",
1988  "MCTrack-glo proton; y; v_{2}",
1989  v1_nbx,
1990  -yvmax,
1991  yvmax,
1992  v1_nby,
1993  -1.,
1994  1.);
1995  fa_v2_rap_glo_pbar = new TH2F("v2_rap_glo_pbar",
1996  "MCTrack-glo antiproton;y; v_{2}",
1997  v1_nbx,
1998  -yvmax,
1999  yvmax,
2000  v1_nby,
2001  -1.,
2002  1.);
2003  fa_v2_rap_glo_d = new TH2F("v2_rap_glo_d",
2004  "MCTrack-glo deuteron;y; v_{2}",
2005  v1_nbx,
2006  -yvmax,
2007  yvmax,
2008  v1_nby,
2009  -1.,
2010  1.);
2011  fa_v2_rap_glo_t = new TH2F("v2_rap_glo_t",
2012  "MCTrack-glo triton; y; v_{2}",
2013  v1_nbx,
2014  -yvmax,
2015  yvmax,
2016  v1_nby,
2017  -1.,
2018  1.);
2019  fa_v2_rap_glo_h = new TH2F("v2_rap_glo_h",
2020  "MCTrack-glo 3he; y; v_{2}",
2021  v1_nbx,
2022  -yvmax,
2023  yvmax,
2024  v1_nby,
2025  -1.,
2026  1.);
2027  fa_v2_rap_glo_a = new TH2F("v2_rap_glo_a",
2028  "MCTrack-glo alpha; y; v_{2}",
2029  v1_nbx,
2030  -yvmax,
2031  yvmax,
2032  v1_nby,
2033  -1.,
2034  1.);
2035  fa_v2_rap_glo_imf = new TH2F("v2_rap_glo_imf",
2036  "MCTrack-glo imf; y; v_{2}",
2037  v1_nbx,
2038  -yvmax,
2039  yvmax,
2040  v1_nby,
2041  -1.,
2042  1.);
2043 
2044  // xy - hit densities and rates
2045  Int_t nbinx = 200;
2046  Int_t nbiny = 200;
2047  Float_t xrange = 750.;
2048  Float_t yrange = 500.;
2049  fwxy2 = nbinx * nbiny / 4. / xrange / yrange;
2050 
2051  fa_xy_poi1 = new TH2F(
2052  "xy_poi1", "TofPoint; ;", nbinx, -xrange, xrange, nbiny, -yrange, yrange);
2053  fa_xy_poi2 = new TH2F("xy_poi2",
2054  "TofPoint /cm^{2}; ;",
2055  nbinx,
2056  -xrange,
2057  xrange,
2058  nbiny,
2059  -yrange,
2060  yrange);
2061  fa_xy_poi3 = new TH2F("xy_poi3",
2062  "TofPoint /cm^{2}/s; ;",
2063  nbinx,
2064  -xrange,
2065  xrange,
2066  nbiny,
2067  -yrange,
2068  yrange);
2069 
2070  fa_pv_poi = new TH2F(
2071  "pv_poi", "TofPoint(all); velocity;momentum;", 100, 0., 32., 100., 0., 5.);
2072  fa_tm_poi =
2073  new TH2F("tm_poi",
2074  "Tofpoi(all); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2075  100,
2076  0.,
2077  10.,
2078  200.,
2079  -1.5,
2080  2.5);
2081  fa_tm_poiprim = new TH2F("tm_poiprim",
2082  "Tofpoi(primary); momentum; Tofmass",
2083  100,
2084  0.,
2085  10.,
2086  200.,
2087  -1.5,
2088  2.5);
2089 
2090  fa_xy_hit1 = new TH2F(
2091  "xy_hit1", "TofHit; ;", nbinx, -xrange, xrange, nbiny, -yrange, yrange);
2092  fa_xy_hit2 = new TH2F("xy_hit2",
2093  "TofHit /cm^{2}; ;",
2094  nbinx,
2095  -xrange,
2096  xrange,
2097  nbiny,
2098  -yrange,
2099  yrange);
2100  fa_xy_hit3 = new TH2F("xy_hit3",
2101  "TofHit /cm^{2}/s; ;",
2102  nbinx,
2103  -xrange,
2104  xrange,
2105  nbiny,
2106  -yrange,
2107  yrange);
2108 
2109 
2110  fa_tof_hit =
2111  new TH1F("tof_hit", "TofHit(all); t (ns); counts;", 100, 10., 110.);
2112  fa_dtof_hit =
2113  new TH1F("dtof_hit", "TofHit(all); #Deltat (ns); counts;", 100, -1., 1.);
2114  fa_tof_hitprim =
2115  new TH1F("tof_hitprim", "TofHit(prim); t (ns); counts;", 100, 10., 110.);
2116  fa_pv_hit = new TH2F(
2117  "pv_hit", "TofHit(all); velocity; momentum;", 100, 0., 32., 100., 0., 5.);
2118  fa_tm_hit =
2119  new TH2F("tm_hit",
2120  "TofHit(all); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2121  100,
2122  0.,
2123  10.,
2124  200.,
2125  -1.5,
2126  2.5);
2127  fa_tm_hitprim = new TH2F("tm_hitprim",
2128  "TofHit(primary); momentum; Tofmass",
2129  100,
2130  0.,
2131  10.,
2132  200.,
2133  -1.5,
2134  2.5);
2135  fa_tn_hit =
2136  new TH1F("tn_hit", "fastest TofHit(all); t (ns); counts;", 100, -1.0, 1.);
2137  fa_t0_hit =
2138  new TH1F("t0_hit", "time zero; t0 (ns) ; counts;", 100, -0.5, 0.5);
2139  fa_t0m_hit =
2140  new TH1F("t0m_hit", "average time zero; t0 (ns) ; counts;", 100, -0.1, 0.1);
2141  fa_t0mn_hit = new TH1F("t0mn_hit",
2142  "average time zero hits; number of hits ; counts;",
2143  100,
2144  0.,
2145  500.);
2146  fa_t0m_b_hit = new TH2F("t0m_b_hit",
2147  "average time zero; b (fm); t0 (ns) ; counts;",
2148  28,
2149  0.,
2150  14.,
2151  500,
2152  -0.3,
2153  0.7);
2154  fa_t0mn_b_hit =
2155  new TH2F("t0mn_b_hit",
2156  "average time zero hits; b(fm); number of hits ; counts;",
2157  28,
2158  0.,
2159  14.,
2160  100,
2161  0.,
2162  500.);
2163 
2164  fa_t0m_f_hit = new TH1F("t0m_f_hit",
2165  "average time zero forward; t0 (ns) ; counts;",
2166  100,
2167  -0.1,
2168  0.1);
2169  fa_t0mn_f_hit =
2170  new TH1F("t0mn_f_hit",
2171  "average time zero hits forward; number of hits ; counts;",
2172  100,
2173  0.,
2174  500.);
2175  fa_t0m_f_b_hit =
2176  new TH2F("t0m_f_b_hit",
2177  "average time zero forward; b (fm); t0 (ns) ; counts;",
2178  28,
2179  0.,
2180  14.,
2181  500,
2182  -0.3,
2183  0.7);
2184  fa_t0mn_f_b_hit =
2185  new TH2F("t0mn_f_b_hit",
2186  "average time zero hits forward ; b(fm); number of hits ; counts;",
2187  28,
2188  0.,
2189  14.,
2190  50,
2191  0.,
2192  50.);
2193 
2194  fa_t0m_nf_hit = new TH1F("t0m_nf_hit",
2195  "average time zero noforward; t0 (ns) ; counts;",
2196  100,
2197  -0.1,
2198  0.1);
2199  fa_t0mn_nf_hit =
2200  new TH1F("t0mn_nf_hit",
2201  "average time zero hits noforward; number of hits ; counts;",
2202  100,
2203  0.,
2204  500.);
2205  fa_t0m_nf_b_hit =
2206  new TH2F("t0m_nf_b_hit",
2207  "average time zero noforward; b (fm); t0 (ns) ; counts;",
2208  28,
2209  0.,
2210  14.,
2211  500,
2212  -0.3,
2213  0.7);
2214  fa_t0mn_nf_b_hit = new TH2F(
2215  "t0mn_nf_b_hit",
2216  "average time zero hits noforward ; b(fm); number of hits ; counts;",
2217  28,
2218  0.,
2219  14.,
2220  100,
2221  0.,
2222  500.);
2223 
2224  fa_dxx = new TH2F(
2225  "dxx", "TofHit; x; Delta x;", 100, -xrange, xrange, 50., -10., 10.);
2226  fa_dxy = new TH2F(
2227  "dxy", "TofHit; y; Delta x;", 100, -yrange, yrange, 50., -10., 10.);
2228  fa_dxz =
2229  new TH2F("dxz", "TofHit; z; Delta x;", 100, 400., 650., 50., -10., 10.);
2230  fa_dyx = new TH2F(
2231  "dyx", "TofHit; x; Delta y;", 100, -xrange, xrange, 50., -10., 10.);
2232  fa_dyy = new TH2F(
2233  "dyy", "TofHit; y; Delta y;", 100, -yrange, yrange, 50., -10., 10.);
2234  fa_dyz =
2235  new TH2F("dyz", "TofHit; z; Delta y;", 100, 400., 650., 50., -10., 10.);
2236  fa_dzx =
2237  new TH2F("dzx", "TofHit; x; Delta z;", 100, -xrange, xrange, 50, -20., 20.);
2238  fa_dzy =
2239  new TH2F("dzy", "TofHit; y; Delta z;", 100, -yrange, yrange, 50, -20., 20.);
2240  fa_dzz =
2241  new TH2F("dzz", "TofHit; z; Delta z;", 100, 400., 650., 50, -20., 20.);
2242 
2243  fa_hit_ch =
2244  new TH1F("hit_ch", "TofHits; channel; rate (Hz/s);", 50000, 0., 50000.);
2245  fa_dhit_ch = new TH2F("dhit_ch",
2246  "Tof Double Hits; channel; counts;",
2247  50000,
2248  0.,
2249  50000.,
2250  2,
2251  0.5,
2252  2.5);
2253 
2254  fa_xy_glo1 = new TH2F("xy_glo1",
2255  "GlobalTrack(all); x (cm); y(cm);",
2256  nbinx,
2257  -xrange,
2258  xrange,
2259  nbiny,
2260  -yrange,
2261  yrange);
2262  fa_xy_glo_pip = new TH2F("xy_glo_pip",
2263  "GlobalTrack(pip); x (cm); y(cm);",
2264  nbinx,
2265  -xrange,
2266  xrange,
2267  nbiny,
2268  -yrange,
2269  yrange);
2270  fa_xy_glo_pim = new TH2F("xy_glo_pim",
2271  "GlobalTrack(pim); x (cm); y(cm);",
2272  nbinx,
2273  -xrange,
2274  xrange,
2275  nbiny,
2276  -yrange,
2277  yrange);
2278  fa_xy_glo_p = new TH2F("xy_glo_p",
2279  "GlobalTrack(p); x (cm); y(cm);",
2280  nbinx,
2281  -xrange,
2282  xrange,
2283  nbiny,
2284  -yrange,
2285  yrange);
2286  fa_xy_glo_pbar = new TH2F("xy_glo_pbar",
2287  "GlobalTrack(pbar); x (cm); y(cm);",
2288  nbinx,
2289  -xrange,
2290  xrange,
2291  nbiny,
2292  -yrange,
2293  yrange);
2294  fa_xy_glo_kp = new TH2F("xy_glo_kp",
2295  "GlobalTrack(kp); x (cm); y(cm);",
2296  nbinx,
2297  -xrange,
2298  xrange,
2299  nbiny,
2300  -yrange,
2301  yrange);
2302  fa_xy_glo_km = new TH2F("xy_glo_km",
2303  "GlobalTrack(km); x (cm); y(cm);",
2304  nbinx,
2305  -xrange,
2306  xrange,
2307  nbiny,
2308  -yrange,
2309  yrange);
2310  fa_xy_glo_d = new TH2F("xy_glo_d",
2311  "GlobalTrack(d); x (cm); y(cm);",
2312  nbinx,
2313  -xrange,
2314  xrange,
2315  nbiny,
2316  -yrange,
2317  yrange);
2318  fa_xy_glo_t = new TH2F("xy_glo_t",
2319  "GlobalTrack(t); x (cm); y(cm);",
2320  nbinx,
2321  -xrange,
2322  xrange,
2323  nbiny,
2324  -yrange,
2325  yrange);
2326  fa_xy_glo_h = new TH2F("xy_glo_h",
2327  "GlobalTrack(h); x (cm); y(cm);",
2328  nbinx,
2329  -xrange,
2330  xrange,
2331  nbiny,
2332  -yrange,
2333  yrange);
2334  fa_xy_glo_a = new TH2F("xy_glo_a",
2335  "GlobalTrack(a); x (cm); y(cm);",
2336  nbinx,
2337  -xrange,
2338  xrange,
2339  nbiny,
2340  -yrange,
2341  yrange);
2342 
2343  fa_TofTrackMul =
2344  new TH1F("TofTrackMul",
2345  "number of assigned TofTrack / global track; multiplicity; ",
2346  50,
2347  0.,
2348  50.);
2349  fa_VtxB = new TH1F("VtxB", "Chi2 to primary vertex; ", 100, 0., 20.);
2350 
2351  Float_t TMMIN = -1.5;
2352  Float_t TMMAX = 2.5;
2353  Int_t TMYBIN = 400;
2354  fa_pv_glo = new TH2F("pv_glo",
2355  "GlobalTrack(all); velocity; momentum;",
2356  100,
2357  0.,
2358  32.,
2359  100.,
2360  0.,
2361  5.);
2362  fa_tm_glo =
2363  new TH2F("tm_glo",
2364  "GlobalTrack(all); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2365  100,
2366  0.,
2367  10.,
2368  TMYBIN,
2369  TMMIN,
2370  TMMAX);
2371  fa_chi2_mom_glo = new TH2F("chi2_mom_glo",
2372  "GlobalTrack(all); momentum; chi2;",
2373  100,
2374  0.,
2375  10.,
2376  100.,
2377  0.,
2378  50.);
2379  fa_chi2_mom_gloprim = new TH2F("chi2_mom_gloprim",
2380  "GlobalTrack(primaries); momentum; chi2;",
2381  100,
2382  0.,
2383  10.,
2384  100.,
2385  0.,
2386  50.);
2387  fa_len_mom_glo = new TH2F("len_mom_glo",
2388  "GlobalTrack(all); momentum; len;",
2389  100,
2390  0.,
2391  10.,
2392  100.,
2393  0.,
2394  1500.);
2395  fa_tm_gloprim = new TH2F("tm_gloprim",
2396  "GlobalTrack(primary); momentum; Tofmass",
2397  100,
2398  0.,
2399  10.,
2400  TMYBIN,
2401  TMMIN,
2402  TMMAX);
2403  fa_tm_glovtxb = new TH2F(
2404  "tm_glovtxb",
2405  "GlobalTrack(vtxb); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2406  100,
2407  0.,
2408  10.,
2409  TMYBIN,
2410  TMMIN,
2411  TMMAX);
2412  fa_tm_gloprimvtxb = new TH2F("tm_gloprimvtxb",
2413  "GlobalTrack(prim,vtxb); momentum; Tofmass",
2414  100,
2415  0.,
2416  10.,
2417  TMYBIN,
2418  TMMIN,
2419  TMMAX);
2420  fa_tm_glomis =
2421  new TH2F("tm_glomis",
2422  "GlobalTrack(mis); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2423  100,
2424  0.,
2425  10.,
2426  TMYBIN,
2427  TMMIN,
2428  TMMAX);
2429  fa_tm_glo_pip =
2430  new TH2F("tm_glo_pip",
2431  "GlobalTrack(pip); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2432  100,
2433  0.,
2434  10.,
2435  TMYBIN,
2436  TMMIN,
2437  TMMAX);
2438  fa_tm_glo_pim =
2439  new TH2F("tm_glo_pim",
2440  "GlobalTrack(pim); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2441  100,
2442  0.,
2443  10.,
2444  TMYBIN,
2445  TMMIN,
2446  TMMAX);
2447  fa_tm_glo_kp =
2448  new TH2F("tm_glo_kp",
2449  "GlobalTrack(kp); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2450  100,
2451  0.,
2452  10.,
2453  TMYBIN,
2454  TMMIN,
2455  TMMAX);
2456  fa_tm_glo_km =
2457  new TH2F("tm_glo_km",
2458  "GlobalTrack(km); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2459  100,
2460  0.,
2461  10.,
2462  TMYBIN,
2463  TMMIN,
2464  TMMAX);
2465  fa_tm_glo_p =
2466  new TH2F("tm_glo_p",
2467  "GlobalTrack(p); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2468  100,
2469  0.,
2470  10.,
2471  TMYBIN,
2472  TMMIN,
2473  TMMAX);
2474  fa_tm_glo_pbar = new TH2F(
2475  "tm_glo_pbar",
2476  "GlobalTrack(pbar); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2477  100,
2478  0.,
2479  10.,
2480  TMYBIN,
2481  TMMIN,
2482  TMMAX);
2483  fa_tm_glo_d =
2484  new TH2F("tm_glo_d",
2485  "GlobalTrack(d); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2486  100,
2487  0.,
2488  10.,
2489  TMYBIN,
2490  TMMIN,
2491  TMMAX);
2492  fa_tm_glo_t =
2493  new TH2F("tm_glo_t",
2494  "GlobalTrack(t); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2495  100,
2496  0.,
2497  10.,
2498  TMYBIN,
2499  TMMIN,
2500  TMMAX);
2501  fa_tm_glo_h =
2502  new TH2F("tm_glo_h",
2503  "GlobalTrack(h); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2504  100,
2505  0.,
2506  10.,
2507  TMYBIN,
2508  TMMIN,
2509  TMMAX);
2510  fa_tm_glo_a =
2511  new TH2F("tm_glo_a",
2512  "GlobalTrack(a); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2513  100,
2514  0.,
2515  10.,
2516  TMYBIN,
2517  TMMIN,
2518  TMMAX);
2519 
2520  Double_t M2MIN = -0.4;
2521  Double_t M2MAX = 1.4;
2522  Int_t M2YBIN = 360;
2523  fa_m2mom_glo =
2524  new TH2F("m2mom_glo",
2525  "GlobalTrack(all); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2526  200,
2527  -10.,
2528  10.,
2529  M2YBIN,
2530  M2MIN,
2531  M2MAX);
2533  new TH2F("m2mom_glovtxb",
2534  "GlobalTrack(vtxb); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2535  200,
2536  -10.,
2537  10.,
2538  M2YBIN,
2539  M2MIN,
2540  M2MAX);
2542  new TH2F("m2mom_gloprim",
2543  "GlobalTrack(prim); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2544  200,
2545  -10.,
2546  10.,
2547  M2YBIN,
2548  M2MIN,
2549  M2MAX);
2550  fa_m2mom_gloprimvtxb = new TH2F(
2551  "m2mom_gloprimvtxb",
2552  "GlobalTrack(primvtxb); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2553  200,
2554  -10.,
2555  10.,
2556  M2YBIN,
2557  M2MIN,
2558  M2MAX);
2560  new TH2F("m2mom_glo_pip",
2561  "GlobalTrack(pip); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2562  200,
2563  -10.,
2564  10.,
2565  M2YBIN,
2566  M2MIN,
2567  M2MAX);
2569  new TH2F("m2mom_glo_pim",
2570  "GlobalTrack(pim); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2571  200,
2572  -10.,
2573  10.,
2574  M2YBIN,
2575  M2MIN,
2576  M2MAX);
2577  fa_m2mom_glo_kp =
2578  new TH2F("m2mom_glo_kp",
2579  "GlobalTrack(kp); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2580  200,
2581  -10.,
2582  10.,
2583  M2YBIN,
2584  M2MIN,
2585  M2MAX);
2586  fa_m2mom_glo_km =
2587  new TH2F("m2mom_glo_km",
2588  "GlobalTrack(km); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2589  200,
2590  -10.,
2591  10.,
2592  M2YBIN,
2593  M2MIN,
2594  M2MAX);
2595  fa_m2mom_glo_p =
2596  new TH2F("m2mom_glo_p",
2597  "GlobalTrack(p); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2598  200,
2599  -10.,
2600  10.,
2601  M2YBIN,
2602  M2MIN,
2603  M2MAX);
2605  new TH2F("m2mom_glo_pbar",
2606  "GlobalTrack(pbar); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2607  200,
2608  -10.,
2609  10.,
2610  M2YBIN,
2611  M2MIN,
2612  M2MAX);
2613 
2614  fa_pMCmom_glo = new TH2F("pMCmom_glo",
2615  "GlobalTrack(all); momentum; p_{MC};",
2616  100,
2617  0.,
2618  10.,
2619  100,
2620  0.,
2621  10.);
2622  fa_pMCmom_glo_pip = new TH2F("pMCmom_glo_pip",
2623  "GlobalTrack(pip); momentum; p_{MC};",
2624  100,
2625  0.,
2626  10.,
2627  100,
2628  0.,
2629  10.);
2630  fa_pMCmom_glo_pim = new TH2F("pMCmom_glo_pim",
2631  "GlobalTrack(pim); momentum; p_{MC};",
2632  100,
2633  0.,
2634  10.,
2635  100,
2636  0.,
2637  10.);
2638  fa_pMCmom_glo_kp = new TH2F("pMCmom_glo_kp",
2639  "GlobalTrack(kp); momentum; p_{MC};",
2640  100,
2641  0.,
2642  10.,
2643  100,
2644  0.,
2645  10.);
2646  fa_pMCmom_glo_km = new TH2F("pMCmom_glo_km",
2647  "GlobalTrack(km); momentum; p_{MC};",
2648  100,
2649  0.,
2650  10.,
2651  100,
2652  0.,
2653  10.);
2654  fa_pMCmom_glo_p = new TH2F("pMCmom_glo_p",
2655  "GlobalTrack(p); momentum; p_{MC};",
2656  100,
2657  0.,
2658  10.,
2659  100,
2660  0.,
2661  10.);
2662  fa_pMCmom_glo_pbar = new TH2F("pMCmom_glo_pbar",
2663  "GlobalTrack(pbar); momentum; p_{MC};",
2664  100,
2665  0.,
2666  10.,
2667  100,
2668  0.,
2669  10.);
2670  fa_pMCmom_glo_d = new TH2F("pMCmom_glo_d",
2671  "GlobalTrack(d); momentum; p_{MC};",
2672  100,
2673  0.,
2674  10.,
2675  100,
2676  0.,
2677  10.);
2678  fa_pMCmom_glo_t = new TH2F("pMCmom_glo_t",
2679  "GlobalTrack(t); momentum; p_{MC};",
2680  100,
2681  0.,
2682  10.,
2683  100,
2684  0.,
2685  10.);
2686  fa_pMCmom_glo_h = new TH2F("pMCmom_glo_h",
2687  "GlobalTrack(h); momentum; p_{MC};",
2688  100,
2689  0.,
2690  10.,
2691  100,
2692  0.,
2693  10.);
2694  fa_pMCmom_glo_a = new TH2F("pMCmom_glo_a",
2695  "GlobalTrack(a); momentum; p_{MC};",
2696  100,
2697  0.,
2698  10.,
2699  100,
2700  0.,
2701  10.);
2702 
2703  Double_t LenDisMax = 20.;
2704  fa_LenDismom_glo = new TH2F("LenDismom_glo",
2705  "GlobalTrack(all); momentum; len-dis;",
2706  100,
2707  0.,
2708  10.,
2709  100.,
2710  -LenDisMax,
2711  LenDisMax);
2712  fa_LenDismom_glo_pip = new TH2F("LenDismom_glo_pip",
2713  "GlobalTrack(pip); momentum; len-dis;",
2714  100,
2715  0.,
2716  10.,
2717  100.,
2718  -LenDisMax,
2719  LenDisMax);
2720  fa_LenDismom_glo_pim = new TH2F("LenDismom_glo_pim",
2721  "GlobalTrack(pim); momentum; len-dis;",
2722  100,
2723  0.,
2724  10.,
2725  100.,
2726  -LenDisMax,
2727  LenDisMax);
2728  fa_LenDismom_glo_kp = new TH2F("LenDismom_glo_kp",
2729  "GlobalTrack(kp); momentum; len-dis;",
2730  100,
2731  0.,
2732  10.,
2733  100.,
2734  -LenDisMax,
2735  LenDisMax);
2736  fa_LenDismom_glo_km = new TH2F("LenDismom_glo_km",
2737  "GlobalTrack(km); momentum; len-dis;",
2738  100,
2739  0.,
2740  10.,
2741  100.,
2742  -LenDisMax,
2743  LenDisMax);
2744  fa_LenDismom_glo_p = new TH2F("LenDismom_glo_p",
2745  "GlobalTrack(p); momentum; len-dis;",
2746  100,
2747  0.,
2748  10.,
2749  100.,
2750  -LenDisMax,
2751  LenDisMax);
2752  fa_LenDismom_glo_pbar = new TH2F("LenDismom_glo_pbar",
2753  "GlobalTrack(pbar); momentum; len-dis;",
2754  100,
2755  0.,
2756  10.,
2757  100.,
2758  -LenDisMax,
2759  LenDisMax);
2760  fa_LenDismom_glo_d = new TH2F("LenDismom_glo_d",
2761  "GlobalTrack(d); momentum; len-dis;",
2762  100,
2763  0.,
2764  10.,
2765  100.,
2766  -LenDisMax,
2767  LenDisMax);
2768  fa_LenDismom_glo_t = new TH2F("LenDismom_glo_t",
2769  "GlobalTrack(t); momentum; len-dis;",
2770  100,
2771  0.,
2772  10.,
2773  100.,
2774  -LenDisMax,
2775  LenDisMax);
2776  fa_LenDismom_glo_h = new TH2F("LenDismom_glo_h",
2777  "GlobalTrack(h); momentum; len-dis;",
2778  100,
2779  0.,
2780  10.,
2781  100.,
2782  -LenDisMax,
2783  LenDisMax);
2784  fa_LenDismom_glo_a = new TH2F("LenDismom_glo_a",
2785  "GlobalTrack(a); momentum; len-dis;",
2786  100,
2787  0.,
2788  10.,
2789  100.,
2790  -LenDisMax,
2791  LenDisMax);
2792 
2794  new TH2F("LenMcLenGlomom_glo",
2795  "GlobalTrack(all); momentum [GeV]; len glo - len MC pnt[cm];",
2796  100,
2797  0.,
2798  10.,
2799  400.,
2800  -LenDisMax,
2801  LenDisMax);
2803  new TH2F("LenMcDismom_glo",
2804  "GlobalTrack(all); momentum [GeV]; len MC pnt - dis [cm];",
2805  100,
2806  0.,
2807  10.,
2808  400.,
2809  -LenDisMax,
2810  LenDisMax);
2811 
2812  Int_t WYBIN = 100;
2813  Float_t WYMAX = 20.;
2814  fa_w_mom_glo = new TH2F("w_mom_glo",
2815  "GlobalTrack(all); momentum; weight;",
2816  100,
2817  0.,
2818  10.,
2819  WYBIN,
2820  0.,
2821  WYMAX);
2822  fa_w_mom_glo_pip = new TH2F("w_mom_glo_pip",
2823  "GlobalTrack(pip); momentum; weight;",
2824  100,
2825  0.,
2826  10.,
2827  WYBIN,
2828  0.,
2829  WYMAX);
2830  fa_w_mom_glo_pim = new TH2F("w_mom_glo_pim",
2831  "GlobalTrack(pim); momentum; weight;",
2832  100,
2833  0.,
2834  10.,
2835  WYBIN,
2836  0.,
2837  WYMAX);
2838  fa_w_mom_glo_kp = new TH2F("w_mom_glo_kp",
2839  "GlobalTrack(kp); momentum; weight;",
2840  100,
2841  0.,
2842  10.,
2843  WYBIN,
2844  0.,
2845  WYMAX);
2846  fa_w_mom_glo_km = new TH2F("w_mom_glo_km",
2847  "GlobalTrack(km); momentum; weight;",
2848  100,
2849  0.,
2850  10.,
2851  WYBIN,
2852  0.,
2853  WYMAX);
2854  fa_w_mom_glo_p = new TH2F("w_mom_glo_p",
2855  "GlobalTrack(p); momentum; weight;",
2856  100,
2857  0.,
2858  10.,
2859  WYBIN,
2860  0.,
2861  WYMAX);
2862  fa_w_mom_glo_pbar = new TH2F("w_mom_glo_pbar",
2863  "GlobalTrack(pbar); momentum; weight;",
2864  100,
2865  0.,
2866  10.,
2867  WYBIN,
2868  0.,
2869  WYMAX);
2870  fa_w_mom_glo_d = new TH2F("w_mom_glo_d",
2871  "GlobalTrack(d); momentum; weight;",
2872  100,
2873  0.,
2874  10.,
2875  WYBIN,
2876  0.,
2877  WYMAX);
2878  fa_w_mom_glo_t = new TH2F("w_mom_glo_t",
2879  "GlobalTrack(t); momentum; weight;",
2880  100,
2881  0.,
2882  10.,
2883  WYBIN,
2884  0.,
2885  WYMAX);
2886  fa_w_mom_glo_h = new TH2F("w_mom_glo_h",
2887  "GlobalTrack(h); momentum; weight;",
2888  100,
2889  0.,
2890  10.,
2891  WYBIN,
2892  0.,
2893  WYMAX);
2894  fa_w_mom_glo_a = new TH2F("w_mom_glo_a",
2895  "GlobalTrack(a); momentum; weight;",
2896  100,
2897  0.,
2898  10.,
2899  WYBIN,
2900  0.,
2901  WYMAX);
2902  fa_w_mom_glomis = new TH2F("w_mom_glomis",
2903  "GlobalTrack(mis); momentum; weight;",
2904  100,
2905  0.,
2906  10.,
2907  WYBIN,
2908  0.,
2909  WYMAX);
2910 
2911  //centrality
2912  fa_mul_b_gen = new TH2F("mul_b_gen",
2913  "Centrality - gen;impact parameter b; multiplicity;",
2914  15,
2915  0.,
2916  15.,
2917  100,
2918  0.,
2919  10000.);
2920  fa_mul_b_poi = new TH2F("mul_b_poi",
2921  "Centrality - poi;impact parameter b; multiplicity;",
2922  15,
2923  0.,
2924  15.,
2925  100,
2926  0.,
2927  10000.);
2928  fa_mul_b_hit = new TH2F("mul_b_hit",
2929  "Centrality - hit;impact parameter b; multiplicity;",
2930  15,
2931  0.,
2932  15.,
2933  100,
2934  0.,
2935  2000.);
2936  fa_mul_b_glo = new TH2F("mul_b_glo",
2937  "Centrality - glo;impact parameter b; multiplicity;",
2938  15,
2939  0.,
2940  15.,
2941  100,
2942  0.,
2943  2000.);
2944  fa_mul_b_had = new TH2F("mul_b_had",
2945  "Centrality - had;impact parameter b; multiplicity;",
2946  15,
2947  0.,
2948  15.,
2949  100,
2950  0.,
2951  2000.);
2952 
2953  //reaction plane
2954  fa_cdrp_b_gen = new TH2F(
2955  "cdrp_b_gen",
2956  "reaction plane resolution - gen;impact parameter b; cos#Delta#phi_{rp};",
2957  15,
2958  0.,
2959  15.,
2960  20,
2961  -1.,
2962  1.);
2963  fa_drp_b_gen =
2964  new TH2F("drp_b_gen",
2965  "#Delta#phi-reaction plane - gen ;impact parameter b;",
2966  15,
2967  0.,
2968  15.,
2969  36,
2970  -180.,
2971  180.);
2972  fa_phirp_b_gen =
2973  new TH2F("phirp_b_gen",
2974  "#phi_{reaction plane} - gen ;impact parameter b;",
2975  15,
2976  0.,
2977  15.,
2978  36,
2979  -180.,
2980  180.);
2981  fa_phgrp_b_gen =
2982  new TH2F("phgrp_b_gen",
2983  "#phi_{G reaction plane} - gen ;impact parameter b;",
2984  15,
2985  0.,
2986  15.,
2987  36,
2988  -180.,
2989  180.);
2990  fa_phphrp_gen = new TH2F("phphrp_gen",
2991  "#phi_#phi - gen ;#phi_{rec}; #phi_{gen} ;",
2992  36,
2993  -180.,
2994  180.,
2995  36,
2996  -180.,
2997  180.);
2998  fa_delrp_b_gen = new TH2F("delrp_b_gen",
2999  "#Delta#phi_{G}-reaction plane - gen ;impact "
3000  "parameter b;#phi_{rec}-#phi_{gen}",
3001  15,
3002  0.,
3003  15.,
3004  36,
3005  -180.,
3006  180.);
3007  fa_delrp_b_poi = new TH2F("delrp_b_poi",
3008  "#Delta#phi_{G}-reaction plane - poi ;impact "
3009  "parameter b;#phi_{rec}-#phi_{gen}",
3010  15,
3011  0.,
3012  15.,
3013  36,
3014  -180.,
3015  180.);
3016  fa_delrp_b_hit = new TH2F("delrp_b_hit",
3017  "#Delta#phi_{G}-reaction plane - hit ;impact "
3018  "parameter b;#phi_{rec}-#phi_{gen}",
3019  15,
3020  0.,
3021  15.,
3022  36,
3023  -180.,
3024  180.);
3025  fa_delrp_b_glo = new TH2F("delrp_b_glo",
3026  "#Delta#phi_{G}-reaction plane - glo ;impact "
3027  "parameter b;#phi_{rec}-#phi_{gen}",
3028  15,
3029  0.,
3030  15.,
3031  36,
3032  -180.,
3033  180.);
3034 
3035  fa_cdelrp_b_gen = new TH2F("cdelrp_b_gen",
3036  "reaction plane resolution - gen;impact parameter "
3037  "b;cos(#phi_{rec}-#phi_{gen})",
3038  15,
3039  0.,
3040  15.,
3041  20,
3042  -1.,
3043  1.);
3044  fa_cdelrp_b_poi = new TH2F("cdelrp_b_poi",
3045  "reaction plane resolution - poi;impact parameter "
3046  "b;cos(#phi_{rec}-#phi_{gen})",
3047  15,
3048  0.,
3049  15.,
3050  20,
3051  -1.,
3052  1.);
3053  fa_cdelrp_b_hit = new TH2F("cdelrp_b_hit",
3054  "reaction plane resolution - hit;impact parameter "
3055  "b;cos(#phi_{rec}-#phi_{gen})",
3056  15,
3057  0.,
3058  15.,
3059  20,
3060  -1.,
3061  1.);
3062  fa_cdelrp_b_glo = new TH2F("cdelrp_b_glo",
3063  "reaction plane resolution - glo;impact parameter "
3064  "b;cos(#phi_{rec}-#phi_{gen})",
3065  15,
3066  0.,
3067  15.,
3068  20,
3069  -1.,
3070  1.);
3071  fa_cdelrp_b_had = new TH2F("cdelrp_b_had",
3072  "reaction plane resolution - had;impact parameter "
3073  "b;cos(#phi_{rec}-#phi_{gen})",
3074  15,
3075  0.,
3076  15.,
3077  20,
3078  -1.,
3079  1.);
3080 
3081  fa_cdrp_b_poi = new TH2F(
3082  "cdrp_b_poi",
3083  "reaction plane resolution - poi;impact parameter b; cos#Delta#phi_{rp};",
3084  15,
3085  0.,
3086  15.,
3087  20,
3088  -1.,
3089  1.);
3090  fa_drp_b_poi =
3091  new TH2F("drp_b_poi",
3092  "#Delta#phi-reaction plane - poi ;impact parameter b;",
3093  15,
3094  0.,
3095  15.,
3096  36,
3097  -180.,
3098  180.);
3099 
3100  fa_cdrp_b_hit = new TH2F(
3101  "cdrp_b_hit",
3102  "reaction plane resolution - hit;impact parameter b; cos#Delta#phi_{rp};",
3103  15,
3104  0.,
3105  15.,
3106  20,
3107  -1.,
3108  1.);
3109  fa_drp_b_hit =
3110  new TH2F("drp_b_hit",
3111  "#Delta#phi-reaction plane - hit ;impact parameter b;",
3112  15,
3113  0.,
3114  15.,
3115  36,
3116  -180.,
3117  180.);
3118 
3119  fa_cdrp_b_glo = new TH2F(
3120  "cdrp_b_glo",
3121  "reaction plane resolution - glo;impact parameter b; cos#Delta#phi_{rp};",
3122  15,
3123  0.,
3124  15.,
3125  20,
3126  -1.,
3127  1.);
3128  fa_drp_b_glo =
3129  new TH2F("drp_b_glo",
3130  "#Delta#phi-reaction plane - glo ;impact parameter b;",
3131  15,
3132  0.,
3133  15.,
3134  36,
3135  -180.,
3136  180.);
3137 
3138  fa_cdrp_b_had = new TH2F(
3139  "cdrp_b_had",
3140  "reaction plane resolution - had;impact parameter b; cos#Delta#phi_{rp};",
3141  15,
3142  0.,
3143  15.,
3144  20,
3145  -1.,
3146  1.);
3147  fa_drp_b_had =
3148  new TH2F("drp_b_had",
3149  "#Delta#phi-reaction plane - had ;impact parameter b;",
3150  15,
3151  0.,
3152  15.,
3153  36,
3154  -180.,
3155  180.);
3156 
3157  fa_phirp_gen = new TH1F("phirp_gen",
3158  "#phi_{reaction plane} - gen ;#phi_{RPgen};",
3159  72,
3160  -180.,
3161  180.);
3162  fa_phirp_poi = new TH1F("phirp_poi",
3163  "#phi_{reaction plane} - poi ;#phi_{RPpoi};",
3164  72,
3165  -180.,
3166  180.);
3167  fa_phirp_hit = new TH1F("phirp_hit",
3168  "#phi_{reaction plane} - hit ;#phi_{RPhit};",
3169  72,
3170  -180.,
3171  180.);
3172  fa_phirp_glo = new TH1F("phirp_glo",
3173  "#phi_{reaction plane} - glo ;#phi_{RPglo};",
3174  72,
3175  -180.,
3176  180.);
3177  fa_phirp_had = new TH1F("phirp_had",
3178  "#phi_{reaction plane} - had ;#phi_{RPhad};",
3179  72,
3180  -180.,
3181  180.);
3182 
3183  fa_phirps_gen = new TH1F("phirps_gen",
3184  "#phi_{reaction plane} - gen ;#phi_{sRPgen};",
3185  72,
3186  -180.,
3187  180.);
3188  fa_phirps_poi = new TH1F("phirps_poi",
3189  "#phi_{reaction plane} - poi ;#phi_{sRPpoi};",
3190  72,
3191  -180.,
3192  180.);
3193  fa_phirps_hit = new TH1F("phirps_hit",
3194  "#phi_{reaction plane} - hit ;#phi_{sRPhit};",
3195  72,
3196  -180.,
3197  180.);
3198  fa_phirps_glo = new TH1F("phirps_glo",
3199  "#phi_{reaction plane} - glo ;#phi_{sRPglo};",
3200  72,
3201  -180.,
3202  180.);
3203 
3204  fhwdist = new TH2F(
3205  "hwdist", "matching wdist; p (GeV/c); dist;", 100, 0., 10., 50, 0., 10.);
3206  fhwmindelmass = new TH2F("hwmindelmass",
3207  "matching wmindelmass ; p (GeV/c); #Delta M;",
3208  100,
3209  0.,
3210  10.,
3211  50,
3212  0.,
3213  1.);
3214  fhwminlen = new TH2F("hwminlen",
3215  "matching wminlen ; p (GeV/c); MinPathlength;",
3216  100,
3217  0.,
3218  10.,
3219  50,
3220  0.,
3221  2.);
3222  fhwdelp = new TH2F("hwdelp",
3223  "matching wdelp ; p (GeV/c); #Delta p/p;",
3224  100,
3225  0.,
3226  10.,
3227  50,
3228  0.,
3229  1.);
3230 
3231  fhTofTrkDx =
3232  new TH1F("hTofTrkDx", " x - position resolution ; #deltax;", 50, -1., 1.);
3233  fhTofTrkDy =
3234  new TH1F("hTofTrkDy", " y - position resolution ; #deltay;", 50, -1., 1.);
3235  fhTofTrkDxsel = new TH1F(
3236  "hTofTrkDxsel", " x - position resolution ; #deltax;", 50, -1., 1.);
3237  fhTofTrkDysel = new TH1F(
3238  "hTofTrkDysel", " y - position resolution ; #deltay;", 50, -1., 1.);
3239 
3240  cout
3241  << "CbmHadronAnalysis::CreateHistogramms: histograms booked in directory "
3242  << gDirectory->GetName() << endl;
3243 }
3244 
3245 // ------------------------------------------------------------------
3246 InitStatus
3247 CbmHadronAnalysis::ReadPdfFile() { // Open PDF file and get histogramms for PID
3248  if (fPdfFileName.IsNull()) return kSUCCESS;
3249  TFile* pdfFile = new TFile(fPdfFileName);
3250  if (NULL == pdfFile) {
3251  cout << "-E- CbmHadronAnalysis::ReadPdfFile : "
3252  << "file " << fPdfFileName << " does not exist!" << endl;
3253  return kSUCCESS;
3254  }
3255  return kSUCCESS;
3256 }
3257 
3258 // ------------------------------------------------------------------
3260  ReadFlowFile() { // Open file and get histogramms for RP corrections
3261  if (fFlowFileName.IsNull()) return kSUCCESS;
3262  fflowFile = new TFile(fFlowFileName);
3263  if (NULL == fflowFile) {
3264  cout << "-E- CbmHadronAnalysis::ReadFlowFile : "
3265  << "file " << fFlowFileName << " does not exist!" << endl;
3266  return kSUCCESS;
3267  }
3268  cout << "-I- CbmHadronAnalysis::ReadFlowFile : RP corrections from "
3269  << fFlowFileName << endl;
3270 
3271  return kSUCCESS;
3272 }
3273 
3274 // ------------------------------------------------------------------
3276  // Task initialisation
3277  FairRootManager* rootMgr = FairRootManager::Instance();
3278  if (NULL == rootMgr) {
3279  cout << "-E- CbmHadronAnalysis::Init : ROOT manager is not instantiated."
3280  << endl;
3281  return kFATAL;
3282  }
3283 
3284  fEventsColl = dynamic_cast<TClonesArray*>(rootMgr->GetObject("Event"));
3285  if (NULL == fEventsColl)
3286  fEventsColl = dynamic_cast<TClonesArray*>(rootMgr->GetObject("CbmEvent"));
3287 
3288  if (NULL == fEventsColl)
3289  LOG(info) << "CbmEvent not found in input file, assume eventwise input";
3290  else
3291  LOG(info) << "CbmEvent found in input file, timebased analysis";
3292 
3293  fMCEventHeader = (FairMCEventHeader*) rootMgr->GetObject("MCEventHeader.");
3294  if (NULL == fMCEventHeader) {
3295  cout << "-W- CbmHadronAnalysis::Init : no MC Header Info" << endl;
3296  }
3297 
3298  fTofPoints = (TClonesArray*) rootMgr->GetObject("TofPoint");
3299  if (NULL == fTofPoints) {
3300  cout << "-W- CbmHadronAnalysis::Init : no TOF point array!" << endl;
3301  }
3302 
3304  fDigiMan->Init();
3306  LOG(error) << GetName() << ": No input digis!";
3307  return kFATAL;
3308  } else
3309  LOG(info) << "DigiManager has Tof Digis";
3310 
3311  /*
3312  fTofDigis = (TClonesArray *) rootMgr->GetObject("TofDigi");
3313 
3314  if( NULL == fTofDigis)
3315  fTofDigis = (TClonesArray *) rootMgr->GetObject("CbmTofDigiExp");
3316 
3317  if( NULL == fTofDigis)
3318  fTofDigis = (TClonesArray *) rootMgr->GetObject("CbmTofDigi");
3319  if( NULL == fTofDigis)
3320  {
3321  LOG(error)<<"CbmHadronAnalysis::RegisterInputs => Could not get the TofDigi TClonesArray!!!";
3322  } // if( NULL == fTofDigis)
3323 */
3324 
3325  fTofDigiMatchColl = (TClonesArray*) rootMgr->GetObject("TofCalDigiMatch");
3326  if (NULL == fTofDigiMatchColl) {
3327  cout << "-I- CbmHadronAnalysis::Init : no TOF CalDigiMatch array!" << endl;
3328  fTofDigiMatchColl = (TClonesArray*) rootMgr->GetObject("TofDigiMatch");
3329  if (NULL == fTofDigiMatchColl) {
3330  cout << "-I- CbmHadronAnalysis::Init : no TOF digiMatch array!" << endl;
3331  }
3332  }
3333 
3335  (TClonesArray*) rootMgr->GetObject("TofDigiMatchPoints");
3336  if (NULL == fTofDigiMatchPointsColl) {
3337  cout << "-I- CbmHadronAnalysis::Init : no TOF digiMatchPoints array!"
3338  << endl;
3339  }
3340 
3341  fTofHitsColl = (TClonesArray*) rootMgr->GetObject("TofHit");
3342  if (NULL == fTofHitsColl) {
3343  cout << "-W- CbmHadronAnalysis::Init : no TOF Hit array!" << endl;
3344  }
3345 
3346  fTofTracks = (TClonesArray*) rootMgr->GetObject("TofTrack");
3347  if (NULL == fTofTracks) {
3348  cout << "-W- CbmHadronAnalysis::Init : "
3349  << "no Tof Track array!" << endl;
3350  }
3351 
3352  fTrdPoints = (TClonesArray*) rootMgr->GetObject("TrdPoint");
3353  if (NULL == fTofPoints) {
3354  cout << "-W- CbmHadronAnalysis::Init : no TRD point array!" << endl;
3355  }
3356 
3357  fTrdHits = (TClonesArray*) rootMgr->GetObject("TrdHit");
3358  if (NULL == fTrdHits) {
3359  cout << "-W- CbmHadronAnalysis::Init : no TRD Hit array!" << endl;
3360  }
3361 
3362  fGlobalTracks = (TClonesArray*) rootMgr->GetObject("GlobalTrack");
3363  if (NULL == fGlobalTracks) {
3364  cout << "-W- CbmHadronAnalysis::Init : no Global Track array!" << endl;
3365  }
3366 
3367  fHadrons = (TClonesArray*) rootMgr->GetObject("Hadron");
3368  if (NULL == fHadrons) {
3369  cout << "-W- CbmHadronAnalysis::Init : no Hadron array!" << endl;
3370  }
3371 
3372  fStsTracks = (TClonesArray*) rootMgr->GetObject("StsTrack");
3373  if (NULL == fStsTracks) {
3374  cout << "-W- CbmHadronAnalysis::Init : no STS Track array!" << endl;
3375  }
3376  fStsHitsColl = (TClonesArray*) rootMgr->GetObject("StsHit");
3377  if (NULL == fStsHitsColl) {
3378  cout << "-W- CbmHadronAnalysis::Init : no STS Hit array!" << endl;
3379  }
3380  fStsClusters = (TClonesArray*) rootMgr->GetObject("StsCluster");
3381  if (NULL == fStsClusters) {
3382  cout << "-W- CbmHadronAnalysis::Init : no STS Cluster array!" << endl;
3383  }
3384  fStsDigis = (TClonesArray*) rootMgr->GetObject("StsDigi");
3385  if (NULL == fStsDigis) {
3386  cout << "-W- CbmHadronAnalysis::Init : no STS Digi array!" << endl;
3387  }
3388  fStsDigiMatchColl = (TClonesArray*) rootMgr->GetObject("StsDigiMatch");
3389  if (NULL == fStsDigiMatchColl) {
3390  cout << "-W- CbmHadronAnalysis::Init : "
3391  << "no STS DigiMatch array!" << endl;
3392  }
3393 
3394  // Get pointer to PrimaryVertex object from IOManager if it exists
3395  // The old name for the object is "PrimaryVertex" the new one
3396  // "PrimaryVertex." Check first for the new name
3397  fPrimVertex = dynamic_cast<CbmVertex*>(rootMgr->GetObject("PrimaryVertex."));
3398  if (nullptr == fPrimVertex) {
3399  fPrimVertex = dynamic_cast<CbmVertex*>(rootMgr->GetObject("PrimaryVertex"));
3400  }
3401  if (nullptr == fPrimVertex) { LOG(warn) << "No primary vertex"; }
3402 
3403  if (NULL == fEventsColl) {
3406  } else { // for time based analysis generate temporary Event TClonesArrays
3407  fTofHits = new TClonesArray("CbmTofHit", 100);
3408  fStsHits = new TClonesArray("CbmStsHit", 100);
3409  }
3410 
3411  // --- MC data manager
3412  CbmMCDataManager* mcManager =
3413  (CbmMCDataManager*) rootMgr->GetObject("MCDataManager");
3414 
3415  if (NULL != mcManager) {
3416  // --- Data arrays
3417  fMCTracks = mcManager->InitBranch("MCTrack");
3418  fStsPoints = mcManager->InitBranch("StsPoint");
3419  }
3420 
3421  fMCTracksColl = (TClonesArray*) rootMgr->GetObject("MCTrack");
3422  if (NULL == fMCTracksColl) {
3423  cout << "-W- CbmHadronAnalysis::Init : "
3424  << "no MC track array!" << endl;
3425  }
3426 
3427  fStsPointsColl = (TClonesArray*) rootMgr->GetObject("StsPoint");
3428  if (NULL == fStsPointsColl) {
3429  cout << "-W- CbmHadronAnalysis::Init : "
3430  << "no STS Point array!" << endl;
3431  }
3432 
3433  fTrackFitter.Init();
3434 
3435  InitStatus status = ReadPdfFile();
3436  if (kSUCCESS != status) { return status; }
3437 
3438  InitStatus statf = ReadFlowFile();
3439  if (kSUCCESS != statf) { return statf; }
3440 
3441  Float_t pbeam = GetBeamMomentum();
3442  {
3443  Float_t ep = TMath::Sqrt(pbeam * pbeam + M2PROT);
3444  Float_t gp = ep / TMath::Sqrt(M2PROT);
3445  Float_t bp = TMath::Sqrt(1. - 1. / gp / gp);
3446  Float_t yp = 0.5 * TMath::Log((1. + bp) / (1. - bp));
3447  SetMidY(yp * 0.5);
3448  cout << "-I- CbmHadronAnalysis: Initialize for pbeam = " << pbeam
3449  << " rap:" << GetMidY() << endl;
3450  }
3451 
3452  cout << "-I- CbmHadronAnalysis::Init : "
3453  << "initialisation completed." << endl;
3454 
3455  return kSUCCESS;
3456 }
3457 // ------------------------------------------------------------------
3458 // ------------------------------------------------------------------
3459 void CbmHadronAnalysis::Exec(Option_t* option) {
3460  // Task execution on TS or Events
3461  if (NULL != fEventsColl) { // working for STS and TOF only
3462  iNbTs++;
3463  LOG(debug) << "process TS " << iNbTs << " with "
3464  << fEventsColl->GetEntriesFast() << " events";
3465  if (NULL == fTofHits || NULL == fTofHitsColl) {
3466  assert("Invalid pointer to Tof TClonesArray");
3467  }
3468  if (NULL == fStsHits || NULL == fStsHitsColl) {
3469  assert("Invalid pointer to Sts TClonesArray");
3470  }
3471  LOG(debug) << "TS contains " << fTofHitsColl->GetEntriesFast() << "TOF and "
3472  << fStsHitsColl->GetEntriesFast() << " Sts hits";
3473 
3474  for (Int_t iEvent = 0; iEvent < fEventsColl->GetEntriesFast(); iEvent++) {
3475  CbmEvent* tEvent = dynamic_cast<CbmEvent*>(fEventsColl->At(iEvent));
3476  // copy TOF hits
3477  fTofHits->Clear();
3478  Int_t iNbHits = 0;
3479  LOG(debug) << "Fill Tof array with mul "
3480  << tEvent->GetNofData(ECbmDataType::kTofHit);
3481  for (Int_t iHit = 0; iHit < tEvent->GetNofData(ECbmDataType::kTofHit);
3482  iHit++) {
3483  Int_t iHitIndex =
3484  static_cast<Int_t>(tEvent->GetIndex(ECbmDataType::kTofHit, iHit));
3485  CbmTofHit* pHit = (CbmTofHit*) fTofHitsColl->At(iHitIndex);
3486  new ((*fTofHits)[iNbHits])
3487  CbmTofHit(*pHit); // fill temporary working TClonesArray
3488  iNbHits++;
3489  }
3490  // copy STS hits
3491  iNbHits = 0;
3492  fStsHits->Clear();
3493  LOG(debug) << "Fill Sts array with mul "
3494  << tEvent->GetNofData(ECbmDataType::kStsHit);
3495  for (Int_t iHit = 0; iHit < tEvent->GetNofData(ECbmDataType::kStsHit);
3496  iHit++) {
3497  Int_t iHitIndex =
3498  static_cast<Int_t>(tEvent->GetIndex(ECbmDataType::kStsHit, iHit));
3499  const CbmStsHit* pHit = (CbmStsHit*) fStsHitsColl->At(iHitIndex);
3500  new ((*fStsHits)[iNbHits])
3501  CbmStsHit(*pHit); // fill temporary working TClonesArray
3502  iNbHits++;
3503  }
3504  LOG(debug) << Form("analyze TS %d, Ev %d with %d STS, %d TOF hits",
3505  iNbTs,
3506  iEvent,
3507  fStsHits->GetEntriesFast(),
3508  fTofHits->GetEntriesFast());
3509  ExecEvent(option);
3510  }
3511  } else { // event based analysis
3512  ExecEvent(option);
3513  }
3514 }
3515 
3516 // ------------------------------------------------------------------
3518  // Task execution
3519 
3520  // Declare variables outside the loop
3521  CbmMCTrack* MCTrack = NULL;
3522  CbmStsTrack* StsTrack = NULL;
3523  CbmTofPoint* TofPoint = NULL;
3524  CbmTofHit* TofHit = NULL;
3525  CbmTofTrack* TofTrack = NULL;
3526  // CbmTofTrack *TofTrackh;
3527  CbmTofTrack* BestTofTrack = NULL;
3528  CbmGlobalTrack* GlobTrack = NULL;
3529  // CbmMatch *tofHitMatch;
3530 
3531 
3532  Int_t pdgCode, Np1, Np2;
3533  Float_t Qx1, Qy1, Qx2, Qy2, phirp1, phirp2, phirp, delrp, rp_weight;
3534  Float_t RADDEG = 57.29577951;
3535  Float_t p_MC, px_MC, py_MC, pz_MC;
3536  Float_t mfrag = 0.;
3537  Float_t MaxT0 = 0.1;
3538 
3539  Int_t TrackP[100000];
3540  Float_t t_hit;
3541  Bool_t use_pions_for_flow = kTRUE;
3542 
3543  Int_t verbose = 1;
3544 
3545  if (GetBSelMax() > 0.) {
3546  if (fMCEventHeader->GetB() > GetBSelMax()) { return; };
3547  }
3548 
3549  if (GetBSelMin() > 0.) {
3550  if (fMCEventHeader->GetB() < GetBSelMin()) { return; };
3551  }
3552 
3553  Float_t yrp_mid = GetMidY(); // midrapidity -> update from simulation!
3554  if (fMCTracksColl != NULL) nMCTracks = fMCTracksColl->GetEntriesFast();
3555  if (fTofPoints != NULL) nTofPoints = fTofPoints->GetEntriesFast();
3556  if (fTofHits != NULL) nTofHits = fTofHits->GetEntriesFast();
3557  if (fTofTracks != NULL) nTofTracks = fTofTracks->GetEntriesFast();
3558  if (fGlobalTracks != NULL) nGlobTracks = fGlobalTracks->GetEntriesFast();
3559  if (fStsHits != NULL) nStsHits = fStsHits->GetEntriesFast();
3560 
3561 
3562  if (verbose > 0) { //nh-debug
3563  LOG(debug) << "<D> HadronAnalysis::Exec starting with MCtrks " << nMCTracks
3564  << ", TofPoi " << nTofPoints << ", TofHit " << nTofHits
3565  << ", TofTrk " << nTofTracks << ", GlbTrk " << nGlobTracks
3566  << ", StsHit " << nStsHits;
3567  if (fMCEventHeader != NULL)
3568  LOG(debug) << "-D- b = " << fMCEventHeader->GetB()
3569  << ", phi = " << fMCEventHeader->GetRotZ();
3570  }
3571  if (FairLogger::GetLogger()->IsLogNeeded(fair::Severity::debug)) {
3572  for (Int_t j = 0; j < nTofHits; j++) {
3573  TofHit = (CbmTofHit*) fTofHits->At(j);
3574  if (NULL == TofHit) continue;
3575  LOG(DEBUG) << Form(
3576  "TofHit %d, addr 0x%08x, x %6.1f, y %6.1f, z %6.1f, t %6.1f ",
3577  j,
3578  TofHit->GetAddress(),
3579  TofHit->GetX(),
3580  TofHit->GetY(),
3581  TofHit->GetZ(),
3582  TofHit->GetTime());
3583  }
3584  }
3585 
3586  Double_t dT0 = 0.;
3587  for (Int_t j = 0; j < nTofHits; j++) {
3588  TofHit = (CbmTofHit*) fTofHits->At(j);
3589  if (NULL == TofHit) continue;
3590  if (TofHit->GetZ() == 0.) dT0 = TofHit->GetTime();
3591  }
3592  if (dT0 != 0.) {
3593  for (Int_t j = 0; j < nTofHits; j++) {
3594  TofHit = (CbmTofHit*) fTofHits->At(j);
3595  if (NULL == TofHit) continue;
3596  TofHit->SetTime(TofHit->GetTime() - dT0);
3597  }
3598  }
3599 
3600  if (FairLogger::GetLogger()->IsLogNeeded(fair::Severity::debug)) {
3601  for (Int_t j = 0; j < nTofHits; j++) {
3602  TofHit = (CbmTofHit*) fTofHits->At(j);
3603  if (NULL == TofHit) continue;
3604  LOG(DEBUG) << Form(
3605  "TofHit %d, addr 0x%08x, x %6.1f, y %6.1f, z %6.1f, t %6.1f ",
3606  j,
3607  TofHit->GetAddress(),
3608  TofHit->GetX(),
3609  TofHit->GetY(),
3610  TofHit->GetZ(),
3611  TofHit->GetTime());
3612  }
3613  }
3614 
3615  if (bRecSec && nTofHits > 1) ReconstructSecondaries(); // independent method
3616 
3617  // some local arrays
3618  Int_t MAXNHT = 50;
3619  Int_t NTHMUL[nGlobTracks]; // number of candidate TofTracks
3620  Int_t
3621  IndTHMUL[nGlobTracks]
3622  [MAXNHT]; // ordered array of candidate number of TofTrack indices
3623  Float_t Weight_THMUL
3624  [nGlobTracks]
3625  [MAXNHT]; // weights for ordered array of candidate number of TofTrack indices
3626  // Int_t IndTofTracks[nGlobTracks][MAXNHT][MAXNHT]; // array of TofTrack Indices that selected TofHit is assigned to
3627  Int_t NTofHitTMul
3628  [nTofHits]; // number of GlobalTracks assigned to a specific TofHit
3629  Int_t IndTofTrack_TofHit
3630  [nTofHits][MAXNHT]; // index of TofTracks assigned to specific TofHit
3631 
3632  // generator level
3633  if (NULL != fMCEventHeader)
3634  fa_mul_b_gen->Fill(fMCEventHeader->GetB(), nMCTracks);
3635 
3636  Qx1 = 0.;
3637  Qy1 = 0.;
3638  Np1 = 0;
3639  Qx2 = 0.;
3640  Qy2 = 0.;
3641  Np2 = 0;
3642  for (Int_t k = 0; k < nMCTracks; k++) { // inspect MCTracks
3643 
3644  MCTrack = (CbmMCTrack*) fMCTracksColl->At(k);
3645 
3646  if (MCTrack->GetMotherId() != -1) continue; // primary particles only
3647 
3648  // Process only hadrons
3649  pdgCode = MCTrack->GetPdgCode();
3650  // cout << " Track k="<<k<<", pdgCode = "<<pdgCode<<endl;
3651 
3652  if (pdgCode < 100000000) {
3653  if (211 != TMath::Abs(pdgCode) && // pions
3654  321 != TMath::Abs(pdgCode) && // kaons
3655  2212 != TMath::Abs(pdgCode)) // protons
3656  continue;
3657  } else {
3658  mfrag =
3659  (pdgCode % 1000) / 10 * .931494028; // ignoring binding energies ...
3660  // where is the proper mass stored ?
3661  }
3662 
3663  Float_t Phip = RADDEG * atan2(MCTrack->GetPy(), MCTrack->GetPx());
3664  Float_t dphi = Phip - RADDEG * fMCEventHeader->GetRotZ();
3665  if (dphi < -180.) { dphi += 360.; };
3666  if (dphi > 180.) { dphi -= 360.; };
3667  dphi = dphi / RADDEG;
3668  rp_weight = 0.;
3669 
3670  //cout << " Track k="<<k<<", pdgCode = "<<pdgCode<<
3671  // " Mass " << MCTrack->GetMass()<<","<<mfrag<<" Y " << MCTrack->GetRapidity() <<
3672  // " Pt " << MCTrack->GetPt() <<endl;
3673 
3674  switch (pdgCode) {
3675  case 211: {
3676  fa_ptm_rap_gen_pip->Fill(MCTrack->GetRapidity(),
3677  MCTrack->GetPt() / MCTrack->GetMass());
3678  fa_v1_rap_gen_pip->Fill(
3679  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
3680  fa_v2_rap_gen_pip->Fill((MCTrack->GetRapidity() - GetMidY())
3681  / GetMidY(),
3682  TMath::Cos(2 * dphi));
3683 
3684  if (use_pions_for_flow
3685  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
3686  > GetDY()
3687  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3688  if (MCTrack->GetRapidity()
3689  > yrp_mid) { // set weights for reaction plane
3690  rp_weight = -1.;
3691  } else {
3692  rp_weight = +1.;
3693  }
3694  } else {
3695  rp_weight = 0.;
3696  }
3697  break;
3698  };
3699  case -211: {
3700  fa_ptm_rap_gen_pim->Fill(MCTrack->GetRapidity(),
3701  MCTrack->GetPt() / MCTrack->GetMass());
3702  fa_v1_rap_gen_pim->Fill(
3703  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
3704  fa_v2_rap_gen_pim->Fill((MCTrack->GetRapidity() - GetMidY())
3705  / GetMidY(),
3706  TMath::Cos(2 * dphi));
3707 
3708  if (use_pions_for_flow
3709  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
3710  > GetDY()
3711  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3712  if (MCTrack->GetRapidity()
3713  > yrp_mid) { // set weights for reaction plane
3714  rp_weight = -1.;
3715  } else {
3716  rp_weight = +1.;
3717  }
3718  } else {
3719  rp_weight = 0.;
3720  }
3721  break;
3722  };
3723  case 321: {
3724  fa_ptm_rap_gen_kp->Fill(MCTrack->GetRapidity(),
3725  MCTrack->GetPt() / MCTrack->GetMass());
3726  fa_v1_rap_gen_kp->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3727  TMath::Cos(dphi));
3728  fa_v2_rap_gen_kp->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3729  TMath::Cos(2 * dphi));
3730  break;
3731  };
3732  case -321: {
3733  fa_ptm_rap_gen_km->Fill(MCTrack->GetRapidity(),
3734  MCTrack->GetPt() / MCTrack->GetMass());
3735  fa_v1_rap_gen_km->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3736  TMath::Cos(dphi));
3737  fa_v2_rap_gen_km->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3738  TMath::Cos(2 * dphi));
3739  break;
3740  };
3741  case 2212: { //protons
3742  fa_ptm_rap_gen_p->Fill(MCTrack->GetRapidity(),
3743  MCTrack->GetPt() / MCTrack->GetMass());
3744  fa_v1_rap_gen_p->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3745  TMath::Cos(dphi));
3746  fa_v2_rap_gen_p->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3747  TMath::Cos(2 * dphi));
3748 
3749  // reaction plane determination
3750  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
3751  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3752  if (MCTrack->GetRapidity()
3753  > yrp_mid) { // set weights for reaction plane
3754  rp_weight = 1.;
3755  } else {
3756  rp_weight = -1.;
3757  }
3758  }
3759  break;
3760  };
3761  case -2212: {
3762  fa_ptm_rap_gen_pbar->Fill(MCTrack->GetRapidity(),
3763  MCTrack->GetPt() / MCTrack->GetMass());
3764  fa_v1_rap_gen_pbar->Fill(
3765  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
3766  fa_v2_rap_gen_pbar->Fill((MCTrack->GetRapidity() - GetMidY())
3767  / GetMidY(),
3768  TMath::Cos(2 * dphi));
3769  break;
3770  };
3771 
3772  case 1000010020: { // deuteron
3773  fa_ptm_rap_gen_d->Fill(MCTrack->GetRapidity(),
3774  MCTrack->GetPt() / mfrag);
3775  fa_v1_rap_gen_d->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3776  TMath::Cos(dphi));
3777  fa_v2_rap_gen_d->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3778  TMath::Cos(2 * dphi));
3779  // reaction plane determination
3780  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
3781  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3782  if (MCTrack->GetRapidity()
3783  > yrp_mid) { // set weights for reaction plane
3784  rp_weight = 1.;
3785  } else {
3786  rp_weight = -1.;
3787  }
3788  }
3789  break;
3790  };
3791 
3792  case 1000010030: { // triton
3793  fa_ptm_rap_gen_t->Fill(MCTrack->GetRapidity(),
3794  MCTrack->GetPt() / mfrag);
3795  fa_v1_rap_gen_t->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3796  TMath::Cos(dphi));
3797  fa_v2_rap_gen_t->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3798  TMath::Cos(2 * dphi));
3799  // reaction plane determination
3800  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
3801  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3802  if (MCTrack->GetRapidity()
3803  > yrp_mid) { // set weights for reaction plane
3804  rp_weight = 1.;
3805  } else {
3806  rp_weight = -1.;
3807  }
3808  }
3809  break;
3810  };
3811 
3812  case 1000020030: { // 3he
3813  fa_ptm_rap_gen_h->Fill(MCTrack->GetRapidity(),
3814  MCTrack->GetPt() / mfrag);
3815  fa_v1_rap_gen_h->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3816  TMath::Cos(dphi));
3817  fa_v2_rap_gen_h->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3818  TMath::Cos(2 * dphi));
3819  // reaction plane determination
3820  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
3821  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3822  if (MCTrack->GetRapidity()
3823  > yrp_mid) { // set weights for reaction plane
3824  rp_weight = 1.;
3825  } else {
3826  rp_weight = -1.;
3827  }
3828  }
3829  break;
3830  };
3831 
3832  case 1000020040: { // alpha
3833  fa_ptm_rap_gen_a->Fill(MCTrack->GetRapidity(),
3834  MCTrack->GetPt() / mfrag);
3835  fa_v1_rap_gen_a->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3836  TMath::Cos(dphi));
3837  fa_v2_rap_gen_a->Fill((MCTrack->GetRapidity() - GetMidY()) / GetMidY(),
3838  TMath::Cos(2 * dphi));
3839  // reaction plane determination
3840  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
3841  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3842  if (MCTrack->GetRapidity()
3843  > yrp_mid) { // set weights for reaction plane
3844  rp_weight = 1.;
3845  } else {
3846  rp_weight = -1.;
3847  }
3848  }
3849  break;
3850  };
3851 
3852  default: { // intermediate mass fragments
3853  //cout << " Track k="<<k<<", pdgCode = "<<pdgCode<<
3854  //" Mass " << MCTrack->GetMass()<<","<<mfrag<<" Y " << MCTrack->GetRapidity() <<
3855  //" Pt " << MCTrack->GetPt() <<endl;
3856  fa_ptm_rap_gen_imf->Fill(MCTrack->GetRapidity(),
3857  MCTrack->GetPt() / mfrag);
3858  fa_v1_rap_gen_imf->Fill(
3859  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
3860  fa_v2_rap_gen_imf->Fill((MCTrack->GetRapidity() - GetMidY())
3861  / GetMidY(),
3862  TMath::Cos(2 * dphi));
3863  // reaction plane determination (optimistic)
3864  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
3865  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
3866  if (MCTrack->GetRapidity()
3867  > yrp_mid) { // set weights for reaction plane
3868  rp_weight = 1.;
3869  } else {
3870  rp_weight = -1.;
3871  }
3872  }
3873  break;
3874  };
3875  }
3876  if (rp_weight != 0.) {
3877  if (gRandom->Uniform(1)
3878  > 0.5) { //subdivide events into 2 random subevents
3879  Np1++;
3880  Qx1 = Qx1 + rp_weight * MCTrack->GetPx();
3881  Qy1 = Qy1 + rp_weight * MCTrack->GetPy();
3882  } else {
3883  Np2++;
3884  Qx2 = Qx2 + rp_weight * MCTrack->GetPx();
3885  Qy2 = Qy2 + rp_weight * MCTrack->GetPy();
3886  }
3887  }
3888  }
3889 
3890  if (Np1 > 0 && Np2 > 0) {
3891  phirp1 = atan2(Qy1, Qx1);
3892  phirp2 = atan2(Qy2, Qx2);
3893  if (fflowFile != NULL) { // subevent RP flattening
3894  TH1F* phirp_gen_fpar = (TH1F*) fflowFile->Get("phirps_gen_fpar");
3895  Float_t dphir = 0.;
3896  for (int j = 0; j < 4; j++) {
3897  Float_t i = (float) (j + 1);
3898  dphir +=
3899  (-phirp_gen_fpar->GetBinContent(j) * TMath::Cos(i * phirp1)
3900  + phirp_gen_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp1))
3901  / i;
3902  }
3903  phirp1 += dphir;
3904 
3905  dphir = 0.;
3906  for (int j = 0; j < 4; j++) {
3907  Float_t i = (float) (j + 1);
3908  dphir +=
3909  (-phirp_gen_fpar->GetBinContent(j) * TMath::Cos(i * phirp2)
3910  + phirp_gen_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp2))
3911  / i;
3912  }
3913  phirp2 += dphir;
3914  } // subevent RP flattening end
3915 
3916  delrp = (phirp1 - phirp2);
3917  fa_phirps_gen->Fill(phirp1 * RADDEG); // 1D histo
3918  fa_phirps_gen->Fill(phirp2 * RADDEG); // 1D histo
3919  if (0) { //nh-debug
3920  cout << "<D-gen> Impact parameter " << fMCEventHeader->GetB()
3921  << ", delrp = " << delrp << endl;
3922  }
3923  fa_cdrp_b_gen->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp));
3924  delrp = delrp * RADDEG;
3925  while (delrp < -180.) {
3926  delrp += 360.;
3927  }
3928  while (delrp > 180.) {
3929  delrp -= 360.;
3930  }
3931  fa_drp_b_gen->Fill(fMCEventHeader->GetB(), delrp);
3932 
3933  phirp = RADDEG * atan2(Qy1 + Qy2, Qx1 + Qx2); // full reaction plane
3934  while (phirp < -180.) {
3935  phirp += 360.;
3936  }
3937  while (phirp > 180.) {
3938  phirp -= 360.;
3939  }
3940  if (fflowFile != NULL) { // RP flattening
3941  TH1F* phirp_gen_fpar = (TH1F*) fflowFile->Get("phirp_gen_fpar");
3942  Float_t dphir = 0.;
3943  for (int j = 0; j < 4; j++) {
3944  Float_t i = (float) (j + 1);
3945  //cout << " RP flat par "<< i << ","<<j<< " par " << phirp_gen_fpar->GetBinContent(j)
3946  // << ","<< phirp_gen_fpar->GetBinContent(j+4) << " phirp "<<phirp<<" dphir "<< dphir << endl;
3947  dphir +=
3948  ((-phirp_gen_fpar->GetBinContent(j) * TMath::Cos(i * phirp / RADDEG)
3949  + phirp_gen_fpar->GetBinContent(j + 4)
3950  * TMath::Sin(i * phirp / RADDEG))
3951  / i);
3952  }
3953  //cout << " phirp " << phirp << " dphir " << dphir*RADDEG << endl;
3954 
3955  phirp += dphir * RADDEG;
3956  while (phirp < -180.) {
3957  phirp += 360.;
3958  }
3959  while (phirp > 180.) {
3960  phirp -= 360.;
3961  }
3962  } // RP flattening end
3963  delrp = phirp - RADDEG * fMCEventHeader->GetRotZ();
3964  while (delrp < -180.) {
3965  delrp += 360.;
3966  }
3967  while (delrp > 180.) {
3968  delrp -= 360.;
3969  }
3970 
3971  fa_phirp_gen->Fill(phirp);
3972  fa_delrp_b_gen->Fill(fMCEventHeader->GetB(), delrp);
3973  fa_cdelrp_b_gen->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp / RADDEG));
3974  fa_phirp_b_gen->Fill(fMCEventHeader->GetB(), phirp);
3975  fa_phgrp_b_gen->Fill(fMCEventHeader->GetB(),
3976  RADDEG * fMCEventHeader->GetRotZ());
3977  fa_phphrp_gen->Fill(phirp, RADDEG * fMCEventHeader->GetRotZ());
3978  } // Np1 && Np2 end
3979 
3980  // TofPoint level
3981 
3982  for (Int_t k = 0; k < nMCTracks; k++)
3983  TrackP[k] = 0; // reset track detected flag
3984 
3985  Qx1 = 0.;
3986  Qy1 = 0.;
3987  Np1 = 0;
3988  Qx2 = 0.;
3989  Qy2 = 0.;
3990  Np2 = 0;
3991  if (NULL != fMCEventHeader)
3992  fa_mul_b_poi->Fill(fMCEventHeader->GetB(), nTofPoints);
3993 
3994  for (Int_t l = 0; l < nTofPoints; l++) {
3995  TofPoint = (CbmTofPoint*) fTofPoints->At(l);
3996  if (NULL == TofPoint) {
3997  LOG(WARNING) << " Missing TofPoint at " << l << ", mul " << nTofPoints;
3998  continue;
3999  }
4000  Int_t k = TofPoint->GetTrackID();
4001  MCTrack = (CbmMCTrack*) fMCTracksColl->At(k);
4002  pdgCode = MCTrack->GetPdgCode();
4003  if (pdgCode > 100000000) {
4004  mfrag =
4005  (pdgCode % 1000) / 10 * .931494028; // ignoring binding energies ...
4006  }
4007  px_MC = MCTrack->GetPx();
4008  py_MC = MCTrack->GetPy();
4009  pz_MC = MCTrack->GetPz();
4010  p_MC = sqrt(px_MC * px_MC + py_MC * py_MC + pz_MC * pz_MC);
4011 
4012  if (TrackP[k] == 0) { // for efficiency
4013  TrackP[k] = 1;
4014 
4015  fa_xy_poi1->Fill(TofPoint->GetX(), TofPoint->GetY());
4016  fa_xy_poi2->Fill(TofPoint->GetX(), TofPoint->GetY(), fwxy2);
4017 
4018  Float_t vel = TofPoint->GetLength() / TofPoint->GetTime();
4019  Float_t bet = vel / clight;
4020  if (bet > 0.99999) { bet = 0.99999; }
4021  Float_t tofmass =
4022  p_MC / bet * TMath::Sqrt(1. - bet * bet) * TMath::Sign(1, pdgCode);
4023 
4024  fa_pv_poi->Fill(vel, p_MC);
4025  fa_tm_poi->Fill(p_MC, tofmass);
4026 
4027  if (MCTrack->GetMotherId() != -1) continue; // primary particles only
4028  fa_tm_poiprim->Fill(p_MC, tofmass);
4029 
4030  Float_t Phip = RADDEG * atan2(MCTrack->GetPy(), MCTrack->GetPx());
4031  Float_t dphi = Phip - RADDEG * fMCEventHeader->GetRotZ();
4032  if (dphi < -180.) { dphi += 360.; };
4033  if (dphi > 180.) { dphi -= 360.; };
4034  dphi = dphi / RADDEG;
4035  rp_weight = 0.;
4036 
4037  switch (pdgCode) {
4038  case 211: {
4039  fa_ptm_rap_poi_pip->Fill(MCTrack->GetRapidity(),
4040  MCTrack->GetPt() / MCTrack->GetMass());
4041  if (use_pions_for_flow
4042  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
4043  > GetDY()
4044  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4045  if (MCTrack->GetRapidity()
4046  > yrp_mid) { // set weights for reaction plane
4047  rp_weight = -1.;
4048  } else {
4049  rp_weight = +1.;
4050  }
4051  } else {
4052  rp_weight = 0.;
4053  }
4054  break;
4055  };
4056  case -211: {
4057  fa_ptm_rap_poi_pim->Fill(MCTrack->GetRapidity(),
4058  MCTrack->GetPt() / MCTrack->GetMass());
4059  if (use_pions_for_flow
4060  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
4061  > GetDY()
4062  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4063  if (MCTrack->GetRapidity()
4064  > yrp_mid) { // set weights for reaction plane
4065  rp_weight = -1.;
4066  } else {
4067  rp_weight = +1.;
4068  }
4069  } else {
4070  rp_weight = 0.;
4071  }
4072  break;
4073  };
4074  case 321: {
4075  fa_ptm_rap_poi_kp->Fill(MCTrack->GetRapidity(),
4076  MCTrack->GetPt() / MCTrack->GetMass());
4077  break;
4078  };
4079  case -321: {
4080  fa_ptm_rap_poi_km->Fill(MCTrack->GetRapidity(),
4081  MCTrack->GetPt() / MCTrack->GetMass());
4082  break;
4083  };
4084  case 2212: {
4085  fa_ptm_rap_poi_p->Fill(MCTrack->GetRapidity(),
4086  MCTrack->GetPt() / MCTrack->GetMass());
4087  // reaction plane determination
4088  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4089  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4090  if (MCTrack->GetRapidity()
4091  > yrp_mid) { // set weights for reaction plane
4092  rp_weight = +1.;
4093  } else {
4094  rp_weight = -1.;
4095  }
4096  }
4097  break;
4098  };
4099  case -2212: {
4100  fa_ptm_rap_poi_pbar->Fill(MCTrack->GetRapidity(),
4101  MCTrack->GetPt() / MCTrack->GetMass());
4102  break;
4103  };
4104 
4105  case 1000010020: { // deuteron
4106  fa_ptm_rap_poi_d->Fill(MCTrack->GetRapidity(),
4107  MCTrack->GetPt() / mfrag);
4108  fa_v1_rap_poi_d->Fill(
4109  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4110  fa_v2_rap_poi_d->Fill((MCTrack->GetRapidity() - GetMidY())
4111  / GetMidY(),
4112  TMath::Cos(2 * dphi));
4113  // reaction plane determination
4114  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4115  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4116  if (MCTrack->GetRapidity()
4117  > yrp_mid) { // set weights for reaction plane
4118  rp_weight = 1.;
4119  } else {
4120  rp_weight = -1.;
4121  }
4122  }
4123  break;
4124  };
4125 
4126  case 1000010030: { // triton
4127  fa_ptm_rap_poi_t->Fill(MCTrack->GetRapidity(),
4128  MCTrack->GetPt() / mfrag);
4129  fa_v1_rap_poi_t->Fill(
4130  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4131  fa_v2_rap_poi_t->Fill((MCTrack->GetRapidity() - GetMidY())
4132  / GetMidY(),
4133  TMath::Cos(2 * dphi));
4134  // reaction plane determination
4135  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4136  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4137  if (MCTrack->GetRapidity()
4138  > yrp_mid) { // set weights for reaction plane
4139  rp_weight = 1.;
4140  } else {
4141  rp_weight = -1.;
4142  }
4143  }
4144  break;
4145  };
4146 
4147  case 1000020030: { // 3he
4148  fa_ptm_rap_poi_h->Fill(MCTrack->GetRapidity(),
4149  MCTrack->GetPt() / mfrag);
4150  fa_v1_rap_poi_h->Fill(
4151  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4152  fa_v2_rap_poi_h->Fill((MCTrack->GetRapidity() - GetMidY())
4153  / GetMidY(),
4154  TMath::Cos(2 * dphi));
4155  // reaction plane determination
4156  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4157  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4158  if (MCTrack->GetRapidity()
4159  > yrp_mid) { // set weights for reaction plane
4160  rp_weight = 1.;
4161  } else {
4162  rp_weight = -1.;
4163  }
4164  }
4165  break;
4166  };
4167 
4168  case 1000020040: { // alpha
4169  fa_ptm_rap_poi_a->Fill(MCTrack->GetRapidity(),
4170  MCTrack->GetPt() / mfrag);
4171  fa_v1_rap_poi_a->Fill(
4172  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4173  fa_v2_rap_poi_a->Fill((MCTrack->GetRapidity() - GetMidY())
4174  / GetMidY(),
4175  TMath::Cos(2 * dphi));
4176  // reaction plane determination
4177  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4178  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4179  if (MCTrack->GetRapidity()
4180  > yrp_mid) { // set weights for reaction plane
4181  rp_weight = 1.;
4182  } else {
4183  rp_weight = -1.;
4184  }
4185  }
4186  break;
4187  };
4188  default: { // intermediate mass fragments
4189  //cout << " Track k="<<k<<", pdgCode = "<<pdgCode<<
4190  //" Mass " << MCTrack->GetMass()<<","<<mfrag<<" Y " << MCTrack->GetRapidity() <<
4191  //" Pt " << MCTrack->GetPt() <<endl;
4192  fa_ptm_rap_poi_imf->Fill(MCTrack->GetRapidity(),
4193  MCTrack->GetPt() / mfrag);
4194  fa_v1_rap_poi_imf->Fill(
4195  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4196  fa_v2_rap_poi_imf->Fill((MCTrack->GetRapidity() - GetMidY())
4197  / GetMidY(),
4198  TMath::Cos(2 * dphi));
4199  // reaction plane determination (optimistic)
4200  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4201  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4202  if (MCTrack->GetRapidity()
4203  > yrp_mid) { // set weights for reaction plane
4204  rp_weight = 1.;
4205  } else {
4206  rp_weight = -1.;
4207  }
4208  }
4209  break;
4210  };
4211  }
4212  if (rp_weight != 0.) {
4213  if (gRandom->Uniform(1)
4214  > 0.5) { //subdivide events into 2 random subevents
4215  Np1++;
4216  Qx1 = Qx1 + rp_weight * MCTrack->GetPx();
4217  Qy1 = Qy1 + rp_weight * MCTrack->GetPy();
4218  } else {
4219  Np2++;
4220  Qx2 = Qx2 + rp_weight * MCTrack->GetPx();
4221  Qy2 = Qy2 + rp_weight * MCTrack->GetPy();
4222  }
4223  }
4224  }
4225  }
4226  if (Np1 > 0 && Np2 > 0) {
4227  phirp1 = atan2(Qy1, Qx1);
4228  phirp2 = atan2(Qy2, Qx2);
4229  if (fflowFile != NULL) { // subevent RP flattening
4230  TH1F* phirp_poi_fpar = (TH1F*) fflowFile->Get("phirps_poi_fpar");
4231  Float_t dphir = 0.;
4232  for (int j = 0; j < 4; j++) {
4233  Float_t i = (float) (j + 1);
4234  dphir +=
4235  (-phirp_poi_fpar->GetBinContent(j) * TMath::Cos(i * phirp1)
4236  + phirp_poi_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp1))
4237  / i;
4238  }
4239  phirp1 += dphir;
4240 
4241  dphir = 0.;
4242  for (int j = 0; j < 4; j++) {
4243  Float_t i = (float) (j + 1);
4244  dphir +=
4245  (-phirp_poi_fpar->GetBinContent(j) * TMath::Cos(i * phirp2)
4246  + phirp_poi_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp2))
4247  / i;
4248  }
4249  phirp2 += dphir;
4250  } // subevent RP flattening end
4251  delrp = (phirp1 - phirp2);
4252  fa_phirps_poi->Fill(phirp1 * RADDEG); // 1D histo
4253  fa_phirps_poi->Fill(phirp2 * RADDEG); // 1D histo
4254  if (0) { //nh-debug
4255  cout << "<D-poi> Impact parameter " << fMCEventHeader->GetB()
4256  << ", delrp = " << delrp << endl;
4257  }
4258  fa_cdrp_b_poi->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp));
4259  delrp = delrp * RADDEG;
4260  if (delrp < -180.) delrp += 360.;
4261  if (delrp > 180.) delrp -= 360.;
4262  fa_drp_b_poi->Fill(fMCEventHeader->GetB(), delrp);
4263  }
4264 
4265  phirp = RADDEG * atan2(Qy1 + Qy2, Qx1 + Qx2); // full reaction plane
4266  while (phirp < -180.) {
4267  phirp += 360.;
4268  }
4269  while (phirp > 180.) {
4270  phirp -= 360.;
4271  }
4272  if (fflowFile != NULL) { // RP flattening
4273  TH1F* phirp_poi_fpar = (TH1F*) fflowFile->Get("phirp_poi_fpar");
4274  Float_t dphir = 0.;
4275  for (int j = 0; j < 4; j++) {
4276  Float_t i = (float) (j + 1);
4277  //cout << " RP flat par "<< i << ","<<j<< " par " << phirp_gen_fpar->GetBinContent(j)
4278  // << ","<< phirp_gen_fpar->GetBinContent(j+4) << " phirp "<<phirp<<" dphir "<< dphir << endl;
4279  dphir +=
4280  ((-phirp_poi_fpar->GetBinContent(j) * TMath::Cos(i * phirp / RADDEG)
4281  + phirp_poi_fpar->GetBinContent(j + 4)
4282  * TMath::Sin(i * phirp / RADDEG))
4283  / i);
4284  }
4285  //cout << " phirp " << phirp << " dphir " << dphir*RADDEG << endl;
4286 
4287  phirp += dphir * RADDEG;
4288  while (phirp < -180.) {
4289  phirp += 360.;
4290  }
4291  while (phirp > 180.) {
4292  phirp -= 360.;
4293  }
4294  } // RP flattening end
4295  if (NULL != fMCEventHeader) {
4296  delrp = phirp - RADDEG * fMCEventHeader->GetRotZ();
4297  while (delrp < -180.) {
4298  delrp += 360.;
4299  }
4300  while (delrp > 180.) {
4301  delrp -= 360.;
4302  }
4303  fa_phirp_poi->Fill(phirp); // 1D histo
4304  fa_delrp_b_poi->Fill(fMCEventHeader->GetB(), delrp);
4305  fa_cdelrp_b_poi->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp / RADDEG));
4306  }
4307  // TofHit level
4308  for (Int_t k = 0; k < nMCTracks; k++)
4309  TrackP[k] = 0; // reset track detected flag
4310 
4311  Qx1 = 0.;
4312  Qy1 = 0.;
4313  Np1 = 0;
4314  Qx2 = 0.;
4315  Qy2 = 0.;
4316  Np2 = 0;
4317  Int_t NT0 = 0;
4318  Float_t t0m_hit = 0.;
4319  Int_t NT0F = 0;
4320  Float_t t0mf_hit = 0.;
4321  Int_t NT0NF = 0;
4322  Float_t t0mnf_hit = 0.;
4323  if (NULL != fMCEventHeader)
4324  fa_mul_b_hit->Fill(fMCEventHeader->GetB(), nTofHits);
4325 
4326  Float_t T0MIN = 0.;
4327  Int_t NFHITS = 10;
4328  Int_t nFTofHits = 0;
4329  Float_t T0FAST[NFHITS];
4330  for (Int_t l = 0; l < NFHITS; l++) {
4331  T0FAST[l] = 100;
4332  };
4333 
4334  for (Int_t j = 0; j < nTofHits; j++) {
4335  // reset track assignment vector
4336  NTofHitTMul[j] = 0;
4337  //cout << "<D-hit> j= " << j << endl;
4338  TofHit = (CbmTofHit*) fTofHits->At(j);
4339  if (NULL == TofHit) continue;
4340  t_hit = TofHit->GetTime();
4341  if (1) { // use everything
4342  //if ((TMath::Abs(TofHit->GetX())<55.&&TMath::Abs(TofHit->GetY())<55.)) { // use region E
4343  //if (!(TMath::Abs(TofHit->GetX())<55.&&TMath::Abs(TofHit->GetY())<55.)) { // exclude region E
4344  nFTofHits++;
4345  Float_t dist = TMath::Sqrt(TMath::Power(TofHit->GetX(), 2)
4346  + TMath::Power(TofHit->GetY(), 2)
4347  + TMath::Power(TofHit->GetZ(), 2));
4348  Float_t t0_hit = t_hit - dist / clight;
4349  for (Int_t l = 0; l < NFHITS; l++) {
4350  if (t0_hit < T0FAST[l]) {
4351  //cout << "Sort fasted hits: j="<<j<<", l="<<l<<","<<t0_hit<<","<<T0FAST[l]<<endl;
4352  if (T0FAST[l] < 100.) {
4353  for (Int_t ll = NFHITS - 1; ll >= l; ll--) {
4354  T0FAST[ll + 1] = T0FAST[ll];
4355  //cout <<"Move: "<<ll<<" -> "<< ll+1 <<": "<< T0FAST[ll] << endl;
4356  }
4357  }
4358  T0FAST[l] = t0_hit;
4359  //cout<<"Sort:"; for(Int_t ll=0; ll<NFHITS; ll++){ cout << T0FAST[ll] <<",";}cout << endl;
4360  break;
4361  } else {
4362  }
4363  }
4364  }
4365  }
4366  // cout << "Interpreting result: ";
4367  // T0MIN=average
4368  Int_t nfh = 0;
4369  Int_t nfhmax = nFTofHits;
4370  Int_t nT0It = 0;
4371  Int_t lmin = 0;
4372  Int_t lmax = NFHITS;
4373  Float_t T02 = 0.;
4374  // nfhmax=TMath::Max(nfhmax,3);
4375  for (Int_t l = 0; l < NFHITS; l++) {
4376  if (T0FAST[l] < 100. && nfh < nfhmax) {
4377  lmax = l;
4378  // cout << T0FAST[l] << ", ";
4379  T0MIN += T0FAST[l];
4380  T02 += TMath::Power(T0FAST[l], 2.);
4381  nfh++;
4382  }
4383  }
4384  T0MIN = T0MIN / (Float_t) nfh;
4385  Float_t T0RMS = TMath::Sqrt(T02 - T0MIN * T0MIN);
4386  // cout << " T0MIN = "<<T0MIN << ", T0RMS = "<< T0RMS << ", nfh = "<<nfh
4387  // << " lmin = "<<lmin << ", lmax = "<<lmax <<endl;
4388 
4389  while (T0RMS > 1. && nT0It < 10 && nfh > 2) {
4390  nT0It++;
4391  Float_t T0AV = T0MIN;
4392  if (TMath::Abs(T0FAST[lmin] - T0AV) > TMath::Abs(T0FAST[lmax] - T0AV)) {
4393  //remove first entry
4394  lmin++;
4395  } else { // remove last entry
4396  lmax--;
4397  }
4398  T0MIN = 0.;
4399  nfh = 0;
4400  T02 = 0.;
4401  for (Int_t l = lmin; l < lmax; l++) {
4402  if (T0FAST[l] < 100. && nfh < nfhmax) {
4403  //cout << T0FAST[l] << ", ";
4404  T0MIN += T0FAST[l];
4405  T02 += TMath::Power(T0FAST[l], 2.);
4406  nfh++;
4407  }
4408  }
4409  T0MIN = T0MIN / (Float_t) nfh;
4410  T0RMS = TMath::Sqrt(T02 - T0MIN * T0MIN);
4411  //cout << "Redo("<<nT0It<<"): T0MIN = "<<T0MIN << ", T0RMS = "<< T0RMS << ", nfh = "
4412  // << nfh << " lmin = "<<lmin << ", lmax = "<<lmax <<endl;
4413  }
4414 
4415  Int_t lp = -1;
4416  for (Int_t j = 0; j < nTofHits; j++) {
4417  //cout << "<D-hit> j= " << j << endl;
4418  TofHit = (CbmTofHit*) fTofHits->At(j);
4419  if (NULL == TofHit) continue;
4420  // Int_t l = TofHit->GetRefId(); // pointer to Digi
4421  Int_t l = j; // One CbmMatch per hit and in same order!!!!
4422  if (fTofDigiMatchColl != NULL && fTofDigiMatchPointsColl != NULL) {
4423  CbmMatch* digiMatch = (CbmMatch*) fTofDigiMatchColl->At(l);
4424  // take first digi's point link
4425  CbmLink L0 = digiMatch->GetLink(0);
4426  Int_t iDigInd0 = L0.GetIndex();
4427  CbmMatch* poiMatch = (CbmMatch*) fTofDigiMatchPointsColl->At(iDigInd0);
4428  if (NULL == poiMatch) {
4429  LOG(warn) << "No MC point found for hit " << j << ", digi " << iDigInd0;
4430  continue;
4431  }
4432  CbmLink LP = poiMatch->GetMatchedLink();
4433  lp = LP.GetIndex();
4434  /*
4435  for (Int_t iLink=0; iLink<digiMatch->GetNofLinks(); iLink+=2){ // loop over digis
4436  CbmLink L0 = digiMatch->GetLink(iLink); //vDigish.at(ivDigInd);
4437  Int_t iDigInd0=L0.GetIndex();
4438  Int_t iDigInd1=(digiMatch->GetLink(iLink+1)).GetIndex(); //vDigish.at(ivDigInd+1);
4439  LOG(debug1)<<" " << iDigInd0<<", "<<iDigInd1;
4440 
4441  if (iDigInd0 < fTofDigisColl->GetEntries() && iDigInd1 < fTofDigisColl->GetEntries()){
4442  CbmTofDigiExp *pDig0 = (CbmTofDigiExp*) (fTofDigisColl->At(iDigInd0));
4443  CbmTofDigiExp *pDig1 = (CbmTofDigiExp*) (fTofDigisColl->At(iDigInd1));
4444  }
4445  }
4446  */
4447  } else {
4448  lp = -1;
4449  LOG(WARNING) << "No Link to MCTofPoint found for hit " << j;
4450  continue;
4451  }
4452  TofPoint = (CbmTofPoint*) fTofPoints->At(lp);
4453  Int_t k = TofPoint->GetTrackID();
4454  MCTrack = (CbmMCTrack*) fMCTracksColl->At(k);
4455  pdgCode = MCTrack->GetPdgCode();
4456  px_MC = MCTrack->GetPx();
4457  py_MC = MCTrack->GetPy();
4458  pz_MC = MCTrack->GetPz();
4459  p_MC = sqrt(px_MC * px_MC + py_MC * py_MC + pz_MC * pz_MC);
4460  if (k > 100000) {
4461  cout << "<E-hit> Too many MCTracks " << k << " from " << nMCTracks
4462  << endl;
4463  continue;
4464  }
4465  //cout << "<D-hit> k= " << k << endl;
4466  //cout << Form("HadronAnalysis:: hit %d, poi %d, MCt %d, Eff %d ",j,lp,k,TrackP[k]) << endl;
4467  /*
4468  if(TofHit->GetX()<-90.) { //nh-debug
4469  LOG(INFO) << Form(" Invalid Hit in ev %d: %6.1f, %6.1f, %6.1f, poi: %6.1f, %6.1f, %6.1f, pdg: %d",
4470  fEvents,TofHit->GetX(),TofHit->GetY(),TofHit->GetZ(),
4471  TofPoint->GetX(),TofPoint->GetY(),TofPoint->GetZ(),
4472  pdgCode);
4473  LOG(FATAL) << "<D-hit> j " << j << ", l " << l << ", k " << k << ", lp ";
4474  }
4475  */
4476  if (TrackP[k] == 0) { // for efficiency
4477  // if (1) {
4478  TrackP[k]++;
4479  t_hit = TofHit->GetTime();
4480  Float_t delta_tof = TofPoint->GetTime() - t_hit;
4481  Float_t delta_x = TofPoint->GetX() - TofHit->GetX();
4482  Float_t delta_y = TofPoint->GetY() - TofHit->GetY();
4483  Float_t delta_z = TofPoint->GetZ() - TofHit->GetZ();
4484 
4485  fa_dxx->Fill(TofPoint->GetX(), delta_x);
4486  fa_dxy->Fill(TofPoint->GetY(), delta_x);
4487  fa_dxz->Fill(TofPoint->GetZ(), delta_x);
4488  fa_dyx->Fill(TofPoint->GetX(), delta_y);
4489  fa_dyy->Fill(TofPoint->GetY(), delta_y);
4490  fa_dyz->Fill(TofPoint->GetZ(), delta_y);
4491  fa_dzx->Fill(TofPoint->GetX(), delta_z);
4492  fa_dzy->Fill(TofPoint->GetY(), delta_z);
4493  fa_dzz->Fill(TofPoint->GetZ(), delta_z);
4494 
4495  fa_xy_hit1->Fill(TofHit->GetX(), TofHit->GetY());
4496  fa_xy_hit2->Fill(TofHit->GetX(), TofHit->GetY(), fwxy2);
4497  fa_hit_ch->Fill(TofHit->GetCh());
4498  fa_dhit_ch->Fill(TofHit->GetCh(), TofHit->GetFlag());
4499 
4500  Float_t vel = TofPoint->GetLength() / t_hit;
4501  Float_t bet = vel / clight;
4502  if (bet > 0.99999) { bet = 0.99999; }
4503  Float_t tofmass =
4504  p_MC / bet * TMath::Sqrt(1. - bet * bet) * TMath::Sign(1, pdgCode);
4505  Float_t dist = TMath::Sqrt(TMath::Power(TofHit->GetX(), 2)
4506  + TMath::Power(TofHit->GetY(), 2)
4507  + TMath::Power(TofHit->GetZ(), 2));
4508  fa_tof_hit->Fill(t_hit);
4509  fa_pv_hit->Fill(vel, p_MC);
4510  fa_tm_hit->Fill(p_MC, tofmass);
4511  fa_dtof_hit->Fill(delta_tof);
4512  Float_t t0_hit = t_hit - dist / clight;
4513  fa_t0_hit->Fill(t0_hit);
4514  //if(t0_hit<MaxT0) {
4515  if (t0_hit < T0MIN + 2.4 * MaxT0) {
4516  NT0++;
4517  t0m_hit = ((Float_t)(NT0 - 1) * t0m_hit + t0_hit) / (Float_t) NT0;
4518  if ((TMath::Abs(TofHit->GetX()) < 55.
4519  && TMath::Abs(TofHit->GetY()) < 55.)) { // region E
4520  NT0F++;
4521  t0mf_hit = ((Float_t)(NT0F - 1) * t0mf_hit + t0_hit) / (Float_t) NT0F;
4522  } else {
4523  NT0NF++;
4524  t0mnf_hit =
4525  ((Float_t)(NT0NF - 1) * t0mnf_hit + t0_hit) / (Float_t) NT0NF;
4526  }
4527  }
4528 
4529  if (MCTrack->GetMotherId() != -1) continue; // primary particles only
4530  if (TrackP[k] > 1)
4531  continue; // for efficiency consider only first hit of track
4532  fa_tm_hitprim->Fill(p_MC, tofmass);
4533  fa_tof_hitprim->Fill(t_hit);
4534 
4535  Float_t Phip = RADDEG * atan2(MCTrack->GetPy(), MCTrack->GetPx());
4536  Float_t dphi = Phip - RADDEG * fMCEventHeader->GetRotZ();
4537  if (dphi < -180.) { dphi += 360.; };
4538  if (dphi > 180.) { dphi -= 360.; };
4539  dphi = dphi / RADDEG;
4540 
4541  rp_weight = 0.;
4542 
4543  switch (pdgCode) {
4544  case 211: {
4545  fa_ptm_rap_hit_pip->Fill(MCTrack->GetRapidity(),
4546  MCTrack->GetPt() / MCTrack->GetMass());
4547  fa_v1_rap_hit_pip->Fill(
4548  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4549  fa_v2_rap_hit_pip->Fill((MCTrack->GetRapidity() - GetMidY())
4550  / GetMidY(),
4551  TMath::Cos(2 * dphi));
4552 
4553  if (use_pions_for_flow
4554  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
4555  > GetDY()
4556  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4557  if (MCTrack->GetRapidity()
4558  > yrp_mid) { // set weights for reaction plane
4559  rp_weight = -1.;
4560  } else {
4561  rp_weight = +1.;
4562  }
4563  } else {
4564  rp_weight = 0.;
4565  }
4566  break;
4567  };
4568  case -211: {
4569  fa_ptm_rap_hit_pim->Fill(MCTrack->GetRapidity(),
4570  MCTrack->GetPt() / MCTrack->GetMass());
4571  fa_v1_rap_hit_pim->Fill(
4572  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4573  fa_v2_rap_hit_pim->Fill((MCTrack->GetRapidity() - GetMidY())
4574  / GetMidY(),
4575  TMath::Cos(2 * dphi));
4576 
4577  if (use_pions_for_flow
4578  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
4579  > GetDY()
4580  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4581  if (MCTrack->GetRapidity()
4582  > yrp_mid) { // set weights for reaction plane
4583  rp_weight = -1.;
4584  } else {
4585  rp_weight = +1.;
4586  }
4587  } else {
4588  rp_weight = 0.;
4589  }
4590  break;
4591  };
4592  case 321: {
4593  fa_ptm_rap_hit_kp->Fill(MCTrack->GetRapidity(),
4594  MCTrack->GetPt() / MCTrack->GetMass());
4595  fa_v1_rap_hit_kp->Fill(
4596  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4597  fa_v2_rap_hit_kp->Fill((MCTrack->GetRapidity() - GetMidY())
4598  / GetMidY(),
4599  TMath::Cos(2 * dphi));
4600  break;
4601  };
4602  case -321: {
4603  fa_ptm_rap_hit_km->Fill(MCTrack->GetRapidity(),
4604  MCTrack->GetPt() / MCTrack->GetMass());
4605  fa_v1_rap_hit_km->Fill(
4606  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4607  fa_v2_rap_hit_km->Fill((MCTrack->GetRapidity() - GetMidY())
4608  / GetMidY(),
4609  TMath::Cos(2 * dphi));
4610  break;
4611  };
4612  case 2212: {
4613  fa_ptm_rap_hit_p->Fill(MCTrack->GetRapidity(),
4614  MCTrack->GetPt() / MCTrack->GetMass());
4615  fa_v1_rap_hit_p->Fill(
4616  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4617  fa_v2_rap_hit_p->Fill((MCTrack->GetRapidity() - GetMidY())
4618  / GetMidY(),
4619  TMath::Cos(2 * dphi));
4620  // reaction plane determination
4621  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4622  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4623  if (MCTrack->GetRapidity()
4624  > yrp_mid) { // set weights for reaction plane
4625  rp_weight = +1.;
4626  } else {
4627  rp_weight = -1.;
4628  }
4629  } else {
4630  rp_weight = 0.;
4631  }
4632  break;
4633  };
4634  case -2212: {
4635  fa_ptm_rap_hit_pbar->Fill(MCTrack->GetRapidity(),
4636  MCTrack->GetPt() / MCTrack->GetMass());
4637  fa_v1_rap_hit_pbar->Fill(
4638  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4639  fa_v2_rap_hit_pbar->Fill((MCTrack->GetRapidity() - GetMidY())
4640  / GetMidY(),
4641  TMath::Cos(2 * dphi));
4642  break;
4643  };
4644 
4645  case 1000010020: { // deuteron
4646  fa_ptm_rap_hit_d->Fill(MCTrack->GetRapidity(),
4647  MCTrack->GetPt() / MCTrack->GetMass());
4648  fa_v1_rap_hit_d->Fill(
4649  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4650  fa_v2_rap_hit_d->Fill((MCTrack->GetRapidity() - GetMidY())
4651  / GetMidY(),
4652  TMath::Cos(2 * dphi));
4653  // reaction plane determination
4654  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4655  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4656  if (MCTrack->GetRapidity()
4657  > yrp_mid) { // set weights for reaction plane
4658  rp_weight = 1.;
4659  } else {
4660  rp_weight = -1.;
4661  }
4662  }
4663  break;
4664  };
4665 
4666  case 1000010030: { // triton
4667  fa_ptm_rap_hit_t->Fill(MCTrack->GetRapidity(),
4668  MCTrack->GetPt() / MCTrack->GetMass());
4669  fa_v1_rap_hit_t->Fill(
4670  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4671  fa_v2_rap_hit_t->Fill((MCTrack->GetRapidity() - GetMidY())
4672  / GetMidY(),
4673  TMath::Cos(2 * dphi));
4674  // reaction plane determination
4675  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4676  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4677  if (MCTrack->GetRapidity()
4678  > yrp_mid) { // set weights for reaction plane
4679  rp_weight = 1.;
4680  } else {
4681  rp_weight = -1.;
4682  }
4683  }
4684  break;
4685  };
4686 
4687  case 1000020030: { // 3he
4688  fa_ptm_rap_hit_h->Fill(MCTrack->GetRapidity(),
4689  MCTrack->GetPt() / MCTrack->GetMass());
4690  fa_v1_rap_hit_h->Fill(
4691  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4692  fa_v2_rap_hit_h->Fill((MCTrack->GetRapidity() - GetMidY())
4693  / GetMidY(),
4694  TMath::Cos(2 * dphi));
4695  // reaction plane determination
4696  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4697  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4698  if (MCTrack->GetRapidity()
4699  > yrp_mid) { // set weights for reaction plane
4700  rp_weight = 1.;
4701  } else {
4702  rp_weight = -1.;
4703  }
4704  }
4705  break;
4706  };
4707  case 1000020040: { // alpha
4708  fa_ptm_rap_hit_a->Fill(MCTrack->GetRapidity(),
4709  MCTrack->GetPt() / MCTrack->GetMass());
4710  fa_v1_rap_hit_a->Fill(
4711  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4712  fa_v2_rap_hit_a->Fill((MCTrack->GetRapidity() - GetMidY())
4713  / GetMidY(),
4714  TMath::Cos(2 * dphi));
4715  // reaction plane determination
4716  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4717  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4718  if (MCTrack->GetRapidity()
4719  > yrp_mid) { // set weights for reaction plane
4720  rp_weight = 1.;
4721  } else {
4722  rp_weight = -1.;
4723  }
4724  }
4725  break;
4726  };
4727 
4728  default: { // intermediate mass fragments
4729  //cout << " Track k="<<k<<", pdgCode = "<<pdgCode<<
4730  //" Mass " << MCTrack->GetMass()<<","<<MCTrack->GetMass()<<" Y " << MCTrack->GetRapidity() <<
4731  //" Pt " << MCTrack->GetPt() <<endl;
4732  fa_ptm_rap_hit_imf->Fill(MCTrack->GetRapidity(),
4733  MCTrack->GetPt() / MCTrack->GetMass());
4734  fa_v1_rap_hit_imf->Fill(
4735  (MCTrack->GetRapidity() - GetMidY()) / GetMidY(), TMath::Cos(dphi));
4736  fa_v2_rap_hit_imf->Fill((MCTrack->GetRapidity() - GetMidY())
4737  / GetMidY(),
4738  TMath::Cos(2 * dphi));
4739  // reaction plane determination (optimistic)
4740  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid) > GetDY()
4741  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
4742  if (MCTrack->GetRapidity()
4743  > yrp_mid) { // set weights for reaction plane
4744  rp_weight = 1.;
4745  } else {
4746  rp_weight = -1.;
4747  }
4748  }
4749  break;
4750  };
4751  }
4752 
4753  if (rp_weight != 0.) {
4754  if (gRandom->Uniform(1)
4755  > 0.5) { //subdivide events into 2 random subevents
4756  Np1++;
4757  Qx1 = Qx1 + rp_weight * MCTrack->GetPx();
4758  Qy1 = Qy1 + rp_weight * MCTrack->GetPy();
4759  } else {
4760  Np2++;
4761  Qx2 = Qx2 + rp_weight * MCTrack->GetPx();
4762  Qy2 = Qy2 + rp_weight * MCTrack->GetPy();
4763  }
4764  }
4765  } else {
4766  if (0) {
4767  cout
4768  << "<W> CHA: >=2. hit from track k =" << k << " Hit# "
4769  << j
4770  // << " Str(Cell) "<< TofHit->GetCell() << "," << TofPoint->GetCell()
4771  // << " Module " << TofHit->GetModule() << "," << TofPoint->GetModule()
4772  // << " SM " << TofHit->GetSModule() << "," << TofPoint->GetSModule()
4773  // << " SMType " << TofHit->GetSMtype() << "," << TofPoint->GetSMtype()
4774  << endl;
4775  }
4776  }
4777  }
4778  if (Np1 > 0 && Np2 > 0) {
4779  phirp1 = atan2(Qy1, Qx1);
4780  phirp2 = atan2(Qy2, Qx2);
4781  if (fflowFile != NULL) { // subevent RP flattening
4782  TH1F* phirp_hit_fpar = (TH1F*) fflowFile->Get("phirps_hit_fpar");
4783  Float_t dphir = 0.;
4784  for (int j = 0; j < 4; j++) {
4785  Float_t i = (float) (j + 1);
4786  dphir +=
4787  (-phirp_hit_fpar->GetBinContent(j) * TMath::Cos(i * phirp1)
4788  + phirp_hit_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp1))
4789  / i;
4790  }
4791  phirp1 += dphir;
4792 
4793  dphir = 0.;
4794  for (int j = 0; j < 4; j++) {
4795  Float_t i = (float) (j + 1);
4796  dphir +=
4797  (-phirp_hit_fpar->GetBinContent(j) * TMath::Cos(i * phirp2)
4798  + phirp_hit_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp2))
4799  / i;
4800  }
4801  phirp2 += dphir;
4802  } // subevent RP flattening end
4803  fa_phirps_hit->Fill(phirp1 * RADDEG); // 1D histo
4804  fa_phirps_hit->Fill(phirp2 * RADDEG); // 1D histo
4805  delrp = (phirp1 - phirp2);
4806  if (NULL != fMCEventHeader) {
4807  if (0) { //nh-debug
4808  cout << "<D-hit> Impact parameter " << fMCEventHeader->GetB()
4809  << ", delrp = " << delrp << endl;
4810  }
4811  fa_cdrp_b_hit->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp));
4812  delrp = delrp * RADDEG;
4813  if (delrp < -180.) delrp += 360.;
4814  if (delrp > 180.) delrp -= 360.;
4815  fa_drp_b_hit->Fill(fMCEventHeader->GetB(), delrp);
4816  }
4817  }
4818  phirp = RADDEG * atan2(Qy1 + Qy2, Qx1 + Qx2); // full reaction plane
4819  while (phirp < -180.) {
4820  phirp += 360.;
4821  }
4822  while (phirp > 180.) {
4823  phirp -= 360.;
4824  }
4825  if (fflowFile != NULL) { // RP flattening
4826  TH1F* phirp_hit_fpar = (TH1F*) fflowFile->Get("phirp_hit_fpar");
4827  Float_t dphir = 0.;
4828  for (int j = 0; j < 4; j++) {
4829  Float_t i = (float) (j + 1);
4830  //cout << " RP flat par "<< i << ","<<j<< " par " << phirp_gen_fpar->GetBinContent(j)
4831  // << ","<< phirp_gen_fpar->GetBinContent(j+4) << " phirp "<<phirp<<" dphir "<< dphir << endl;
4832  dphir +=
4833  ((-phirp_hit_fpar->GetBinContent(j) * TMath::Cos(i * phirp / RADDEG)
4834  + phirp_hit_fpar->GetBinContent(j + 4)
4835  * TMath::Sin(i * phirp / RADDEG))
4836  / i);
4837  }
4838  //cout << " phirp " << phirp << " dphir " << dphir*RADDEG << endl;
4839 
4840  phirp += dphir * RADDEG;
4841  while (phirp < -180.) {
4842  phirp += 360.;
4843  }
4844  while (phirp > 180.) {
4845  phirp -= 360.;
4846  }
4847  } // RP flattening end
4848  if (NULL != fMCEventHeader) {
4849  delrp = phirp - RADDEG * fMCEventHeader->GetRotZ();
4850  while (delrp < -180.) {
4851  delrp += 360.;
4852  }
4853  while (delrp > 180.) {
4854  delrp -= 360.;
4855  }
4856  fa_phirp_hit->Fill(phirp); // 1D histo
4857  fa_delrp_b_hit->Fill(fMCEventHeader->GetB(), delrp);
4858  fa_cdelrp_b_hit->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp / RADDEG));
4859 
4860  fa_tn_hit->Fill(T0MIN);
4861  fa_t0mn_hit->Fill((Float_t) NT0);
4862  fa_t0mn_b_hit->Fill(fMCEventHeader->GetB(), (Float_t) NT0);
4863  if (NT0 > 0) {
4864  fa_t0m_hit->Fill(t0m_hit);
4865  fa_t0m_b_hit->Fill(fMCEventHeader->GetB(), t0m_hit);
4866  }
4867 
4868  fa_t0mn_f_hit->Fill((Float_t) NT0F);
4869  fa_t0mn_f_b_hit->Fill(fMCEventHeader->GetB(), (Float_t) NT0F);
4870  if (NT0F > 0) {
4871  fa_t0m_f_hit->Fill(t0mf_hit);
4872  fa_t0m_f_b_hit->Fill(fMCEventHeader->GetB(), t0mf_hit);
4873  }
4874  fa_t0mn_nf_hit->Fill((Float_t) NT0NF);
4875  fa_t0mn_nf_b_hit->Fill(fMCEventHeader->GetB(), (Float_t) NT0NF);
4876  if (NT0NF > 0) {
4877  fa_t0m_nf_hit->Fill(t0mnf_hit);
4878  fa_t0m_nf_b_hit->Fill(fMCEventHeader->GetB(), t0mnf_hit);
4879  }
4880  }
4881  // cout << "<I> CbmHadronAnalysis: Number of T0 particles: NTO = " << NT0 << endl;
4883  // GlobalTrack level analysis
4884 
4885  const Double_t DISTMAX = 100.;
4886  Double_t WMAX = 10.; //0.02;
4887  if (fWMax != 0.) WMAX = fWMax;
4888 
4889  Int_t NGTofTrack = 0;
4890  Qx1 = 0.;
4891  Qy1 = 0.;
4892  Np1 = 0;
4893  Qx2 = 0.;
4894  Qy2 = 0.;
4895  Np2 = 0;
4896  if (NULL != fMCEventHeader)
4897  fa_mul_b_glo->Fill(fMCEventHeader->GetB(), nGlobTracks);
4898 
4899  Int_t NReas = 0; //100; // activate reassignment of hits to global tracks
4900  Int_t NRIt = 0;
4901  while (NReas > 0) {
4902  NRIt++;
4903  if (verbose > 5) { // nh-debug readability
4904  cout << endl;
4905  cout << Form(" TofTrack selection: %d. iteration, reassigned hits: %d, "
4906  "GlobTracks %d, TofTracks %d",
4907  NRIt,
4908  NReas,
4909  nGlobTracks,
4910  nTofTracks)
4911  << endl;
4912  }
4913  NReas = 0;
4914  for (Int_t i = 0; i < nGlobTracks; i++) { // inspect global tracks
4915  GlobTrack = (CbmGlobalTrack*) fGlobalTracks->At(i);
4916  if (NRIt == 1)
4917  NTHMUL[i] = 0; // number of TofTracks assigned to GlobTrack
4918  Int_t Btt = -1; // best TofTrack index
4919  Int_t Bthi = -1; // best TofHit index
4920 
4921  Int_t s = GlobTrack->GetStsTrackIndex();
4922  Int_t j = GlobTrack->GetTofHitIndex();
4923 
4924  if (verbose > 10) { // nh-debug
4925  cout << "<Di> NRIt " << NRIt << ": Global Track " << i << ", TofHit "
4926  << j << " StsTrk " << s << endl;
4927  }
4928 
4929  const FairTrackParam* tparf = GlobTrack->GetParamFirst();
4930  if (0 == tparf->GetQp()) {
4931  if (verbose > 10) { // nh-debug
4932  cout << "<W> Global Track " << i << " without Qp!, take from Sts "
4933  << s << endl;
4934  }
4935  StsTrack = (CbmStsTrack*) fStsTracks->At(s);
4936  if (NULL == StsTrack) {
4937  cout << "<E> Invalid StsTrack pointer at location " << s << endl;
4938  continue;
4939  }
4940  GlobTrack->SetParamFirst(StsTrack->GetParamFirst());
4941  }
4942  tparf = GlobTrack->GetParamFirst();
4943  if (0 == tparf->GetQp()) {
4944  cout << "<E> Global Track " << i << " without Qp! " << endl;
4945  continue;
4946  }
4947 
4948  if (211 != StsTrack->GetPidHypo()) {
4949  cout << "<E> Invalid StsTrack PID " << StsTrack->GetPidHypo() << " at "
4950  << s << endl;
4951  continue;
4952  }
4953 
4954  FairTrackParam paramExtr;
4955  fTrackFitter.FitToVertex(StsTrack, fPrimVertex, &paramExtr);
4956  // GlobTrack -> SetParamFirst(&paramExtr); // nh: attach track parameter to global track
4957  // cout <<Form("<D> Extrapolate StsTrack %d with PidHypo %6.0f to vertex (%5.2f,%5.2f,%5.2f)",
4958  // s,StsTrack->GetPidHypo(),fPrimVertex->GetX(),fPrimVertex->GetY(),fPrimVertex->GetZ()) <<endl;
4959  Double_t vtxb = fTrackFitter.GetChiToVertex(
4960  StsTrack, fPrimVertex); //impact paramter ???
4961  if (verbose > 10) { // nh-debug
4962  cout << Form(
4963  "<D> Extrapolate Glob Track %d to prim. vertex %6.2f with chi2 %6.2f",
4964  i,
4965  fPrimVertex->GetZ(),
4966  vtxb)
4967  << endl;
4968  //GlobTrack->GetParamFirst()->Print();
4969  }
4970 
4971 
4972  Float_t momf = 1. / tparf->GetQp();
4973  if (momf < 0.) momf = -momf; // positive momentum at vertex
4974 
4975  Float_t dist = 0.;
4976 
4977  if (j > -1) { // TOF Track analysis
4978 
4979  if (NRIt == 1) {
4980  Float_t DISTMIN = WMAX;
4981  Int_t nth = -1; // number of TofHits for global track i
4982  Weight_THMUL[i][0] = WMAX; // initialize limit
4983  for (Int_t tt = 0; tt < nTofTracks;
4984  tt++) { // loop over all TofTracks
4985  TofTrack = (CbmTofTrack*) fTofTracks->At(tt);
4986  if (
4987  i
4988  == TofTrack
4989  ->GetTrackIndex()) { // select TofTrack belonging to global track i
4990  if (verbose > 10) { // nh-debug
4991  cout << "<Dt> Global Track " << i << ", TofHit " << j
4992  << ", StsTrk " << s << ", TofTrack " << tt << endl;
4993  }
4994 
4995  Int_t thi = TofTrack->GetTofHitIndex();
4996  TofHit = (CbmTofHit*) fTofHits->At(thi);
4997  if (NULL == TofHit) continue;
4998 
4999  dist = TofTrack->GetDistance();
5000 
5001  if (isinf(dist)) {
5002  cout << "<E> invalid dist for gt " << i << ", tt " << tt
5003  << ", d:" << dist << endl;
5004  break;
5005  }
5006  /*
5007  fhTofTrkDx->Fill(TofTrack->GetTrackDx());
5008  fhTofTrkDy->Fill(TofTrack->GetTrackDy());
5009  */
5010 
5011  //dist=TMath::Abs(TMath::Abs(dist)-0.5);
5012 
5013  const FairTrackParam* tpar = TofTrack->GetTrackParameter();
5014  //cout << " Inspect TrackParameter "; tpar->Print();
5015  Float_t moml = 1. / tpar->GetQp();
5016  if (moml < 0.) moml = -moml;
5017  Float_t bet = TofHit->GetR() / TofHit->GetTime() / clight;
5018  //nh-inconsistent (?), TrackLength needs to be determined experimentally
5019  if (bet > 0.99999) { bet = 0.99999; }
5020  Float_t tofmass = momf / bet * sqrt(1. - bet * bet)
5021  * TMath::Sign(1., tpar->GetQp());
5022  TofTrack->SetMass(tofmass); // store tofmass as part of PID info
5023  if (TofTrack->GetMass() != tofmass) {
5024  cout << "<E> did not store tofmass properly " << tofmass
5025  << endl;
5026  }
5027  // calculate attachment weight, to be refined ... (nh, 03.01.2014)
5028  Float_t mindelmass = 1.E6;
5029  Float_t minlen;
5030  Int_t
5031  immin; // minlen = (TofTrack->GetTrackLength()-MinWallDist)/MinWallDist;
5032  minlen = (TofHit->GetR() - MinWallDist) / MinWallDist;
5033  mindelmass = 1.E6;
5034  immin = 0;
5035  for (Int_t im = 0; im < NMASS; im++) {
5036  Float_t delmass =
5037  TMath::Abs(TMath::Abs(TofTrack->GetMass()) - refMass[im]);
5038  if (delmass < mindelmass) {
5039  mindelmass = delmass;
5040  immin = im;
5041  }
5042  }
5043  mindelmass /= refMass[immin];
5044  Float_t delp = TMath::Abs((momf - moml) / momf);
5045  // Float_t w = dist * mindelmass * minlen * delp * 10000.;
5046  Float_t w = dist;
5047  //Float_t w = minlen;
5048  //Float_t w = mindelmass ;
5049  //Float_t w = delp;
5050  //Float_t w = TMath::Sqrt((dist*dist + delp*delp)/2.);
5051  //Float_t w = TMath::Sqrt((dist*dist + mindelmass*mindelmass)/2.);
5052  //Float_t w = TMath::Sqrt((dist*dist + delp*delp + mindelmass*mindelmass + minlen*minlen)/4.);
5053  //Float_t w = dist * mindelmass * minlen ;
5054  //Float_t w = dist * mindelmass * 15.;
5055  //Float_t w = dist * mindelmass *delp;
5056  //Float_t w = dist * delp;
5057 
5058  fhwdist->Fill(momf, dist);
5059  fhwmindelmass->Fill(momf, mindelmass);
5060  fhwminlen->Fill(momf, minlen);
5061  fhwdelp->Fill(momf, delp);
5062  if (verbose > 5) {
5063  cout << Form("<D> w for gt %3d, tt %3d, w: %9.5f, d: %7.2f, m: "
5064  "%7.3f, l: %7.2f, dp: %7.3f, p: %7.2f ",
5065  i,
5066  tt,
5067  w,
5068  dist,
5069  mindelmass,
5070  minlen,
5071  delp,
5072  momf)
5073  << endl;
5074  }
5075  if (w < WMAX) {
5076  nth++;
5077  if (nth == MAXNHT) {
5078  if (verbose > 1) {
5079  cout << "<W> Too many TofTrack candidates for track " << i
5080  << ", limit to " << nth << endl;
5081  }
5082  nth = MAXNHT - 1;
5083  }
5084  // sort TofTracks according to weight into array IndTHMUL
5085  Int_t jthmin = nth;
5086  for (Int_t jth = 0; jth < nth;
5087  jth++) { //determine position in array
5088  if (verbose > 10) {
5089  cout << " Compare for position " << jth << " w " << w
5090  << " - " << Weight_THMUL[i][jth] << endl;
5091  }
5092  if (w < Weight_THMUL[i][jth]) {
5093  jthmin = jth;
5094  break;
5095  }
5096  }
5097  if (verbose > 10) {
5098  cout << " Put Track " << tt << " with w = " << w
5099  << " to position " << jthmin << " of " << nth << endl;
5100  }
5101  for (Int_t jth = nth; jth > jthmin;
5102  jth--) { // save old entries
5103  if (verbose > 10) {
5104  cout << " Save Track " << IndTHMUL[i][jth - 1] << " with w "
5105  << Weight_THMUL[i][jth - 1] << " to position " << jth
5106  << endl;
5107  }
5108  IndTHMUL[i][jth] = IndTHMUL[i][jth - 1];
5109  Weight_THMUL[i][jth] = Weight_THMUL[i][jth - 1];
5110  }
5111  IndTHMUL[i][jthmin] = tt; // store index of TofTrack
5112  Weight_THMUL[i][jthmin] = w; // store weight of TofTrack
5113 
5114  if (w < DISTMIN) {
5115  DISTMIN = w;
5116  BestTofTrack = TofTrack;
5117  Bthi = thi; // best TofHit index
5118  Btt = tt; // best TofTrack index
5119  if (verbose > 5) {
5120  cout << Form(
5121  "<DMin> gt %d, hit %d, tt %d, w: %6.2f", i, Bthi, Btt, w)
5122  << endl;
5123  }
5124  }
5125  } //w < WMAX end
5126  if (verbose > 10) {
5127  cout << Form("<D> tt-loop: gt %d, tt %d, w: %6.2f", i, tt, w)
5128  << endl;
5129  }
5130  } // (i==TofTrack->GetTrackIndex())
5131  } // inspection of all TofTracks finished
5132  NTHMUL[i] = nth + 1; // number of TofHit candidates
5133  fa_TofTrackMul->Fill(NTHMUL[i]);
5134 
5135  // report summary:
5136  if (verbose > 5) {
5137  for (Int_t k = 0; k < NTHMUL[i]; k++) {
5138  if (verbose > 3) {
5139  cout << Form("<Ddeb> i %d, k %d, M %d, Ind %d ",
5140  i,
5141  k,
5142  NTHMUL[i],
5143  IndTHMUL[i][k])
5144  << endl;
5145  }
5146 
5147  TofTrack = (CbmTofTrack*) fTofTracks->At(IndTHMUL[i][k]);
5148  cout << "<DSum> GlobTrack " << i << ", TMul: " << NTHMUL[i]
5149  << ", TofTrack " << IndTHMUL[i][k] << ", TofHit "
5150  << TofTrack->GetTofHitIndex() << ", TMul_hit "
5151  << NTofHitTMul[TofTrack->GetTofHitIndex()] << ", dist "
5152  << TofTrack->GetDistance() << ", len "
5153  << TofTrack->GetTrackLength() << ", R "
5154  << ((CbmTofHit*) fTofHits->At(j))->GetR() << ", mass "
5155  << TofTrack->GetMass() << ", mom " << momf << ", w "
5156  << Weight_THMUL[i][k] << endl;
5157  }
5158  }
5159  } else { // NRIt>1; initialize from array
5160  if (NTHMUL[i] > 0) {
5161  Btt = IndTHMUL[i][0];
5162  if (Btt < 0 || Btt > fTofTracks->GetEntries()) {
5163  cout << "<E> invalid TofTrackIndex " << Btt << ", gt " << i
5164  << ", NRIt " << NRIt << endl;
5165  Btt = -1;
5166  continue;
5167  }
5168 
5169  BestTofTrack = (CbmTofTrack*) fTofTracks->At(Btt);
5170  Bthi = BestTofTrack->GetTofHitIndex();
5171  if (verbose > 5) {
5172  cout << "<DBest> GloBTrack " << i << ", TMul: " << NTHMUL[i]
5173  << ", TofTrack " << IndTHMUL[i][0] << ", TofHit "
5174  << BestTofTrack->GetTofHitIndex() << ", TMul_hit "
5175  << NTofHitTMul[BestTofTrack->GetTofHitIndex()] << ", dist "
5176  << BestTofTrack->GetDistance() << ", len "
5177  << BestTofTrack->GetTrackLength() << ", mass "
5178  << BestTofTrack->GetMass() << ", w " << Weight_THMUL[i][0]
5179  << endl;
5180  }
5181  }
5182  }
5183  } //(j > -1) end
5184 
5185  // now do global distribution of TofHits to GlobalTracks
5186  // attach BestTofTrack candidate to GlobalTrack
5187  if (verbose > 10) {
5188  cout << Form("<Ddis> NRIt %d, gt %d, BestTofTrack j=%d, best 0x%p, %d, "
5189  "%d, w: %7.2f ",
5190  NRIt,
5191  i,
5192  j,
5193  BestTofTrack,
5194  Btt,
5195  Bthi,
5196  Weight_THMUL[i][0])
5197  << endl;
5198  }
5199 
5200  if (NRIt == 1) GlobTrack->SetLength(0.);
5201  if (Btt > -1)
5202  while (j > -1
5203  && GlobTrack->GetLength() != BestTofTrack->GetTrackLength()) {
5204  if (verbose > 10) {
5205  cout << Form("<Ddeb> BestTofTrack j=%d, best 0x%p, %d",
5206  j,
5207  BestTofTrack,
5208  BestTofTrack->GetTofHitIndex())
5209  << endl;
5210  }
5211  dist = BestTofTrack->GetDistance();
5212  if (isinf(dist)) {
5213  cout << "<E2> invalid dist for gt " << i << ", Btt " << Btt
5214  << ", d:" << dist << endl;
5215  break;
5216  }
5217  if (dist < DISTMAX && Weight_THMUL[i][0] < WMAX) {
5218  Int_t jh = NTofHitTMul[Bthi]++;
5219  Int_t nht = NTofHitTMul[Bthi];
5220  if (nht == MAXNHT) {
5221  if (verbose > -1) {
5222  cout << "<E> Too many TofTrack candidates for hit " << Bthi
5223  << ", break!" << endl;
5224  }
5225  break;
5226  }
5227  IndTofTrack_TofHit[Bthi][jh] =
5228  Btt; // index of TofTrack assigned to specific TofHit
5229  if (verbose > 3) {
5230  cout << "<Ias> GlobTrack " << i << " -> TofTrack " << Btt
5231  << ", TofHitIndex " << Bthi << ", TMul_hit " << nht << endl;
5232  }
5233 
5234  Int_t io = -1;
5235  if (NTofHitTMul[BestTofTrack->GetTofHitIndex()] > 1) {
5236  CbmTofTrack* TofTracko = (CbmTofTrack*) fTofTracks->At(
5237  IndTofTrack_TofHit[BestTofTrack->GetTofHitIndex()][0]);
5238  io = TofTracko->GetTrackIndex(); // Global Track index
5239  if (verbose > 2) { // nh-debug
5240  cout << "<D> GlobTrack " << i << ": update TofHitIndex from "
5241  << j << " (Mul " << NTofHitTMul[j] << ") "
5242  << " to " << BestTofTrack->GetTofHitIndex() << " (Mul "
5243  << NTofHitTMul[BestTofTrack->GetTofHitIndex()] << ")"
5244  << ", m " << BestTofTrack->GetMass() << ", w "
5245  << Weight_THMUL[i][0] << ", cur: tt "
5246  << IndTofTrack_TofHit[Bthi][0] << ", gt " << io << ", w "
5247  << Weight_THMUL[io][0] << " ? " << endl;
5248  }
5249 
5250  // decide now!
5251  if (Weight_THMUL[i][0] < Weight_THMUL
5252  [io][0]) { // new assignment better than old one -> change
5253  if (verbose > 1) { //nh-debug
5254  cout << "<D> New cand. is better, invalidate entry for gt "
5255  << io << endl;
5256  }
5257  NReas++;
5258  NTofHitTMul[Bthi]--; // deregister old toftrack
5259  IndTofTrack_TofHit[Bthi][0] = Btt; // update
5260  CbmGlobalTrack* GlobTrack2 =
5261  (CbmGlobalTrack*) fGlobalTracks->At(io);
5262  GlobTrack2->SetLength(0.); // signal entry invalid
5263  } else { // old assignment better than current candidate
5264  if (verbose > 0) { //nh-debug
5265  cout << Form(
5266  "<D> Stick to old assignment, Bthi %d, TM %d, THM %d",
5267  Bthi,
5268  NTofHitTMul[Bthi],
5269  NTHMUL[i])
5270  << endl;
5271  }
5272  NTofHitTMul[Bthi]--; // deregister toftrack
5273  if (NTHMUL[i] > 1) { // take next one from list
5274  NTHMUL[i]--;
5275  for (Int_t jth = 0; jth < NTHMUL[i];
5276  jth++) { // shift old entries
5277  IndTHMUL[i][jth] = IndTHMUL[i][jth + 1];
5278  Weight_THMUL[i][jth] = Weight_THMUL[i][jth + 1];
5279  }
5280  Btt = IndTHMUL[i][0]; // next best TofTrack index
5281  BestTofTrack = (CbmTofTrack*) fTofTracks->At(Btt);
5282  Bthi =
5283  BestTofTrack->GetTofHitIndex(); // next best TofHit index
5284  } else { // no other candidate available
5285  if (verbose > 0) { //nh-debug
5286  cout << "<I> no TofTrack candidate for Global Track " << i
5287  << endl;
5288  }
5289  // BestTofTrack->Delete();
5290  Bthi = -1;
5291  Btt = -1;
5292  GlobTrack->SetTofHitIndex(-1);
5293  j = -1;
5294  continue;
5295  }
5296  if (verbose > 0) { //nh-debug
5297  cout << "<D> Old choice better, current options: NTHMUL "
5298  << NTHMUL[i] << ", take btt = " << IndTHMUL[i][0]
5299  << ", bthi " << Bthi << endl;
5300  }
5301  }
5302 
5303  if (NTofHitTMul[BestTofTrack->GetTofHitIndex()] > 1) {
5304  if (verbose > -1) {
5305  cout << "<E> GlobTrack " << i
5306  << ": double assignment of hit, check all possibilities "
5307  "... "
5308  << endl;
5309  continue;
5310  }
5311  }
5312  j = BestTofTrack->GetTofHitIndex();
5313  GlobTrack->SetTofHitIndex(j); // update Global Track info
5314  }
5315  GlobTrack->SetParamLast(BestTofTrack->GetTrackParameter());
5316  GlobTrack->SetLength(BestTofTrack->GetTrackLength());
5317  } else {
5318  if (verbose > 3) {
5319  cout << "<D> GlobTrack " << i << ", dist = " << dist
5320  << ", w = " << Weight_THMUL[i][0] << " -> remove TofTrack"
5321  << endl;
5322  }
5323  GlobTrack->SetTofHitIndex(-1);
5324  j = -1;
5325  }
5326  } // GetTrackLength matching while end
5327  else {
5328  if (verbose > 3) {
5329  cout << "<D> GlobTrack " << i << ", dist = " << dist
5330  << ", w = " << Weight_THMUL[i][0] << " -> no TofTrack" << endl;
5331  }
5332  GlobTrack->SetTofHitIndex(-1);
5333  j = -1;
5334  }
5335  if (verbose > 10) {
5336  cout << "<Dch> GlobTrack " << i << "(" << nGlobTracks << "), Btt "
5337  << Btt << endl;
5338  }
5339  } // endfor of GlobalTrack inspection and TofHit assignment
5340  if (verbose > 1) {
5341  cout << "<Q> Reassignment iteration for b= " << fMCEventHeader->GetB()
5342  << ": " << NReas << endl;
5343  }
5344  } //end of reassignment while
5345  // Analysis of GlobalTracks
5346  for (Int_t i = 0; i < nGlobTracks; i++) { // loop over global tracks
5347  GlobTrack = (CbmGlobalTrack*) fGlobalTracks->At(i);
5348  Int_t s = GlobTrack->GetStsTrackIndex();
5349  Int_t j = GlobTrack->GetTofHitIndex();
5350 
5351  if (j > -1 && Weight_THMUL[i][0] >= WMAX) {
5352  cout << "<E> TofHit assigned beyond w-limit, Track " << i
5353  << " w= " << Weight_THMUL[i][0] << endl;
5354  break; // less drastic response
5355  }
5356 
5357  if (verbose > 10) {
5358  cout << "<Da> gt " << i << ", th " << j << ", s " << s << endl;
5359  }
5360  const FairTrackParam* tparf = GlobTrack->GetParamFirst();
5361  if (0 == tparf->GetQp()) {
5362  if (verbose > 10)
5363  cout << "<W2> Global Track " << i << " without Qp!, take from Sts " << s
5364  << endl;
5365  StsTrack = (CbmStsTrack*) fStsTracks->At(s);
5366  GlobTrack->SetParamFirst(StsTrack->GetParamFirst());
5367  }
5368  tparf = GlobTrack->GetParamFirst();
5369  Float_t qpf = tparf->GetQp(); //
5370  if (qpf == 0.) {
5371  cout << "<E2> GlobTrack " << i << ", STS " << s << ", TofHit " << j
5372  << " without momentum " << endl;
5373  break;
5374  }
5375 
5376  // STS
5377  Double_t vtxb = 100.;
5378  Int_t smc = -1;
5379  Int_t StsMCt[100]; // array of MC track indices for current StsTrack
5380  Int_t NStsMCc[100] = {100 * 0}; // number of contributions
5381  Int_t NStsMCt = 0; // number of MC tracks contributing to this Ststrack
5382  if (s > -1) { // STS Track analysis, disable, bad referencing to StsHits
5383  StsTrack = (CbmStsTrack*) fStsTracks->At(s);
5384 
5385  FairTrackParam paramExtr;
5386  fTrackFitter.FitToVertex(StsTrack, fPrimVertex, &paramExtr);
5387  vtxb = fTrackFitter.GetChiToVertex(StsTrack,
5388  fPrimVertex); //impact paramter ???
5389  fa_VtxB->Fill(vtxb);
5390 
5391  Int_t NStsHits = StsTrack->GetNofStsHits();
5392  //if(NStsHits<8) continue; // nh-debugging
5393  for (Int_t ih = 0; ih < NStsHits; ih++) {
5394  Int_t iHind = StsTrack->GetHitIndex(ih);
5395  LOG(debug1) << " inspect STS track " << s << ", hit " << ih
5396  << ", hitindex " << iHind;
5397  if (NULL == fStsHits) LOG(fatal) << " No STS Hits available ";
5398  //CbmStsHit* hit = (CbmStsHit*) fStsHits->At(iHind); // still valid ? - ok?
5399  CbmStsHit* hit = dynamic_cast<CbmStsHit*>(fStsHits->At(iHind));
5400  if (NULL == hit) continue;
5401  LOG(debug1) << " valid hit " << ih << ", hitindex " << iHind
5402  << " cluster index f: " << hit->GetFrontClusterId()
5403  << ", b: " << hit->GetBackClusterId();
5404 
5405  CbmStsCluster* fclu =
5407  CbmStsCluster* bclu =
5409  LOG(debug1) << " Mul f: " << fclu->GetNofDigis() << " (";
5410  for (Int_t iDigi = 0; iDigi < fclu->GetNofDigis(); iDigi++) {
5411  LOG(debug1) << fclu->GetDigi(iDigi) << " ";
5412  //CbmStsDigi* stsdigi = (CbmStsDigi*) fStsDigis->At( fclu->GetDigi(iDigi) );
5413  CbmMatch* stsdigiMatch =
5414  (CbmMatch*) fStsDigiMatchColl->At(fclu->GetDigi(iDigi));
5415  LOG(debug1) << stsdigiMatch->GetNofLinks() << " ";
5416  for (Int_t iL = 0; iL < stsdigiMatch->GetNofLinks(); iL++) {
5417  const CbmLink& link = stsdigiMatch->GetLink(iL);
5418  CbmStsPoint* poi =
5419  (CbmStsPoint*) fStsPointsColl->At(link.GetIndex());
5420  if (NULL == poi) continue;
5421  Int_t MCInd = poi->GetTrackID();
5422  LOG(debug1) << " MCInd " << poi->GetTrackID() << " ";
5423  Int_t iMCt = 0;
5424  for (; iMCt < NStsMCt; iMCt++) {
5425  if (MCInd == StsMCt[iMCt]) {
5426  NStsMCc[iMCt]++;
5427  break;
5428  }
5429  }
5430  if (iMCt == NStsMCt) {
5431  LOG(debug) << "contribution by new MC track: " << MCInd;
5432  StsMCt[iMCt] = MCInd;
5433  NStsMCc[iMCt] = 1;
5434  NStsMCt++;
5435  }
5436  }
5437  }
5438 
5439  for (Int_t iDigi = 0; iDigi < bclu->GetNofDigis(); iDigi++) {
5440  LOG(debug1) << bclu->GetDigi(iDigi) << " ";
5441  //CbmStsDigi* stsdigi = (CbmStsDigi*) fStsDigis->At( bclu->GetDigi(iDigi) );
5442  CbmMatch* stsdigiMatch =
5443  (CbmMatch*) fStsDigiMatchColl->At(bclu->GetDigi(iDigi));
5444  LOG(debug1) << stsdigiMatch->GetNofLinks() << " ";
5445  for (Int_t iL = 0; iL < stsdigiMatch->GetNofLinks(); iL++) {
5446  const CbmLink& link = stsdigiMatch->GetLink(iL);
5447  CbmStsPoint* poi =
5448  (CbmStsPoint*) fStsPointsColl->At(link.GetIndex());
5449  Int_t MCInd = poi->GetTrackID();
5450  LOG(debug1) << " MCInd " << poi->GetTrackID() << " ";
5451  Int_t iMCt = 0;
5452  for (; iMCt < NStsMCt; iMCt++) {
5453  if (MCInd == StsMCt[iMCt]) {
5454  NStsMCc[iMCt]++;
5455  break;
5456  }
5457  }
5458  if (iMCt == NStsMCt) {
5459  LOG(debug) << "contribution by new back MC track: " << MCInd;
5460  StsMCt[iMCt] = MCInd;
5461  NStsMCc[iMCt] = 1;
5462  NStsMCt++;
5463  }
5464  }
5465  }
5466 
5467  LOG(debug1) << "), mul b: " << bclu->GetNofDigis();
5468  } // loop over STS hits finished
5469 
5470  std::stringstream ss;
5471  ss << "STS summary: NStsMCt =" << NStsMCt;
5472  for (Int_t iT = 0; iT < NStsMCt; iT++) {
5473  ss << " iT " << iT << " NMCc " << NStsMCc[iT] << " MCt " << StsMCt[iT];
5474  }
5475  LOG(debug) << ss.str();
5476 
5477  if (NStsMCt == 0) {
5478  smc = -1;
5479  LOG(debug) << "StsTrack " << s << " with " << NStsHits
5480  << " Hits without StsPoints ??? from Global Track " << i
5481  << ", TofHit " << j;
5482  } else { // find most probable MCtrack
5483  smc = -1;
5484  Int_t iMaxCount = 0;
5485  for (Int_t k = 0; k < NStsMCt; k++) {
5486  if (NStsMCc[k] > iMaxCount) {
5487  smc = StsMCt[k];
5488  iMaxCount = NStsMCc[k];
5489  // cout << "-D- STS Track "<<smc<<" with "<<NStsMCc[k]<<"("<< NStsMCt<<") matches "
5490  // <<" in "<<k<<". position"<<endl;
5491  // continue;
5492  }
5493  }
5494  }
5495  // analysis of STS tracks
5496  if (-1 < smc) {
5497  MCTrack = (CbmMCTrack*) fMCTracksColl->At(smc);
5498  pdgCode = MCTrack->GetPdgCode();
5499  px_MC = MCTrack->GetPx();
5500  py_MC = MCTrack->GetPy();
5501  pz_MC = MCTrack->GetPz();
5502  p_MC = sqrt(px_MC * px_MC + py_MC * py_MC + pz_MC * pz_MC);
5503  if (MCTrack->GetMotherId() == -1) { // select primaries
5504  // if (0 == MCTrack->GetMass()) continue;
5505  switch (pdgCode) {
5506  case 211: {
5507  fa_ptm_rap_sts_pip->Fill(MCTrack->GetRapidity(),
5508  MCTrack->GetPt() / MCTrack->GetMass());
5509  fa_plab_sts_pip->Fill(p_MC);
5510  break;
5511  };
5512  case -211: {
5513  fa_ptm_rap_sts_pim->Fill(MCTrack->GetRapidity(),
5514  MCTrack->GetPt() / MCTrack->GetMass());
5515  fa_plab_sts_pim->Fill(p_MC);
5516  break;
5517  };
5518  case 321: {
5519  fa_ptm_rap_sts_kp->Fill(MCTrack->GetRapidity(),
5520  MCTrack->GetPt() / MCTrack->GetMass());
5521  fa_plab_sts_kp->Fill(p_MC);
5522  break;
5523  };
5524  case -321: {
5525  fa_ptm_rap_sts_km->Fill(MCTrack->GetRapidity(),
5526  MCTrack->GetPt() / MCTrack->GetMass());
5527  fa_plab_sts_km->Fill(p_MC);
5528  break;
5529  };
5530  case 2212: {
5531  fa_ptm_rap_sts_p->Fill(MCTrack->GetRapidity(),
5532  MCTrack->GetPt() / MCTrack->GetMass());
5533  fa_plab_sts_p->Fill(p_MC);
5534  break;
5535  };
5536  case -2212: {
5537  fa_ptm_rap_sts_pbar->Fill(MCTrack->GetRapidity(),
5538  MCTrack->GetPt() / MCTrack->GetMass());
5539  fa_plab_sts_pbar->Fill(p_MC);
5540  break;
5541  };
5542  case 1000010020: { // deuteron
5543  fa_ptm_rap_sts_d->Fill(MCTrack->GetRapidity(),
5544  MCTrack->GetPt() / MCTrack->GetMass());
5545  break;
5546  };
5547  case 1000010030: { // triton
5548  fa_ptm_rap_sts_t->Fill(MCTrack->GetRapidity(),
5549  MCTrack->GetPt() / MCTrack->GetMass());
5550  break;
5551  };
5552  case 1000020030: { // 3he
5553  fa_ptm_rap_sts_h->Fill(MCTrack->GetRapidity(),
5554  MCTrack->GetPt() / MCTrack->GetMass());
5555  break;
5556  };
5557  case 1000020040: { // alpha
5558  fa_ptm_rap_sts_a->Fill(MCTrack->GetRapidity(),
5559  MCTrack->GetPt() / MCTrack->GetMass());
5560  break;
5561  };
5562  default: { // intermediate mass fragments
5563  //cout << " Track k="<<k<<", pdgCode = "<<pdgCode<<
5564  //" Mass " << MCTrack->GetMass()<<","<<MCTrack->GetMass()<<" Y " << MCTrack->GetRapidity() <<
5565  //" Pt " << MCTrack->GetPt() <<endl;
5566  fa_ptm_rap_sts_imf->Fill(MCTrack->GetRapidity(),
5567  MCTrack->GetPt() / MCTrack->GetMass());
5568  break;
5569  };
5570  }
5571  }
5572  }
5573  }
5574 
5575  if (j > -1) { // TofHit available for global track
5576  NGTofTrack++;
5577  TofHit = (CbmTofHit*) fTofHits->At(j);
5578  if (NULL == TofHit) continue;
5579  // Int_t l = TofHit->GetRefId();
5580  Int_t l = j; // One CbmMatch per Hit and in the same order!!!!
5581  Int_t k = -1;
5582 
5583  if (NULL == fTofDigiMatchColl) {
5584  LOG(fatal) << "No Digi Info available for TofHit !?? ";
5585  //TofPoint = (CbmTofPoint*) fTofPoints->At( TofHit->GetRefId() );
5586  //k = TofPoint->GetTrackID();
5587  } else {
5588  CbmMatch* digiMatch = (CbmMatch*) fTofDigiMatchColl->At(l);
5589  // take first digi's point link
5590  Int_t iDigiMul = digiMatch->GetNofLinks();
5591  Int_t iPoiMul = 0;
5592  Int_t iTrkMul = 0;
5593  Int_t iPoiArr[iDigiMul];
5594  Int_t iTrkArr[iDigiMul];
5595  iPoiArr[0] = -1;
5596  iTrkArr[0] = -1;
5597  for (Int_t iLink = 0; iLink < digiMatch->GetNofLinks();
5598  iLink++) { // loop over digis
5599  CbmLink L = digiMatch->GetLink(iLink);
5600  Int_t iDigInd = L.GetIndex();
5601  CbmMatch* poiMatch = (CbmMatch*) fTofDigiMatchPointsColl->At(iDigInd);
5602  CbmLink LP = poiMatch->GetMatchedLink();
5603  lp = LP.GetIndex();
5604  if (lp != iPoiArr[iPoiMul]) {
5605  // cout << Form("<D> HadronAnalysis: gt %d, Hit %d, Link %d, poi %d, lpoi %d, PoiMul %d",
5606  // i,j,iLink,lp, iPoiArr[iPoiMul], iPoiMul)<<endl;
5607  iPoiArr[iPoiMul] = lp;
5608  iPoiMul++;
5609  iPoiArr[iPoiMul] = lp;
5610  }
5611 
5612  TofPoint = (CbmTofPoint*) fTofPoints->At(lp);
5613  k = TofPoint->GetTrackID();
5614  if (k != iTrkArr[iTrkMul]) {
5615  iTrkArr[iTrkMul] = k;
5616  iTrkMul++;
5617  iTrkArr[iTrkMul] = k;
5618  }
5619  }
5620  /*
5621  if(iTrkMul>1 || iPoiMul>1) {
5622  // cout << Form("HadronAnalysis: McTrkMul %d for TofHit %d, PoiMul %d,",iTrkMul,j,iPoiMul)<<endl;
5623  continue; // for debugging response
5624  }
5625  */
5626  TofPoint = (CbmTofPoint*) fTofPoints->At(iPoiArr[0]);
5627  k = iTrkArr[0];
5628  }
5629 
5630  MCTrack = (CbmMCTrack*) fMCTracksColl->At(k);
5631  pdgCode = MCTrack->GetPdgCode();
5632  px_MC = MCTrack->GetPx();
5633  py_MC = MCTrack->GetPy();
5634  pz_MC = MCTrack->GetPz();
5635  p_MC = sqrt(px_MC * px_MC + py_MC * py_MC + pz_MC * pz_MC);
5636 
5637  Double_t len = GlobTrack->GetLength();
5638  const FairTrackParam* tpar = GlobTrack->GetParamFirst();
5639  // FairTrackParam *tpar = GlobTrack->GetParamLast();
5640  if (tpar->GetQp() == 0.) {
5641  cout << "Invalid momentum for global track " << i << " TofHit " << j
5642  << endl;
5643  break;
5644  }
5645  Double_t mom = 1. / tpar->GetQp();
5646  if (mom < 0.) mom = -mom;
5647  Float_t vel =
5648  TofHit->GetR() / TofHit->GetTime(); // GetR() instead of len
5649  Float_t bet = vel / clight;
5650  Double_t m2 = mom * mom * (1. / bet / bet - 1.);
5651 
5652  if (bet > 0.99999) { bet = 0.99999; }
5653  Float_t tofmass =
5654  mom / bet * sqrt(1. - bet * bet) * TMath::Sign(1., tpar->GetQp());
5655  // Double_t chi2=0.;//(Double_t)(GlobTrack->GetChi2())/(GlobTrack->GetNDF());
5656  //cout << "GlobTrack-Chi2 "<<GlobTrack->GetChi2()<<", "<<GlobTrack->GetNDF()<<", "<<chi2<<endl;
5657 
5658  if (k != smc) {
5659  // cout << " Ana GlobalTrack: MCTrack TOF - STS mismatch: "<< k <<" - "<<smc<<endl;
5660  fa_tm_glomis->Fill(mom, tofmass);
5661  fa_w_mom_glomis->Fill(mom, Weight_THMUL[i][0]);
5662  // continue; // for debugging
5663  }
5664  // if(TofHit->GetRt()<150.) continue; // nh-debugging
5665 
5666  fa_xy_glo1->Fill(TofHit->GetX(), TofHit->GetY());
5667  fa_pv_glo->Fill(vel, mom);
5668  fa_tm_glo->Fill(mom, tofmass);
5669  fa_m2mom_glo->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5670  fa_pMCmom_glo->Fill(mom, p_MC);
5671  fa_chi2_mom_glo->Fill(mom, vtxb);
5672  fa_w_mom_glo->Fill(mom, Weight_THMUL[i][0]);
5673  fa_len_mom_glo->Fill(mom, len);
5674  fa_LenDismom_glo->Fill(mom, len - TofHit->GetR());
5675 
5676  if (NULL != TofPoint) {
5677  fa_LenMcLenGlomom_glo->Fill(mom, len - TofPoint->GetLength());
5678  fa_LenMcDismom_glo->Fill(mom, TofPoint->GetLength() - TofHit->GetR());
5679  }
5680  /*
5681  fhTofTrkDxsel->Fill(TofTrack->GetTrackDx());
5682  fhTofTrkDysel->Fill(TofTrack->GetTrackDy());
5683  */
5684  if (vtxb < fVtxBMax) {
5685  fa_tm_glovtxb->Fill(mom, tofmass);
5686  fa_m2mom_glovtxb->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5687  }
5688 
5689  if (MCTrack->GetMotherId() == -1) { // select primaries
5690  fa_tm_gloprim->Fill(mom, tofmass);
5691  fa_m2mom_gloprim->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5692  fa_chi2_mom_gloprim->Fill(mom, vtxb);
5693 
5694  if (vtxb < fVtxBMax) {
5695  fa_tm_gloprimvtxb->Fill(mom, tofmass);
5696  fa_m2mom_gloprimvtxb->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5697  }
5698  Float_t Phip = RADDEG * atan2(MCTrack->GetPy(), MCTrack->GetPx());
5699  Float_t dphi = Phip - RADDEG * fMCEventHeader->GetRotZ();
5700  if (dphi < -180.) { dphi += 360.; };
5701  if (dphi > 180.) { dphi -= 360.; };
5702  dphi = dphi / RADDEG;
5703  rp_weight = 0.;
5704 
5705  switch (pdgCode) {
5706  case 211: {
5707  fa_ptm_rap_glo_pip->Fill(MCTrack->GetRapidity(),
5708  MCTrack->GetPt() / MCTrack->GetMass());
5709  fa_v1_rap_glo_pip->Fill((MCTrack->GetRapidity() - GetMidY())
5710  / GetMidY(),
5711  TMath::Cos(dphi));
5712  fa_v2_rap_glo_pip->Fill((MCTrack->GetRapidity() - GetMidY())
5713  / GetMidY(),
5714  TMath::Cos(2 * dphi));
5715  fa_xy_glo_pip->Fill(TofHit->GetX(), TofHit->GetY());
5716  fa_tm_glo_pip->Fill(mom, tofmass);
5717  fa_m2mom_glo_pip->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5718  fa_pMCmom_glo_pip->Fill(mom, p_MC);
5719  fa_w_mom_glo_pip->Fill(mom, Weight_THMUL[i][0]);
5720  fa_LenDismom_glo_pip->Fill(mom, len - TofHit->GetR());
5721 
5722  if (use_pions_for_flow
5723  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5724  > GetDY()
5725  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5726  if (MCTrack->GetRapidity()
5727  > yrp_mid) { // set weights for reaction plane
5728  rp_weight = -1.;
5729  } else {
5730  rp_weight = +1.;
5731  }
5732  } else {
5733  rp_weight = 0.;
5734  }
5735  break;
5736  };
5737  case -211: {
5738  fa_ptm_rap_glo_pim->Fill(MCTrack->GetRapidity(),
5739  MCTrack->GetPt() / MCTrack->GetMass());
5740  fa_v1_rap_glo_pim->Fill((MCTrack->GetRapidity() - GetMidY())
5741  / GetMidY(),
5742  TMath::Cos(dphi));
5743  fa_v2_rap_glo_pim->Fill((MCTrack->GetRapidity() - GetMidY())
5744  / GetMidY(),
5745  TMath::Cos(2 * dphi));
5746  fa_xy_glo_pim->Fill(TofHit->GetX(), TofHit->GetY());
5747  fa_tm_glo_pim->Fill(mom, tofmass);
5748  fa_m2mom_glo_pim->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5749  fa_pMCmom_glo_pim->Fill(mom, p_MC);
5750  fa_w_mom_glo_pim->Fill(mom, Weight_THMUL[i][0]);
5751  fa_LenDismom_glo_pim->Fill(mom, len - TofHit->GetR());
5752 
5753  if (use_pions_for_flow
5754  && TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5755  > GetDY()
5756  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5757  if (MCTrack->GetRapidity()
5758  > yrp_mid) { // set weights for reaction plane
5759  rp_weight = -1.;
5760  } else {
5761  rp_weight = +1.;
5762  }
5763  } else {
5764  rp_weight = 0.;
5765  }
5766  break;
5767  };
5768  case 321: {
5769  fa_ptm_rap_glo_kp->Fill(MCTrack->GetRapidity(),
5770  MCTrack->GetPt() / MCTrack->GetMass());
5771  fa_v1_rap_glo_kp->Fill((MCTrack->GetRapidity() - GetMidY())
5772  / GetMidY(),
5773  TMath::Cos(dphi));
5774  fa_v2_rap_glo_kp->Fill((MCTrack->GetRapidity() - GetMidY())
5775  / GetMidY(),
5776  TMath::Cos(2 * dphi));
5777  fa_xy_glo_kp->Fill(TofHit->GetX(), TofHit->GetY());
5778  fa_tm_glo_kp->Fill(mom, tofmass);
5779  fa_m2mom_glo_kp->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5780  fa_pMCmom_glo_kp->Fill(mom, p_MC);
5781  fa_w_mom_glo_kp->Fill(mom, Weight_THMUL[i][0]);
5782  fa_LenDismom_glo_kp->Fill(mom, len - TofHit->GetR());
5783 
5784  break;
5785  };
5786  case -321: {
5787  fa_ptm_rap_glo_km->Fill(MCTrack->GetRapidity(),
5788  MCTrack->GetPt() / MCTrack->GetMass());
5789  fa_v1_rap_glo_km->Fill((MCTrack->GetRapidity() - GetMidY())
5790  / GetMidY(),
5791  TMath::Cos(dphi));
5792  fa_v2_rap_glo_km->Fill((MCTrack->GetRapidity() - GetMidY())
5793  / GetMidY(),
5794  TMath::Cos(2 * dphi));
5795  fa_xy_glo_km->Fill(TofHit->GetX(), TofHit->GetY());
5796  fa_tm_glo_km->Fill(mom, tofmass);
5797  fa_m2mom_glo_km->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5798  fa_pMCmom_glo_km->Fill(mom, p_MC);
5799  fa_w_mom_glo_km->Fill(mom, Weight_THMUL[i][0]);
5800  fa_LenDismom_glo_km->Fill(mom, len - TofHit->GetR());
5801 
5802  break;
5803  };
5804  case 2212: {
5805  fa_ptm_rap_glo_p->Fill(MCTrack->GetRapidity(),
5806  MCTrack->GetPt() / MCTrack->GetMass());
5807  fa_v1_rap_glo_p->Fill((MCTrack->GetRapidity() - GetMidY())
5808  / GetMidY(),
5809  TMath::Cos(dphi));
5810  fa_v2_rap_glo_p->Fill((MCTrack->GetRapidity() - GetMidY())
5811  / GetMidY(),
5812  TMath::Cos(2 * dphi));
5813  fa_xy_glo_p->Fill(TofHit->GetX(), TofHit->GetY());
5814  fa_tm_glo_p->Fill(mom, tofmass);
5815  fa_m2mom_glo_p->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5816  fa_pMCmom_glo_p->Fill(mom, p_MC);
5817  fa_w_mom_glo_p->Fill(mom, Weight_THMUL[i][0]);
5818  fa_LenDismom_glo_p->Fill(mom, len - TofHit->GetR());
5819 
5820  // reaction plane determination
5821  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5822  > GetDY()
5823  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5824  if (MCTrack->GetRapidity()
5825  > yrp_mid) { // set weights for reaction plane
5826  rp_weight = 1.;
5827  } else {
5828  rp_weight = -1.;
5829  }
5830  } else {
5831  rp_weight = 0.;
5832  }
5833  break;
5834  };
5835  case -2212: {
5836  fa_ptm_rap_glo_pbar->Fill(MCTrack->GetRapidity(),
5837  MCTrack->GetPt() / MCTrack->GetMass());
5838  fa_v1_rap_glo_pbar->Fill((MCTrack->GetRapidity() - GetMidY())
5839  / GetMidY(),
5840  TMath::Cos(dphi));
5841  fa_v2_rap_glo_pbar->Fill((MCTrack->GetRapidity() - GetMidY())
5842  / GetMidY(),
5843  TMath::Cos(2 * dphi));
5844  fa_xy_glo_pbar->Fill(TofHit->GetX(), TofHit->GetY());
5845  fa_tm_glo_pbar->Fill(mom, tofmass);
5846  fa_m2mom_glo_pbar->Fill(mom * TMath::Sign(1., tpar->GetQp()), m2);
5847  fa_pMCmom_glo_pbar->Fill(mom, p_MC);
5848  fa_w_mom_glo_pbar->Fill(mom, Weight_THMUL[i][0]);
5849  fa_LenDismom_glo_pbar->Fill(mom, len - TofHit->GetR());
5850 
5851  break;
5852  };
5853  case 1000010020: { // deuteron
5854  fa_ptm_rap_glo_d->Fill(MCTrack->GetRapidity(),
5855  MCTrack->GetPt() / MCTrack->GetMass());
5856  fa_v1_rap_glo_d->Fill((MCTrack->GetRapidity() - GetMidY())
5857  / GetMidY(),
5858  TMath::Cos(dphi));
5859  fa_v2_rap_glo_d->Fill((MCTrack->GetRapidity() - GetMidY())
5860  / GetMidY(),
5861  TMath::Cos(2 * dphi));
5862  fa_xy_glo_d->Fill(TofHit->GetX(), TofHit->GetY());
5863  fa_tm_glo_d->Fill(mom, tofmass);
5864  fa_pMCmom_glo_d->Fill(mom, p_MC);
5865  fa_w_mom_glo_d->Fill(mom, Weight_THMUL[i][0]);
5866 
5867  // reaction plane determination
5868  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5869  > GetDY()
5870  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5871  if (MCTrack->GetRapidity()
5872  > yrp_mid) { // set weights for reaction plane
5873  rp_weight = 1.;
5874  } else {
5875  rp_weight = -1.;
5876  }
5877  }
5878  break;
5879  };
5880  case 1000010030: { // triton
5881  fa_ptm_rap_glo_t->Fill(MCTrack->GetRapidity(),
5882  MCTrack->GetPt() / MCTrack->GetMass());
5883  fa_v1_rap_glo_t->Fill((MCTrack->GetRapidity() - GetMidY())
5884  / GetMidY(),
5885  TMath::Cos(dphi));
5886  fa_v2_rap_glo_t->Fill((MCTrack->GetRapidity() - GetMidY())
5887  / GetMidY(),
5888  TMath::Cos(2 * dphi));
5889  fa_xy_glo_t->Fill(TofHit->GetX(), TofHit->GetY());
5890  fa_tm_glo_t->Fill(mom, tofmass);
5891  fa_pMCmom_glo_t->Fill(mom, p_MC);
5892  fa_w_mom_glo_t->Fill(mom, Weight_THMUL[i][0]);
5893 
5894  // reaction plane determination
5895  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5896  > GetDY()
5897  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5898  if (MCTrack->GetRapidity()
5899  > yrp_mid) { // set weights for reaction plane
5900  rp_weight = 1.;
5901  } else {
5902  rp_weight = -1.;
5903  }
5904  }
5905  break;
5906  };
5907  case 1000020030: { // 3he
5908  fa_ptm_rap_glo_h->Fill(MCTrack->GetRapidity(),
5909  MCTrack->GetPt() / MCTrack->GetMass());
5910  fa_v1_rap_glo_h->Fill((MCTrack->GetRapidity() - GetMidY())
5911  / GetMidY(),
5912  TMath::Cos(dphi));
5913  fa_v2_rap_glo_h->Fill((MCTrack->GetRapidity() - GetMidY())
5914  / GetMidY(),
5915  TMath::Cos(2 * dphi));
5916  fa_xy_glo_h->Fill(TofHit->GetX(), TofHit->GetY());
5917  fa_tm_glo_h->Fill(mom, tofmass);
5918  fa_pMCmom_glo_h->Fill(mom, p_MC);
5919  fa_w_mom_glo_h->Fill(mom, Weight_THMUL[i][0]);
5920 
5921  // reaction plane determination
5922  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5923  > GetDY()
5924  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5925  if (MCTrack->GetRapidity()
5926  > yrp_mid) { // set weights for reaction plane
5927  rp_weight = 1.;
5928  } else {
5929  rp_weight = -1.;
5930  }
5931  }
5932  break;
5933  };
5934  case 1000020040: { // alpha
5935  fa_ptm_rap_glo_a->Fill(MCTrack->GetRapidity(),
5936  MCTrack->GetPt() / MCTrack->GetMass());
5937  fa_v1_rap_glo_a->Fill((MCTrack->GetRapidity() - GetMidY())
5938  / GetMidY(),
5939  TMath::Cos(dphi));
5940  fa_v2_rap_glo_a->Fill((MCTrack->GetRapidity() - GetMidY())
5941  / GetMidY(),
5942  TMath::Cos(2 * dphi));
5943  fa_xy_glo_a->Fill(TofHit->GetX(), TofHit->GetY());
5944  fa_tm_glo_a->Fill(mom, tofmass);
5945  fa_pMCmom_glo_a->Fill(mom, p_MC);
5946  fa_w_mom_glo_a->Fill(mom, Weight_THMUL[i][0]);
5947 
5948  // reaction plane determination
5949  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5950  > GetDY()
5951  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5952  if (MCTrack->GetRapidity()
5953  > yrp_mid) { // set weights for reaction plane
5954  rp_weight = 1.;
5955  } else {
5956  rp_weight = -1.;
5957  }
5958  }
5959  break;
5960  };
5961  default: { // intermediate mass fragments
5962  //cout << " Track k="<<k<<", pdgCode = "<<pdgCode<<
5963  //" Mass " << MCTrack->GetMass()<<","<<MCTrack->GetMass()<<" Y " << MCTrack->GetRapidity() <<
5964  //" Pt " << MCTrack->GetPt() <<endl;
5965  fa_ptm_rap_glo_imf->Fill(MCTrack->GetRapidity(),
5966  MCTrack->GetPt() / MCTrack->GetMass());
5967  fa_v1_rap_glo_imf->Fill((MCTrack->GetRapidity() - GetMidY())
5968  / GetMidY(),
5969  TMath::Cos(dphi));
5970  fa_v2_rap_glo_imf->Fill((MCTrack->GetRapidity() - GetMidY())
5971  / GetMidY(),
5972  TMath::Cos(2 * dphi));
5973  // reaction plane determination (optimistic)
5974  if (TMath::Abs((MCTrack->GetRapidity() - yrp_mid) / yrp_mid)
5975  > GetDY()
5976  && MCTrack->GetPt() / MCTrack->GetMass() > GetFlowMinPtm()) {
5977  if (MCTrack->GetRapidity()
5978  > yrp_mid) { // set weights for reaction plane
5979  rp_weight = 1.;
5980  } else {
5981  rp_weight = -1.;
5982  }
5983  }
5984  break;
5985  };
5986  }
5987  if (rp_weight != 0.) {
5988  if (gRandom->Uniform(1)
5989  > 0.5) { //subdivide events into 2 random subevents
5990  Np1++;
5991  Qx1 = Qx1 + rp_weight * MCTrack->GetPx();
5992  Qy1 = Qy1 + rp_weight * MCTrack->GetPy();
5993  } else {
5994  Np2++;
5995  Qx2 = Qx2 + rp_weight * MCTrack->GetPx();
5996  Qy2 = Qy2 + rp_weight * MCTrack->GetPy();
5997  }
5998  }
5999  }
6000  }
6001  }
6002  if (verbose > 10) {
6003  cout << "<D> RP analysis " << Np1 << ", " << Np2 << endl;
6004  }
6005  if (Np1 > 0 && Np2 > 0) {
6006  phirp1 = atan2(Qy1, Qx1);
6007  phirp2 = atan2(Qy2, Qx2);
6008  if (fflowFile != NULL) { // subevent RP flattening
6009  TH1F* phirp_glo_fpar = (TH1F*) fflowFile->Get("phirps_glo_fpar");
6010  Float_t dphir = 0.;
6011  for (int j = 0; j < 4; j++) {
6012  Float_t i = (float) (j + 1);
6013  dphir +=
6014  (-phirp_glo_fpar->GetBinContent(j) * TMath::Cos(i * phirp1)
6015  + phirp_glo_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp1))
6016  / i;
6017  }
6018  phirp1 += dphir;
6019 
6020  dphir = 0.;
6021  for (int j = 0; j < 4; j++) {
6022  Float_t i = (float) (j + 1);
6023  dphir +=
6024  (-phirp_glo_fpar->GetBinContent(j) * TMath::Cos(i * phirp2)
6025  + phirp_glo_fpar->GetBinContent(j + 4) * TMath::Sin(i * phirp2))
6026  / i;
6027  }
6028  phirp2 += dphir;
6029  } // subevent RP flattening end
6030  delrp = (phirp1 - phirp2);
6031  fa_phirps_glo->Fill(phirp1 * RADDEG); // 1D histo
6032  fa_phirps_glo->Fill(phirp2 * RADDEG); // 1D histo
6033  if (NULL != fMCEventHeader) {
6034  // cout << " Impact parameter "<<fMCEventHeader->GetB()<< ", delrp = "<< delrp << endl;
6035  fa_cdrp_b_glo->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp));
6036  delrp = delrp * RADDEG;
6037  if (delrp < -180.) delrp += 360.;
6038  if (delrp > 180.) delrp -= 360.;
6039  fa_drp_b_glo->Fill(fMCEventHeader->GetB(), delrp);
6040  }
6041  phirp = RADDEG * atan2(Qy1 + Qy2, Qx1 + Qx2); // full reaction plane
6042  while (phirp < -180.) {
6043  phirp += 360.;
6044  }
6045  while (phirp > 180.) {
6046  phirp -= 360.;
6047  }
6048  if (fflowFile != NULL) { // RP flattening
6049  TH1F* phirp_glo_fpar = (TH1F*) fflowFile->Get("phirp_glo_fpar");
6050  Float_t dphir = 0.;
6051  for (int j = 0; j < 4; j++) {
6052  Float_t i = (float) (j + 1);
6053  //cout << " RP flat par "<< i << ","<<j<< " par " << phirp_glo_fpar->GetBinContent(j)
6054  // << ","<< phirp_glo_fpar->GetBinContent(j+4) << " phirp "<<phirp<<" dphir "<< dphir << endl;
6055  dphir +=
6056  ((-phirp_glo_fpar->GetBinContent(j) * TMath::Cos(i * phirp / RADDEG)
6057  + phirp_glo_fpar->GetBinContent(j + 4)
6058  * TMath::Sin(i * phirp / RADDEG))
6059  / i);
6060  }
6061  //cout << " phirp " << phirp << " dphir " << dphir*RADDEG << endl;
6062 
6063  phirp += dphir * RADDEG;
6064  while (phirp < -180.) {
6065  phirp += 360.;
6066  }
6067  while (phirp > 180.) {
6068  phirp -= 360.;
6069  }
6070  } // RP flattening end
6071  if (NULL != fMCEventHeader) {
6072  delrp = phirp - RADDEG * fMCEventHeader->GetRotZ();
6073  while (delrp < -180.) {
6074  delrp += 360.;
6075  }
6076  while (delrp > 180.) {
6077  delrp -= 360.;
6078  }
6079  fa_phirp_glo->Fill(phirp); // 1D histo
6080  fa_delrp_b_glo->Fill(fMCEventHeader->GetB(), delrp);
6081  fa_cdelrp_b_glo->Fill(fMCEventHeader->GetB(), TMath::Cos(delrp / RADDEG));
6082 
6083  fa_mul_b_had->Fill(fMCEventHeader->GetB(), NGTofTrack);
6084  }
6085  }
6086 
6087  // Hadron level
6088 
6089  if (0 == (fEvents % 1000)) {
6090  LOG(info) << "-I- CbmHadronAnalysis::Exec : "
6091  << "event " << fEvents << " processed.";
6092  }
6093  fEvents += 1;
6094 }
6095 // ------------------------------------------------------------------
6096 
6097 
6098 // ------------------------------------------------------------------
6100  // Normalisations
6101  cout << "CbmHadronAnalysis::Finish up with " << fEvents << " analyzed events "
6102  << endl;
6103 
6104  Double_t sfe = 1. / fEvents;
6105  Double_t sfac = 1.E7;
6106 
6107  cout << "<I> Normalisation factors " << sfe << "," << sfac << endl;
6108 
6109  fa_hit_ch->Scale(sfe * sfac);
6110 
6111  fa_xy_poi2->Scale(sfe);
6112  fa_xy_poi3->Add(fa_xy_poi2, fa_xy_poi2, sfac, 0.);
6113 
6114  fa_xy_hit2->Scale(sfe);
6115  fa_xy_hit3->Add(fa_xy_hit2, fa_xy_hit2, sfac, 0.);
6116 
6117  // Finish of the task execution
6118 
6119  // WriteHistogramms();
6120 }
6121 // ------------------------------------------------------------------
6122 
6123 
6124 // ------------------------------------------------------------------
6126  // Write histogramms to the file
6127  TFile* fHist = new TFile("data/auaumbias.hst.root", "RECREATE");
6128  {
6129  TIter next(gDirectory->GetList());
6130  TH1* h;
6131  TObject* obj;
6132  while ((obj = (TObject*) next())) {
6133  if (obj->InheritsFrom(TH1::Class())) {
6134  h = (TH1*) obj;
6135  //cout << "Write histo " << h->GetTitle() << endl;
6136  h->Write();
6137  }
6138  }
6139  }
6140  //fHist->ls();
6141  fHist->Close();
6142 }
6143 // ------------------------------------------------------------------
6144 static Int_t iCandEv = 0;
6146 #include "TLorentzVector.h"
6147 #include "TVector3.h"
6148 
6149  static TH1F* fhTofHitMul;
6150  static TH1F* fhTofChi;
6151  static TH1F* fhDperp;
6152  static TH2F* fhdEdxMul;
6153  static TH2F* fhdEdxMulsec;
6154  static TH1F* fhDTRDprim;
6155  static TH1F* fhDTRDsec;
6156  static TH1F* fhDperp2;
6157  static TH1F* fhDperpS;
6158  static TH1F* fhD0prim;
6159  static TH1F* fhOpAng;
6160  static TH1F* fhDCA;
6161  static TH1F* fhMinv;
6162  static TH1F* fhPathLen;
6163  static TH1F* fhMMom;
6164  static TH1F* fhMIXOpAng;
6165  static TH1F* fhMIXDCA;
6166  static TH1F* fhMIXMinv;
6167  static TH1F* fhMIXPathLen;
6168  static TH1F* fhMIXMMom;
6169  static TH1F* fhMCLamMom;
6170  static TH1F* fhMCPathLen;
6171 
6172  static TH2F* fa_ptm_rap_gen_lam;
6173  static TH2F* fa_ptm_rap_rec_lam;
6174  static TH2F* fa_ptm_rap_mix_lam;
6175  //static TH2F* fa_ptm_rap_sub_lam;
6176 
6177  static std::vector<std::list<std::vector<TLorentzVector>>> fvP;
6178  static std::vector<std::list<std::vector<TLorentzVector>>> fvX;
6179  static std::vector<std::list<std::vector<TVector3>>> fvX0;
6180  static std::vector<std::list<std::vector<TVector3>>> fvDX;
6181 
6182  /*
6183  Double_t fdDistPrimLim =1.5; // Ext Parameter: Max Tof-Sts trans distance for primaries
6184  Double_t fdDistPrimLim2=0.3; // Ext Parameter: Max Sts-Sts trans distance for primaries
6185  Double_t fdDistSecLim2=0.5; // Ext Parameter: Max Sts-Sts trans distance from TOF direction for secondaries
6186  Double_t fdD0ProtLim=0.4; // Ext Parameter: Min impact parameter for secondary proton
6187  Double_t fdOpAngMin=0.01; // Ext Parameter: Min opening angle for accepting pair
6188  Double_t fdDCALim=0.2; // Ext Parameter: Max DCA for accepting pair
6189  Double_t fdVLenMax=25.; // Ext Parameter: Max Lambda flight path length for accepting pair
6190  Double_t fdDistTRD = 10.; // max accepted distance of Trd Hit from STS-TOF line
6191  Double_t fdTRDHmulMin = 0.; // min associated Trd Hits to Track candidates
6192  */
6193 
6194 
6195  const Int_t fiTofHitMulMax = 200;
6196  const Int_t fiNMixClasses = 10;
6197  const Double_t beamRotY = -25.;
6198  const Double_t MLAM = 1.1156;
6199  const Double_t DMLAM = 0.015;
6200  const Int_t NSECMASS = 2; // pi-minus, proton, he3, alpha
6201  const Int_t iMode = 0;
6202  Float_t secMass[NSECMASS] = {0.139, 0.938};
6203  switch (iMode) {
6204  case 0: // Lambda
6205  break;
6206  case 1: // hypertriton
6207  secMass[1] = 2.808381; //3he
6208  break;
6209  }
6210  const Double_t dTofSigX = 0.5;
6211  const Double_t dTofSigY = 0.8;
6212  const Double_t dTofSigT = 0.08;
6213  const Double_t dChiTofLim = 3.;
6214 
6215  nStsHits = 0;
6216  if (NULL != fStsHits) nStsHits = fStsHits->GetEntriesFast();
6217  Int_t nTrdHits = 0;
6218  if (NULL != fTrdHits) nTrdHits = fTrdHits->GetEntriesFast();
6219 
6220  LOG(DEBUG) << "Secondaries from " << nTofHits << " TofHits, " << nStsHits
6221  << " StsHits and " << nTrdHits << " TrdHits in event " << iCandEv;
6222 
6223  if (iCandEv == 0) { //initialize
6224  // define some histograms
6225  Double_t MinvMin = secMass[0] + secMass[1];
6226  fhTofHitMul = new TH1F(Form("hTofHitMul"),
6227  Form("TofHit Multiplicity; M_{TofHit} "),
6228  fiTofHitMulMax,
6229  0.,
6230  (Double_t) fiTofHitMulMax);
6231  fhTofChi = new TH1F(
6232  Form("hTofChi"), Form("TofHit Merger; #chi "), 100, 0., dChiTofLim * 2.);
6233  fhDperp = new TH1F(Form("hDperp"),
6234  Form("transverse matching distance; d [cm]"),
6235  100,
6236  0.,
6237  5.);
6238  fhdEdxMul =
6239  new TH2F(Form("hdEdxMul"),
6240  Form("average energy loss vs TrdHitMul; TrdHitMul; dE []"),
6241  4,
6242  1,
6243  5,
6244  100,
6245  0.,
6246  5.E-5);
6247  fhdEdxMulsec = new TH2F(
6248  Form("hdEdxMulsec"),
6249  Form("av. energy loss vs TrdHitMul for secondaries; TrdHitMul; dE []"),
6250  4,
6251  1,
6252  5,
6253  100,
6254  0.,
6255  5.E-5);
6256  fhDTRDprim =
6257  new TH1F(Form("hDTRDprim"),
6258  Form("TRD transverse matching distance (prim); d [cm]"),
6259  100,
6260  0.,
6261  2. * fdDistTRD);
6262  fhDTRDsec = new TH1F(Form("hDTRDsec"),
6263  Form("TRD transverse matching distance (sec); d [cm]"),
6264  100,
6265  0.,
6266  2. * fdDistTRD);
6267 
6268  fhDperp2 = new TH1F(Form("hDperp2"),
6269  Form("transverse matching distance (prim); d [cm]"),
6270  100,
6271  0.,
6272  1.);
6273  fhDperpS = new TH1F(Form("hDperpS"),
6274  Form("transverse matching distance (sec); d [cm]"),
6275  100,
6276  0.,
6277  1.);
6278  fhD0prim = new TH1F(Form("hD0prim"),
6279  Form("transverse distance to primary vertex; d [cm]"),
6280  100,
6281  0.,
6282  2.);
6283  fhOpAng = new TH1F(
6284  Form("hOpAng"), Form("opening angle; #alpha [rad]"), 100, 0., 0.5);
6285  fhDCA = new TH1F(
6286  Form("hDCA"), Form("distance of closest approach; d [cm]"), 100, 0., 2.);
6287  fhMinv = new TH1F(Form("hMinv"),
6288  Form("invariant mass; M_{inv} [GeV]"),
6289  100,
6290  MinvMin,
6291  MinvMin + 0.2);
6292  fhPathLen =
6293  new TH1F(Form("hPathLen"), Form("path length; L [cm]"), 100, 0., 30.);
6294  fhMMom = new TH1F(
6295  Form("hMMom"), Form("momentum of mother ; p [GeV]"), 100, 0., 5.);
6296  fhMIXOpAng = new TH1F(
6297  Form("hMIXOpAng"), Form("opening angle; #alpha [rad]"), 100, 0., 0.5);
6298  fhMIXDCA = new TH1F(Form("hMIXDCA"),
6299  Form("distance of closest approach; d [cm]"),
6300  100,
6301  0.,
6302  2.);
6303  fhMIXMinv = new TH1F(Form("hMIXMinv"),
6304  Form("invariant mass; M_{inv} [GeV]"),
6305  100,
6306  MinvMin,
6307  MinvMin + 0.2);
6308  fhMIXPathLen =
6309  new TH1F(Form("hMIXPathLen"), Form("path length; L [cm]"), 100, 0., 30.);
6310  fhMIXMMom = new TH1F(
6311  Form("hMIXMMom"), Form("momentum of mother ; p [GeV]"), 100, 0., 5.);
6312  fhMCPathLen = new TH1F(
6313  Form("hMCPathLen"), Form("MC hyperon path length; L [cm]"), 100, 0., 30.);
6314  fhMCLamMom = new TH1F(
6315  Form("hMCLamMom"), Form("MC hyperon momentum; p [GeV]"), 100, 0., 5.);
6316 
6317 
6318  // physics observables
6319  Float_t ymin = -1.;
6320  Float_t ymax = 4.;
6321  Float_t ptmmax = 2.5;
6322  Int_t ptm_nbx = 30;
6323  Int_t ptm_nby = 30;
6324 
6325  fa_ptm_rap_gen_lam = new TH2F("ptm_rap_gen_lam",
6326  "MCTrack-gen lam; y; p_{T}/m",
6327  ptm_nbx,
6328  ymin,
6329  ymax,
6330  ptm_nby,
6331  0.,
6332  ptmmax);
6333  fa_ptm_rap_rec_lam = new TH2F("ptm_rap_rec_lam",
6334  "rec lam; y; p_{T}/m",
6335  ptm_nbx,
6336  ymin,
6337  ymax,
6338  ptm_nby,
6339  0.,
6340  ptmmax);
6341  fa_ptm_rap_mix_lam = new TH2F("ptm_rap_mix_lam",
6342  "mix lam; y; p_{T}/m",
6343  ptm_nbx,
6344  ymin,
6345  ymax,
6346  ptm_nby,
6347  0.,
6348  ptmmax);
6349  // fa_ptm_rap_sub_lam = new TH2F("ptm_rap_sub_lam","sub lam; y; p_{T}/m",ptm_nbx,ymin,ymax,ptm_nby,0.,ptmmax);
6350  }
6351  iCandEv++; // count events locally
6352 
6353  // fill generator distributions for reference
6354  for (Int_t k = 0; k < nMCTracks; k++) { // inspect MCTracks
6355  CbmMCTrack* MCTrack = (CbmMCTrack*) fMCTracksColl->At(k);
6356  Int_t pdgCode = MCTrack->GetPdgCode();
6357  //cout<<"MCTrack pdg "<< pdgCode << ", Mother "<<MCTrack->GetMotherId()<<endl;
6358  if (MCTrack->GetMotherId() == -1 && pdgCode == 3122) {
6359  fhMCLamMom->Fill(MCTrack->GetP());
6360  TLorentzVector PLAM(MCTrack->GetPx(),
6361  MCTrack->GetPy(),
6362  MCTrack->GetPz(),
6363  MCTrack->GetEnergy());
6364  PLAM.RotateY(beamRotY * TMath::Pi() / 180.);
6365  fa_ptm_rap_gen_lam->Fill(PLAM.Rapidity(), PLAM.Pt() / MCTrack->GetMass());
6366  }
6367  if (MCTrack->GetMotherId() > -1 && pdgCode == -211) { // decay pion
6368  CbmMCTrack* MCTrackm =
6369  (CbmMCTrack*) fMCTracksColl->At(MCTrack->GetMotherId());
6370  if (MCTrackm->GetPdgCode() == 3122) {
6371  TVector3 MCV;
6372  MCTrack->GetStartVertex(MCV);
6373  fhMCPathLen->Fill(MCV.Mag());
6374  LOG(debug) << "MC vertex at Pathlen = " << MCV.Mag() << ", pi-mom "
6375  << MCTrack->GetP();
6376  }
6377  }
6378  }
6379 
6380  fhTofHitMul->Fill((Double_t) nTofHits);
6381 
6382  fvP.resize(fiNMixClasses);
6383  fvX.resize(fiNMixClasses);
6384  fvX0.resize(fiNMixClasses);
6385  fvDX.resize(fiNMixClasses);
6386 
6387  Int_t iMixClass = nTofHits * fiNMixClasses / fiTofHitMulMax;
6388  if (iMixClass >= fiNMixClasses) iMixClass = fiNMixClasses - 1;
6389 
6390  std::vector<TLorentzVector> P;
6391  P.resize(nTofHits); // define array of momentum Lorentzvectors
6392  std::vector<TLorentzVector> X;
6393  X.resize(nTofHits); // define array of space Lorentzvectors
6394  std::vector<TVector3> X0;
6395  X0.resize(nTofHits); // first measured point of line
6396  std::vector<TVector3> DX;
6397  DX.resize(nTofHits); // direction of line
6398  const Int_t NTrdStations = 4;
6399  std::vector<std::vector<Int_t>> iTRD;
6400  iTRD.resize(nTofHits);
6401 
6402  Double_t dStsDistMin[nTofHits];
6403  Double_t dSts2DistMin[nTofHits];
6404  Double_t dTofDistMin[nStsHits];
6405  Double_t dTofDist2Min[nStsHits];
6406  Int_t iStsMin[nTofHits][2]; // storage of track candidate STS hits
6407  Int_t iTofMin[nStsHits];
6408 
6409  Double_t dTrdDistMin[nTofHits][NTrdStations];
6410 
6411  Int_t proton_cand = 0;
6412  Int_t pion_cand = 0;
6413 
6414  for (Int_t j = 0; j < nStsHits; j++) {
6415  iTofMin[j] = -1; //initialize
6416  dTofDistMin[j] = 100.; //initialize
6417  dTofDist2Min[j] = 100.; //initialize
6418  }
6419 
6420  //0. merge TOF hits due to counter overlaps
6421  for (Int_t i = 0; i < nTofHits; i++) {
6422  CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i);
6423  if (NULL == pTofHit) continue;
6424  if (pTofHit->GetZ() == 0) continue; // don't merge with fake beam counter
6425  for (Int_t i2 = 0; i2 < nTofHits; i2++) {
6426  if (i2 != i) {
6427  CbmTofHit* pTofHit2 = (CbmTofHit*) fTofHits->At(i2);
6428  if (NULL == pTofHit2) continue;
6429  // Project to plane with smallest z coordinate
6430  if (pTofHit2->GetZ() < pTofHit->GetZ()) { //invert order
6431  CbmTofHit* pTofHittmp = pTofHit;
6432  pTofHit = pTofHit2;
6433  pTofHit2 = pTofHittmp;
6434  }
6435  Double_t dPosZExp = pTofHit->GetZ() / pTofHit2->GetZ();
6436  Double_t dPosXExp = pTofHit2->GetX() * dPosZExp;
6437  Double_t dPosYExp = pTofHit2->GetY() * dPosZExp;
6438  Double_t dTimeExp = pTofHit2->GetTime() * dPosZExp;
6439  Double_t dChi2 =
6440  TMath::Power((dPosXExp - pTofHit->GetX()) / dTofSigX, 2)
6441  + TMath::Power((dPosYExp - pTofHit->GetY()) / dTofSigY, 2)
6442  + TMath::Power((dTimeExp - pTofHit->GetTime()) / dTofSigT, 2);
6443  Double_t dChi = TMath::Sqrt(dChi2) / 3.;
6444  fhTofChi->Fill(dChi);
6445  if (dChi < dChiTofLim) { // merge info
6446  pTofHit->SetTime((pTofHit->GetTime() + dTimeExp)
6447  * 0.5); // update time
6448  fTofHits->Remove(pTofHit2);
6449  //pTofHit2->Delete(); // remove from TClonesArray
6450  LOG(DEBUG) << "Tof Hits " << i << " and " << i2 << " merged ";
6451  LOG(debug) << "Tof " << i << ", xyz " << pTofHit->GetX() << ", "
6452  << pTofHit->GetY() << ", " << pTofHit->GetZ();
6453  }
6454  }
6455  }
6456  }
6457 
6458  //1. find best tof silicon match for primary track hypothesis
6459  for (Int_t i = 0; i < nTofHits; i++) {
6460  CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i);
6461  if (NULL == pTofHit) continue;
6462  if (pTofHit->GetZ() == 0) continue; // skip fake beam counter
6463  dStsDistMin[i] = 1.E3;
6464  dSts2DistMin[i] = 1.E3;
6465  for (Int_t l = 0; l < NTrdStations; l++)
6466  dTrdDistMin[i][l] = 1.E3;
6467  iStsMin[i][0] = -1;
6468  iStsMin[i][1] = -1;
6469  for (Int_t j = 0; j < nStsHits; j++) {
6470  CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(j);
6471  // Check for primary track
6472  Double_t sPosZ = pStsHit->GetZ();
6473  Double_t sPosXext = pTofHit->GetX() * sPosZ / pTofHit->GetZ();
6474  Double_t sPosYext = pTofHit->GetY() * sPosZ / pTofHit->GetZ();
6475  Double_t dDist2 = TMath::Power(pStsHit->GetX() - sPosXext, 2)
6476  + TMath::Power(pStsHit->GetY() - sPosYext, 2);
6477  Double_t dDist = TMath::Sqrt(dDist2);
6478  fhDperp->Fill(dDist);
6479  LOG(debug) << "Sts " << j << ", xyz " << pStsHit->GetX() << ", "
6480  << pStsHit->GetY() << ", " << sPosZ;
6481  LOG(debug) << "Tof " << i << ", xyz " << pTofHit->GetX() << ", "
6482  << pTofHit->GetY() << ", " << pTofHit->GetZ();
6483  LOG(debug) << "Tof " << i << ", Sts " << j
6484  << Form(" -> dist %6.3f, Min %6.3f ", dDist, dStsDistMin[i]);
6485 
6486  if (dDist < fdDistPrimLim
6487  && dDist < dStsDistMin[i]) { // primary or proton candidate
6488  if (iTofMin[j] > -1) {
6489  LOG(debug) << Form("Sts hit %d already assigned to tof hit %d with "
6490  "dist= %6.3f, prev %6.3f",
6491  j,
6492  iTofMin[j],
6493  dDist,
6494  dTofDistMin[j]);
6495  if (dDist > dTofDistMin[j])
6496  continue; // previous assignment was better
6497  }
6498  dStsDistMin[i] = dDist;
6499  iTofMin[j] = i;
6500  dTofDistMin[j] = dDist;
6501  LOG(debug) << "Prim Track cand started for Tof " << i << ", Sts " << j
6502  << Form(": dist %6.3f, Min %6.3f at z = %4.1f",
6503  dDist,
6504  dStsDistMin[i],
6505  sPosZ);
6506  }
6507  } // for (Int_t j=0; j<nStsHits; j++) {
6508  } //for (Int_t i=0; i<nTofHits; i++) {
6509 
6510  //2.: find second silicon hit for primary tracks
6511  for (Int_t j = 0; j < nStsHits; j++) {
6512  if (iTofMin[j] < 0) continue;
6513  Int_t i = iTofMin[j]; // index of Tof Hit
6514  CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(j);
6515  // Check for confirmation of primary track
6516  for (Int_t k = 0; k < nStsHits; k++) {
6517  if (j == k) continue;
6518  CbmStsHit* pSts2Hit = (CbmStsHit*) fStsHits->At(k);
6519  Double_t sPos2Z = pSts2Hit->GetZ();
6520  Double_t sPos2Xext = pStsHit->GetX() * sPos2Z / pStsHit->GetZ();
6521  Double_t sPos2Yext = pStsHit->GetY() * sPos2Z / pStsHit->GetZ();
6522  Double_t dDist2 = TMath::Power(pSts2Hit->GetX() - sPos2Xext, 2)
6523  + TMath::Power(pSts2Hit->GetY() - sPos2Yext, 2);
6524  Double_t dDist = TMath::Sqrt(dDist2);
6525  fhDperp2->Fill(dDist);
6526  LOG(debug) << "Tof " << i << ", Sts " << j
6527  << Form(" Sts2 %d -> dist %6.3f, Min %6.3f at z = %4.1f",
6528  k,
6529  dDist,
6530  dSts2DistMin[i],
6531  sPos2Z);
6532 
6533  if (dDist < fdDistPrimLim2
6534  && dDist < dSts2DistMin[i]) { // look for primary or proton candidate
6535  if (iTofMin[k] > -1) {
6536  LOG(debug) << Form("Sts2hit %d already assigned to tof hit %d with "
6537  "dist= %6.3f, prev %6.3f",
6538  k,
6539  iTofMin[k],
6540  dDist,
6541  dTofDistMin[k]);
6542  if (dDist > dTofDist2Min[k])
6543  continue; // previous assignment was better
6544  }
6545  dSts2DistMin[i] = dDist;
6546  iTofMin[k] = i;
6547  if (pStsHit->GetZ() < pSts2Hit->GetZ()) {
6548  iStsMin[i][0] = j;
6549  iStsMin[i][1] = k;
6550  } else {
6551  iStsMin[i][0] = k;
6552  iStsMin[i][1] = j;
6553  }
6554  dTofDistMin[k] = dDist;
6555  LOG(debug) << "Prim Track cand found for Tof " << i << ", Sts " << j
6556  << ", Sts2 " << k
6557  << Form(": dist %6.3f, Min %6.3f at z = %4.1f",
6558  dDist,
6559  dSts2DistMin[i],
6560  sPos2Z);
6561  } // primary or proton candidate
6562  } // for (Int_t k=0; k<nStsHits; k++) {
6563  } // for (Int_t j=0; j<nStsHits; j++) {
6564 
6565  //2.a - confirm primary track hypothesis by TRD
6566  if (nTrdHits > 0) {
6567  for (Int_t i = 0; i < nTofHits; i++) {
6568  Int_t j = iStsMin[i][1]; // index of STS hit in second plane
6569  if (j < 0) continue; // no STS assigned
6570  CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i);
6571  if (NULL == pTofHit) continue;
6572  if (pTofHit->GetZ() == 0) continue; // skip fake beam counter
6573  CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(j);
6574  Double_t dDx = pTofHit->GetX() - pStsHit->GetX();
6575  Double_t dDy = pTofHit->GetY() - pStsHit->GetY();
6576  Double_t dDz = pTofHit->GetZ() - pStsHit->GetZ();
6577  LOG(DEBUG) << "Check for TRD hits between STS " << j << " and TOF " << i;
6578 
6579  for (Int_t l = 0; l < nTrdHits; l++) {
6580  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(l);
6581  // calculate expected position in Trd layer
6582  Double_t dXexp =
6583  pStsHit->GetX() + dDx * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6584  Double_t dYexp =
6585  pStsHit->GetY() + dDy * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6586  Double_t dDtrans =
6587  TMath::Sqrt(TMath::Power(dXexp - pTrdHit->GetX(), 2)
6588  + TMath::Power(dYexp - pTrdHit->GetY(), 2));
6589  UInt_t iTrdLayer = CbmTrdAddress::GetLayerId(pTrdHit->GetAddress());
6590  LOG(DEBUG) << "Inspect TRD hit " << l << " in "
6591  << Form("Module 0x%08x, layer %d",
6592  pTrdHit->GetAddress(),
6594  << " at z= " << pTrdHit->GetZ() << " dD = " << dDtrans
6595  << " < " << fdDistTRD;
6596  fhDTRDprim->Fill(dDtrans);
6597  if (dDtrans < fdDistTRD
6598  && dDtrans < dTrdDistMin
6599  [i][iTrdLayer]) { // check if acceptable and take best match
6600  Int_t iMul = iTRD[i].size();
6601  if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry
6602  //find old entry in vector
6603  Int_t ll = 0;
6604  for (; ll < iMul; ll++)
6605  if (static_cast<UInt_t>(CbmTrdAddress::GetLayerId(
6606  ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress()))
6607  == iTrdLayer)
6608  break;
6609  iTRD[i][ll] = l;
6610  } else { //add hit
6611  dTrdDistMin[i][iTrdLayer] = dDtrans;
6612  iTRD[i].resize(iMul + 1);
6613  iTRD[i][iMul] = l;
6614  }
6615  LOG(DEBUG) << "assign TrdHit " << l << " to TofHit " << i
6616  << " in layer " << iTrdLayer << " with d = " << dDtrans
6617  << ", TrdMul" << iMul
6618  << ", dEdx = " << pTrdHit->GetELoss();
6619  }
6620  }
6621  }
6622  //2.b - monitor TRD dEdx
6623  for (Int_t i = 0; i < nTofHits; i++) {
6624  Int_t iMul = iTRD[i].size();
6625  if (iMul > 0) {
6626  Double_t ddEdx = 0.;
6627  for (Int_t l = 0; l < iMul; l++) {
6628  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(iTRD[i][l]);
6629  ddEdx += pTrdHit->GetELoss();
6630  }
6631  ddEdx /= (Double_t) iMul;
6632  fhdEdxMul->Fill((Double_t) iMul, ddEdx);
6633  }
6634  }
6635  }
6636 
6637  //2.a - confirm primary track hypothesis by TRD
6638  if (nTrdHits > 0) {
6639  for (Int_t i = 0; i < nTofHits; i++) {
6640  Int_t j = iStsMin[i][1]; // index of STS hit in second plane
6641  if (j < 0) continue; // no STS assigned
6642  CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i);
6643  if (NULL == pTofHit) continue;
6644  if (pTofHit->GetZ() == 0) continue; // skip fake beam counter
6645  CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(j);
6646  Double_t dDx = pTofHit->GetX() - pStsHit->GetX();
6647  Double_t dDy = pTofHit->GetY() - pStsHit->GetY();
6648  Double_t dDz = pTofHit->GetZ() - pStsHit->GetZ();
6649  LOG(DEBUG) << "Check for TRD hits between STS " << j << " and TOF " << i;
6650 
6651  for (Int_t l = 0; l < nTrdHits; l++) {
6652  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(l);
6653  // calculate expected position in Trd layer
6654  Double_t dXexp =
6655  pStsHit->GetX() + dDx * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6656  Double_t dYexp =
6657  pStsHit->GetY() + dDy * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6658  Double_t dDtrans =
6659  TMath::Sqrt(TMath::Power(dXexp - pTrdHit->GetX(), 2)
6660  + TMath::Power(dYexp - pTrdHit->GetY(), 2));
6661  UInt_t iTrdLayer = CbmTrdAddress::GetLayerId(pTrdHit->GetAddress());
6662  LOG(DEBUG) << "Inspect TRD hit " << l << " in "
6663  << Form("Module 0x%08x, layer %d",
6664  pTrdHit->GetAddress(),
6666  << " at z= " << pTrdHit->GetZ() << " dD = " << dDtrans
6667  << " < " << fdDistTRD;
6668  fhDTRDprim->Fill(dDtrans);
6669  if (dDtrans < fdDistTRD
6670  && dDtrans < dTrdDistMin
6671  [i][iTrdLayer]) { // check if acceptable and take best match
6672  Int_t iMul = iTRD[i].size();
6673  if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry
6674  //find old entry in vector
6675  Int_t ll = 0;
6676  for (; ll < iMul; ll++)
6678  ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress())
6679  == iTrdLayer)
6680  break;
6681  iTRD[i][ll] = l;
6682  } else { //add hit
6683  dTrdDistMin[i][iTrdLayer] = dDtrans;
6684  iTRD[i].resize(iMul + 1);
6685  iTRD[i][iMul] = l;
6686  }
6687  LOG(DEBUG) << "assign TrdHit " << l << " to TofHit " << i
6688  << " in layer " << iTrdLayer << " with d = " << dDtrans
6689  << ", TrdMul" << iMul
6690  << ", dEdx = " << pTrdHit->GetELoss();
6691  }
6692  }
6693  }
6694  //2.b - monitor TRD dEdx
6695  for (Int_t i = 0; i < nTofHits; i++) {
6696  Int_t iMul = iTRD[i].size();
6697  if (iMul > 0) {
6698  Double_t ddEdx = 0.;
6699  for (Int_t l = 0; l < iMul; l++) {
6700  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(iTRD[i][l]);
6701  ddEdx += pTrdHit->GetELoss();
6702  }
6703  ddEdx /= (Double_t) iMul;
6704  fhdEdxMul->Fill((Double_t) iMul, ddEdx);
6705  }
6706  }
6707  }
6708 
6709  //3. find secondary proton candidate
6710  for (Int_t i = 0; i < nTofHits; i++) {
6711  CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i);
6712  if (NULL == pTofHit) continue;
6713  if (pTofHit->GetZ() == 0) continue; // skip fake beam counter
6714  if (iStsMin[i][0] > -1 && iStsMin[i][1] > -1) {
6715  CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(iStsMin[i][0]);
6716  CbmStsHit* pSts2Hit = (CbmStsHit*) fStsHits->At(iStsMin[i][1]);
6717 
6718  Double_t dDx = pStsHit->GetX() - pSts2Hit->GetX();
6719  Double_t dDy = pStsHit->GetY() - pSts2Hit->GetY();
6720  Double_t dDz = pStsHit->GetZ() - pSts2Hit->GetZ();
6721  // Extrapolate to z=0 (from Si information)
6722  Double_t dX0 = pSts2Hit->GetX() - dDx / dDz * pSts2Hit->GetZ();
6723  Double_t dY0 = pSts2Hit->GetY() - dDy / dDz * pSts2Hit->GetZ();
6724  Double_t dD0 = TMath::Sqrt(dX0 * dX0 + dY0 * dY0);
6725  fhD0prim->Fill(dD0);
6726 
6727  if (
6728  dD0 > fdD0ProtLim
6729  && (Double_t) iTRD[i].size()
6730  >= fdTRDHmulMin) { // secondary proton canditate, memorize relevant quantities
6731  Double_t dDd = TMath::Sqrt(dDx * dDx + dDy * dDy + dDz * dDz);
6732  Double_t vel = pTofHit->GetR() / pTofHit->GetTime();
6733  Double_t bet = vel / clight;
6734  if (bet > 0.9999) continue; // bet=0.9999;
6735  Double_t m = secMass[1]; // assume proton
6736  Double_t pmag = m * bet / TMath::Sqrt(1. - bet * bet); // natural units
6737  Double_t pz = pmag * dDz / dDd;
6738  Double_t px = pmag * dDx / dDd;
6739  Double_t py = pmag * dDy / dDd;
6740  Double_t E = TMath::Sqrt(pmag * pmag + m * m);
6741  P[i].SetPxPyPzE(px, py, pz, E);
6742  X[i].SetXYZT(pTofHit->GetX(),
6743  pTofHit->GetY(),
6744  pTofHit->GetZ(),
6745  pTofHit->GetTime());
6746  LOG(debug) << "Init proton LV at ind "
6747  << Form("%d %d %d", i, iStsMin[i][0], iStsMin[i][1])
6748  << " with beta = " << bet << ", minv = " << P[i].M()
6749  << ", tof " << X[i].T() << ", TRDHmul " << iTRD[i].size();
6750  X0[i].SetXYZ(pSts2Hit->GetX(), pSts2Hit->GetY(), pSts2Hit->GetZ());
6751  DX[i].SetXYZ(dDx, dDy, dDz);
6752  proton_cand++;
6753  } // secondary proton canditate,
6754  }
6755  }
6756 
6757  //4. find tof silicon match for secondaries
6758  for (Int_t i = 0; i < nTofHits; i++) {
6759  LOG(DEBUG) << "Tof " << i
6760  << Form(" sec cand Min %6.3f > %6.3f ?",
6761  dStsDistMin[i],
6762  fdDistPrimLim);
6763  if (dStsDistMin[i] > fdDistPrimLim) { // Tof hit not in the primary class
6764  Double_t dDistMin = 100.;
6765  Int_t jbest = -1;
6766  Int_t kbest = -1;
6767  CbmTofHit* pTofHit = (CbmTofHit*) fTofHits->At(i);
6768  if (NULL == pTofHit) continue;
6769  if (pTofHit->GetZ() == 0) continue; // skip fake beam counter
6770  for (Int_t j = 0; j < nStsHits; j++) {
6771  LOG(debug) << "Tof " << i << ", Sts " << j
6772  << Form(" ? sec cand %6.3f Min %6.3f ",
6773  dTofDistMin[j],
6774  fdDistPrimLim);
6775  if (dTofDistMin[j]
6776  > fdDistPrimLim) { // Sts hit not in the primary class
6777  CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(j);
6778  // check for extension of pair to 2nd silicon plane
6779  Double_t dDx = pTofHit->GetX() - pStsHit->GetX();
6780  Double_t dDy = pTofHit->GetY() - pStsHit->GetY();
6781  Double_t dDz = pTofHit->GetZ() - pStsHit->GetZ();
6782 
6783  for (Int_t k = 0; k < nStsHits; k++) {
6784  if (j == k) continue;
6785  CbmStsHit* pSts2Hit = (CbmStsHit*) fStsHits->At(k);
6786  Double_t sPos2Z = pSts2Hit->GetZ();
6787  Double_t sPos2Xext =
6788  pStsHit->GetX() + dDx / dDz * (sPos2Z - pStsHit->GetZ());
6789  Double_t sPos2Yext =
6790  pStsHit->GetY() + dDy / dDz * (sPos2Z - pStsHit->GetZ());
6791  Double_t dDist2 = TMath::Power(pSts2Hit->GetX() - sPos2Xext, 2)
6792  + TMath::Power(pSts2Hit->GetY() - sPos2Yext, 2);
6793  Double_t dDist = TMath::Sqrt(dDist2);
6794  fhDperpS->Fill(dDist);
6795  LOG(DEBUG) << "Sec Tof " << i << ", Sts " << j
6796  << Form(" Sts2 %d -> dist %6.3f < %6.3f ? at z = %4.1f",
6797  k,
6798  dDist,
6799  TMath::Min(dDistMin, fdDistSecLim2),
6800  sPos2Z);
6801  if (dDist < fdDistSecLim2
6802  && dDist < dDistMin) { // secondary or pion candidate
6803  dDistMin = dDist;
6804  jbest = j;
6805  kbest = k;
6806  ;
6807  }
6808  } // for (Int_t k=0; k<nStsHits; k++) {
6809  } //if( dTofDistMin[j] > dDistPrimLim) { // Sts hit not in the primary class
6810  } // for (Int_t j=0; j<nStsHits; j++) {
6811 
6812  LOG(DEBUG) << "Sec Dist for TofHit " << i << ": " << dDistMin << ", j "
6813  << jbest << ", k " << kbest;
6814 
6815  if (dDistMin < 100.) { // secondary candidate found, store vectors
6816  CbmStsHit* pStsHit = (CbmStsHit*) fStsHits->At(jbest);
6817  CbmStsHit* pSts2Hit = (CbmStsHit*) fStsHits->At(kbest);
6818  if (pSts2Hit->GetZ() > pStsHit->GetZ()) { // swap order
6819  pStsHit = (CbmStsHit*) fStsHits->At(kbest);
6820  pSts2Hit = (CbmStsHit*) fStsHits->At(jbest);
6821  }
6822  //4.a - confirm secondary track hypothesis by TRD
6823  if (nTrdHits > 0) {
6824  Double_t dDx = pTofHit->GetX() - pStsHit->GetX();
6825  Double_t dDy = pTofHit->GetY() - pStsHit->GetY();
6826  Double_t dDz = pTofHit->GetZ() - pStsHit->GetZ();
6827  for (Int_t l = 0; l < nTrdHits; l++) {
6828  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(l);
6829  // calculate expected position in Trd layer
6830  Double_t dXexp =
6831  pStsHit->GetX() + dDx * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6832  Double_t dYexp =
6833  pStsHit->GetY() + dDy * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6834  Double_t dDtrans =
6835  TMath::Sqrt(TMath::Power(dXexp - pTrdHit->GetX(), 2)
6836  + TMath::Power(dYexp - pTrdHit->GetY(), 2));
6837  UInt_t iTrdLayer = CbmTrdAddress::GetLayerId(pTrdHit->GetAddress());
6838  fhDTRDsec->Fill(dDtrans);
6839  LOG(DEBUG) << "Inspect sec. TRD hit " << l << " in "
6840  << Form("Module 0x%08x, layer %d",
6841  pTrdHit->GetAddress(),
6843  << " at z= " << pTrdHit->GetZ() << " dD = " << dDtrans
6844  << " < " << fdDistTRD;
6845  if (
6846  dDtrans < fdDistTRD
6847  && dDtrans < dTrdDistMin
6848  [i]
6849  [iTrdLayer]) { // check if acceptable and take best match
6850  Int_t iMul = iTRD[i].size();
6851  if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry
6852  //find old entry in vector
6853  Int_t ll = 0;
6854  for (; ll < iMul; ll++)
6855  if (static_cast<UInt_t>(CbmTrdAddress::GetLayerId(
6856  ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress()))
6857  == iTrdLayer)
6858  break;
6859  iTRD[i][ll] = l;
6860  } else { //add hit
6861  dTrdDistMin[i][iTrdLayer] = dDtrans;
6862  iTRD[i].resize(iMul + 1);
6863  iTRD[i][iMul] = l;
6864  }
6865  LOG(DEBUG) << "assign TrdHit " << l << " to TofHit " << i
6866  << " in layer " << iTrdLayer << " with d = " << dDtrans
6867  << ", TrdMul" << iMul
6868  << ", dEdx = " << pTrdHit->GetELoss();
6869  }
6870  }
6871  //4.b - monitor TRD dEdx
6872  Int_t iMul = iTRD[i].size();
6873  if (iMul > 0) {
6874  Double_t ddEdx = 0.;
6875  for (Int_t l = 0; l < iMul; l++) {
6876  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(iTRD[i][l]);
6877  ddEdx += pTrdHit->GetELoss();
6878  }
6879  ddEdx /= (Double_t) iMul;
6880  fhdEdxMulsec->Fill((Double_t) iMul, ddEdx);
6881  }
6882  } // (nTrdHits > 0) end
6883  if ((Double_t) iTRD[i].size() >= fdTRDHmulMin) {
6884  Double_t dDx = pStsHit->GetX() - pSts2Hit->GetX();
6885  Double_t dDy = pStsHit->GetY() - pSts2Hit->GetY();
6886  Double_t dDz = pStsHit->GetZ() - pSts2Hit->GetZ();
6887  Double_t dDd = TMath::Sqrt(dDx * dDx + dDy * dDy + dDz * dDz);
6888  Double_t vel =
6889  pTofHit->GetR()
6890  / pTofHit->GetTime(); // approximation, ignoring decay kinematics
6891  Double_t bet = vel / clight;
6892  if (bet > 0.9999) continue; //bet=0.9999;
6893  Double_t m = secMass[0]; // assume pion
6894  Double_t pmag =
6895  m * bet / TMath::Sqrt(1. - bet * bet); // natural units
6896  Double_t pz = pmag * dDz / dDd;
6897  Double_t px = pmag * dDx / dDd;
6898  Double_t py = pmag * dDy / dDd;
6899  Double_t E = TMath::Sqrt(pmag * pmag + m * m);
6900  P[i].SetPxPyPzE(px, py, pz, E);
6901  X[i].SetXYZT(pTofHit->GetX(),
6902  pTofHit->GetY(),
6903  pTofHit->GetZ(),
6904  pTofHit->GetTime());
6905  LOG(DEBUG) << "Init pion LV at ind " << i << " with beta = " << bet
6906  << ", minv = " << P[i].M() << ", tof " << X[i].T()
6907  << ", TRDHmul " << iTRD[i].size();
6908  X0[i].SetXYZ(pSts2Hit->GetX(), pSts2Hit->GetY(), pSts2Hit->GetZ());
6909  DX[i].SetXYZ(dDx, dDy, dDz);
6910  pion_cand++;
6911  }
6912  //4.a - confirm secondary track hypothesis by TRD
6913  if (nTrdHits > 0) {
6914  Double_t dDx = pTofHit->GetX() - pStsHit->GetX();
6915  Double_t dDy = pTofHit->GetY() - pStsHit->GetY();
6916  Double_t dDz = pTofHit->GetZ() - pStsHit->GetZ();
6917  for (Int_t l = 0; l < nTrdHits; l++) {
6918  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(l);
6919  // calculate expected position in Trd layer
6920  Double_t dXexp =
6921  pStsHit->GetX() + dDx * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6922  Double_t dYexp =
6923  pStsHit->GetY() + dDy * (pTrdHit->GetZ() - pStsHit->GetZ()) / dDz;
6924  Double_t dDtrans =
6925  TMath::Sqrt(TMath::Power(dXexp - pTrdHit->GetX(), 2)
6926  + TMath::Power(dYexp - pTrdHit->GetY(), 2));
6927  UInt_t iTrdLayer = CbmTrdAddress::GetLayerId(pTrdHit->GetAddress());
6928  fhDTRDsec->Fill(dDtrans);
6929  LOG(DEBUG) << "Inspect sec. TRD hit " << l << " in "
6930  << Form("Module 0x%08x, layer %d",
6931  pTrdHit->GetAddress(),
6933  << " at z= " << pTrdHit->GetZ() << " dD = " << dDtrans
6934  << " < " << fdDistTRD;
6935  if (
6936  dDtrans < fdDistTRD
6937  && dDtrans < dTrdDistMin
6938  [i]
6939  [iTrdLayer]) { // check if acceptable and take best match
6940  Int_t iMul = iTRD[i].size();
6941  if (dTrdDistMin[i][iTrdLayer] < 1.E3) { // modify previous entry
6942  //find old entry in vector
6943  Int_t ll = 0;
6944  for (; ll < iMul; ll++)
6946  ((CbmTrdHit*) fTrdHits->At(iTRD[i][ll]))->GetAddress())
6947  == iTrdLayer)
6948  break;
6949  iTRD[i][ll] = l;
6950  } else { //add hit
6951  dTrdDistMin[i][iTrdLayer] = dDtrans;
6952  iTRD[i].resize(iMul + 1);
6953  iTRD[i][iMul] = l;
6954  }
6955  LOG(DEBUG) << "assign TrdHit " << l << " to TofHit " << i
6956  << " in layer " << iTrdLayer << " with d = " << dDtrans
6957  << ", TrdMul" << iMul
6958  << ", dEdx = " << pTrdHit->GetELoss();
6959  }
6960  }
6961  //4.b - monitor TRD dEdx
6962  Int_t iMul = iTRD[i].size();
6963  if (iMul > 0) {
6964  Double_t ddEdx = 0.;
6965  for (Int_t l = 0; l < iMul; l++) {
6966  CbmTrdHit* pTrdHit = (CbmTrdHit*) fTrdHits->At(iTRD[i][l]);
6967  ddEdx += pTrdHit->GetELoss();
6968  }
6969  ddEdx /= (Double_t) iMul;
6970  fhdEdxMulsec->Fill((Double_t) iMul, ddEdx);
6971  }
6972  } // (nTrdHits > 0) end
6973  if ((Double_t) iTRD[i].size() >= fdTRDHmulMin) {
6974  Double_t dDx = pStsHit->GetX() - pSts2Hit->GetX();
6975  Double_t dDy = pStsHit->GetY() - pSts2Hit->GetY();
6976  Double_t dDz = pStsHit->GetZ() - pSts2Hit->GetZ();
6977  Double_t dDd = TMath::Sqrt(dDx * dDx + dDy * dDy + dDz * dDz);
6978  Double_t vel =
6979  pTofHit->GetR()
6980  / pTofHit->GetTime(); // approximation, ignoring decay kinematics
6981  Double_t bet = vel / clight;
6982  if (bet > 0.9999) continue; //bet=0.9999;
6983  Double_t m = secMass[0]; // assume pion
6984  Double_t pmag =
6985  m * bet / TMath::Sqrt(1. - bet * bet); // natural units
6986  Double_t pz = pmag * dDz / dDd;
6987  Double_t px = pmag * dDx / dDd;
6988  Double_t py = pmag * dDy / dDd;
6989  Double_t E = TMath::Sqrt(pmag * pmag + m * m);
6990  P[i].SetPxPyPzE(px, py, pz, E);
6991  X[i].SetXYZT(pTofHit->GetX(),
6992  pTofHit->GetY(),
6993  pTofHit->GetZ(),
6994  pTofHit->GetTime());
6995  LOG(DEBUG) << "Init pion LV at ind " << i << " with beta = " << bet
6996  << ", minv = " << P[i].M() << ", tof " << X[i].T()
6997  << ", TRDHmul " << iTRD[i].size();
6998  X0[i].SetXYZ(pSts2Hit->GetX(), pSts2Hit->GetY(), pSts2Hit->GetZ());
6999  DX[i].SetXYZ(dDx, dDy, dDz);
7000  pion_cand++;
7001  }
7002  }
7003  } //if( dStsDistMin[i] > dDistPrimLim) { // Sts hit not in the primary class
7004  } //for (Int_t i=0; i<nTofHits; i++)
7005  LOG(DEBUG) << " Ev " << iCandEv << " has " << proton_cand << " protons and "
7006  << pion_cand << " pion candidates";
7007  if (proton_cand > 0 && pion_cand > 0) {
7008  LOG(DEBUG) << "add event " << iCandEv << " to mixing class " << iMixClass
7009  << " of size " << fvP[iMixClass].size();
7010 
7011  fvP[iMixClass].push_front(P); //insert to mixed event vector
7012  fvX[iMixClass].push_front(X); //insert to mixed event vector
7013  fvX0[iMixClass].push_front(X0); //insert to mixed event vector
7014  fvDX[iMixClass].push_front(DX); //insert to mixed event vector
7015 
7016  if (fvP[iMixClass].size() > fNMixedEvents + 1) {
7017  fvP[iMixClass].pop_back();
7018  fvX[iMixClass].pop_back();
7019  fvX0[iMixClass].pop_back();
7020  fvDX[iMixClass].pop_back();
7021  }
7022  } else
7023  return; // nothing to be done
7024 
7025  //5. do combinatorics
7026  for (Int_t i = 0; i < nTofHits; i++) {
7027  if (TMath::Abs(P[i].M() - secMass[1]) < 0.01) { // proton candidate
7028  std::list<std::vector<TLorentzVector>>::iterator itX =
7029  fvX[iMixClass].begin();
7030  std::list<std::vector<TVector3>>::iterator itX0 = fvX0[iMixClass].begin();
7031  std::list<std::vector<TVector3>>::iterator itDX = fvDX[iMixClass].begin();
7032  Int_t iMixEv = 0;
7033  itX0--;
7034  itDX--;
7035  itX--;
7036  LOG(debug1) << "LV P has size " << P.size() << ", fvP size "
7037  << fvP[iMixClass].size() << " in mix class " << iMixClass;
7038  for (std::list<std::vector<TLorentzVector>>::iterator itP =
7039  fvP[iMixClass].begin();
7040  itP != fvP[iMixClass].end();
7041  ++itP) {
7042  iMixEv++;
7043  ++itX;
7044  ++itX0;
7045  ++itDX;
7046  std::vector<TLorentzVector> PE = *itP; //fvP[iEv];
7047  std::vector<TLorentzVector> XE = *itX; //fvX[iEv];
7048  std::vector<TVector3> X0E = *itX0; //fvX0[iEv];
7049  std::vector<TVector3> DXE = *itDX; //fvDX[iEv];
7050  LOG(debug1) << "iMixEv " << iMixEv << ": PE has size " << PE.size()
7051  << ", X0E: " << X0E.size();
7052  if (iMixEv == 1) {
7053  if (PE != P) LOG(fatal) << "P not properly restored from list";
7054  }
7055 
7056  for (UInt_t j = 0; j < PE.size(); j++) {
7057  if (TMath::Abs(PE[j].M() - secMass[0]) < 0.01) { // pion candidate
7058  //request minimum opening angle
7059  Double_t dOpAngle = DX[i].Angle(DXE[j]);
7060  if (iMixEv == 1)
7061  fhOpAng->Fill(dOpAngle);
7062  else
7063  fhMIXOpAng->Fill(dOpAngle);
7064  if (dOpAngle < fdOpAngMin) continue;
7065  // calculate decay vertex
7066  TVector3 N = DX[i].Cross(DXE[j]);
7067  if (N.Mag() == 0.) continue;
7068  N.SetMag(1.);
7069  Double_t dDCA = TMath::Abs((X0[i] - X0E[j]) * N);
7070  if (iMixEv == 1)
7071  fhDCA->Fill(dDCA);
7072  else
7073  fhMIXDCA->Fill(dDCA);
7074  LOG(debug) << "DCA for iMixEv " << iMixEv << " at ind i " << i
7075  << ", j " << j << ": " << dDCA;
7076  if (dDCA == 0.) continue;
7077  if (dDCA < fdDCALim) {
7078  // vertex position
7079  TVector3 D = dDCA * N;
7080  TVector3 Ni = DX[i].Cross(N);
7081  Double_t cj = -(X0E[j] - X0[i] - D) * Ni / (DXE[j] * Ni);
7082  TVector3 V = X0E[j] + cj * DXE[j] - 0.5 * D; // Vertex vector
7083  Double_t dVLen = V.Mag(); // Lambda flight pathlength
7084  if (dVLen > fdVLenMax) continue;
7085  if (dVLen < fdVLenMin) continue;
7086  TLorentzVector PM = P[i] + PE[j];
7087  TVector3 PV = TVector3(PM.Px(), PM.Py(), PM.Pz());
7088  Double_t TofM =
7089  dVLen / PM.Beta() / clight; // flight time of M in ns
7090 
7091  Double_t TofMLast = 100.;
7092  Int_t Niter = 0;
7093  std::vector<TLorentzVector> Ptmp = P;
7094  std::vector<TLorentzVector> PEtmp = PE;
7095  std::vector<TLorentzVector> Xtmp = X;
7096  std::vector<TLorentzVector> XEtmp = XE;
7097 
7098  while (TMath::Abs(TofM - TofMLast) > 0.001 && Niter++ < 3) {
7099  LOG(debug) << "MinvI at ind i " << i << ", j " << j << ": "
7100  << PM.M() << ", vertex: " << V[0] << " " << V[1]
7101  << " " << V[2] << ", Len " << dVLen
7102  << ", mom = " << PV.Mag() << ", TofM " << TofM;
7103 
7104  // update momentum calculation
7105  for (Int_t ii = 0; ii < 2; ii++) {
7106  Int_t k;
7107  TVector3 TofX;
7108  Double_t m;
7109  Double_t tof;
7110  if (ii == 0) {
7111  k = i;
7112  TofX = Xtmp[k].Vect();
7113  m = Ptmp[k].M();
7114  tof = Xtmp[k].T();
7115  } else {
7116  k = j;
7117  TofX = XEtmp[k].Vect();
7118  m = PEtmp[k].M();
7119  tof = XEtmp[k].T();
7120  }
7121  TVector3 vDTofV = TofX - V;
7122  Double_t vel = vDTofV.Mag() / (tof - TofM);
7123  Double_t bet = vel / clight;
7124  if (bet > 0.9999) bet = 0.9999;
7125  Double_t pmag =
7126  m * bet / TMath::Sqrt(1. - bet * bet); // natural units
7127  TVector3 vPsec = vDTofV;
7128  vPsec.SetMag(pmag);
7129  Double_t E = TMath::Sqrt(pmag * pmag + m * m);
7130  if (ii == 0) {
7131  Ptmp[k].SetVect(vPsec);
7132  Ptmp[k].SetE(E);
7133  } else {
7134  PEtmp[k].SetVect(vPsec);
7135  PEtmp[k].SetE(E);
7136  }
7137  }
7138  PM = Ptmp[i] + PEtmp[j];
7139  PV = TVector3(PM.Px(), PM.Py(), PM.Pz());
7140  TofMLast = TofM;
7141  TofM = dVLen / PM.Beta() / clight; // flight time of M in ns
7142  }
7143  Double_t minv = PM.M();
7144  if (iMixEv == 1) { // fill correlated event distributions
7145  fhMinv->Fill(minv);
7146  fhPathLen->Fill(dVLen);
7147  fhMMom->Fill(PV.Mag());
7148 
7149  LOG(debug) << "MinvII in event " << fEvents << " at ind i " << i
7150  << ", j " << j << ": " << minv
7151  << ", vertex: " << V[0] << " " << V[1] << " " << V[2]
7152  << ", Len " << dVLen << ", mom = " << PV.Mag()
7153  << ", tof " << TofM;
7154 
7155  if (TMath::Abs(MLAM - minv) < DMLAM) {
7156  PM.RotateY(beamRotY * TMath::Pi() / 180.);
7157  fa_ptm_rap_rec_lam->Fill(PM.Rapidity(), PM.Pt() / MLAM);
7158  }
7159  } else { // fill mixed event distributions
7160  fhMIXMinv->Fill(minv);
7161  fhMIXPathLen->Fill(dVLen);
7162  fhMIXMMom->Fill(PV.Mag());
7163  if (TMath::Abs(MLAM - minv) < DMLAM) {
7164  PM.RotateY(beamRotY * TMath::Pi() / 180.);
7165  fa_ptm_rap_mix_lam->Fill(PM.Rapidity(), PM.Pt() / MLAM);
7166  }
7167  }
7168  }
7169  }
7170  }
7171  }
7172  }
7173  }
7174 } //void CbmHadronAnalysis::ReconstructSecondaries()
7175 
CbmHadronAnalysis::fa_v1_rap_glo_h
TH2F * fa_v1_rap_glo_h
Definition: CbmHadronAnalysis.h:259
CbmHadronAnalysis::fa_v1_rap_poi_pim
TH2F * fa_v1_rap_poi_pim
Definition: CbmHadronAnalysis.h:204
CbmHadronAnalysis::fa_chi2_mom_gloprim
TH2F * fa_chi2_mom_gloprim
Definition: CbmHadronAnalysis.h:342
CbmHadronAnalysis::fa_v1_rap_glo_imf
TH2F * fa_v1_rap_glo_imf
Definition: CbmHadronAnalysis.h:261
CbmHadronAnalysis::fa_pMCmom_glo_km
TH2F * fa_pMCmom_glo_km
Definition: CbmHadronAnalysis.h:381
CbmHadronAnalysis::fa_cdrp_b_glo
TH2F * fa_cdrp_b_glo
Definition: CbmHadronAnalysis.h:157
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmTofTrack::SetMass
void SetMass(Float_t mass)
Definition: CbmTofTrack.h:107
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmHadronAnalysis::fa_xy_hit2
TH2F * fa_xy_hit2
Definition: CbmHadronAnalysis.h:281
CbmHadronAnalysis::fa_dzy
TH2F * fa_dzy
Definition: CbmHadronAnalysis.h:309
CbmHadronAnalysis::fWMax
Double_t fWMax
Definition: CbmHadronAnalysis.h:36
CbmHadronAnalysis::fa_phgrp_b_gen
TH2F * fa_phgrp_b_gen
Definition: CbmHadronAnalysis.h:143
CbmHadronAnalysis::fa_m2mom_glo_p
TH2F * fa_m2mom_glo_p
Definition: CbmHadronAnalysis.h:370
CbmMCTrack::GetMass
Double_t GetMass() const
Mass of the associated particle.
Definition: CbmMCTrack.cxx:114
CbmMatch
Definition: CbmMatch.h:22
CbmHadronAnalysis::fa_tm_glo
TH2F * fa_tm_glo
Definition: CbmHadronAnalysis.h:345
CbmHadronAnalysis::fdD0ProtLim
Double_t fdD0ProtLim
Definition: CbmHadronAnalysis.h:435
h
Generates beam ions for transport simulation.
Definition: CbmBeamGenerator.h:17
ECbmDataType::kStsHit
@ kStsHit
CbmHadronAnalysis::fa_pMCmom_glo_pbar
TH2F * fa_pMCmom_glo_pbar
Definition: CbmHadronAnalysis.h:383
CbmMCDataManager.h
CbmEvent::GetIndex
UInt_t GetIndex(ECbmDataType type, UInt_t iData)
Definition: CbmEvent.cxx:24
CbmHadronAnalysis::fa_m2mom_glo_pim
TH2F * fa_m2mom_glo_pim
Definition: CbmHadronAnalysis.h:367
CbmHadronAnalysis::fa_v1_rap_glo_a
TH2F * fa_v1_rap_glo_a
Definition: CbmHadronAnalysis.h:260
CbmVertex.h
CbmHadronAnalysis::fa_mul_b_glo
TH2F * fa_mul_b_glo
Definition: CbmHadronAnalysis.h:139
CbmHadronAnalysis::fa_plab_sts_pim
TH1F * fa_plab_sts_pim
Definition: CbmHadronAnalysis.h:82
CbmHadronAnalysis::fa_ptm_rap_gen_p
TH2F * fa_ptm_rap_gen_p
Definition: CbmHadronAnalysis.h:73
CbmHadronAnalysis::Init
virtual InitStatus Init()
Definition: CbmHadronAnalysis.cxx:3275
CbmHadronAnalysis::fa_ptm_rap_gen_t
TH2F * fa_ptm_rap_gen_t
Definition: CbmHadronAnalysis.h:76
CbmHadronAnalysis::fa_dxz
TH2F * fa_dxz
Definition: CbmHadronAnalysis.h:304
CbmHadronAnalysis::fa_LenDismom_glo_t
TH2F * fa_LenDismom_glo_t
Definition: CbmHadronAnalysis.h:411
CbmHadronAnalysis::fa_v1_rap_gen_pbar
TH2F * fa_v1_rap_gen_pbar
Definition: CbmHadronAnalysis.h:184
CbmHadronAnalysis::fa_pMCmom_glo_pip
TH2F * fa_pMCmom_glo_pip
Definition: CbmHadronAnalysis.h:378
CbmHadronAnalysis::fa_cdrp_b_had
TH2F * fa_cdrp_b_had
Definition: CbmHadronAnalysis.h:159
CbmHadronAnalysis::fa_m2mom_glo_km
TH2F * fa_m2mom_glo_km
Definition: CbmHadronAnalysis.h:369
CbmHadronAnalysis::fa_w_mom_glo_a
TH2F * fa_w_mom_glo_a
Definition: CbmHadronAnalysis.h:399
CbmHadronAnalysis::fa_v1_rap_poi_h
TH2F * fa_v1_rap_poi_h
Definition: CbmHadronAnalysis.h:211
CbmHadronAnalysis::fa_pv_glo
TH2F * fa_pv_glo
Definition: CbmHadronAnalysis.h:344
CbmHadronAnalysis::fa_cdrp_b_poi
TH2F * fa_cdrp_b_poi
Definition: CbmHadronAnalysis.h:153
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmHadronAnalysis::fa_phirps_gen
TH1F * fa_phirps_gen
Definition: CbmHadronAnalysis.h:173
CbmHadronAnalysis::fa_pMCmom_glo_d
TH2F * fa_pMCmom_glo_d
Definition: CbmHadronAnalysis.h:384
CbmMatch::GetLink
const CbmLink & GetLink(Int_t i) const
Definition: CbmMatch.h:35
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmHadronAnalysis::fa_phirp_gen
TH1F * fa_phirp_gen
Definition: CbmHadronAnalysis.h:167
atan2
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Definition: L1/vectors/P4_F32vec4.h:142
CbmStsCluster
Data class for STS clusters.
Definition: CbmStsCluster.h:31
CbmTofTrack.h
M2PROT
#define M2PROT
Definition: CbmHadronAnalysis.cxx:59
CbmHadronAnalysis::fa_v1_rap_glo_pim
TH2F * fa_v1_rap_glo_pim
Definition: CbmHadronAnalysis.h:252
CbmHadronAnalysis::fa_plab_sts_km
TH1F * fa_plab_sts_km
Definition: CbmHadronAnalysis.h:84
CbmHadronAnalysis::fa_tm_glo_pip
TH2F * fa_tm_glo_pip
Definition: CbmHadronAnalysis.h:346
CbmHadronAnalysis::fa_len_mom_glo
TH2F * fa_len_mom_glo
Definition: CbmHadronAnalysis.h:343
CbmHadronAnalysis::fa_v1_rap_poi_d
TH2F * fa_v1_rap_poi_d
Definition: CbmHadronAnalysis.h:209
CbmHadronAnalysis::fa_m2mom_gloprimvtxb
TH2F * fa_m2mom_gloprimvtxb
Definition: CbmHadronAnalysis.h:365
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmHadronAnalysis::fa_dhit_ch
TH2F * fa_dhit_ch
Definition: CbmHadronAnalysis.h:313
CbmHadronAnalysis::fa_chi2_mom_glo
TH2F * fa_chi2_mom_glo
Definition: CbmHadronAnalysis.h:341
CbmHadronAnalysis::fa_v2_rap_hit_t
TH2F * fa_v2_rap_hit_t
Definition: CbmHadronAnalysis.h:246
CbmHadronAnalysis::~CbmHadronAnalysis
virtual ~CbmHadronAnalysis()
Definition: CbmHadronAnalysis.cxx:845
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmHadronAnalysis::fa_ptm_rap_hit_kp
TH2F * fa_ptm_rap_hit_kp
Definition: CbmHadronAnalysis.h:114
CbmHadronAnalysis::fa_v1_rap_glo_pbar
TH2F * fa_v1_rap_glo_pbar
Definition: CbmHadronAnalysis.h:256
CbmHadronAnalysis::fhTofTrkDysel
TH1F * fhTofTrkDysel
Definition: CbmHadronAnalysis.h:425
CbmHadronAnalysis::fa_delrp_b_glo
TH2F * fa_delrp_b_glo
Definition: CbmHadronAnalysis.h:148
CbmHadronAnalysis::Finish
virtual void Finish()
Definition: CbmHadronAnalysis.cxx:6099
CbmHadronAnalysis::fTrdHits
TClonesArray * fTrdHits
Definition: CbmHadronAnalysis.h:57
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
CbmTrdHit::GetELoss
Double_t GetELoss() const
Definition: CbmTrdHit.h:79
CbmHadronAnalysis::fVtxBMax
Double_t fVtxBMax
Definition: CbmHadronAnalysis.h:37
CbmHadronAnalysis::fa_ptm_rap_gen_d
TH2F * fa_ptm_rap_gen_d
Definition: CbmHadronAnalysis.h:75
CbmHadronAnalysis::fa_v2_rap_poi_h
TH2F * fa_v2_rap_poi_h
Definition: CbmHadronAnalysis.h:223
CbmGlobalTrack::SetParamLast
void SetParamLast(const FairTrackParam *parLast)
Definition: CbmGlobalTrack.h:62
CbmHadronAnalysis::fa_xy_glo1
TH2F * fa_xy_glo1
Definition: CbmHadronAnalysis.h:284
CbmHadronAnalysis::fa_phirp_poi
TH1F * fa_phirp_poi
Definition: CbmHadronAnalysis.h:168
CbmHadronAnalysis::fa_ptm_rap_glo_d
TH2F * fa_ptm_rap_glo_d
Definition: CbmHadronAnalysis.h:130
CbmHadronAnalysis::fa_w_mom_glo_pbar
TH2F * fa_w_mom_glo_pbar
Definition: CbmHadronAnalysis.h:395
CbmHadronAnalysis::fa_m2mom_glo_pbar
TH2F * fa_m2mom_glo_pbar
Definition: CbmHadronAnalysis.h:371
CbmHadronAnalysis::fa_m2mom_glo_pip
TH2F * fa_m2mom_glo_pip
Definition: CbmHadronAnalysis.h:366
CbmHadronAnalysis::fa_ptm_rap_gen_imf
TH2F * fa_ptm_rap_gen_imf
Definition: CbmHadronAnalysis.h:79
CbmHadronAnalysis
Definition: CbmHadronAnalysis.h:24
CbmHadronAnalysis::fa_t0mn_nf_hit
TH1F * fa_t0mn_nf_hit
Definition: CbmHadronAnalysis.h:334
CbmHadronAnalysis::fa_ptm_rap_sts_km
TH2F * fa_ptm_rap_sts_km
Definition: CbmHadronAnalysis.h:91
CbmHadronAnalysis::fa_v2_rap_gen_pim
TH2F * fa_v2_rap_gen_pim
Definition: CbmHadronAnalysis.h:192
CbmHadronAnalysis::fa_ptm_rap_poi_pbar
TH2F * fa_ptm_rap_poi_pbar
Definition: CbmHadronAnalysis.h:105
rootMgr
static FairRootManager * rootMgr
Definition: CbmDeviceHitBuilderTof.cxx:72
CbmHadronAnalysis::fPrimVertex
CbmVertex * fPrimVertex
Definition: CbmHadronAnalysis.h:65
CbmStsKFTrackFitter::GetChiToVertex
Double_t GetChiToVertex(CbmStsTrack *track, CbmVertex *vtx=0)
Definition: CbmStsKFTrackFitter.cxx:164
CbmHadronAnalysis::fa_v2_rap_glo_a
TH2F * fa_v2_rap_glo_a
Definition: CbmHadronAnalysis.h:272
CbmHadronAnalysis::fa_tof_hit
TH1F * fa_tof_hit
Definition: CbmHadronAnalysis.h:315
CbmHadronAnalysis::fa_ptm_rap_sts_imf
TH2F * fa_ptm_rap_sts_imf
Definition: CbmHadronAnalysis.h:98
CbmHadronAnalysis::fa_v2_rap_poi_p
TH2F * fa_v2_rap_poi_p
Definition: CbmHadronAnalysis.h:219
CbmHadronAnalysis::fa_t0mn_f_b_hit
TH2F * fa_t0mn_f_b_hit
Definition: CbmHadronAnalysis.h:331
CbmHadronAnalysis::fa_v2_rap_gen_p
TH2F * fa_v2_rap_gen_p
Definition: CbmHadronAnalysis.h:195
CbmHadronAnalysis::fa_phphrp_gen
TH2F * fa_phphrp_gen
Definition: CbmHadronAnalysis.h:144
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
iNbTs
static Int_t iNbTs
Definition: CbmHadronAnalysis.cxx:55
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmHadronAnalysis::fa_w_mom_glomis
TH2F * fa_w_mom_glomis
Definition: CbmHadronAnalysis.h:401
CbmHadronAnalysis::fa_ptm_rap_poi_t
TH2F * fa_ptm_rap_poi_t
Definition: CbmHadronAnalysis.h:107
CbmHadronAnalysis::fa_v2_rap_gen_kp
TH2F * fa_v2_rap_gen_kp
Definition: CbmHadronAnalysis.h:193
CbmTrdHit
data class for a reconstructed Energy-4D measurement in the TRD
Definition: CbmTrdHit.h:35
CbmHadronAnalysis::fa_dyz
TH2F * fa_dyz
Definition: CbmHadronAnalysis.h:307
CbmHadronAnalysis::fa_tm_glo_km
TH2F * fa_tm_glo_km
Definition: CbmHadronAnalysis.h:349
CbmHadronAnalysis::fa_tm_gloprim
TH2F * fa_tm_gloprim
Definition: CbmHadronAnalysis.h:357
CbmMCDataManager::InitBranch
CbmMCDataArray * InitBranch(const char *name)
Definition: CbmMCDataManager.cxx:106
CbmHadronAnalysis::fNMixedEvents
UInt_t fNMixedEvents
Definition: CbmHadronAnalysis.h:446
CbmHadronAnalysis::fa_tm_glo_a
TH2F * fa_tm_glo_a
Definition: CbmHadronAnalysis.h:355
CbmTofTrack::GetTrackParameter
const FairTrackParam * GetTrackParameter() const
Definition: CbmTofTrack.h:80
CbmHadronAnalysis::fdDistPrimLim
Double_t fdDistPrimLim
Definition: CbmHadronAnalysis.h:429
CbmHadronAnalysis::fa_ptm_rap_glo_pip
TH2F * fa_ptm_rap_glo_pip
Definition: CbmHadronAnalysis.h:124
nTofHits
Int_t nTofHits
Definition: CbmHadronAnalysis.cxx:63
CbmHadronAnalysis::fdDCALim
Double_t fdDCALim
Definition: CbmHadronAnalysis.h:439
CbmHadronAnalysis::fa_delrp_b_poi
TH2F * fa_delrp_b_poi
Definition: CbmHadronAnalysis.h:146
CbmMCDataArray.h
CbmHadronAnalysis::fa_m2mom_glovtxb
TH2F * fa_m2mom_glovtxb
Definition: CbmHadronAnalysis.h:363
CbmHadronAnalysis::fa_v2_rap_hit_imf
TH2F * fa_v2_rap_hit_imf
Definition: CbmHadronAnalysis.h:249
CbmHadronAnalysis.h
CbmHadronAnalysis::fa_LenMcDismom_glo
TH2F * fa_LenMcDismom_glo
Definition: CbmHadronAnalysis.h:415
CbmGlobalTrack.h
CbmHadronAnalysis::GetMidY
Float_t GetMidY() const
Definition: CbmHadronAnalysis.h:481
CbmHadronAnalysis::fa_LenDismom_glo_a
TH2F * fa_LenDismom_glo_a
Definition: CbmHadronAnalysis.h:413
CbmHadronAnalysis::fTrdPoints
TClonesArray * fTrdPoints
Definition: CbmHadronAnalysis.h:56
CbmTrdAddress::GetLayerId
static UInt_t GetLayerId(UInt_t address)
Return layer ID from address.
Definition: CbmTrdAddress.h:69
CbmHadronAnalysis::fa_ptm_rap_gen_pbar
TH2F * fa_ptm_rap_gen_pbar
Definition: CbmHadronAnalysis.h:74
CbmHadronAnalysis::fa_ptm_rap_hit_pbar
TH2F * fa_ptm_rap_hit_pbar
Definition: CbmHadronAnalysis.h:117
CbmHadronAnalysis::fa_phirps_glo
TH1F * fa_phirps_glo
Definition: CbmHadronAnalysis.h:176
CbmStsHit::GetFrontClusterId
Int_t GetFrontClusterId() const
Definition: CbmStsHit.h:93
CbmHadronAnalysis::fMCTracks
CbmMCDataArray * fMCTracks
Definition: CbmHadronAnalysis.h:47
CbmHadronAnalysis::fa_LenDismom_glo_pip
TH2F * fa_LenDismom_glo_pip
Definition: CbmHadronAnalysis.h:404
CbmHadronAnalysis::fa_ptm_rap_poi_h
TH2F * fa_ptm_rap_poi_h
Definition: CbmHadronAnalysis.h:108
CbmHadronAnalysis::fStsHits
TClonesArray * fStsHits
Definition: CbmHadronAnalysis.h:51
CbmHadronAnalysis::fa_ptm_rap_gen_pim
TH2F * fa_ptm_rap_gen_pim
Definition: CbmHadronAnalysis.h:70
ECbmDataType::kTofHit
@ kTofHit
CbmGlobalTrack::GetLength
Double_t GetLength() const
Definition: CbmGlobalTrack.h:50
CbmHadronAnalysis::fa_pMCmom_glo
TH2F * fa_pMCmom_glo
Definition: CbmHadronAnalysis.h:377
CbmMCTrack::GetPx
Double_t GetPx() const
Definition: CbmMCTrack.h:72
CbmHadronAnalysis::Exec
virtual void Exec(Option_t *option)
Definition: CbmHadronAnalysis.cxx:3459
CbmHadronAnalysis::fTofDigiMatchColl
TClonesArray * fTofDigiMatchColl
Definition: CbmHadronAnalysis.h:61
CbmHadronAnalysis::fa_phirp_hit
TH1F * fa_phirp_hit
Definition: CbmHadronAnalysis.h:169
CbmHadronAnalysis::fa_tm_gloprimvtxb
TH2F * fa_tm_gloprimvtxb
Definition: CbmHadronAnalysis.h:360
CbmHadronAnalysis::fa_tm_glo_pim
TH2F * fa_tm_glo_pim
Definition: CbmHadronAnalysis.h:347
CbmHadronAnalysis::fa_v1_rap_glo_p
TH2F * fa_v1_rap_glo_p
Definition: CbmHadronAnalysis.h:255
CbmMCTrack::GetPy
Double_t GetPy() const
Definition: CbmMCTrack.h:73
CbmTofHit::GetCh
Int_t GetCh() const
Definition: core/data/tof/CbmTofHit.h:92
CbmHadronAnalysis::fa_v2_rap_gen_km
TH2F * fa_v2_rap_gen_km
Definition: CbmHadronAnalysis.h:194
CbmHadronAnalysis::fa_xy_glo_km
TH2F * fa_xy_glo_km
Definition: CbmHadronAnalysis.h:288
Cbm::Sign
int Sign(const T &x)
Definition: CbmUtils.h:36
CbmHadronAnalysis::fa_ptm_rap_hit_a
TH2F * fa_ptm_rap_hit_a
Definition: CbmHadronAnalysis.h:121
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmHadronAnalysis::fa_v2_rap_poi_a
TH2F * fa_v2_rap_poi_a
Definition: CbmHadronAnalysis.h:224
CbmHadronAnalysis::fa_xy_glo_kp
TH2F * fa_xy_glo_kp
Definition: CbmHadronAnalysis.h:287
CbmHadronAnalysis::fa_dxy
TH2F * fa_dxy
Definition: CbmHadronAnalysis.h:303
CbmHadron.h
CbmHadronAnalysis::fhwmindelmass
TH2F * fhwmindelmass
Definition: CbmHadronAnalysis.h:418
CbmStsPoint
Definition: CbmStsPoint.h:27
CbmMatch.h
CbmHadronAnalysis::fa_LenDismom_glo_d
TH2F * fa_LenDismom_glo_d
Definition: CbmHadronAnalysis.h:410
CbmHadronAnalysis::fa_t0mn_hit
TH1F * fa_t0mn_hit
Definition: CbmHadronAnalysis.h:324
CbmHadronAnalysis::fa_ptm_rap_sts_pip
TH2F * fa_ptm_rap_sts_pip
Definition: CbmHadronAnalysis.h:88
CbmHadronAnalysis::ExecEvent
virtual void ExecEvent(Option_t *option)
Definition: CbmHadronAnalysis.cxx:3517
CbmHadronAnalysis::fa_w_mom_glo_d
TH2F * fa_w_mom_glo_d
Definition: CbmHadronAnalysis.h:396
CbmHadronAnalysis::fTofHits
TClonesArray * fTofHits
Definition: CbmHadronAnalysis.h:59
CbmHadronAnalysis::SetMidY
void SetMidY(Float_t midY)
Definition: CbmHadronAnalysis.h:469
CbmHadronAnalysis::fa_v2_rap_hit_h
TH2F * fa_v2_rap_hit_h
Definition: CbmHadronAnalysis.h:247
CbmHadronAnalysis::fa_cdelrp_b_poi
TH2F * fa_cdelrp_b_poi
Definition: CbmHadronAnalysis.h:162
CbmHadronAnalysis::fa_v1_rap_hit_d
TH2F * fa_v1_rap_hit_d
Definition: CbmHadronAnalysis.h:233
CbmHadronAnalysis::fa_ptm_rap_sts_h
TH2F * fa_ptm_rap_sts_h
Definition: CbmHadronAnalysis.h:96
CbmDigiManager::IsPresent
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
Definition: CbmDigiManager.cxx:112
CbmHadronAnalysis::fa_xy_glo_t
TH2F * fa_xy_glo_t
Definition: CbmHadronAnalysis.h:292
CbmHadronAnalysis::fa_tm_glo_pbar
TH2F * fa_tm_glo_pbar
Definition: CbmHadronAnalysis.h:351
CbmHadronAnalysis::GetBSelMax
Float_t GetBSelMax() const
Definition: CbmHadronAnalysis.h:485
CbmHadronAnalysis::fa_v2_rap_glo_p
TH2F * fa_v2_rap_glo_p
Definition: CbmHadronAnalysis.h:267
CbmHadronAnalysis::fa_dxx
TH2F * fa_dxx
Definition: CbmHadronAnalysis.h:302
CbmHadronAnalysis::fa_v1_rap_poi_a
TH2F * fa_v1_rap_poi_a
Definition: CbmHadronAnalysis.h:212
CbmHadronAnalysis::fa_ptm_rap_sts_pbar
TH2F * fa_ptm_rap_sts_pbar
Definition: CbmHadronAnalysis.h:93
CbmHadronAnalysis::fa_pMCmom_glo_kp
TH2F * fa_pMCmom_glo_kp
Definition: CbmHadronAnalysis.h:380
CbmHadronAnalysis::fa_xy_glo_pbar
TH2F * fa_xy_glo_pbar
Definition: CbmHadronAnalysis.h:290
CbmHadronAnalysis::fhTofTrkDx
TH1F * fhTofTrkDx
Definition: CbmHadronAnalysis.h:422
CbmHadronAnalysis::fdDistSecLim2
Double_t fdDistSecLim2
Definition: CbmHadronAnalysis.h:433
CbmHadronAnalysis::fa_v2_rap_poi_pip
TH2F * fa_v2_rap_poi_pip
Definition: CbmHadronAnalysis.h:215
CbmTofTrack::GetTrackLength
Double_t GetTrackLength() const
Definition: CbmTofTrack.h:77
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
CbmHadronAnalysis::fa_v1_rap_poi_pip
TH2F * fa_v1_rap_poi_pip
Definition: CbmHadronAnalysis.h:203
CbmCluster::GetNofDigis
Int_t GetNofDigis() const
Number of digis in cluster.
Definition: CbmCluster.h:69
CbmHadronAnalysis::fa_v1_rap_hit_p
TH2F * fa_v1_rap_hit_p
Definition: CbmHadronAnalysis.h:231
CbmHadronAnalysis::fdVLenMin
Double_t fdVLenMin
Definition: CbmHadronAnalysis.h:441
fStsHitsColl
TClonesArray * fStsHitsColl
Definition: CbmHadronAnalysis.cxx:53
CbmHadronAnalysis::fa_ptm_rap_hit_p
TH2F * fa_ptm_rap_hit_p
Definition: CbmHadronAnalysis.h:116
fTofTracks
TClonesArray * fTofTracks
Definition: CbmHadronAnalysis.cxx:51
CbmTofGeoHandler.h
CbmHadronAnalysis::fa_tm_hit
TH2F * fa_tm_hit
Definition: CbmHadronAnalysis.h:319
CbmHadronAnalysis::fa_ptm_rap_poi_pim
TH2F * fa_ptm_rap_poi_pim
Definition: CbmHadronAnalysis.h:101
nTofTracks
Int_t nTofTracks
Definition: CbmHadronAnalysis.cxx:64
CbmHadronAnalysis::fa_pMCmom_glo_p
TH2F * fa_pMCmom_glo_p
Definition: CbmHadronAnalysis.h:382
CbmHadronAnalysis::GetDY
Float_t GetDY() const
Definition: CbmHadronAnalysis.h:482
CbmHadronAnalysis::fa_delrp_b_hit
TH2F * fa_delrp_b_hit
Definition: CbmHadronAnalysis.h:147
CbmHadronAnalysis::fa_v2_rap_gen_pip
TH2F * fa_v2_rap_gen_pip
Definition: CbmHadronAnalysis.h:191
CbmHadronAnalysis::fa_drp_b_poi
TH2F * fa_drp_b_poi
Definition: CbmHadronAnalysis.h:152
CbmHadronAnalysis::fdVLenMax
Double_t fdVLenMax
Definition: CbmHadronAnalysis.h:443
CbmHadronAnalysis::fa_v1_rap_hit_t
TH2F * fa_v1_rap_hit_t
Definition: CbmHadronAnalysis.h:234
CbmEvent.h
CbmStsHit
data class for a reconstructed 3-d hit in the STS
Definition: CbmStsHit.h:31
CbmHadronAnalysis::fa_LenDismom_glo_kp
TH2F * fa_LenDismom_glo_kp
Definition: CbmHadronAnalysis.h:406
CbmHadronAnalysis::fa_v1_rap_gen_pip
TH2F * fa_v1_rap_gen_pip
Definition: CbmHadronAnalysis.h:179
CbmHadronAnalysis::fa_v2_rap_glo_pip
TH2F * fa_v2_rap_glo_pip
Definition: CbmHadronAnalysis.h:263
CbmHadronAnalysis::fa_tm_glo_kp
TH2F * fa_tm_glo_kp
Definition: CbmHadronAnalysis.h:348
CbmHadronAnalysis::fa_dzx
TH2F * fa_dzx
Definition: CbmHadronAnalysis.h:308
CbmHadronAnalysis::fa_phirp_had
TH1F * fa_phirp_had
Definition: CbmHadronAnalysis.h:171
CbmHadronAnalysis::fa_t0m_f_hit
TH1F * fa_t0m_f_hit
Definition: CbmHadronAnalysis.h:328
CbmHadronAnalysis::fa_v1_rap_gen_a
TH2F * fa_v1_rap_gen_a
Definition: CbmHadronAnalysis.h:188
CbmHadronAnalysis::fa_pv_poi
TH2F * fa_pv_poi
Definition: CbmHadronAnalysis.h:297
CbmStsDigi.h
CbmHadronAnalysis::fhTofTrkDxsel
TH1F * fhTofTrkDxsel
Definition: CbmHadronAnalysis.h:424
CbmStsTrack.h
Data class for STS tracks.
CbmHadronAnalysis::fa_mul_b_poi
TH2F * fa_mul_b_poi
Definition: CbmHadronAnalysis.h:137
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmHadronAnalysis::fa_v1_rap_glo_kp
TH2F * fa_v1_rap_glo_kp
Definition: CbmHadronAnalysis.h:253
CbmHadronAnalysis::fa_ptm_rap_hit_pip
TH2F * fa_ptm_rap_hit_pip
Definition: CbmHadronAnalysis.h:112
TrbNetState::DEBUG
@ DEBUG
CbmHadronAnalysis::fa_tm_glo_t
TH2F * fa_tm_glo_t
Definition: CbmHadronAnalysis.h:353
CbmHadronAnalysis::fa_v2_rap_hit_pim
TH2F * fa_v2_rap_hit_pim
Definition: CbmHadronAnalysis.h:240
CbmHadronAnalysis::fa_w_mom_glo_h
TH2F * fa_w_mom_glo_h
Definition: CbmHadronAnalysis.h:398
CbmHadronAnalysis::fa_t0m_hit
TH1F * fa_t0m_hit
Definition: CbmHadronAnalysis.h:323
CbmHadronAnalysis::fa_ptm_rap_poi_pip
TH2F * fa_ptm_rap_poi_pip
Definition: CbmHadronAnalysis.h:100
CbmGlobalTrack::SetLength
void SetLength(Double_t length)
Definition: CbmGlobalTrack.h:70
CbmTofTrack::GetMass
Float_t GetMass() const
Definition: CbmTofTrack.h:58
CbmHadronAnalysis::fa_w_mom_glo_pip
TH2F * fa_w_mom_glo_pip
Definition: CbmHadronAnalysis.h:390
CbmHadronAnalysis::fdDistTRD
Double_t fdDistTRD
Definition: CbmHadronAnalysis.h:444
CbmHadronAnalysis::fa_ptm_rap_sts_p
TH2F * fa_ptm_rap_sts_p
Definition: CbmHadronAnalysis.h:92
CbmHadronAnalysis::fa_ptm_rap_poi_d
TH2F * fa_ptm_rap_poi_d
Definition: CbmHadronAnalysis.h:106
CbmHadronAnalysis::fflowFile
TFile * fflowFile
Definition: CbmHadronAnalysis.h:41
CbmHadronAnalysis::fa_LenMcLenGlomom_glo
TH2F * fa_LenMcLenGlomom_glo
Definition: CbmHadronAnalysis.h:414
CbmHadronAnalysis::fa_v2_rap_glo_t
TH2F * fa_v2_rap_glo_t
Definition: CbmHadronAnalysis.h:270
CbmHadronAnalysis::CreateHistogramms
void CreateHistogramms()
Definition: CbmHadronAnalysis.cxx:853
CbmHadronAnalysis::fa_t0mn_f_hit
TH1F * fa_t0mn_f_hit
Definition: CbmHadronAnalysis.h:329
CbmHadronAnalysis::fa_ptm_rap_glo_km
TH2F * fa_ptm_rap_glo_km
Definition: CbmHadronAnalysis.h:127
CbmHadronAnalysis::fa_w_mom_glo_kp
TH2F * fa_w_mom_glo_kp
Definition: CbmHadronAnalysis.h:392
CbmHadronAnalysis::fa_tm_hitprim
TH2F * fa_tm_hitprim
Definition: CbmHadronAnalysis.h:320
CbmTofDetectorId_v12b.h
CbmHadronAnalysis::fMCEventHeader
FairMCEventHeader * fMCEventHeader
Definition: CbmHadronAnalysis.h:43
CbmHadronAnalysis::fa_ptm_rap_glo_t
TH2F * fa_ptm_rap_glo_t
Definition: CbmHadronAnalysis.h:131
CbmHadronAnalysis::fa_cdrp_b_gen
TH2F * fa_cdrp_b_gen
Definition: CbmHadronAnalysis.h:151
iCandEv
static Int_t iCandEv
Definition: CbmHadronAnalysis.cxx:6144
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmHadronAnalysis::fa_ptm_rap_sts_kp
TH2F * fa_ptm_rap_sts_kp
Definition: CbmHadronAnalysis.h:90
CbmHadronAnalysis::fa_m2mom_gloprim
TH2F * fa_m2mom_gloprim
Definition: CbmHadronAnalysis.h:364
CbmHadronAnalysis::fa_plab_sts_pbar
TH1F * fa_plab_sts_pbar
Definition: CbmHadronAnalysis.h:86
CbmHadronAnalysis::fa_ptm_rap_poi_a
TH2F * fa_ptm_rap_poi_a
Definition: CbmHadronAnalysis.h:109
CbmHadronAnalysis::fStsDigiMatchColl
TClonesArray * fStsDigiMatchColl
Definition: CbmHadronAnalysis.h:55
CbmTrack::GetHitIndex
Int_t GetHitIndex(Int_t iHit) const
Definition: CbmTrack.h:54
CbmHadronAnalysis::fa_v2_rap_glo_d
TH2F * fa_v2_rap_glo_d
Definition: CbmHadronAnalysis.h:269
CbmHadronAnalysis::fa_v2_rap_glo_h
TH2F * fa_v2_rap_glo_h
Definition: CbmHadronAnalysis.h:271
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
CbmHadronAnalysis::fa_xy_hit3
TH2F * fa_xy_hit3
Definition: CbmHadronAnalysis.h:282
CbmVertex
Definition: CbmVertex.h:26
CbmHadronAnalysis::fa_drp_b_hit
TH2F * fa_drp_b_hit
Definition: CbmHadronAnalysis.h:154
CbmHadronAnalysis::fdDistPrimLim2
Double_t fdDistPrimLim2
Definition: CbmHadronAnalysis.h:431
CbmHadronAnalysis::fa_t0mn_b_hit
TH2F * fa_t0mn_b_hit
Definition: CbmHadronAnalysis.h:326
CbmHadronAnalysis::fa_pMCmom_glo_h
TH2F * fa_pMCmom_glo_h
Definition: CbmHadronAnalysis.h:386
CbmHadronAnalysis::fa_v1_rap_poi_pbar
TH2F * fa_v1_rap_poi_pbar
Definition: CbmHadronAnalysis.h:208
CbmHadronAnalysis::fStsPointsColl
TClonesArray * fStsPointsColl
Definition: CbmHadronAnalysis.h:50
nMCTracks
Int_t nMCTracks
Definition: CbmHadronAnalysis.cxx:63
CbmTofHit::GetR
Double_t GetR() const
Definition: core/data/tof/CbmTofHit.h:94
CbmHadronAnalysis::fa_ptm_rap_glo_pbar
TH2F * fa_ptm_rap_glo_pbar
Definition: CbmHadronAnalysis.h:129
CbmHadronAnalysis::fa_tn_hit
TH1F * fa_tn_hit
Definition: CbmHadronAnalysis.h:321
CbmHadronAnalysis::fa_LenDismom_glo
TH2F * fa_LenDismom_glo
Definition: CbmHadronAnalysis.h:403
CbmHadronAnalysis::fa_v2_rap_gen_t
TH2F * fa_v2_rap_gen_t
Definition: CbmHadronAnalysis.h:198
CbmTrdHit.h
Class for hits in TRD detector.
CbmVertex::GetZ
Double_t GetZ() const
Definition: CbmVertex.h:70
CbmHadronAnalysis::fa_v1_rap_glo_t
TH2F * fa_v1_rap_glo_t
Definition: CbmHadronAnalysis.h:258
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
CbmHadronAnalysis::fa_dyx
TH2F * fa_dyx
Definition: CbmHadronAnalysis.h:305
CbmHadronAnalysis::fa_v1_rap_glo_d
TH2F * fa_v1_rap_glo_d
Definition: CbmHadronAnalysis.h:257
CbmHadronAnalysis::fa_ptm_rap_poi_imf
TH2F * fa_ptm_rap_poi_imf
Definition: CbmHadronAnalysis.h:110
CbmHadronAnalysis::fa_t0m_nf_hit
TH1F * fa_t0m_nf_hit
Definition: CbmHadronAnalysis.h:333
CbmHadronAnalysis::fa_w_mom_glo_pim
TH2F * fa_w_mom_glo_pim
Definition: CbmHadronAnalysis.h:391
CbmHadronAnalysis::fa_pMCmom_glo_pim
TH2F * fa_pMCmom_glo_pim
Definition: CbmHadronAnalysis.h:379
CbmHadronAnalysis::CbmHadronAnalysis
CbmHadronAnalysis()
Definition: CbmHadronAnalysis.cxx:77
CbmTofTrack::GetTrackIndex
Int_t GetTrackIndex() const
Definition: CbmTofTrack.h:74
CbmMCTrack::GetStartVertex
void GetStartVertex(TVector3 &vertex) const
Definition: CbmMCTrack.h:182
CbmHadronAnalysis::fa_plab_sts_p
TH1F * fa_plab_sts_p
Definition: CbmHadronAnalysis.h:85
CbmHadronAnalysis::fa_v2_rap_glo_imf
TH2F * fa_v2_rap_glo_imf
Definition: CbmHadronAnalysis.h:273
CbmHadronAnalysis::fa_tm_glo_h
TH2F * fa_tm_glo_h
Definition: CbmHadronAnalysis.h:354
CbmHadronAnalysis::fa_tm_poi
TH2F * fa_tm_poi
Definition: CbmHadronAnalysis.h:298
CbmHadronAnalysis::fa_v2_rap_gen_h
TH2F * fa_v2_rap_gen_h
Definition: CbmHadronAnalysis.h:199
CbmHadronAnalysis::fa_v2_rap_poi_d
TH2F * fa_v2_rap_poi_d
Definition: CbmHadronAnalysis.h:221
CbmHadronAnalysis::fa_v1_rap_gen_p
TH2F * fa_v1_rap_gen_p
Definition: CbmHadronAnalysis.h:183
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmHadronAnalysis::fa_v2_rap_poi_kp
TH2F * fa_v2_rap_poi_kp
Definition: CbmHadronAnalysis.h:217
nGlobTracks
Int_t nGlobTracks
Definition: CbmHadronAnalysis.cxx:66
CbmHadronAnalysis::fa_ptm_rap_glo_p
TH2F * fa_ptm_rap_glo_p
Definition: CbmHadronAnalysis.h:128
CbmHadronAnalysis::fa_xy_poi3
TH2F * fa_xy_poi3
Definition: CbmHadronAnalysis.h:278
CbmHadronAnalysis::fEvents
Int_t fEvents
Definition: CbmHadronAnalysis.h:27
CbmHadronAnalysis::fa_tm_poiprim
TH2F * fa_tm_poiprim
Definition: CbmHadronAnalysis.h:299
CbmTofCell.h
CbmHadronAnalysis::fa_v1_rap_glo_pip
TH2F * fa_v1_rap_glo_pip
Definition: CbmHadronAnalysis.h:251
CbmTofTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmTofTrack.h:61
CbmHadronAnalysis::fa_v1_rap_poi_imf
TH2F * fa_v1_rap_poi_imf
Definition: CbmHadronAnalysis.h:213
CbmTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTrack.h:61
CbmHadronAnalysis::fa_v1_rap_gen_d
TH2F * fa_v1_rap_gen_d
Definition: CbmHadronAnalysis.h:185
clight
#define clight
Definition: CbmHadronAnalysis.cxx:60
CbmHadronAnalysis::fa_v1_rap_poi_t
TH2F * fa_v1_rap_poi_t
Definition: CbmHadronAnalysis.h:210
CbmHadronAnalysis::fa_v1_rap_hit_pbar
TH2F * fa_v1_rap_hit_pbar
Definition: CbmHadronAnalysis.h:232
CbmTofHit::GetFlag
Int_t GetFlag() const
Definition: core/data/tof/CbmTofHit.h:91
CbmHadronAnalysis::fa_v2_rap_gen_d
TH2F * fa_v2_rap_gen_d
Definition: CbmHadronAnalysis.h:197
fTofHitsColl
TClonesArray * fTofHitsColl
Definition: CbmHadronAnalysis.cxx:52
CbmHadronAnalysis::fa_cdelrp_b_glo
TH2F * fa_cdelrp_b_glo
Definition: CbmHadronAnalysis.h:164
CbmHadronAnalysis::fhwminlen
TH2F * fhwminlen
Definition: CbmHadronAnalysis.h:419
fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmHadronAnalysis.cxx:49
CbmHadronAnalysis::fa_ptm_rap_hit_d
TH2F * fa_ptm_rap_hit_d
Definition: CbmHadronAnalysis.h:118
CbmHadronAnalysis::fa_w_mom_glo_t
TH2F * fa_w_mom_glo_t
Definition: CbmHadronAnalysis.h:397
CbmHadronAnalysis::fTofDigiMatchPointsColl
TClonesArray * fTofDigiMatchPointsColl
Definition: CbmHadronAnalysis.h:62
CbmMCTrack::GetPt
Double_t GetPt() const
Definition: CbmMCTrack.h:99
CbmHadronAnalysis::fa_tm_glo_d
TH2F * fa_tm_glo_d
Definition: CbmHadronAnalysis.h:352
CbmHadronAnalysis::fa_t0m_f_b_hit
TH2F * fa_t0m_f_b_hit
Definition: CbmHadronAnalysis.h:330
CbmHadronAnalysis::fa_ptm_rap_sts_a
TH2F * fa_ptm_rap_sts_a
Definition: CbmHadronAnalysis.h:97
CbmHadronAnalysis::fa_ptm_rap_hit_km
TH2F * fa_ptm_rap_hit_km
Definition: CbmHadronAnalysis.h:115
CbmHadronAnalysis::fwxy2
Float_t fwxy2
Definition: CbmHadronAnalysis.h:35
CbmHadronAnalysis::fa_delrp_b_gen
TH2F * fa_delrp_b_gen
Definition: CbmHadronAnalysis.h:145
CbmHadronAnalysis::fa_ptm_rap_sts_pim
TH2F * fa_ptm_rap_sts_pim
Definition: CbmHadronAnalysis.h:89
CbmMCDataManager
Task class creating and managing CbmMCDataArray objects.
Definition: CbmMCDataManager.h:27
CbmHadronAnalysis::fFlowFileName
TString fFlowFileName
Definition: CbmHadronAnalysis.h:40
CbmEvent::GetNofData
Int_t GetNofData() const
Definition: CbmEvent.h:90
CbmHadronAnalysis::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmHadronAnalysis.h:63
CbmHadronAnalysis::fa_phirps_hit
TH1F * fa_phirps_hit
Definition: CbmHadronAnalysis.h:175
CbmStsKFTrackFitter::Init
void Init()
Definition: CbmStsKFTrackFitter.cxx:29
CbmHadronAnalysis::fa_v2_rap_poi_km
TH2F * fa_v2_rap_poi_km
Definition: CbmHadronAnalysis.h:218
CbmHadronAnalysis::fa_xy_poi1
TH2F * fa_xy_poi1
Definition: CbmHadronAnalysis.h:276
CbmHadronAnalysis::fa_v2_rap_hit_pbar
TH2F * fa_v2_rap_hit_pbar
Definition: CbmHadronAnalysis.h:244
CbmHadronAnalysis::fa_tm_glomis
TH2F * fa_tm_glomis
Definition: CbmHadronAnalysis.h:358
CbmHadronAnalysis::fdTRDHmulMin
Double_t fdTRDHmulMin
Definition: CbmHadronAnalysis.h:445
CbmHadronAnalysis::fStsTracks
TClonesArray * fStsTracks
Definition: CbmHadronAnalysis.h:53
CbmHadronAnalysis::fa_hit_ch
TH1F * fa_hit_ch
Definition: CbmHadronAnalysis.h:312
CbmHit::SetTime
void SetTime(Double_t time)
Definition: CbmHit.h:84
CbmHadronAnalysis::fa_ptm_rap_sts_t
TH2F * fa_ptm_rap_sts_t
Definition: CbmHadronAnalysis.h:95
CbmHadronAnalysis::fa_ptm_rap_glo_imf
TH2F * fa_ptm_rap_glo_imf
Definition: CbmHadronAnalysis.h:134
CbmHadronAnalysis::fa_xy_glo_pip
TH2F * fa_xy_glo_pip
Definition: CbmHadronAnalysis.h:285
CbmHadronAnalysis::fa_ptm_rap_poi_kp
TH2F * fa_ptm_rap_poi_kp
Definition: CbmHadronAnalysis.h:102
CbmHadronAnalysis::fa_ptm_rap_gen_km
TH2F * fa_ptm_rap_gen_km
Definition: CbmHadronAnalysis.h:72
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmMCTrack::GetRapidity
Double_t GetRapidity() const
Definition: CbmMCTrack.cxx:177
CbmHadronAnalysis::ReadPdfFile
InitStatus ReadPdfFile()
Definition: CbmHadronAnalysis.cxx:3247
CbmHadronAnalysis::fa_drp_b_gen
TH2F * fa_drp_b_gen
Definition: CbmHadronAnalysis.h:150
CbmHadronAnalysis::fa_m2mom_glo_kp
TH2F * fa_m2mom_glo_kp
Definition: CbmHadronAnalysis.h:368
CbmHadronAnalysis::fHadrons
TClonesArray * fHadrons
Definition: CbmHadronAnalysis.h:64
NMASS
Int_t NMASS
Definition: CbmHadronAnalysis.cxx:67
CbmTofTrack::GetDistance
Double_t GetDistance() const
Definition: CbmTofTrack.h:89
nStsHits
Int_t nStsHits
Definition: CbmHadronAnalysis.cxx:65
CbmHadronAnalysis::fa_v2_rap_glo_km
TH2F * fa_v2_rap_glo_km
Definition: CbmHadronAnalysis.h:266
CbmHadronAnalysis::fa_v2_rap_hit_km
TH2F * fa_v2_rap_hit_km
Definition: CbmHadronAnalysis.h:242
CbmHadronAnalysis::fa_v1_rap_gen_pim
TH2F * fa_v1_rap_gen_pim
Definition: CbmHadronAnalysis.h:180
CbmHadronAnalysis::fa_TofTrackMul
TH1F * fa_TofTrackMul
Definition: CbmHadronAnalysis.h:339
CbmHadronAnalysis::fa_v1_rap_gen_imf
TH2F * fa_v1_rap_gen_imf
Definition: CbmHadronAnalysis.h:189
CbmHadronAnalysis::fa_w_mom_glo
TH2F * fa_w_mom_glo
Definition: CbmHadronAnalysis.h:389
CbmGlobalTrack::SetParamFirst
void SetParamFirst(const FairTrackParam *parFirst)
Definition: CbmGlobalTrack.h:59
CbmHadronAnalysis::fa_ptm_rap_hit_t
TH2F * fa_ptm_rap_hit_t
Definition: CbmHadronAnalysis.h:119
CbmStsPoint.h
CbmHadronAnalysis::fa_ptm_rap_gen_h
TH2F * fa_ptm_rap_gen_h
Definition: CbmHadronAnalysis.h:77
CbmMCTrack.h
CbmHadronAnalysis::fa_LenDismom_glo_pbar
TH2F * fa_LenDismom_glo_pbar
Definition: CbmHadronAnalysis.h:409
CbmHadronAnalysis::fa_drp_b_glo
TH2F * fa_drp_b_glo
Definition: CbmHadronAnalysis.h:156
CbmHadronAnalysis::fa_v1_rap_glo_km
TH2F * fa_v1_rap_glo_km
Definition: CbmHadronAnalysis.h:254
CbmHadronAnalysis::fa_v1_rap_gen_h
TH2F * fa_v1_rap_gen_h
Definition: CbmHadronAnalysis.h:187
CbmStsHit::GetBackClusterId
Int_t GetBackClusterId() const
Definition: CbmStsHit.h:69
CbmHadronAnalysis::fa_v2_rap_hit_kp
TH2F * fa_v2_rap_hit_kp
Definition: CbmHadronAnalysis.h:241
CbmHadronAnalysis::fa_ptm_rap_gen_pip
TH2F * fa_ptm_rap_gen_pip
Definition: CbmHadronAnalysis.h:69
CbmDigiManager.h
CbmHadronAnalysis::fa_tm_glo_p
TH2F * fa_tm_glo_p
Definition: CbmHadronAnalysis.h:350
CbmHadronAnalysis::fa_phirp_glo
TH1F * fa_phirp_glo
Definition: CbmHadronAnalysis.h:170
CbmHadronAnalysis::fa_pMCmom_glo_a
TH2F * fa_pMCmom_glo_a
Definition: CbmHadronAnalysis.h:387
CbmHadronAnalysis::fa_t0m_nf_b_hit
TH2F * fa_t0m_nf_b_hit
Definition: CbmHadronAnalysis.h:335
CbmHadronAnalysis::fTofPoints
TClonesArray * fTofPoints
Definition: CbmHadronAnalysis.h:58
CbmHadronAnalysis::fa_xy_glo_pim
TH2F * fa_xy_glo_pim
Definition: CbmHadronAnalysis.h:286
CbmHadronAnalysis::fa_dyy
TH2F * fa_dyy
Definition: CbmHadronAnalysis.h:306
CbmHadronAnalysis::fhTofTrkDy
TH1F * fhTofTrkDy
Definition: CbmHadronAnalysis.h:423
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmHadronAnalysis::fa_xy_hit1
TH2F * fa_xy_hit1
Definition: CbmHadronAnalysis.h:280
nTofPoints
Int_t nTofPoints
Definition: CbmHadronAnalysis.cxx:63
CbmHadronAnalysis::fa_ptm_rap_hit_pim
TH2F * fa_ptm_rap_hit_pim
Definition: CbmHadronAnalysis.h:113
CbmTofPoint.h
CbmHadronAnalysis::fa_ptm_rap_poi_km
TH2F * fa_ptm_rap_poi_km
Definition: CbmHadronAnalysis.h:103
CbmHadronAnalysis::fa_v2_rap_poi_pbar
TH2F * fa_v2_rap_poi_pbar
Definition: CbmHadronAnalysis.h:220
CbmHadronAnalysis::fa_dtof_hit
TH1F * fa_dtof_hit
Definition: CbmHadronAnalysis.h:316
CbmStsKFTrackFitter::FitToVertex
Double_t FitToVertex(CbmStsTrack *track, CbmVertex *vtx, FairTrackParam *v_track)
Definition: CbmStsKFTrackFitter.cxx:200
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
CbmHadronAnalysis::fa_v1_rap_hit_pim
TH2F * fa_v1_rap_hit_pim
Definition: CbmHadronAnalysis.h:228
CbmHadronAnalysis::fa_tm_glovtxb
TH2F * fa_tm_glovtxb
Definition: CbmHadronAnalysis.h:359
CbmHadronAnalysis::fa_pv_hit
TH2F * fa_pv_hit
Definition: CbmHadronAnalysis.h:318
CbmHadronAnalysis::fa_v2_rap_glo_kp
TH2F * fa_v2_rap_glo_kp
Definition: CbmHadronAnalysis.h:265
CbmHadronAnalysis::fa_tof_hitprim
TH1F * fa_tof_hitprim
Definition: CbmHadronAnalysis.h:317
CbmHadronAnalysis::fa_ptm_rap_hit_h
TH2F * fa_ptm_rap_hit_h
Definition: CbmHadronAnalysis.h:120
CbmTrdPoint.h
fEventsColl
TClonesArray * fEventsColl
Definition: CbmHadronAnalysis.cxx:50
CbmHadronAnalysis::fa_VtxB
TH1F * fa_VtxB
Definition: CbmHadronAnalysis.h:340
CbmEvent
Class characterising one event by a collection of links (indices) to data objects,...
Definition: CbmEvent.h:30
CbmHadronAnalysis::fa_v1_rap_gen_km
TH2F * fa_v1_rap_gen_km
Definition: CbmHadronAnalysis.h:182
CbmHadronAnalysis::fStsDigis
TClonesArray * fStsDigis
Definition: CbmHadronAnalysis.h:54
CbmHadronAnalysis::GetBeamMomentum
Float_t GetBeamMomentum() const
Definition: CbmHadronAnalysis.h:480
CbmHadronAnalysis::fa_v1_rap_hit_pip
TH2F * fa_v1_rap_hit_pip
Definition: CbmHadronAnalysis.h:227
CbmHadronAnalysis::fa_LenDismom_glo_p
TH2F * fa_LenDismom_glo_p
Definition: CbmHadronAnalysis.h:408
CbmHadronAnalysis::fa_v1_rap_hit_km
TH2F * fa_v1_rap_hit_km
Definition: CbmHadronAnalysis.h:230
CbmHadronAnalysis::fStsPoints
CbmMCDataArray * fStsPoints
Definition: CbmHadronAnalysis.h:48
CbmHadronAnalysis::fa_ptm_rap_glo_pim
TH2F * fa_ptm_rap_glo_pim
Definition: CbmHadronAnalysis.h:125
CbmHadronAnalysis::fa_ptm_rap_gen_kp
TH2F * fa_ptm_rap_gen_kp
Definition: CbmHadronAnalysis.h:71
CbmHadronAnalysis::fhwdist
TH2F * fhwdist
Definition: CbmHadronAnalysis.h:417
CbmTrack::GetPidHypo
Int_t GetPidHypo() const
Definition: CbmTrack.h:56
CbmHadronAnalysis::fa_ptm_rap_poi_p
TH2F * fa_ptm_rap_poi_p
Definition: CbmHadronAnalysis.h:104
CbmHadronAnalysis::fMCTracksColl
TClonesArray * fMCTracksColl
Definition: CbmHadronAnalysis.h:49
CbmGlobalTrack::SetTofHitIndex
void SetTofHitIndex(Int_t iTofHit)
Definition: CbmGlobalTrack.h:58
CbmTofPoint
Geometric intersection of a MC track with a TOFb detector.
Definition: CbmTofPoint.h:40
CbmHadronAnalysis::fa_v2_rap_glo_pbar
TH2F * fa_v2_rap_glo_pbar
Definition: CbmHadronAnalysis.h:268
CbmHadronAnalysis::fa_v2_rap_poi_pim
TH2F * fa_v2_rap_poi_pim
Definition: CbmHadronAnalysis.h:216
CbmHadronAnalysis::fa_xy_glo_d
TH2F * fa_xy_glo_d
Definition: CbmHadronAnalysis.h:291
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmHadronAnalysis::fa_v2_rap_gen_a
TH2F * fa_v2_rap_gen_a
Definition: CbmHadronAnalysis.h:200
MinWallDist
#define MinWallDist
Definition: CbmHadronAnalysis.cxx:61
CbmHadronAnalysis::fhwdelp
TH2F * fhwdelp
Definition: CbmHadronAnalysis.h:420
CbmHadronAnalysis::fa_v1_rap_poi_km
TH2F * fa_v1_rap_poi_km
Definition: CbmHadronAnalysis.h:206
CbmHadronAnalysis::fa_LenDismom_glo_pim
TH2F * fa_LenDismom_glo_pim
Definition: CbmHadronAnalysis.h:405
CbmGlobalTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmGlobalTrack.h:42
CbmHadronAnalysis::fa_v2_rap_hit_d
TH2F * fa_v2_rap_hit_d
Definition: CbmHadronAnalysis.h:245
CbmCluster.h
Base class for cluster objects.
CbmHadronAnalysis::fa_mul_b_gen
TH2F * fa_mul_b_gen
Definition: CbmHadronAnalysis.h:136
CbmGlobalTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmGlobalTrack.h:43
CbmHadronAnalysis::fa_phirp_b_gen
TH2F * fa_phirp_b_gen
Definition: CbmHadronAnalysis.h:142
CbmHadronAnalysis::fPdfFileName
TString fPdfFileName
Definition: CbmHadronAnalysis.h:39
CbmHadronAnalysis::fa_w_mom_glo_p
TH2F * fa_w_mom_glo_p
Definition: CbmHadronAnalysis.h:394
CbmHadronAnalysis::fa_ptm_rap_hit_imf
TH2F * fa_ptm_rap_hit_imf
Definition: CbmHadronAnalysis.h:122
CbmHadronAnalysis::fa_v1_rap_gen_kp
TH2F * fa_v1_rap_gen_kp
Definition: CbmHadronAnalysis.h:181
CbmStsCluster.h
Data class for STS clusters.
CbmHadronAnalysis::fa_ptm_rap_gen_a
TH2F * fa_ptm_rap_gen_a
Definition: CbmHadronAnalysis.h:78
CbmHadronAnalysis::fa_v2_rap_hit_p
TH2F * fa_v2_rap_hit_p
Definition: CbmHadronAnalysis.h:243
CbmHadronAnalysis::fa_t0mn_nf_b_hit
TH2F * fa_t0mn_nf_b_hit
Definition: CbmHadronAnalysis.h:336
CbmMCTrack::GetEnergy
Double_t GetEnergy() const
Definition: CbmMCTrack.h:165
CbmHadronAnalysis::fa_cdelrp_b_gen
TH2F * fa_cdelrp_b_gen
Definition: CbmHadronAnalysis.h:161
CbmHadronAnalysis::ReadFlowFile
InitStatus ReadFlowFile()
Definition: CbmHadronAnalysis.cxx:3260
ClassImp
ClassImp(CbmHadronAnalysis)
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmHadronAnalysis::fa_v2_rap_hit_pip
TH2F * fa_v2_rap_hit_pip
Definition: CbmHadronAnalysis.h:239
CbmHadronAnalysis::fa_cdelrp_b_had
TH2F * fa_cdelrp_b_had
Definition: CbmHadronAnalysis.h:165
CbmHadronAnalysis::fa_ptm_rap_sts_d
TH2F * fa_ptm_rap_sts_d
Definition: CbmHadronAnalysis.h:94
CbmHadronAnalysis::fa_mul_b_hit
TH2F * fa_mul_b_hit
Definition: CbmHadronAnalysis.h:138
CbmHadronAnalysis::fa_LenDismom_glo_h
TH2F * fa_LenDismom_glo_h
Definition: CbmHadronAnalysis.h:412
CbmHadronAnalysis::fa_dzz
TH2F * fa_dzz
Definition: CbmHadronAnalysis.h:310
CbmHadronAnalysis::fa_ptm_rap_glo_kp
TH2F * fa_ptm_rap_glo_kp
Definition: CbmHadronAnalysis.h:126
CbmHadronAnalysis::fa_v2_rap_gen_pbar
TH2F * fa_v2_rap_gen_pbar
Definition: CbmHadronAnalysis.h:196
CbmHadronAnalysis::GetFlowMinPtm
Float_t GetFlowMinPtm() const
Definition: CbmHadronAnalysis.h:483
CbmHadronAnalysis::fa_v2_rap_poi_t
TH2F * fa_v2_rap_poi_t
Definition: CbmHadronAnalysis.h:222
CbmHadronAnalysis::bRecSec
Bool_t bRecSec
Definition: CbmHadronAnalysis.h:427
CbmCluster::GetDigi
Int_t GetDigi(Int_t index) const
Get digi at position index.
Definition: CbmCluster.h:76
CbmHadronAnalysis::fa_cdrp_b_hit
TH2F * fa_cdrp_b_hit
Definition: CbmHadronAnalysis.h:155
CbmHadronAnalysis::fa_v1_rap_hit_imf
TH2F * fa_v1_rap_hit_imf
Definition: CbmHadronAnalysis.h:237
CbmHadronAnalysis::fa_xy_glo_p
TH2F * fa_xy_glo_p
Definition: CbmHadronAnalysis.h:289
CbmHadronAnalysis::fa_plab_sts_kp
TH1F * fa_plab_sts_kp
Definition: CbmHadronAnalysis.h:83
CbmHadronAnalysis::fa_v1_rap_hit_a
TH2F * fa_v1_rap_hit_a
Definition: CbmHadronAnalysis.h:236
CbmHadronAnalysis::fa_v1_rap_poi_kp
TH2F * fa_v1_rap_poi_kp
Definition: CbmHadronAnalysis.h:205
CbmKFVertex.h
CbmHadronAnalysis::fa_v2_rap_hit_a
TH2F * fa_v2_rap_hit_a
Definition: CbmHadronAnalysis.h:248
CbmHadronAnalysis::fa_v2_rap_gen_imf
TH2F * fa_v2_rap_gen_imf
Definition: CbmHadronAnalysis.h:201
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
CbmHadronAnalysis::fStsClusters
TClonesArray * fStsClusters
Definition: CbmHadronAnalysis.h:52
CbmHadronAnalysis::fa_w_mom_glo_km
TH2F * fa_w_mom_glo_km
Definition: CbmHadronAnalysis.h:393
CbmHadronAnalysis::fa_xy_glo_a
TH2F * fa_xy_glo_a
Definition: CbmHadronAnalysis.h:294
CbmHadronAnalysis::fa_mul_b_had
TH2F * fa_mul_b_had
Definition: CbmHadronAnalysis.h:140
CbmHadronAnalysis::fa_phirps_poi
TH1F * fa_phirps_poi
Definition: CbmHadronAnalysis.h:174
CbmHadronAnalysis::fa_LenDismom_glo_km
TH2F * fa_LenDismom_glo_km
Definition: CbmHadronAnalysis.h:407
CbmHadronAnalysis::fa_v1_rap_hit_kp
TH2F * fa_v1_rap_hit_kp
Definition: CbmHadronAnalysis.h:229
CbmHadronAnalysis::fa_m2mom_glo
TH2F * fa_m2mom_glo
Definition: CbmHadronAnalysis.h:362
CbmHadronAnalysis::fa_ptm_rap_glo_h
TH2F * fa_ptm_rap_glo_h
Definition: CbmHadronAnalysis.h:132
CbmHadronAnalysis::fa_cdelrp_b_hit
TH2F * fa_cdelrp_b_hit
Definition: CbmHadronAnalysis.h:163
CbmHadronAnalysis::WriteHistogramms
void WriteHistogramms()
Definition: CbmHadronAnalysis.cxx:6125
CbmHadronAnalysis::fa_v1_rap_poi_p
TH2F * fa_v1_rap_poi_p
Definition: CbmHadronAnalysis.h:207
CbmHadronAnalysis::fa_xy_poi2
TH2F * fa_xy_poi2
Definition: CbmHadronAnalysis.h:277
CbmStsKFTrackFitter.h
refMass
Float_t refMass[3]
Definition: CbmHadronAnalysis.cxx:68
CbmMCTrack::GetPz
Double_t GetPz() const
Definition: CbmMCTrack.h:74
CbmHadronAnalysis::fa_drp_b_had
TH2F * fa_drp_b_had
Definition: CbmHadronAnalysis.h:158
CbmHadronAnalysis::fa_t0_hit
TH1F * fa_t0_hit
Definition: CbmHadronAnalysis.h:322
CbmHadronAnalysis::fTrackFitter
CbmStsKFTrackFitter fTrackFitter
Definition: CbmHadronAnalysis.h:67
CbmHadronAnalysis::fa_v1_rap_gen_t
TH2F * fa_v1_rap_gen_t
Definition: CbmHadronAnalysis.h:186
CbmTofTrack
Provides information on attaching a TofHit to a GlobalTrack.
Definition: CbmTofTrack.h:20
CbmHadronAnalysis::ReconstructSecondaries
void ReconstructSecondaries()
Definition: CbmHadronAnalysis.cxx:6145
CbmHadronAnalysis::fa_v2_rap_poi_imf
TH2F * fa_v2_rap_poi_imf
Definition: CbmHadronAnalysis.h:225
CbmHadronAnalysis::GetBSelMin
Float_t GetBSelMin() const
Definition: CbmHadronAnalysis.h:484
CbmHadronAnalysis::fa_plab_sts_pip
TH1F * fa_plab_sts_pip
Definition: CbmHadronAnalysis.h:81
CbmHadronAnalysis::fa_v1_rap_hit_h
TH2F * fa_v1_rap_hit_h
Definition: CbmHadronAnalysis.h:235
CbmHadronAnalysis::fa_t0m_b_hit
TH2F * fa_t0m_b_hit
Definition: CbmHadronAnalysis.h:325
CbmHadronAnalysis::fa_v2_rap_glo_pim
TH2F * fa_v2_rap_glo_pim
Definition: CbmHadronAnalysis.h:264
CbmStsHit.h
Data class for a reconstructed hit in the STS.
CbmHadronAnalysis::fa_ptm_rap_glo_a
TH2F * fa_ptm_rap_glo_a
Definition: CbmHadronAnalysis.h:133
CbmHadronAnalysis::fa_pMCmom_glo_t
TH2F * fa_pMCmom_glo_t
Definition: CbmHadronAnalysis.h:385
CbmStsTrack::GetNofStsHits
Int_t GetNofStsHits() const
Definition: CbmStsTrack.h:90
CbmHadronAnalysis::fa_xy_glo_h
TH2F * fa_xy_glo_h
Definition: CbmHadronAnalysis.h:293
CbmHadronAnalysis::fdOpAngMin
Double_t fdOpAngMin
Definition: CbmHadronAnalysis.h:437