8 #include "TClonesArray.h"
38 #include "CbmTofHit.h"
44 #include "FairLogger.h"
45 #include "FairMCEventHeader.h"
46 #include "FairMCPoint.h"
47 #include "FairRootManager.h"
57 #define M2PI 0.019479835
58 #define M2KA 0.24371698
59 #define M2PROT 0.88035435
60 #define clight 29.9792
61 #define MinWallDist 550.
68 Float_t
refMass[3] = {0.139, 0.494, 0.938};
78 : FairTask(
"HadronAnalysis")
92 , fMCEventHeader(NULL)
98 , fStsPointsColl(NULL)
103 , fStsDigiMatchColl(NULL)
109 , fTofDigiMatchColl(NULL)
110 , fTofDigiMatchPointsColl(NULL)
111 , fGlobalTracks(NULL)
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)
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)
189 , fa_cdrp_b_gen(NULL)
191 , fa_cdrp_b_poi(NULL)
193 , fa_cdrp_b_hit(NULL)
195 , fa_cdrp_b_glo(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)
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)
308 , fa_xy_glo_pip(NULL)
309 , fa_xy_glo_pim(NULL)
313 , fa_xy_glo_pbar(NULL)
320 , fa_tm_poiprim(NULL)
334 , fa_tof_hitprim(NULL)
337 , fa_tm_hitprim(NULL)
343 , fa_t0mn_b_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)
354 , fa_chi2_mom_glo(NULL)
355 , fa_chi2_mom_gloprim(NULL)
356 , fa_len_mom_glo(NULL)
359 , fa_tm_glo_pip(NULL)
360 , fa_tm_glo_pim(NULL)
364 , fa_tm_glo_pbar(NULL)
369 , fa_tm_gloprim(NULL)
371 , fa_tm_glovtxb(NULL)
372 , fa_tm_gloprimvtxb(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)
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)
425 , fhwmindelmass(NULL)
430 , fhTofTrkDxsel(NULL)
431 , fhTofTrkDysel(NULL)
455 cout <<
"CbmHadronAnalysis: Task started " << endl;
461 : FairTask(name, verbose)
475 , fMCEventHeader(NULL)
480 , fMCTracksColl(NULL)
481 , fStsPointsColl(NULL)
486 , fStsDigiMatchColl(NULL)
492 , fTofDigiMatchColl(NULL)
493 , fTofDigiMatchPointsColl(NULL)
494 , fGlobalTracks(NULL)
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)
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)
572 , fa_cdrp_b_gen(NULL)
574 , fa_cdrp_b_poi(NULL)
576 , fa_cdrp_b_hit(NULL)
578 , fa_cdrp_b_glo(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)
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)
691 , fa_xy_glo_pip(NULL)
692 , fa_xy_glo_pim(NULL)
696 , fa_xy_glo_pbar(NULL)
703 , fa_tm_poiprim(NULL)
717 , fa_tof_hitprim(NULL)
720 , fa_tm_hitprim(NULL)
726 , fa_t0mn_b_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)
737 , fa_chi2_mom_glo(NULL)
738 , fa_chi2_mom_gloprim(NULL)
739 , fa_len_mom_glo(NULL)
742 , fa_tm_glo_pip(NULL)
743 , fa_tm_glo_pim(NULL)
747 , fa_tm_glo_pbar(NULL)
752 , fa_tm_gloprim(NULL)
754 , fa_tm_glovtxb(NULL)
755 , fa_tm_gloprimvtxb(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)
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)
808 , fhwmindelmass(NULL)
813 , fhTofTrkDxsel(NULL)
814 , fhTofTrkDysel(NULL)
858 Float_t ptmmax = 2.5;
865 "MCTrack-gen pi-plus; y; p_{T}/m",
873 "MCTrack-gen pi-minus;y; p_{T}/m",
881 "MCTrack-gen k-plus; y; p_{T}/m",
889 "MCTrack-gen k-minus; y; p_{T}/m",
897 "MCTrack-gen proton; y; p_{T}/m",
905 "MCTrack-gen antiproton;y;p_{T}/m",
913 "MCTrack-gen deuteron;y; p_{T}/m",
921 "MCTrack-gen triton; y; p_{T}/m",
929 "MCTrack-gen 3he; y; p_{T}/m",
937 "MCTrack-gen alpha; y; p_{T}/m",
945 "MCTrack-gen imf; y; p_{T}/m",
953 Float_t v1_nbx = 20.;
954 Float_t v1_nby = 20.;
958 "MCTrack-gen pi-plus; y; v_{1}",
966 "MCTrack-gen pi-minus;y; v_{1}",
974 "MCTrack-gen k-plus; y; v_{1}",
982 "MCTrack-gen k-minus; y; v_{1}",
990 "MCTrack-gen proton; y; v_{1}",
998 "MCTrack-gen antiproton;y; v_{1}",
1006 "MCTrack-gen deuteron;y; v_{1}",
1014 "MCTrack-gen triton; y; v_{1}",
1022 "MCTrack-gen 3he; y; v_{1}",
1030 "MCTrack-gen alpha; y; v_{1}",
1038 "MCTrack-gen imf; y; v_{1}",
1047 "MCTrack-gen pi-plus; y; v_{2}",
1055 "MCTrack-gen pi-minus;y; v_{2}",
1063 "MCTrack-gen k-plus; y; v_{2}",
1071 "MCTrack-gen k-minus; y; v_{2}",
1079 "MCTrack-gen proton; y; v_{2}",
1087 "MCTrack-gen antiproton;y; v_{2}",
1095 "MCTrack-gen deuteron;y; v_{2}",
1103 "MCTrack-gen triton; y; v_{2}",
1111 "MCTrack-gen 3he; y; v_{2}",
1119 "MCTrack-gen alpha; y; v_{2}",
1127 "MCTrack-gen imf; y; v_{2}",
1138 "MCTrack-poi pi-plus; y; p_{T}/m",
1146 "MCTrack-poi pi-minus;y; p_{T}/m",
1154 "MCTrack-poi k-plus; y; p_{T}/m",
1162 "MCTrack-poi k-minus; y; p_{T}/m",
1170 "MCTrack-poi proton; y; p_{T}/m",
1178 "MCTrack-poi antiproton;y;p_{T}/m",
1186 "MCTrack-poi deuteron;y; p_{T}/m",
1194 "MCTrack-poi triton; y; p_{T}/m",
1202 "MCTrack-poi 3he; y; p_{T}/m",
1210 "MCTrack-poi alpha; y; p_{T}/m",
1218 "MCTrack-poi imf; y; p_{T}/m",
1227 "MCTrack-poi pi-plus; y; v_{1}",
1235 "MCTrack-poi pi-minus;y; v_{1}",
1243 "MCTrack-poi k-plus; y; v_{1}",
1251 "MCTrack-poi k-minus; y; v_{1}",
1259 "MCTrack-poi proton; y; v_{1}",
1267 "MCTrack-poi antiproton;y; v_{1}",
1275 "MCTrack-poi deuteron;y; v_{1}",
1283 "MCTrack-poi triton; y; v_{1}",
1291 "MCTrack-poi 3he; y; v_{1}",
1299 "MCTrack-poi alpha; y; v_{1}",
1307 "MCTrack-poi imf; y; v_{1}",
1316 "MCTrack-poi pi-plus; y; v_{2}",
1324 "MCTrack-poi pi-minus;y; v_{2}",
1332 "MCTrack-poi k-plus; y; v_{2}",
1340 "MCTrack-poi k-minus; y; v_{2}",
1348 "MCTrack-poi proton; y; v_{2}",
1356 "MCTrack-poi antiproton;y; v_{2}",
1364 "MCTrack-poi deuteron;y; v_{2}",
1372 "MCTrack-poi triton; y; v_{2}",
1380 "MCTrack-poi 3he; y; v_{2}",
1388 "MCTrack-poi alpha; y; v_{2}",
1396 "MCTrack-poi imf; y; v_{2}",
1407 "MCTrack-hit pi-plus; y; p_{T}/m",
1415 "MCTrack-hit pi-minus;y; p_{T}/m",
1423 "MCTrack-hit k-plus; y; p_{T}/m",
1431 "MCTrack-hit k-minus; y; p_{T}/m",
1439 "MCTrack-hit proton; y; p_{T}/m",
1447 "MCTrack-hit antiproton;y;p_{T}/m",
1455 "MCTrack-hit deuteron;y; p_{T}/m",
1463 "MCTrack-hit triton; y; p_{T}/m",
1471 "MCTrack-hit 3he; y; p_{T}/m",
1479 "MCTrack-hit alpha; y; p_{T}/m",
1487 "MCTrack-hit imf; y; p_{T}/m",
1496 "MCTrack-hit pi-plus; y; v_{1}",
1504 "MCTrack-hit pi-minus;y; v_{1}",
1512 "MCTrack-hit k-plus; y; v_{1}",
1520 "MCTrack-hit k-minus; y; v_{1}",
1528 "MCTrack-hit proton; y; v_{1}",
1536 "MCTrack-hit antiproton;y; v_{1}",
1544 "MCTrack-hit deuteron;y; v_{1}",
1552 "MCTrack-hit triton; y; v_{1}",
1560 "MCTrack-hit 3he; y; v_{1}",
1568 "MCTrack-hit alpha; y; v_{1}",
1576 "MCTrack-hit imf; y; v_{1}",
1585 "MCTrack-hit pi-plus; y; v_{2}",
1593 "MCTrack-hit pi-minus;y; v_{2}",
1601 "MCTrack-hit k-plus; y; v_{2}",
1609 "MCTrack-hit k-minus; y; v_{2}",
1617 "MCTrack-hit proton; y; v_{2}",
1625 "MCTrack-hit antiproton;y; v_{2}",
1633 "MCTrack-hit deuteron;y; v_{2}",
1641 "MCTrack-hit triton; y; v_{2}",
1649 "MCTrack-hit 3he; y; v_{2}",
1657 "MCTrack-hit alpha; y; v_{2}",
1665 "MCTrack-hit imf; y; v_{2}",
1676 "plab_sts_pip",
"MCTrack-sts pi-plus; p_{Lab}(GeV/c)", 100, 0., 10.);
1678 "plab_sts_pim",
"MCTrack-sts pi-minus; p_{Lab}(GeV/c)", 100, 0., 10.);
1680 new TH1F(
"plab_sts_kp",
"MCTrack-sts k-plus; p_{Lab}(GeV/c)", 100, 0., 10.);
1682 "plab_sts_km",
"MCTrack-sts k-minus; p_{Lab}(GeV/c)", 100, 0., 10.);
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.);
1689 "MCTrack-sts pi-plus; y; p_{T}/m",
1697 "MCTrack-sts pi-minus;y; p_{T}/m",
1705 "MCTrack-sts k-plus; y; p_{T}/m",
1713 "MCTrack-sts k-minus; y; p_{T}/m",
1721 "MCTrack-sts proton; y; p_{T}/m",
1729 "MCTrack-sts antiproton;y;p_{T}/m",
1737 "MCTrack-sts deuteron;y; p_{T}/m",
1745 "MCTrack-sts triton; y; p_{T}/m",
1753 "MCTrack-sts 3he; y; p_{T}/m",
1761 "MCTrack-sts alpha; y; p_{T}/m",
1769 "MCTrack-sts imf; y; p_{T}/m",
1778 "MCTrack-glo pi-plus; y; p_{T}/m",
1786 "MCTrack-glo pi-minus;y; p_{T}/m",
1794 "MCTrack-glo k-plus; y; p_{T}/m",
1802 "MCTrack-glo k-minus; y; p_{T}/m",
1810 "MCTrack-glo proton; y; p_{T}/m",
1818 "MCTrack-glo antiproton;y;p_{T}/m",
1826 "MCTrack-glo deuteron;y; p_{T}/m",
1834 "MCTrack-glo triton; y; p_{T}/m",
1842 "MCTrack-glo 3he; y; p_{T}/m",
1850 "MCTrack-glo alpha; y; p_{T}/m",
1858 "MCTrack-glo imf; y; p_{T}/m",
1867 "MCTrack-glo pi-plus; y; v_{1}",
1875 "MCTrack-glo pi-minus;y; v_{1}",
1883 "MCTrack-glo k-plus; y; v_{1}",
1891 "MCTrack-glo k-minus; y; v_{1}",
1899 "MCTrack-glo proton; y; v_{1}",
1907 "MCTrack-glo antiproton;y; v_{1}",
1915 "MCTrack-glo deuteron;y; v_{1}",
1923 "MCTrack-glo triton; y; v_{1}",
1931 "MCTrack-glo 3he; y; v_{1}",
1939 "MCTrack-glo alpha; y; v_{1}",
1947 "MCTrack-glo imf; y; v_{1}",
1956 "MCTrack-glo pi-plus; y; v_{2}",
1964 "MCTrack-glo pi-minus;y; v_{2}",
1972 "MCTrack-glo k-plus; y; v_{2}",
1980 "MCTrack-glo k-minus; y; v_{2}",
1988 "MCTrack-glo proton; y; v_{2}",
1996 "MCTrack-glo antiproton;y; v_{2}",
2004 "MCTrack-glo deuteron;y; v_{2}",
2012 "MCTrack-glo triton; y; v_{2}",
2020 "MCTrack-glo 3he; y; v_{2}",
2028 "MCTrack-glo alpha; y; v_{2}",
2036 "MCTrack-glo imf; y; v_{2}",
2047 Float_t xrange = 750.;
2048 Float_t yrange = 500.;
2049 fwxy2 = nbinx * nbiny / 4. / xrange / yrange;
2052 "xy_poi1",
"TofPoint; ;", nbinx, -xrange, xrange, nbiny, -yrange, yrange);
2054 "TofPoint /cm^{2}; ;",
2062 "TofPoint /cm^{2}/s; ;",
2071 "pv_poi",
"TofPoint(all); velocity;momentum;", 100, 0., 32., 100., 0., 5.);
2074 "Tofpoi(all); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2082 "Tofpoi(primary); momentum; Tofmass",
2091 "xy_hit1",
"TofHit; ;", nbinx, -xrange, xrange, nbiny, -yrange, yrange);
2093 "TofHit /cm^{2}; ;",
2101 "TofHit /cm^{2}/s; ;",
2111 new TH1F(
"tof_hit",
"TofHit(all); t (ns); counts;", 100, 10., 110.);
2113 new TH1F(
"dtof_hit",
"TofHit(all); #Deltat (ns); counts;", 100, -1., 1.);
2115 new TH1F(
"tof_hitprim",
"TofHit(prim); t (ns); counts;", 100, 10., 110.);
2117 "pv_hit",
"TofHit(all); velocity; momentum;", 100, 0., 32., 100., 0., 5.);
2120 "TofHit(all); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2128 "TofHit(primary); momentum; Tofmass",
2136 new TH1F(
"tn_hit",
"fastest TofHit(all); t (ns); counts;", 100, -1.0, 1.);
2138 new TH1F(
"t0_hit",
"time zero; t0 (ns) ; counts;", 100, -0.5, 0.5);
2140 new TH1F(
"t0m_hit",
"average time zero; t0 (ns) ; counts;", 100, -0.1, 0.1);
2142 "average time zero hits; number of hits ; counts;",
2147 "average time zero; b (fm); t0 (ns) ; counts;",
2155 new TH2F(
"t0mn_b_hit",
2156 "average time zero hits; b(fm); number of hits ; counts;",
2165 "average time zero forward; t0 (ns) ; counts;",
2170 new TH1F(
"t0mn_f_hit",
2171 "average time zero hits forward; number of hits ; counts;",
2176 new TH2F(
"t0m_f_b_hit",
2177 "average time zero forward; b (fm); t0 (ns) ; counts;",
2185 new TH2F(
"t0mn_f_b_hit",
2186 "average time zero hits forward ; b(fm); number of hits ; counts;",
2195 "average time zero noforward; t0 (ns) ; counts;",
2200 new TH1F(
"t0mn_nf_hit",
2201 "average time zero hits noforward; number of hits ; counts;",
2206 new TH2F(
"t0m_nf_b_hit",
2207 "average time zero noforward; b (fm); t0 (ns) ; counts;",
2216 "average time zero hits noforward ; b(fm); number of hits ; counts;",
2225 "dxx",
"TofHit; x; Delta x;", 100, -xrange, xrange, 50., -10., 10.);
2227 "dxy",
"TofHit; y; Delta x;", 100, -yrange, yrange, 50., -10., 10.);
2229 new TH2F(
"dxz",
"TofHit; z; Delta x;", 100, 400., 650., 50., -10., 10.);
2231 "dyx",
"TofHit; x; Delta y;", 100, -xrange, xrange, 50., -10., 10.);
2233 "dyy",
"TofHit; y; Delta y;", 100, -yrange, yrange, 50., -10., 10.);
2235 new TH2F(
"dyz",
"TofHit; z; Delta y;", 100, 400., 650., 50., -10., 10.);
2237 new TH2F(
"dzx",
"TofHit; x; Delta z;", 100, -xrange, xrange, 50, -20., 20.);
2239 new TH2F(
"dzy",
"TofHit; y; Delta z;", 100, -yrange, yrange, 50, -20., 20.);
2241 new TH2F(
"dzz",
"TofHit; z; Delta z;", 100, 400., 650., 50, -20., 20.);
2244 new TH1F(
"hit_ch",
"TofHits; channel; rate (Hz/s);", 50000, 0., 50000.);
2246 "Tof Double Hits; channel; counts;",
2255 "GlobalTrack(all); x (cm); y(cm);",
2263 "GlobalTrack(pip); x (cm); y(cm);",
2271 "GlobalTrack(pim); x (cm); y(cm);",
2279 "GlobalTrack(p); x (cm); y(cm);",
2287 "GlobalTrack(pbar); x (cm); y(cm);",
2295 "GlobalTrack(kp); x (cm); y(cm);",
2303 "GlobalTrack(km); x (cm); y(cm);",
2311 "GlobalTrack(d); x (cm); y(cm);",
2319 "GlobalTrack(t); x (cm); y(cm);",
2327 "GlobalTrack(h); x (cm); y(cm);",
2335 "GlobalTrack(a); x (cm); y(cm);",
2344 new TH1F(
"TofTrackMul",
2345 "number of assigned TofTrack / global track; multiplicity; ",
2349 fa_VtxB =
new TH1F(
"VtxB",
"Chi2 to primary vertex; ", 100, 0., 20.);
2351 Float_t TMMIN = -1.5;
2352 Float_t TMMAX = 2.5;
2355 "GlobalTrack(all); velocity; momentum;",
2364 "GlobalTrack(all); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2372 "GlobalTrack(all); momentum; chi2;",
2380 "GlobalTrack(primaries); momentum; chi2;",
2388 "GlobalTrack(all); momentum; len;",
2396 "GlobalTrack(primary); momentum; Tofmass",
2405 "GlobalTrack(vtxb); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2413 "GlobalTrack(prim,vtxb); momentum; Tofmass",
2421 new TH2F(
"tm_glomis",
2422 "GlobalTrack(mis); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2430 new TH2F(
"tm_glo_pip",
2431 "GlobalTrack(pip); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2439 new TH2F(
"tm_glo_pim",
2440 "GlobalTrack(pim); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2448 new TH2F(
"tm_glo_kp",
2449 "GlobalTrack(kp); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2457 new TH2F(
"tm_glo_km",
2458 "GlobalTrack(km); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2466 new TH2F(
"tm_glo_p",
2467 "GlobalTrack(p); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2476 "GlobalTrack(pbar); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2484 new TH2F(
"tm_glo_d",
2485 "GlobalTrack(d); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2493 new TH2F(
"tm_glo_t",
2494 "GlobalTrack(t); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2502 new TH2F(
"tm_glo_h",
2503 "GlobalTrack(h); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2511 new TH2F(
"tm_glo_a",
2512 "GlobalTrack(a); momentum (GeV/c); M_{ToF}*sign(Z) (GeV/c^{2});",
2520 Double_t M2MIN = -0.4;
2521 Double_t M2MAX = 1.4;
2524 new TH2F(
"m2mom_glo",
2525 "GlobalTrack(all); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2533 new TH2F(
"m2mom_glovtxb",
2534 "GlobalTrack(vtxb); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2542 new TH2F(
"m2mom_gloprim",
2543 "GlobalTrack(prim); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2551 "m2mom_gloprimvtxb",
2552 "GlobalTrack(primvtxb); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2560 new TH2F(
"m2mom_glo_pip",
2561 "GlobalTrack(pip); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2569 new TH2F(
"m2mom_glo_pim",
2570 "GlobalTrack(pim); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2578 new TH2F(
"m2mom_glo_kp",
2579 "GlobalTrack(kp); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2587 new TH2F(
"m2mom_glo_km",
2588 "GlobalTrack(km); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2596 new TH2F(
"m2mom_glo_p",
2597 "GlobalTrack(p); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2605 new TH2F(
"m2mom_glo_pbar",
2606 "GlobalTrack(pbar); p ^{.} sign(Z)(GeV); M_{ToF}^{2} (GeV^{2});",
2615 "GlobalTrack(all); momentum; p_{MC};",
2623 "GlobalTrack(pip); momentum; p_{MC};",
2631 "GlobalTrack(pim); momentum; p_{MC};",
2639 "GlobalTrack(kp); momentum; p_{MC};",
2647 "GlobalTrack(km); momentum; p_{MC};",
2655 "GlobalTrack(p); momentum; p_{MC};",
2663 "GlobalTrack(pbar); momentum; p_{MC};",
2671 "GlobalTrack(d); momentum; p_{MC};",
2679 "GlobalTrack(t); momentum; p_{MC};",
2687 "GlobalTrack(h); momentum; p_{MC};",
2695 "GlobalTrack(a); momentum; p_{MC};",
2703 Double_t LenDisMax = 20.;
2705 "GlobalTrack(all); momentum; len-dis;",
2713 "GlobalTrack(pip); momentum; len-dis;",
2721 "GlobalTrack(pim); momentum; len-dis;",
2729 "GlobalTrack(kp); momentum; len-dis;",
2737 "GlobalTrack(km); momentum; len-dis;",
2745 "GlobalTrack(p); momentum; len-dis;",
2753 "GlobalTrack(pbar); momentum; len-dis;",
2761 "GlobalTrack(d); momentum; len-dis;",
2769 "GlobalTrack(t); momentum; len-dis;",
2777 "GlobalTrack(h); momentum; len-dis;",
2785 "GlobalTrack(a); momentum; len-dis;",
2794 new TH2F(
"LenMcLenGlomom_glo",
2795 "GlobalTrack(all); momentum [GeV]; len glo - len MC pnt[cm];",
2803 new TH2F(
"LenMcDismom_glo",
2804 "GlobalTrack(all); momentum [GeV]; len MC pnt - dis [cm];",
2813 Float_t WYMAX = 20.;
2815 "GlobalTrack(all); momentum; weight;",
2823 "GlobalTrack(pip); momentum; weight;",
2831 "GlobalTrack(pim); momentum; weight;",
2839 "GlobalTrack(kp); momentum; weight;",
2847 "GlobalTrack(km); momentum; weight;",
2855 "GlobalTrack(p); momentum; weight;",
2863 "GlobalTrack(pbar); momentum; weight;",
2871 "GlobalTrack(d); momentum; weight;",
2879 "GlobalTrack(t); momentum; weight;",
2887 "GlobalTrack(h); momentum; weight;",
2895 "GlobalTrack(a); momentum; weight;",
2903 "GlobalTrack(mis); momentum; weight;",
2913 "Centrality - gen;impact parameter b; multiplicity;",
2921 "Centrality - poi;impact parameter b; multiplicity;",
2929 "Centrality - hit;impact parameter b; multiplicity;",
2937 "Centrality - glo;impact parameter b; multiplicity;",
2945 "Centrality - had;impact parameter b; multiplicity;",
2956 "reaction plane resolution - gen;impact parameter b; cos#Delta#phi_{rp};",
2964 new TH2F(
"drp_b_gen",
2965 "#Delta#phi-reaction plane - gen ;impact parameter b;",
2973 new TH2F(
"phirp_b_gen",
2974 "#phi_{reaction plane} - gen ;impact parameter b;",
2982 new TH2F(
"phgrp_b_gen",
2983 "#phi_{G reaction plane} - gen ;impact parameter b;",
2991 "#phi_#phi - gen ;#phi_{rec}; #phi_{gen} ;",
2999 "#Delta#phi_{G}-reaction plane - gen ;impact "
3000 "parameter b;#phi_{rec}-#phi_{gen}",
3008 "#Delta#phi_{G}-reaction plane - poi ;impact "
3009 "parameter b;#phi_{rec}-#phi_{gen}",
3017 "#Delta#phi_{G}-reaction plane - hit ;impact "
3018 "parameter b;#phi_{rec}-#phi_{gen}",
3026 "#Delta#phi_{G}-reaction plane - glo ;impact "
3027 "parameter b;#phi_{rec}-#phi_{gen}",
3036 "reaction plane resolution - gen;impact parameter "
3037 "b;cos(#phi_{rec}-#phi_{gen})",
3045 "reaction plane resolution - poi;impact parameter "
3046 "b;cos(#phi_{rec}-#phi_{gen})",
3054 "reaction plane resolution - hit;impact parameter "
3055 "b;cos(#phi_{rec}-#phi_{gen})",
3063 "reaction plane resolution - glo;impact parameter "
3064 "b;cos(#phi_{rec}-#phi_{gen})",
3072 "reaction plane resolution - had;impact parameter "
3073 "b;cos(#phi_{rec}-#phi_{gen})",
3083 "reaction plane resolution - poi;impact parameter b; cos#Delta#phi_{rp};",
3091 new TH2F(
"drp_b_poi",
3092 "#Delta#phi-reaction plane - poi ;impact parameter b;",
3102 "reaction plane resolution - hit;impact parameter b; cos#Delta#phi_{rp};",
3110 new TH2F(
"drp_b_hit",
3111 "#Delta#phi-reaction plane - hit ;impact parameter b;",
3121 "reaction plane resolution - glo;impact parameter b; cos#Delta#phi_{rp};",
3129 new TH2F(
"drp_b_glo",
3130 "#Delta#phi-reaction plane - glo ;impact parameter b;",
3140 "reaction plane resolution - had;impact parameter b; cos#Delta#phi_{rp};",
3148 new TH2F(
"drp_b_had",
3149 "#Delta#phi-reaction plane - had ;impact parameter b;",
3158 "#phi_{reaction plane} - gen ;#phi_{RPgen};",
3163 "#phi_{reaction plane} - poi ;#phi_{RPpoi};",
3168 "#phi_{reaction plane} - hit ;#phi_{RPhit};",
3173 "#phi_{reaction plane} - glo ;#phi_{RPglo};",
3178 "#phi_{reaction plane} - had ;#phi_{RPhad};",
3184 "#phi_{reaction plane} - gen ;#phi_{sRPgen};",
3189 "#phi_{reaction plane} - poi ;#phi_{sRPpoi};",
3194 "#phi_{reaction plane} - hit ;#phi_{sRPhit};",
3199 "#phi_{reaction plane} - glo ;#phi_{sRPglo};",
3205 "hwdist",
"matching wdist; p (GeV/c); dist;", 100, 0., 10., 50, 0., 10.);
3207 "matching wmindelmass ; p (GeV/c); #Delta M;",
3215 "matching wminlen ; p (GeV/c); MinPathlength;",
3223 "matching wdelp ; p (GeV/c); #Delta p/p;",
3232 new TH1F(
"hTofTrkDx",
" x - position resolution ; #deltax;", 50, -1., 1.);
3234 new TH1F(
"hTofTrkDy",
" y - position resolution ; #deltay;", 50, -1., 1.);
3236 "hTofTrkDxsel",
" x - position resolution ; #deltax;", 50, -1., 1.);
3238 "hTofTrkDysel",
" y - position resolution ; #deltay;", 50, -1., 1.);
3241 <<
"CbmHadronAnalysis::CreateHistogramms: histograms booked in directory "
3242 << gDirectory->GetName() << endl;
3250 if (NULL == pdfFile) {
3251 cout <<
"-E- CbmHadronAnalysis::ReadPdfFile : "
3252 <<
"file " <<
fPdfFileName <<
" does not exist!" << endl;
3264 cout <<
"-E- CbmHadronAnalysis::ReadFlowFile : "
3268 cout <<
"-I- CbmHadronAnalysis::ReadFlowFile : RP corrections from "
3277 FairRootManager*
rootMgr = FairRootManager::Instance();
3279 cout <<
"-E- CbmHadronAnalysis::Init : ROOT manager is not instantiated."
3289 LOG(info) <<
"CbmEvent not found in input file, assume eventwise input";
3291 LOG(info) <<
"CbmEvent found in input file, timebased analysis";
3295 cout <<
"-W- CbmHadronAnalysis::Init : no MC Header Info" << endl;
3300 cout <<
"-W- CbmHadronAnalysis::Init : no TOF point array!" << endl;
3306 LOG(error) << GetName() <<
": No input digis!";
3309 LOG(info) <<
"DigiManager has Tof Digis";
3327 cout <<
"-I- CbmHadronAnalysis::Init : no TOF CalDigiMatch array!" << endl;
3330 cout <<
"-I- CbmHadronAnalysis::Init : no TOF digiMatch array!" << endl;
3335 (TClonesArray*)
rootMgr->GetObject(
"TofDigiMatchPoints");
3337 cout <<
"-I- CbmHadronAnalysis::Init : no TOF digiMatchPoints array!"
3343 cout <<
"-W- CbmHadronAnalysis::Init : no TOF Hit array!" << endl;
3348 cout <<
"-W- CbmHadronAnalysis::Init : "
3349 <<
"no Tof Track array!" << endl;
3354 cout <<
"-W- CbmHadronAnalysis::Init : no TRD point array!" << endl;
3359 cout <<
"-W- CbmHadronAnalysis::Init : no TRD Hit array!" << endl;
3364 cout <<
"-W- CbmHadronAnalysis::Init : no Global Track array!" << endl;
3369 cout <<
"-W- CbmHadronAnalysis::Init : no Hadron array!" << endl;
3374 cout <<
"-W- CbmHadronAnalysis::Init : no STS Track array!" << endl;
3378 cout <<
"-W- CbmHadronAnalysis::Init : no STS Hit array!" << endl;
3382 cout <<
"-W- CbmHadronAnalysis::Init : no STS Cluster array!" << endl;
3386 cout <<
"-W- CbmHadronAnalysis::Init : no STS Digi array!" << endl;
3390 cout <<
"-W- CbmHadronAnalysis::Init : "
3391 <<
"no STS DigiMatch array!" << endl;
3401 if (
nullptr ==
fPrimVertex) { LOG(warn) <<
"No primary vertex"; }
3407 fTofHits =
new TClonesArray(
"CbmTofHit", 100);
3408 fStsHits =
new TClonesArray(
"CbmStsHit", 100);
3415 if (NULL != mcManager) {
3423 cout <<
"-W- CbmHadronAnalysis::Init : "
3424 <<
"no MC track array!" << endl;
3429 cout <<
"-W- CbmHadronAnalysis::Init : "
3430 <<
"no STS Point array!" << endl;
3436 if (kSUCCESS != status) {
return status; }
3439 if (kSUCCESS != statf) {
return statf; }
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));
3448 cout <<
"-I- CbmHadronAnalysis: Initialize for pbeam = " << pbeam
3449 <<
" rap:" <<
GetMidY() << endl;
3452 cout <<
"-I- CbmHadronAnalysis::Init : "
3453 <<
"initialisation completed." << endl;
3463 LOG(debug) <<
"process TS " <<
iNbTs <<
" with "
3466 assert(
"Invalid pointer to Tof TClonesArray");
3469 assert(
"Invalid pointer to Sts TClonesArray");
3471 LOG(debug) <<
"TS contains " <<
fTofHitsColl->GetEntriesFast() <<
"TOF and "
3474 for (Int_t iEvent = 0; iEvent <
fEventsColl->GetEntriesFast(); iEvent++) {
3479 LOG(debug) <<
"Fill Tof array with mul "
3486 new ((*fTofHits)[iNbHits])
3493 LOG(debug) <<
"Fill Sts array with mul "
3500 new ((*fStsHits)[iNbHits])
3504 LOG(debug) << Form(
"analyze TS %d, Ev %d with %d STS, %d TOF hits",
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;
3537 Float_t MaxT0 = 0.1;
3539 Int_t TrackP[100000];
3541 Bool_t use_pions_for_flow = kTRUE;
3563 LOG(debug) <<
"<D> HadronAnalysis::Exec starting with MCtrks " <<
nMCTracks
3571 if (FairLogger::GetLogger()->IsLogNeeded(fair::Severity::debug)) {
3572 for (Int_t j = 0; j <
nTofHits; j++) {
3574 if (NULL == TofHit)
continue;
3576 "TofHit %d, addr 0x%08x, x %6.1f, y %6.1f, z %6.1f, t %6.1f ",
3587 for (Int_t j = 0; j <
nTofHits; j++) {
3589 if (NULL == TofHit)
continue;
3590 if (TofHit->
GetZ() == 0.) dT0 = TofHit->
GetTime();
3593 for (Int_t j = 0; j <
nTofHits; j++) {
3595 if (NULL == TofHit)
continue;
3600 if (FairLogger::GetLogger()->IsLogNeeded(fair::Severity::debug)) {
3601 for (Int_t j = 0; j <
nTofHits; j++) {
3603 if (NULL == TofHit)
continue;
3605 "TofHit %d, addr 0x%08x, x %6.1f, y %6.1f, z %6.1f, t %6.1f ",
3623 Float_t Weight_THMUL
3629 Int_t IndTofTrack_TofHit
3652 if (pdgCode < 100000000) {
3653 if (211 != TMath::Abs(pdgCode) &&
3654 321 != TMath::Abs(pdgCode) &&
3655 2212 != TMath::Abs(pdgCode))
3659 (pdgCode % 1000) / 10 * .931494028;
3665 if (dphi < -180.) { dphi += 360.; };
3666 if (dphi > 180.) { dphi -= 360.; };
3667 dphi = dphi / RADDEG;
3682 TMath::Cos(2 * dphi));
3684 if (use_pions_for_flow
3685 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
3706 TMath::Cos(2 * dphi));
3708 if (use_pions_for_flow
3709 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
3729 TMath::Cos(2 * dphi));
3738 TMath::Cos(2 * dphi));
3747 TMath::Cos(2 * dphi));
3768 TMath::Cos(2 * dphi));
3774 MCTrack->
GetPt() / mfrag);
3778 TMath::Cos(2 * dphi));
3794 MCTrack->
GetPt() / mfrag);
3798 TMath::Cos(2 * dphi));
3814 MCTrack->
GetPt() / mfrag);
3818 TMath::Cos(2 * dphi));
3834 MCTrack->
GetPt() / mfrag);
3838 TMath::Cos(2 * dphi));
3857 MCTrack->
GetPt() / mfrag);
3862 TMath::Cos(2 * dphi));
3876 if (rp_weight != 0.) {
3877 if (gRandom->Uniform(1)
3880 Qx1 = Qx1 + rp_weight * MCTrack->
GetPx();
3881 Qy1 = Qy1 + rp_weight * MCTrack->
GetPy();
3884 Qx2 = Qx2 + rp_weight * MCTrack->
GetPx();
3885 Qy2 = Qy2 + rp_weight * MCTrack->
GetPy();
3890 if (Np1 > 0 && Np2 > 0) {
3891 phirp1 =
atan2(Qy1, Qx1);
3892 phirp2 =
atan2(Qy2, Qx2);
3894 TH1F* phirp_gen_fpar = (TH1F*)
fflowFile->Get(
"phirps_gen_fpar");
3896 for (
int j = 0; j < 4; j++) {
3897 Float_t
i = (float) (j + 1);
3899 (-phirp_gen_fpar->GetBinContent(j) * TMath::Cos(
i * phirp1)
3900 + phirp_gen_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp1))
3906 for (
int j = 0; j < 4; j++) {
3907 Float_t
i = (float) (j + 1);
3909 (-phirp_gen_fpar->GetBinContent(j) * TMath::Cos(
i * phirp2)
3910 + phirp_gen_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp2))
3916 delrp = (phirp1 - phirp2);
3921 <<
", delrp = " << delrp << endl;
3924 delrp = delrp * RADDEG;
3925 while (delrp < -180.) {
3928 while (delrp > 180.) {
3933 phirp = RADDEG *
atan2(Qy1 + Qy2, Qx1 + Qx2);
3934 while (phirp < -180.) {
3937 while (phirp > 180.) {
3941 TH1F* phirp_gen_fpar = (TH1F*)
fflowFile->Get(
"phirp_gen_fpar");
3943 for (
int j = 0; j < 4; j++) {
3944 Float_t
i = (float) (j + 1);
3948 ((-phirp_gen_fpar->GetBinContent(j) * TMath::Cos(
i * phirp / RADDEG)
3949 + phirp_gen_fpar->GetBinContent(j + 4)
3950 * TMath::Sin(
i * phirp / RADDEG))
3955 phirp += dphir * RADDEG;
3956 while (phirp < -180.) {
3959 while (phirp > 180.) {
3964 while (delrp < -180.) {
3967 while (delrp > 180.) {
3996 if (NULL == TofPoint) {
3997 LOG(WARNING) <<
" Missing TofPoint at " << l <<
", mul " <<
nTofPoints;
4000 Int_t k = TofPoint->GetTrackID();
4003 if (pdgCode > 100000000) {
4005 (pdgCode % 1000) / 10 * .931494028;
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);
4012 if (TrackP[k] == 0) {
4015 fa_xy_poi1->Fill(TofPoint->GetX(), TofPoint->GetY());
4018 Float_t vel = TofPoint->GetLength() / TofPoint->GetTime();
4019 Float_t bet = vel /
clight;
4020 if (bet > 0.99999) { bet = 0.99999; }
4022 p_MC / bet * TMath::Sqrt(1. - bet * bet) *
TMath::Sign(1, pdgCode);
4032 if (dphi < -180.) { dphi += 360.; };
4033 if (dphi > 180.) { dphi -= 360.; };
4034 dphi = dphi / RADDEG;
4041 if (use_pions_for_flow
4042 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
4059 if (use_pions_for_flow
4060 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
4107 MCTrack->
GetPt() / mfrag);
4112 TMath::Cos(2 * dphi));
4128 MCTrack->
GetPt() / mfrag);
4133 TMath::Cos(2 * dphi));
4149 MCTrack->
GetPt() / mfrag);
4154 TMath::Cos(2 * dphi));
4170 MCTrack->
GetPt() / mfrag);
4175 TMath::Cos(2 * dphi));
4193 MCTrack->
GetPt() / mfrag);
4198 TMath::Cos(2 * dphi));
4212 if (rp_weight != 0.) {
4213 if (gRandom->Uniform(1)
4216 Qx1 = Qx1 + rp_weight * MCTrack->
GetPx();
4217 Qy1 = Qy1 + rp_weight * MCTrack->
GetPy();
4220 Qx2 = Qx2 + rp_weight * MCTrack->
GetPx();
4221 Qy2 = Qy2 + rp_weight * MCTrack->
GetPy();
4226 if (Np1 > 0 && Np2 > 0) {
4227 phirp1 =
atan2(Qy1, Qx1);
4228 phirp2 =
atan2(Qy2, Qx2);
4230 TH1F* phirp_poi_fpar = (TH1F*)
fflowFile->Get(
"phirps_poi_fpar");
4232 for (
int j = 0; j < 4; j++) {
4233 Float_t
i = (float) (j + 1);
4235 (-phirp_poi_fpar->GetBinContent(j) * TMath::Cos(
i * phirp1)
4236 + phirp_poi_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp1))
4242 for (
int j = 0; j < 4; j++) {
4243 Float_t
i = (float) (j + 1);
4245 (-phirp_poi_fpar->GetBinContent(j) * TMath::Cos(
i * phirp2)
4246 + phirp_poi_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp2))
4251 delrp = (phirp1 - phirp2);
4256 <<
", delrp = " << delrp << endl;
4259 delrp = delrp * RADDEG;
4260 if (delrp < -180.) delrp += 360.;
4261 if (delrp > 180.) delrp -= 360.;
4265 phirp = RADDEG *
atan2(Qy1 + Qy2, Qx1 + Qx2);
4266 while (phirp < -180.) {
4269 while (phirp > 180.) {
4273 TH1F* phirp_poi_fpar = (TH1F*)
fflowFile->Get(
"phirp_poi_fpar");
4275 for (
int j = 0; j < 4; j++) {
4276 Float_t
i = (float) (j + 1);
4280 ((-phirp_poi_fpar->GetBinContent(j) * TMath::Cos(
i * phirp / RADDEG)
4281 + phirp_poi_fpar->GetBinContent(j + 4)
4282 * TMath::Sin(
i * phirp / RADDEG))
4287 phirp += dphir * RADDEG;
4288 while (phirp < -180.) {
4291 while (phirp > 180.) {
4297 while (delrp < -180.) {
4300 while (delrp > 180.) {
4318 Float_t t0m_hit = 0.;
4320 Float_t t0mf_hit = 0.;
4322 Float_t t0mnf_hit = 0.;
4328 Int_t nFTofHits = 0;
4329 Float_t T0FAST[NFHITS];
4330 for (Int_t l = 0; l < NFHITS; l++) {
4334 for (Int_t j = 0; j <
nTofHits; j++) {
4339 if (NULL == TofHit)
continue;
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]) {
4352 if (T0FAST[l] < 100.) {
4353 for (Int_t ll = NFHITS - 1; ll >= l; ll--) {
4354 T0FAST[ll + 1] = T0FAST[ll];
4369 Int_t nfhmax = nFTofHits;
4372 Int_t lmax = NFHITS;
4375 for (Int_t l = 0; l < NFHITS; l++) {
4376 if (T0FAST[l] < 100. && nfh < nfhmax) {
4380 T02 += TMath::Power(T0FAST[l], 2.);
4384 T0MIN = T0MIN / (Float_t) nfh;
4385 Float_t T0RMS = TMath::Sqrt(T02 - T0MIN * T0MIN);
4389 while (T0RMS > 1. && nT0It < 10 && nfh > 2) {
4391 Float_t T0AV = T0MIN;
4392 if (TMath::Abs(T0FAST[lmin] - T0AV) > TMath::Abs(T0FAST[lmax] - T0AV)) {
4401 for (Int_t l = lmin; l < lmax; l++) {
4402 if (T0FAST[l] < 100. && nfh < nfhmax) {
4405 T02 += TMath::Power(T0FAST[l], 2.);
4409 T0MIN = T0MIN / (Float_t) nfh;
4410 T0RMS = TMath::Sqrt(T02 - T0MIN * T0MIN);
4416 for (Int_t j = 0; j <
nTofHits; j++) {
4419 if (NULL == TofHit)
continue;
4428 if (NULL == poiMatch) {
4429 LOG(warn) <<
"No MC point found for hit " << j <<
", digi " << iDigInd0;
4449 LOG(WARNING) <<
"No Link to MCTofPoint found for hit " << j;
4453 Int_t k = TofPoint->GetTrackID();
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);
4461 cout <<
"<E-hit> Too many MCTracks " << k <<
" from " <<
nMCTracks
4476 if (TrackP[k] == 0) {
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();
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);
4500 Float_t vel = TofPoint->GetLength() / t_hit;
4501 Float_t bet = vel /
clight;
4502 if (bet > 0.99999) { bet = 0.99999; }
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));
4512 Float_t t0_hit = t_hit - dist /
clight;
4515 if (t0_hit < T0MIN + 2.4 * MaxT0) {
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.)) {
4521 t0mf_hit = ((Float_t)(NT0F - 1) * t0mf_hit + t0_hit) / (Float_t) NT0F;
4525 ((Float_t)(NT0NF - 1) * t0mnf_hit + t0_hit) / (Float_t) NT0NF;
4537 if (dphi < -180.) { dphi += 360.; };
4538 if (dphi > 180.) { dphi -= 360.; };
4539 dphi = dphi / RADDEG;
4551 TMath::Cos(2 * dphi));
4553 if (use_pions_for_flow
4554 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
4575 TMath::Cos(2 * dphi));
4577 if (use_pions_for_flow
4578 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
4599 TMath::Cos(2 * dphi));
4609 TMath::Cos(2 * dphi));
4619 TMath::Cos(2 * dphi));
4641 TMath::Cos(2 * dphi));
4652 TMath::Cos(2 * dphi));
4673 TMath::Cos(2 * dphi));
4694 TMath::Cos(2 * dphi));
4714 TMath::Cos(2 * dphi));
4738 TMath::Cos(2 * dphi));
4753 if (rp_weight != 0.) {
4754 if (gRandom->Uniform(1)
4757 Qx1 = Qx1 + rp_weight * MCTrack->
GetPx();
4758 Qy1 = Qy1 + rp_weight * MCTrack->
GetPy();
4761 Qx2 = Qx2 + rp_weight * MCTrack->
GetPx();
4762 Qy2 = Qy2 + rp_weight * MCTrack->
GetPy();
4768 <<
"<W> CHA: >=2. hit from track k =" << k <<
" Hit# "
4778 if (Np1 > 0 && Np2 > 0) {
4779 phirp1 =
atan2(Qy1, Qx1);
4780 phirp2 =
atan2(Qy2, Qx2);
4782 TH1F* phirp_hit_fpar = (TH1F*)
fflowFile->Get(
"phirps_hit_fpar");
4784 for (
int j = 0; j < 4; j++) {
4785 Float_t
i = (float) (j + 1);
4787 (-phirp_hit_fpar->GetBinContent(j) * TMath::Cos(
i * phirp1)
4788 + phirp_hit_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp1))
4794 for (
int j = 0; j < 4; j++) {
4795 Float_t
i = (float) (j + 1);
4797 (-phirp_hit_fpar->GetBinContent(j) * TMath::Cos(
i * phirp2)
4798 + phirp_hit_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp2))
4805 delrp = (phirp1 - phirp2);
4809 <<
", delrp = " << delrp << endl;
4812 delrp = delrp * RADDEG;
4813 if (delrp < -180.) delrp += 360.;
4814 if (delrp > 180.) delrp -= 360.;
4818 phirp = RADDEG *
atan2(Qy1 + Qy2, Qx1 + Qx2);
4819 while (phirp < -180.) {
4822 while (phirp > 180.) {
4826 TH1F* phirp_hit_fpar = (TH1F*)
fflowFile->Get(
"phirp_hit_fpar");
4828 for (
int j = 0; j < 4; j++) {
4829 Float_t
i = (float) (j + 1);
4833 ((-phirp_hit_fpar->GetBinContent(j) * TMath::Cos(
i * phirp / RADDEG)
4834 + phirp_hit_fpar->GetBinContent(j + 4)
4835 * TMath::Sin(
i * phirp / RADDEG))
4840 phirp += dphir * RADDEG;
4841 while (phirp < -180.) {
4844 while (phirp > 180.) {
4850 while (delrp < -180.) {
4853 while (delrp > 180.) {
4885 const Double_t DISTMAX = 100.;
4886 Double_t WMAX = 10.;
4889 Int_t NGTofTrack = 0;
4905 cout << Form(
" TofTrack selection: %d. iteration, reassigned hits: %d, "
4906 "GlobTracks %d, TofTracks %d",
4925 cout <<
"<Di> NRIt " << NRIt <<
": Global Track " <<
i <<
", TofHit "
4926 << j <<
" StsTrk " << s << endl;
4930 if (0 == tparf->GetQp()) {
4932 cout <<
"<W> Global Track " <<
i <<
" without Qp!, take from Sts "
4936 if (NULL == StsTrack) {
4937 cout <<
"<E> Invalid StsTrack pointer at location " << s << endl;
4943 if (0 == tparf->GetQp()) {
4944 cout <<
"<E> Global Track " <<
i <<
" without Qp! " << endl;
4949 cout <<
"<E> Invalid StsTrack PID " << StsTrack->
GetPidHypo() <<
" at "
4954 FairTrackParam paramExtr;
4963 "<D> Extrapolate Glob Track %d to prim. vertex %6.2f with chi2 %6.2f",
4972 Float_t momf = 1. / tparf->GetQp();
4973 if (momf < 0.) momf = -momf;
4980 Float_t DISTMIN = WMAX;
4982 Weight_THMUL[
i][0] = WMAX;
4989 ->GetTrackIndex()) {
4991 cout <<
"<Dt> Global Track " <<
i <<
", TofHit " << j
4992 <<
", StsTrk " << s <<
", TofTrack " << tt << endl;
4997 if (NULL == TofHit)
continue;
5002 cout <<
"<E> invalid dist for gt " <<
i <<
", tt " << tt
5003 <<
", d:" << dist << endl;
5015 Float_t moml = 1. / tpar->GetQp();
5016 if (moml < 0.) moml = -moml;
5019 if (bet > 0.99999) { bet = 0.99999; }
5020 Float_t tofmass = momf / bet *
sqrt(1. - bet * bet)
5023 if (TofTrack->
GetMass() != tofmass) {
5024 cout <<
"<E> did not store tofmass properly " << tofmass
5028 Float_t mindelmass = 1.E6;
5035 for (Int_t im = 0; im <
NMASS; im++) {
5038 if (delmass < mindelmass) {
5039 mindelmass = delmass;
5044 Float_t delp = TMath::Abs((momf - moml) / momf);
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 ",
5077 if (nth == MAXNHT) {
5079 cout <<
"<W> Too many TofTrack candidates for track " <<
i
5080 <<
", limit to " << nth << endl;
5086 for (Int_t jth = 0; jth < nth;
5089 cout <<
" Compare for position " << jth <<
" w " << w
5090 <<
" - " << Weight_THMUL[
i][jth] << endl;
5092 if (w < Weight_THMUL[
i][jth]) {
5098 cout <<
" Put Track " << tt <<
" with w = " << w
5099 <<
" to position " << jthmin <<
" of " << nth << endl;
5101 for (Int_t jth = nth; jth > jthmin;
5104 cout <<
" Save Track " << IndTHMUL[
i][jth - 1] <<
" with w "
5105 << Weight_THMUL[
i][jth - 1] <<
" to position " << jth
5108 IndTHMUL[
i][jth] = IndTHMUL[
i][jth - 1];
5109 Weight_THMUL[
i][jth] = Weight_THMUL[
i][jth - 1];
5111 IndTHMUL[
i][jthmin] = tt;
5112 Weight_THMUL[
i][jthmin] = w;
5116 BestTofTrack = TofTrack;
5121 "<DMin> gt %d, hit %d, tt %d, w: %6.2f",
i, Bthi, Btt, w)
5127 cout << Form(
"<D> tt-loop: gt %d, tt %d, w: %6.2f",
i, tt, w)
5132 NTHMUL[
i] = nth + 1;
5137 for (Int_t k = 0; k < NTHMUL[
i]; k++) {
5139 cout << Form(
"<Ddeb> i %d, k %d, M %d, Ind %d ",
5148 cout <<
"<DSum> GlobTrack " <<
i <<
", TMul: " << NTHMUL[
i]
5149 <<
", TofTrack " << IndTHMUL[
i][k] <<
", TofHit "
5155 << TofTrack->
GetMass() <<
", mom " << momf <<
", w "
5156 << Weight_THMUL[
i][k] << endl;
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;
5172 cout <<
"<DBest> GloBTrack " <<
i <<
", TMul: " << NTHMUL[
i]
5173 <<
", TofTrack " << IndTHMUL[
i][0] <<
", TofHit "
5178 << BestTofTrack->
GetMass() <<
", w " << Weight_THMUL[
i][0]
5188 cout << Form(
"<Ddis> NRIt %d, gt %d, BestTofTrack j=%d, best 0x%p, %d, "
5200 if (NRIt == 1) GlobTrack->
SetLength(0.);
5205 cout << Form(
"<Ddeb> BestTofTrack j=%d, best 0x%p, %d",
5213 cout <<
"<E2> invalid dist for gt " <<
i <<
", Btt " << Btt
5214 <<
", d:" << dist << endl;
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) {
5222 cout <<
"<E> Too many TofTrack candidates for hit " << Bthi
5223 <<
", break!" << endl;
5227 IndTofTrack_TofHit[Bthi][jh] =
5230 cout <<
"<Ias> GlobTrack " <<
i <<
" -> TofTrack " << Btt
5231 <<
", TofHitIndex " << Bthi <<
", TMul_hit " << nht << endl;
5240 cout <<
"<D> GlobTrack " <<
i <<
": update TofHitIndex from "
5241 << j <<
" (Mul " << NTofHitTMul[j] <<
") "
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;
5251 if (Weight_THMUL[
i][0] < Weight_THMUL
5254 cout <<
"<D> New cand. is better, invalidate entry for gt "
5258 NTofHitTMul[Bthi]--;
5259 IndTofTrack_TofHit[Bthi][0] = Btt;
5266 "<D> Stick to old assignment, Bthi %d, TM %d, THM %d",
5272 NTofHitTMul[Bthi]--;
5273 if (NTHMUL[
i] > 1) {
5275 for (Int_t jth = 0; jth < NTHMUL[
i];
5277 IndTHMUL[
i][jth] = IndTHMUL[
i][jth + 1];
5278 Weight_THMUL[
i][jth] = Weight_THMUL[
i][jth + 1];
5280 Btt = IndTHMUL[
i][0];
5286 cout <<
"<I> no TofTrack candidate for Global Track " <<
i
5297 cout <<
"<D> Old choice better, current options: NTHMUL "
5298 << NTHMUL[
i] <<
", take btt = " << IndTHMUL[
i][0]
5299 <<
", bthi " << Bthi << endl;
5305 cout <<
"<E> GlobTrack " <<
i
5306 <<
": double assignment of hit, check all possibilities "
5319 cout <<
"<D> GlobTrack " <<
i <<
", dist = " << dist
5320 <<
", w = " << Weight_THMUL[
i][0] <<
" -> remove TofTrack"
5329 cout <<
"<D> GlobTrack " <<
i <<
", dist = " << dist
5330 <<
", w = " << Weight_THMUL[
i][0] <<
" -> no TofTrack" << endl;
5336 cout <<
"<Dch> GlobTrack " <<
i <<
"(" <<
nGlobTracks <<
"), Btt "
5341 cout <<
"<Q> Reassignment iteration for b= " <<
fMCEventHeader->GetB()
5342 <<
": " << NReas << endl;
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;
5358 cout <<
"<Da> gt " <<
i <<
", th " << j <<
", s " << s << endl;
5361 if (0 == tparf->GetQp()) {
5363 cout <<
"<W2> Global Track " <<
i <<
" without Qp!, take from Sts " << s
5369 Float_t qpf = tparf->GetQp();
5371 cout <<
"<E2> GlobTrack " <<
i <<
", STS " << s <<
", TofHit " << j
5372 <<
" without momentum " << endl;
5377 Double_t vtxb = 100.;
5380 Int_t NStsMCc[100] = {100 * 0};
5385 FairTrackParam paramExtr;
5393 for (Int_t ih = 0; ih < NStsHits; ih++) {
5395 LOG(debug1) <<
" inspect STS track " << s <<
", hit " << ih
5396 <<
", hitindex " << iHind;
5397 if (NULL ==
fStsHits) LOG(fatal) <<
" No STS Hits available ";
5400 if (NULL == hit)
continue;
5401 LOG(debug1) <<
" valid hit " << ih <<
", hitindex " << iHind
5409 LOG(debug1) <<
" Mul f: " << fclu->
GetNofDigis() <<
" (";
5410 for (Int_t iDigi = 0; iDigi < fclu->
GetNofDigis(); iDigi++) {
5411 LOG(debug1) << fclu->
GetDigi(iDigi) <<
" ";
5415 LOG(debug1) << stsdigiMatch->
GetNofLinks() <<
" ";
5416 for (Int_t iL = 0; iL < stsdigiMatch->
GetNofLinks(); iL++) {
5420 if (NULL == poi)
continue;
5421 Int_t MCInd = poi->GetTrackID();
5422 LOG(debug1) <<
" MCInd " << poi->GetTrackID() <<
" ";
5424 for (; iMCt < NStsMCt; iMCt++) {
5425 if (MCInd == StsMCt[iMCt]) {
5430 if (iMCt == NStsMCt) {
5431 LOG(debug) <<
"contribution by new MC track: " << MCInd;
5432 StsMCt[iMCt] = MCInd;
5439 for (Int_t iDigi = 0; iDigi < bclu->
GetNofDigis(); iDigi++) {
5440 LOG(debug1) << bclu->
GetDigi(iDigi) <<
" ";
5444 LOG(debug1) << stsdigiMatch->
GetNofLinks() <<
" ";
5445 for (Int_t iL = 0; iL < stsdigiMatch->
GetNofLinks(); iL++) {
5449 Int_t MCInd = poi->GetTrackID();
5450 LOG(debug1) <<
" MCInd " << poi->GetTrackID() <<
" ";
5452 for (; iMCt < NStsMCt; iMCt++) {
5453 if (MCInd == StsMCt[iMCt]) {
5458 if (iMCt == NStsMCt) {
5459 LOG(debug) <<
"contribution by new back MC track: " << MCInd;
5460 StsMCt[iMCt] = MCInd;
5467 LOG(debug1) <<
"), mul b: " << bclu->
GetNofDigis();
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];
5475 LOG(debug) << ss.str();
5479 LOG(debug) <<
"StsTrack " << s <<
" with " << NStsHits
5480 <<
" Hits without StsPoints ??? from Global Track " <<
i
5481 <<
", TofHit " << j;
5484 Int_t iMaxCount = 0;
5485 for (Int_t k = 0; k < NStsMCt; k++) {
5486 if (NStsMCc[k] > iMaxCount) {
5488 iMaxCount = NStsMCc[k];
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);
5578 if (NULL == TofHit)
continue;
5584 LOG(fatal) <<
"No Digi Info available for TofHit !?? ";
5593 Int_t iPoiArr[iDigiMul];
5594 Int_t iTrkArr[iDigiMul];
5597 for (Int_t iLink = 0; iLink < digiMatch->
GetNofLinks();
5604 if (lp != iPoiArr[iPoiMul]) {
5607 iPoiArr[iPoiMul] = lp;
5609 iPoiArr[iPoiMul] = lp;
5613 k = TofPoint->GetTrackID();
5614 if (k != iTrkArr[iTrkMul]) {
5615 iTrkArr[iTrkMul] = k;
5617 iTrkArr[iTrkMul] = k;
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);
5640 if (tpar->GetQp() == 0.) {
5641 cout <<
"Invalid momentum for global track " <<
i <<
" TofHit " << j
5645 Double_t mom = 1. / tpar->GetQp();
5646 if (mom < 0.) mom = -mom;
5649 Float_t bet = vel /
clight;
5650 Double_t m2 = mom * mom * (1. / bet / bet - 1.);
5652 if (bet > 0.99999) { bet = 0.99999; }
5676 if (NULL != TofPoint) {
5700 if (dphi < -180.) { dphi += 360.; };
5701 if (dphi > 180.) { dphi -= 360.; };
5702 dphi = dphi / RADDEG;
5714 TMath::Cos(2 * dphi));
5722 if (use_pions_for_flow
5723 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5745 TMath::Cos(2 * dphi));
5753 if (use_pions_for_flow
5754 && TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5776 TMath::Cos(2 * dphi));
5794 TMath::Cos(2 * dphi));
5812 TMath::Cos(2 * dphi));
5821 if (TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5843 TMath::Cos(2 * dphi));
5861 TMath::Cos(2 * dphi));
5868 if (TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5888 TMath::Cos(2 * dphi));
5895 if (TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5915 TMath::Cos(2 * dphi));
5922 if (TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5942 TMath::Cos(2 * dphi));
5949 if (TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5972 TMath::Cos(2 * dphi));
5974 if (TMath::Abs((MCTrack->
GetRapidity() - yrp_mid) / yrp_mid)
5987 if (rp_weight != 0.) {
5988 if (gRandom->Uniform(1)
5991 Qx1 = Qx1 + rp_weight * MCTrack->
GetPx();
5992 Qy1 = Qy1 + rp_weight * MCTrack->
GetPy();
5995 Qx2 = Qx2 + rp_weight * MCTrack->
GetPx();
5996 Qy2 = Qy2 + rp_weight * MCTrack->
GetPy();
6003 cout <<
"<D> RP analysis " << Np1 <<
", " << Np2 << endl;
6005 if (Np1 > 0 && Np2 > 0) {
6006 phirp1 =
atan2(Qy1, Qx1);
6007 phirp2 =
atan2(Qy2, Qx2);
6009 TH1F* phirp_glo_fpar = (TH1F*)
fflowFile->Get(
"phirps_glo_fpar");
6011 for (
int j = 0; j < 4; j++) {
6012 Float_t
i = (float) (j + 1);
6014 (-phirp_glo_fpar->GetBinContent(j) * TMath::Cos(
i * phirp1)
6015 + phirp_glo_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp1))
6021 for (
int j = 0; j < 4; j++) {
6022 Float_t
i = (float) (j + 1);
6024 (-phirp_glo_fpar->GetBinContent(j) * TMath::Cos(
i * phirp2)
6025 + phirp_glo_fpar->GetBinContent(j + 4) * TMath::Sin(
i * phirp2))
6030 delrp = (phirp1 - phirp2);
6036 delrp = delrp * RADDEG;
6037 if (delrp < -180.) delrp += 360.;
6038 if (delrp > 180.) delrp -= 360.;
6041 phirp = RADDEG *
atan2(Qy1 + Qy2, Qx1 + Qx2);
6042 while (phirp < -180.) {
6045 while (phirp > 180.) {
6049 TH1F* phirp_glo_fpar = (TH1F*)
fflowFile->Get(
"phirp_glo_fpar");
6051 for (
int j = 0; j < 4; j++) {
6052 Float_t
i = (float) (j + 1);
6056 ((-phirp_glo_fpar->GetBinContent(j) * TMath::Cos(
i * phirp / RADDEG)
6057 + phirp_glo_fpar->GetBinContent(j + 4)
6058 * TMath::Sin(
i * phirp / RADDEG))
6063 phirp += dphir * RADDEG;
6064 while (phirp < -180.) {
6067 while (phirp > 180.) {
6073 while (delrp < -180.) {
6076 while (delrp > 180.) {
6090 LOG(info) <<
"-I- CbmHadronAnalysis::Exec : "
6091 <<
"event " <<
fEvents <<
" processed.";
6101 cout <<
"CbmHadronAnalysis::Finish up with " <<
fEvents <<
" analyzed events "
6105 Double_t sfac = 1.E7;
6107 cout <<
"<I> Normalisation factors " << sfe <<
"," << sfac << endl;
6127 TFile* fHist =
new TFile(
"data/auaumbias.hst.root",
"RECREATE");
6129 TIter next(gDirectory->GetList());
6132 while ((obj = (TObject*) next())) {
6133 if (obj->InheritsFrom(TH1::Class())) {
6146 #include "TLorentzVector.h"
6147 #include "TVector3.h"
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;
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;
6172 static TH2F* fa_ptm_rap_gen_lam;
6173 static TH2F* fa_ptm_rap_rec_lam;
6174 static TH2F* fa_ptm_rap_mix_lam;
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;
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;
6201 const Int_t iMode = 0;
6202 Float_t secMass[NSECMASS] = {0.139, 0.938};
6207 secMass[1] = 2.808381;
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.;
6221 <<
" StsHits and " << nTrdHits <<
" TrdHits in event " <<
iCandEv;
6225 Double_t MinvMin = secMass[0] + secMass[1];
6226 fhTofHitMul =
new TH1F(Form(
"hTofHitMul"),
6227 Form(
"TofHit Multiplicity; M_{TofHit} "),
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]"),
6239 new TH2F(Form(
"hdEdxMul"),
6240 Form(
"average energy loss vs TrdHitMul; TrdHitMul; dE []"),
6247 fhdEdxMulsec =
new TH2F(
6248 Form(
"hdEdxMulsec"),
6249 Form(
"av. energy loss vs TrdHitMul for secondaries; TrdHitMul; dE []"),
6257 new TH1F(Form(
"hDTRDprim"),
6258 Form(
"TRD transverse matching distance (prim); d [cm]"),
6262 fhDTRDsec =
new TH1F(Form(
"hDTRDsec"),
6263 Form(
"TRD transverse matching distance (sec); d [cm]"),
6268 fhDperp2 =
new TH1F(Form(
"hDperp2"),
6269 Form(
"transverse matching distance (prim); d [cm]"),
6273 fhDperpS =
new TH1F(Form(
"hDperpS"),
6274 Form(
"transverse matching distance (sec); d [cm]"),
6278 fhD0prim =
new TH1F(Form(
"hD0prim"),
6279 Form(
"transverse distance to primary vertex; d [cm]"),
6284 Form(
"hOpAng"), Form(
"opening angle; #alpha [rad]"), 100, 0., 0.5);
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]"),
6293 new TH1F(Form(
"hPathLen"), Form(
"path length; L [cm]"), 100, 0., 30.);
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]"),
6303 fhMIXMinv =
new TH1F(Form(
"hMIXMinv"),
6304 Form(
"invariant mass; M_{inv} [GeV]"),
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.);
6321 Float_t ptmmax = 2.5;
6325 fa_ptm_rap_gen_lam =
new TH2F(
"ptm_rap_gen_lam",
6326 "MCTrack-gen lam; y; p_{T}/m",
6333 fa_ptm_rap_rec_lam =
new TH2F(
"ptm_rap_rec_lam",
6334 "rec lam; y; p_{T}/m",
6341 fa_ptm_rap_mix_lam =
new TH2F(
"ptm_rap_mix_lam",
6342 "mix lam; y; p_{T}/m",
6358 if (MCTrack->
GetMotherId() == -1 && pdgCode == 3122) {
6359 fhMCLamMom->Fill(MCTrack->
GetP());
6360 TLorentzVector PLAM(MCTrack->
GetPx(),
6364 PLAM.RotateY(beamRotY *
TMath::Pi() / 180.);
6365 fa_ptm_rap_gen_lam->Fill(PLAM.Rapidity(), PLAM.Pt() / MCTrack->
GetMass());
6367 if (MCTrack->
GetMotherId() > -1 && pdgCode == -211) {
6373 fhMCPathLen->Fill(MCV.Mag());
6374 LOG(debug) <<
"MC vertex at Pathlen = " << MCV.Mag() <<
", pi-mom "
6380 fhTofHitMul->Fill((Double_t)
nTofHits);
6382 fvP.resize(fiNMixClasses);
6383 fvX.resize(fiNMixClasses);
6384 fvX0.resize(fiNMixClasses);
6385 fvDX.resize(fiNMixClasses);
6387 Int_t iMixClass =
nTofHits * fiNMixClasses / fiTofHitMulMax;
6388 if (iMixClass >= fiNMixClasses) iMixClass = fiNMixClasses - 1;
6390 std::vector<TLorentzVector> P;
6392 std::vector<TLorentzVector> X;
6394 std::vector<TVector3> X0;
6396 std::vector<TVector3> DX;
6398 const Int_t NTrdStations = 4;
6399 std::vector<std::vector<Int_t>> iTRD;
6409 Double_t dTrdDistMin[
nTofHits][NTrdStations];
6411 Int_t proton_cand = 0;
6412 Int_t pion_cand = 0;
6414 for (Int_t j = 0; j <
nStsHits; j++) {
6416 dTofDistMin[j] = 100.;
6417 dTofDist2Min[j] = 100.;
6423 if (NULL == pTofHit)
continue;
6424 if (pTofHit->
GetZ() == 0)
continue;
6425 for (Int_t i2 = 0; i2 <
nTofHits; i2++) {
6428 if (NULL == pTofHit2)
continue;
6430 if (pTofHit2->
GetZ() < pTofHit->
GetZ()) {
6433 pTofHit2 = pTofHittmp;
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;
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) {
6450 LOG(
DEBUG) <<
"Tof Hits " <<
i <<
" and " << i2 <<
" merged ";
6451 LOG(debug) <<
"Tof " <<
i <<
", xyz " << pTofHit->
GetX() <<
", "
6452 << pTofHit->
GetY() <<
", " << pTofHit->
GetZ();
6461 if (NULL == pTofHit)
continue;
6462 if (pTofHit->
GetZ() == 0)
continue;
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;
6469 for (Int_t j = 0; j <
nStsHits; j++) {
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]);
6487 && dDist < dStsDistMin[
i]) {
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",
6495 if (dDist > dTofDistMin[j])
6498 dStsDistMin[
i] = dDist;
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",
6511 for (Int_t j = 0; j <
nStsHits; j++) {
6512 if (iTofMin[j] < 0)
continue;
6513 Int_t
i = iTofMin[j];
6516 for (Int_t k = 0; k <
nStsHits; k++) {
6517 if (j == k)
continue;
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",
6534 && dDist < dSts2DistMin[
i]) {
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",
6542 if (dDist > dTofDist2Min[k])
6545 dSts2DistMin[
i] = dDist;
6547 if (pStsHit->
GetZ() < pSts2Hit->
GetZ()) {
6554 dTofDistMin[k] = dDist;
6555 LOG(debug) <<
"Prim Track cand found for Tof " <<
i <<
", Sts " << j
6557 << Form(
": dist %6.3f, Min %6.3f at z = %4.1f",
6568 Int_t j = iStsMin[
i][1];
6569 if (j < 0)
continue;
6571 if (NULL == pTofHit)
continue;
6572 if (pTofHit->
GetZ() == 0)
continue;
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;
6579 for (Int_t l = 0; l < nTrdHits; l++) {
6583 pStsHit->
GetX() + dDx * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6585 pStsHit->
GetY() + dDy * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6587 TMath::Sqrt(TMath::Power(dXexp - pTrdHit->
GetX(), 2)
6588 + TMath::Power(dYexp - pTrdHit->
GetY(), 2));
6590 LOG(
DEBUG) <<
"Inspect TRD hit " << l <<
" in "
6591 << Form(
"Module 0x%08x, layer %d",
6594 <<
" at z= " << pTrdHit->
GetZ() <<
" dD = " << dDtrans
6596 fhDTRDprim->Fill(dDtrans);
6598 && dDtrans < dTrdDistMin
6600 Int_t iMul = iTRD[
i].size();
6601 if (dTrdDistMin[
i][iTrdLayer] < 1.E3) {
6604 for (; ll < iMul; ll++)
6611 dTrdDistMin[
i][iTrdLayer] = dDtrans;
6612 iTRD[
i].resize(iMul + 1);
6615 LOG(
DEBUG) <<
"assign TrdHit " << l <<
" to TofHit " <<
i
6616 <<
" in layer " << iTrdLayer <<
" with d = " << dDtrans
6617 <<
", TrdMul" << iMul
6618 <<
", dEdx = " << pTrdHit->
GetELoss();
6624 Int_t iMul = iTRD[
i].size();
6626 Double_t ddEdx = 0.;
6627 for (Int_t l = 0; l < iMul; l++) {
6631 ddEdx /= (Double_t) iMul;
6632 fhdEdxMul->Fill((Double_t) iMul, ddEdx);
6640 Int_t j = iStsMin[
i][1];
6641 if (j < 0)
continue;
6643 if (NULL == pTofHit)
continue;
6644 if (pTofHit->
GetZ() == 0)
continue;
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;
6651 for (Int_t l = 0; l < nTrdHits; l++) {
6655 pStsHit->
GetX() + dDx * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6657 pStsHit->
GetY() + dDy * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6659 TMath::Sqrt(TMath::Power(dXexp - pTrdHit->
GetX(), 2)
6660 + TMath::Power(dYexp - pTrdHit->
GetY(), 2));
6662 LOG(
DEBUG) <<
"Inspect TRD hit " << l <<
" in "
6663 << Form(
"Module 0x%08x, layer %d",
6666 <<
" at z= " << pTrdHit->
GetZ() <<
" dD = " << dDtrans
6668 fhDTRDprim->Fill(dDtrans);
6670 && dDtrans < dTrdDistMin
6672 Int_t iMul = iTRD[
i].size();
6673 if (dTrdDistMin[
i][iTrdLayer] < 1.E3) {
6676 for (; ll < iMul; ll++)
6683 dTrdDistMin[
i][iTrdLayer] = dDtrans;
6684 iTRD[
i].resize(iMul + 1);
6687 LOG(
DEBUG) <<
"assign TrdHit " << l <<
" to TofHit " <<
i
6688 <<
" in layer " << iTrdLayer <<
" with d = " << dDtrans
6689 <<
", TrdMul" << iMul
6690 <<
", dEdx = " << pTrdHit->
GetELoss();
6696 Int_t iMul = iTRD[
i].size();
6698 Double_t ddEdx = 0.;
6699 for (Int_t l = 0; l < iMul; l++) {
6703 ddEdx /= (Double_t) iMul;
6704 fhdEdxMul->Fill((Double_t) iMul, ddEdx);
6712 if (NULL == pTofHit)
continue;
6713 if (pTofHit->
GetZ() == 0)
continue;
6714 if (iStsMin[
i][0] > -1 && iStsMin[
i][1] > -1) {
6718 Double_t dDx = pStsHit->
GetX() - pSts2Hit->
GetX();
6719 Double_t dDy = pStsHit->
GetY() - pSts2Hit->
GetY();
6720 Double_t dDz = pStsHit->
GetZ() - pSts2Hit->
GetZ();
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);
6729 && (Double_t) iTRD[
i].size()
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;
6735 Double_t
m = secMass[1];
6736 Double_t pmag =
m * bet / TMath::Sqrt(1. - bet * bet);
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(),
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);
6759 LOG(
DEBUG) <<
"Tof " <<
i
6760 << Form(
" sec cand Min %6.3f > %6.3f ?",
6764 Double_t dDistMin = 100.;
6768 if (NULL == pTofHit)
continue;
6769 if (pTofHit->
GetZ() == 0)
continue;
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 ",
6779 Double_t dDx = pTofHit->
GetX() - pStsHit->
GetX();
6780 Double_t dDy = pTofHit->
GetY() - pStsHit->
GetY();
6781 Double_t dDz = pTofHit->
GetZ() - pStsHit->
GetZ();
6783 for (Int_t k = 0; k <
nStsHits; k++) {
6784 if (j == k)
continue;
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",
6802 && dDist < dDistMin) {
6812 LOG(
DEBUG) <<
"Sec Dist for TofHit " <<
i <<
": " << dDistMin <<
", j "
6813 << jbest <<
", k " << kbest;
6815 if (dDistMin < 100.) {
6818 if (pSts2Hit->
GetZ() > pStsHit->
GetZ()) {
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++) {
6831 pStsHit->
GetX() + dDx * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6833 pStsHit->
GetY() + dDy * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6835 TMath::Sqrt(TMath::Power(dXexp - pTrdHit->
GetX(), 2)
6836 + TMath::Power(dYexp - pTrdHit->
GetY(), 2));
6838 fhDTRDsec->Fill(dDtrans);
6839 LOG(
DEBUG) <<
"Inspect sec. TRD hit " << l <<
" in "
6840 << Form(
"Module 0x%08x, layer %d",
6843 <<
" at z= " << pTrdHit->
GetZ() <<
" dD = " << dDtrans
6847 && dDtrans < dTrdDistMin
6850 Int_t iMul = iTRD[
i].size();
6851 if (dTrdDistMin[
i][iTrdLayer] < 1.E3) {
6854 for (; ll < iMul; ll++)
6861 dTrdDistMin[
i][iTrdLayer] = dDtrans;
6862 iTRD[
i].resize(iMul + 1);
6865 LOG(
DEBUG) <<
"assign TrdHit " << l <<
" to TofHit " <<
i
6866 <<
" in layer " << iTrdLayer <<
" with d = " << dDtrans
6867 <<
", TrdMul" << iMul
6868 <<
", dEdx = " << pTrdHit->
GetELoss();
6872 Int_t iMul = iTRD[
i].size();
6874 Double_t ddEdx = 0.;
6875 for (Int_t l = 0; l < iMul; l++) {
6879 ddEdx /= (Double_t) iMul;
6880 fhdEdxMulsec->Fill((Double_t) iMul, ddEdx);
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);
6891 Double_t bet = vel /
clight;
6892 if (bet > 0.9999)
continue;
6893 Double_t
m = secMass[0];
6895 m * bet / TMath::Sqrt(1. - bet * bet);
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(),
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);
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++) {
6921 pStsHit->
GetX() + dDx * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6923 pStsHit->
GetY() + dDy * (pTrdHit->
GetZ() - pStsHit->
GetZ()) / dDz;
6925 TMath::Sqrt(TMath::Power(dXexp - pTrdHit->
GetX(), 2)
6926 + TMath::Power(dYexp - pTrdHit->
GetY(), 2));
6928 fhDTRDsec->Fill(dDtrans);
6929 LOG(
DEBUG) <<
"Inspect sec. TRD hit " << l <<
" in "
6930 << Form(
"Module 0x%08x, layer %d",
6933 <<
" at z= " << pTrdHit->
GetZ() <<
" dD = " << dDtrans
6937 && dDtrans < dTrdDistMin
6940 Int_t iMul = iTRD[
i].size();
6941 if (dTrdDistMin[
i][iTrdLayer] < 1.E3) {
6944 for (; ll < iMul; ll++)
6951 dTrdDistMin[
i][iTrdLayer] = dDtrans;
6952 iTRD[
i].resize(iMul + 1);
6955 LOG(
DEBUG) <<
"assign TrdHit " << l <<
" to TofHit " <<
i
6956 <<
" in layer " << iTrdLayer <<
" with d = " << dDtrans
6957 <<
", TrdMul" << iMul
6958 <<
", dEdx = " << pTrdHit->
GetELoss();
6962 Int_t iMul = iTRD[
i].size();
6964 Double_t ddEdx = 0.;
6965 for (Int_t l = 0; l < iMul; l++) {
6969 ddEdx /= (Double_t) iMul;
6970 fhdEdxMulsec->Fill((Double_t) iMul, ddEdx);
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);
6981 Double_t bet = vel /
clight;
6982 if (bet > 0.9999)
continue;
6983 Double_t
m = secMass[0];
6985 m * bet / TMath::Sqrt(1. - bet * bet);
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(),
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);
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();
7011 fvP[iMixClass].push_front(P);
7012 fvX[iMixClass].push_front(X);
7013 fvX0[iMixClass].push_front(X0);
7014 fvDX[iMixClass].push_front(DX);
7017 fvP[iMixClass].pop_back();
7018 fvX[iMixClass].pop_back();
7019 fvX0[iMixClass].pop_back();
7020 fvDX[iMixClass].pop_back();
7027 if (TMath::Abs(P[
i].M() - secMass[1]) < 0.01) {
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();
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();
7046 std::vector<TLorentzVector> PE = *itP;
7047 std::vector<TLorentzVector> XE = *itX;
7048 std::vector<TVector3> X0E = *itX0;
7049 std::vector<TVector3> DXE = *itDX;
7050 LOG(debug1) <<
"iMixEv " << iMixEv <<
": PE has size " << PE.size()
7051 <<
", X0E: " << X0E.size();
7053 if (PE != P) LOG(fatal) <<
"P not properly restored from list";
7056 for (UInt_t j = 0; j < PE.size(); j++) {
7057 if (TMath::Abs(PE[j].M() - secMass[0]) < 0.01) {
7059 Double_t dOpAngle = DX[
i].Angle(DXE[j]);
7061 fhOpAng->Fill(dOpAngle);
7063 fhMIXOpAng->Fill(dOpAngle);
7066 TVector3 N = DX[
i].Cross(DXE[j]);
7067 if (N.Mag() == 0.)
continue;
7069 Double_t dDCA = TMath::Abs((X0[
i] - X0E[j]) * N);
7073 fhMIXDCA->Fill(dDCA);
7074 LOG(debug) <<
"DCA for iMixEv " << iMixEv <<
" at ind i " <<
i
7075 <<
", j " << j <<
": " << dDCA;
7076 if (dDCA == 0.)
continue;
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;
7083 Double_t dVLen = V.Mag();
7086 TLorentzVector PM = P[
i] + PE[j];
7087 TVector3 PV = TVector3(PM.Px(), PM.Py(), PM.Pz());
7089 dVLen / PM.Beta() /
clight;
7091 Double_t TofMLast = 100.;
7093 std::vector<TLorentzVector> Ptmp = P;
7094 std::vector<TLorentzVector> PEtmp = PE;
7095 std::vector<TLorentzVector> Xtmp = X;
7096 std::vector<TLorentzVector> XEtmp = XE;
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;
7105 for (Int_t ii = 0; ii < 2; ii++) {
7112 TofX = Xtmp[k].Vect();
7117 TofX = XEtmp[k].Vect();
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;
7126 m * bet / TMath::Sqrt(1. - bet * bet);
7127 TVector3 vPsec = vDTofV;
7129 Double_t E = TMath::Sqrt(pmag * pmag +
m *
m);
7131 Ptmp[k].SetVect(vPsec);
7134 PEtmp[k].SetVect(vPsec);
7138 PM = Ptmp[
i] + PEtmp[j];
7139 PV = TVector3(PM.Px(), PM.Py(), PM.Pz());
7141 TofM = dVLen / PM.Beta() /
clight;
7143 Double_t minv = PM.M();
7146 fhPathLen->Fill(dVLen);
7147 fhMMom->Fill(PV.Mag());
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;
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);
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);