235 static int L1_NEVENTS = 0;
236 static double L1_CATIME = 0.0;
247 static int statNghost = 0;
250 ntra.
ghosts += rtraIt->IsGhost();
251 if (0 && rtraIt->IsGhost()) {
253 std::stringstream ss;
254 ss <<
" L1: ghost track: nhits " << rtraIt->GetNofHits() <<
" p " << 1. / rtraIt->GetQp() <<
" purity "
255 << rtraIt->GetMaxPurity() <<
" | hits ";
256 for (map<int, int>::iterator posIt = rtraIt->hitMap.begin(); posIt != rtraIt->hitMap.end(); posIt++) {
257 ss <<
" (" << posIt->second <<
" " << posIt->first <<
") ";
259 LOG(info) << ss.str();
260 for (map<int, int>::iterator posIt = rtraIt->hitMap.begin(); posIt != rtraIt->hitMap.end(); posIt++) {
262 LOG(info) <<
"mc " << posIt->first <<
" pdg " << mcTrk.GetPdgCode() <<
" mother: " << mcTrk.GetMotherId()
263 <<
" chain " << mcTrk.GetChainId() <<
" n mc stations: " << mcTrk.GetNofConsStationsWithPoint();
265 for (
unsigned int i = 0; i < rtraIt->Hits.size(); i++) {
268 LOG(info) <<
" x y z t " << s.
x <<
" " << s.
y <<
" " <<
h.Z() <<
" dx " << s.
dx <<
" dy " << s.
dy;
270 h.Z(),
h.T(), s.
dx, s.
dy);
287 if (!mcTrk.IsReconstructable() && !mcTrk.IsAdditional())
continue;
291 const bool reco = (mcTrk.IsReconstructed());
293 const bool killed = !reco && mcTrk.IsDisturbed();
295 double ratio_length = 0;
296 double ratio_fakes = 0;
297 double mc_length_hits = mcTrk.GetTotNofStationsWithHit();
300 int mc_length = mcTrk.GetTotNofStationsWithPoint();
302 for (
unsigned int irt : mcTrk.GetRecoTrackIndexes()) {
304 ratio_length +=
static_cast<double>(rTrk.GetNofHits()) * rTrk.GetMaxPurity() / mc_length_hits;
305 ratio_fakes += 1 - rTrk.GetMaxPurity();
312 if (reco) nclones = mcTrk.GetNofClones();
321 if (mcTrk.IsAdditional()) {
322 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"short");
323 switch (mcTrk.GetPdgCode()) {
326 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"shortE");
330 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"shortPion");
334 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"shortKaon");
338 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"shortProton");
340 default: ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"shortRest");
346 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"total");
348 if (mcTrk.IsSignal()) {
349 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"d0");
353 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"fast");
355 if (mcTrk.IsPrimary()) {
356 if (mcTrk.GetTotNofStationsWithHit() ==
fNStations) {
357 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"long_fast_prim");
359 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"fast_prim");
362 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"fast_sec");
366 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"slow");
368 if (mcTrk.IsPrimary()) {
369 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"slow_prim");
372 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"slow_sec");
376 if (mcTrk.GetPdgCode() == 11 || mcTrk.GetPdgCode() == -11) {
377 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"total_e");
380 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"fast_e");
382 if (mcTrk.IsPrimary()) {
385 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"fast_sec_e");
389 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"slow_e");
391 if (mcTrk.IsPrimary()) {
394 ntra.
Inc(reco, killed, ratio_length, ratio_fakes, nclones, mc_length, mc_length_hits,
"slow_sec_e");
413 std::stringstream ss;
414 ss <<
"Number of true and fake hits in stations: \n";
416 ss << sta_nhits[i] - sta_nfakes[i] <<
"+" << sta_nfakes[i] <<
" ";
418 LOG(info) << ss.str();
421 <<
"L1 ACCUMULATED STAT : " << L1_NEVENTS <<
" EVENTS \n";
423 LOG(info) <<
"Reconstructible MC tracks/event: "
425 LOG(info) <<
"Reconstructed MC tracks/event: "
427 LOG(info) <<
"\nCA Track Finder: " << L1_CATIME / L1_NEVENTS <<
" s/time slice \n";
435 static TProfile *p_eff_all_vs_mom, *p_eff_prim_vs_mom, *p_eff_sec_vs_mom, *p_eff_d0_vs_mom, *p_eff_prim_vs_theta,
436 *p_eff_all_vs_pt, *p_eff_prim_vs_pt, *p_eff_all_vs_nhits, *p_eff_prim_vs_nhits, *p_eff_sec_vs_nhits;
438 static TH1F *h_reg_MCmom, *h_acc_MCmom, *h_reco_MCmom, *h_ghost_Rmom;
439 static TH1F *h_reg_prim_MCmom, *h_acc_prim_MCmom, *h_reco_prim_MCmom;
440 static TH1F *h_reg_sec_MCmom, *h_acc_sec_MCmom, *h_reco_sec_MCmom;
442 static TH1F* h_acc_mom_short123s;
444 static TH1F *h_reg_mom_prim, *h_reg_mom_sec, *h_reg_nhits_prim, *h_reg_nhits_sec;
445 static TH1F *h_acc_mom_prim, *h_acc_mom_sec, *h_acc_nhits_prim, *h_acc_nhits_sec;
446 static TH1F *h_reco_mom_prim, *h_reco_mom_sec, *h_reco_nhits_prim, *h_reco_nhits_sec;
447 static TH1F *h_rest_mom_prim, *h_rest_mom_sec, *h_rest_nhits_prim, *h_rest_nhits_sec;
451 static TH1F *h_ghost_purity, *h_ghost_mom, *h_ghost_nhits, *h_ghost_fstation, *h_ghost_chi2, *h_ghost_prob,
452 *h_ghost_tx, *h_ghost_ty;
453 static TH1F *h_reco_mom, *h_reco_d0_mom, *h_reco_nhits, *h_reco_station, *h_reco_chi2, *h_reco_prob, *h_rest_prob,
454 *h_reco_purity, *h_reco_time;
455 static TProfile *h_reco_timeNtr, *h_reco_timeNhit;
456 static TProfile *h_reco_fakeNtr, *h_reco_fakeNhit;
457 static TH1F *h_tx, *h_ty, *h_sec_r, *h_ghost_r;
459 static TH1F *h_notfound_mom, *h_notfound_nhits, *h_notfound_station, *h_notfound_r, *h_notfound_tx, *h_notfound_ty;
461 static TH1F *h_mcp, *h_nmchits;
466 static TH2F *h2_vertex, *h2_prim_vertex, *h2_sec_vertex;
469 static TH2F *h2_reg_nhits_vs_mom_prim, *h2_reg_nhits_vs_mom_sec, *h2_reg_fstation_vs_mom_prim,
470 *h2_reg_fstation_vs_mom_sec, *h2_reg_lstation_vs_fstation_prim, *h2_reg_lstation_vs_fstation_sec;
471 static TH2F *h2_acc_nhits_vs_mom_prim, *h2_acc_nhits_vs_mom_sec, *h2_acc_fstation_vs_mom_prim,
472 *h2_acc_fstation_vs_mom_sec, *h2_acc_lstation_vs_fstation_prim, *h2_acc_lstation_vs_fstation_sec;
473 static TH2F *h2_reco_nhits_vs_mom_prim, *h2_reco_nhits_vs_mom_sec, *h2_reco_fstation_vs_mom_prim,
474 *h2_reco_fstation_vs_mom_sec, *h2_reco_lstation_vs_fstation_prim, *h2_reco_lstation_vs_fstation_sec;
475 static TH2F *h2_ghost_nhits_vs_mom, *h2_ghost_fstation_vs_mom, *h2_ghost_lstation_vs_fstation;
476 static TH2F *h2_rest_nhits_vs_mom_prim, *h2_rest_nhits_vs_mom_sec, *h2_rest_fstation_vs_mom_prim,
477 *h2_rest_fstation_vs_mom_sec, *h2_rest_lstation_vs_fstation_prim, *h2_rest_lstation_vs_fstation_sec;
479 static TH1F* h_reg_phi_prim;
480 static TH1F* h_reg_phi_sec;
481 static TH1F* h_acc_phi_prim;
482 static TH1F* h_acc_phi_sec;
483 static TH1F* h_reco_phi_prim;
484 static TH1F* h_reco_phi_sec;
485 static TH1F* h_rest_phi_prim;
486 static TH1F* h_rest_phi_sec;
487 static TH1F* h_ghost_phi;
488 static TH1F* h_reco_phi;
489 static TH1F* h_notfound_phi;
491 static TH2F* h2_fst_hit_yz;
492 static TH2F* h2_lst_hit_yz;
493 static TH2F* h2_all_hit_yz;
495 static bool first_call = 1;
500 TDirectory* curdir = gDirectory;
504 new TH2F(
"h2_fst_hit_yz",
"Track first hit occupancy in y-z plane;z [cm];y [cm]", 80, 0, 0, 80, 0, 0);
506 new TH2F(
"h2_lst_hit_yz",
"Track last hit occupancy in y-z plane;z[ cm];y [cm]", 80, 0, 0, 80, 0, 0);
507 h2_all_hit_yz =
new TH2F(
"h2_all_hit_yz",
"Track hit occupancy in y-z plane;z[ cm];y [cm]", 80, 0, 0, 80, 0, 0);
509 p_eff_all_vs_mom =
new TProfile(
"p_eff_all_vs_mom",
"AllSet Efficiency vs Momentum", 100, 0.0, 5.0, 0.0, 100.0);
511 new TProfile(
"p_eff_prim_vs_mom",
"Primary Set Efficiency vs Momentum", 100, 0.0, 5.0, 0.0, 100.0);
513 new TProfile(
"p_eff_sec_vs_mom",
"Secondary Set Efficiency vs Momentum", 100, 0.0, 5.0, 0.0, 100.0);
515 new TProfile(
"p_eff_d0_vs_mom",
"D0 Secondary Tracks Efficiency vs Momentum", 150, 0.0, 15.0, 0.0, 100.0);
516 p_eff_prim_vs_theta =
517 new TProfile(
"p_eff_prim_vs_theta",
"All Primary Set Efficiency vs Theta", 100, 0.0, 30.0, 0.0, 100.0);
518 p_eff_all_vs_pt =
new TProfile(
"p_eff_all_vs_pt",
"AllSet Efficiency vs Pt", 100, 0.0, 5.0, 0.0, 100.0);
519 p_eff_prim_vs_pt =
new TProfile(
"p_eff_prim_vs_pt",
"Primary Set Efficiency vs Pt", 100, 0.0, 5.0, 0.0, 100.0);
521 p_eff_all_vs_nhits =
new TProfile(
"p_eff_all_vs_nhits",
"AllSet Efficiency vs NMCHits", 8, 3.0, 11.0, 0.0, 100.0);
522 p_eff_prim_vs_nhits =
523 new TProfile(
"p_eff_prim_vs_nhits",
"PrimSet Efficiency vs NMCHits", 8, 3.0, 11.0, 0.0, 100.0);
524 p_eff_sec_vs_nhits =
new TProfile(
"p_eff_sec_vs_nhits",
"SecSet Efficiency vs NMCHits", 8, 3.0, 11.0, 0.0, 100.0);
526 h_reg_MCmom =
new TH1F(
"h_reg_MCmom",
"Momentum of registered tracks", 100, 0.0, 5.0);
527 h_acc_MCmom =
new TH1F(
"h_acc_MCmom",
"Reconstructable tracks", 100, 0.0, 5.0);
528 h_reco_MCmom =
new TH1F(
"h_reco_MCmom",
"Reconstructed tracks", 100, 0.0, 5.0);
530 h_ghost_Rmom =
new TH1F(
"h_ghost_Rmom",
"Ghost tracks", 100, 0.0, 5.0);
531 h_reg_prim_MCmom =
new TH1F(
"h_reg_prim_MCmom",
"Momentum of registered tracks", 100, 0.0, 5.0);
532 h_acc_prim_MCmom =
new TH1F(
"h_acc_prim_MCmom",
"Reconstructable tracks", 100, 0.0, 5.0);
533 h_reco_prim_MCmom =
new TH1F(
"h_reco_prim_MCmom",
"Reconstructed tracks", 100, 0.0, 5.0);
534 h_reg_sec_MCmom =
new TH1F(
"h_reg_sec_MCmom",
"Momentum of registered tracks", 100, 0.0, 5.0);
535 h_acc_sec_MCmom =
new TH1F(
"h_acc_sec_MCmom",
"Reconstructable tracks", 100, 0.0, 5.0);
536 h_reco_sec_MCmom =
new TH1F(
"h_reco_sec_MCmom",
"Reconstructed tracks", 100, 0.0, 5.0);
538 h_acc_mom_short123s =
539 new TH1F(
"h_acc_mom_short123s",
"Momentum of accepted tracks with 3 hits on first stations", 500, 0.0, 5.0);
541 h_reg_mom_prim =
new TH1F(
"h_reg_mom_prim",
"Momentum of registered primary tracks", 500, 0.0, 5.0);
542 h_reg_mom_sec =
new TH1F(
"h_reg_mom_sec",
"Momentum of registered secondary tracks", 500, 0.0, 5.0);
543 h_acc_mom_prim =
new TH1F(
"h_acc_mom_prim",
"Momentum of accepted primary tracks", 500, 0.0, 5.0);
544 h_acc_mom_sec =
new TH1F(
"h_acc_mom_sec",
"Momentum of accepted secondary tracks", 500, 0.0, 5.0);
545 h_reco_mom_prim =
new TH1F(
"h_reco_mom_prim",
"Momentum of reconstructed primary tracks", 500, 0.0, 5.0);
546 h_reco_mom_sec =
new TH1F(
"h_reco_mom_sec",
"Momentum of reconstructed secondary tracks", 500, 0.0, 5.0);
547 h_rest_mom_prim =
new TH1F(
"h_rest_mom_prim",
"Momentum of not found primary tracks", 500, 0.0, 5.0);
548 h_rest_mom_sec =
new TH1F(
"h_rest_mom_sec",
"Momentum of not found secondary tracks", 500, 0.0, 5.0);
550 h_reg_phi_prim =
new TH1F(
"h_reg_phi_prim",
"Azimuthal angle of registered primary tracks", 1000, -3.15, 3.15);
551 h_reg_phi_sec =
new TH1F(
"h_reg_phi_sec",
"Azimuthal angle of registered secondary tracks", 1000, -3.15, 3.15);
552 h_acc_phi_prim =
new TH1F(
"h_acc_phi_prim",
"Azimuthal angle of accepted primary tracks", 1000, -3.15, 3.15);
553 h_acc_phi_sec =
new TH1F(
"h_acc_phi_sec",
"Azimuthal angle of accepted secondary tracks", 1000, -3.15, 3.15);
554 h_reco_phi_prim =
new TH1F(
"h_reco_phi_prim",
"Azimuthal angle of reconstructed primary tracks", 1000, -3.15, 3.15);
555 h_reco_phi_sec =
new TH1F(
"h_reco_phi_sec",
"Azimuthal angle of reconstructed secondary tracks", 1000, -3.15, 3.15);
556 h_rest_phi_prim =
new TH1F(
"h_rest_phi_prim",
"Azimuthal angle of not found primary tracks", 1000, -3.15, 3.15);
557 h_rest_phi_sec =
new TH1F(
"h_rest_phi_sec",
"Azimuthal angle of not found secondary tracks", 1000, -3.15, 3.15);
559 h_reg_nhits_prim =
new TH1F(
"h_reg_nhits_prim",
"Number of hits in registered primary track", 51, -0.1, 10.1);
560 h_reg_nhits_sec =
new TH1F(
"h_reg_nhits_sec",
"Number of hits in registered secondary track", 51, -0.1, 10.1);
561 h_acc_nhits_prim =
new TH1F(
"h_acc_nhits_prim",
"Number of hits in accepted primary track", 51, -0.1, 10.1);
562 h_acc_nhits_sec =
new TH1F(
"h_acc_nhits_sec",
"Number of hits in accepted secondary track", 51, -0.1, 10.1);
563 h_reco_nhits_prim =
new TH1F(
"h_reco_nhits_prim",
"Number of hits in reconstructed primary track", 51, -0.1, 10.1);
564 h_reco_nhits_sec =
new TH1F(
"h_reco_nhits_sec",
"Number of hits in reconstructed secondary track", 51, -0.1, 10.1);
565 h_rest_nhits_prim =
new TH1F(
"h_rest_nhits_prim",
"Number of hits in not found primary track", 51, -0.1, 10.1);
566 h_rest_nhits_sec =
new TH1F(
"h_rest_nhits_sec",
"Number of hits in not found secondary track", 51, -0.1, 10.1);
568 h_ghost_mom =
new TH1F(
"h_ghost_mom",
"Momentum of ghost tracks", 500, 0.0, 5.0);
569 h_ghost_phi =
new TH1F(
"h_ghost_phi",
"Azimuthal angle of ghost tracks", 1000, -3.15, 3.15);
570 h_ghost_nhits =
new TH1F(
"h_ghost_nhits",
"Number of hits in ghost track", 51, -0.1, 10.1);
571 h_ghost_fstation =
new TH1F(
"h_ghost_fstation",
"First station of ghost track", 50, -0.5, 10.0);
572 h_ghost_chi2 =
new TH1F(
"h_ghost_chi2",
"Chi2/NDF of ghost track", 50, -0.5, 10.0);
573 h_ghost_prob =
new TH1F(
"h_ghost_prob",
"Prob of ghost track", 505, 0., 1.01);
574 h_ghost_r =
new TH1F(
"h_ghost_r",
"R of ghost track at the first hit", 50, 0.0, 150.0);
575 h_ghost_tx =
new TH1F(
"h_ghost_tx",
"tx of ghost track at the first hit", 50, -5.0, 5.0);
576 h_ghost_ty =
new TH1F(
"h_ghost_ty",
"ty of ghost track at the first hit", 50, -1.0, 1.0);
577 h_ghost_purity =
new TH1F(
"h_ghost_purity",
"Ghost: percentage of correct hits", 100, -0.5, 100.5);
579 h_reco_mom =
new TH1F(
"h_reco_mom",
"Momentum of reco track", 50, 0.0, 5.0);
580 h_reco_phi =
new TH1F(
"h_reco_phi",
"Azimuthal angle of reco track", 1000, -3.15, 3.15);
581 h_reco_nhits =
new TH1F(
"h_reco_nhits",
"Number of hits in reco track", 50, 0.0, 10.0);
582 h_reco_station =
new TH1F(
"h_reco_station",
"First station of reco track", 50, -0.5, 10.0);
583 h_reco_chi2 =
new TH1F(
"h_reco_chi2",
"Chi2/NDF of reco track", 50, -0.5, 10.0);
584 h_reco_prob =
new TH1F(
"h_reco_prob",
"Prob of reco track", 505, 0., 1.01);
585 h_rest_prob =
new TH1F(
"h_rest_prob",
"Prob of reco rest track", 505, 0., 1.01);
586 h_reco_purity =
new TH1F(
"h_reco_purity",
"Percentage of correct hits", 100, -0.5, 100.5);
587 h_reco_time =
new TH1F(
"h_reco_time",
"CA Track Finder Time (s/ev)", 20, 0.0, 20.0);
588 h_reco_timeNtr =
new TProfile(
"h_reco_timeNtr",
"CA Track Finder Time (s/ev) vs N Tracks", 200, 0.0, 1000.0);
589 h_reco_timeNhit =
new TProfile(
"h_reco_timeNhit",
"CA Track Finder Time (s/ev) vs N Hits", 200, 0.0, 30000.0);
590 h_reco_fakeNtr =
new TProfile(
"h_reco_fakeNtr",
"N Fake hits vs N Tracks", 200, 0.0, 1000.0);
591 h_reco_fakeNhit =
new TProfile(
"h_reco_fakeNhit",
"N Fake hits vs N Hits", 200, 0.0, 30000.0);
593 h_reco_d0_mom =
new TH1F(
"h_reco_d0_mom",
"Momentum of reco D0 track", 150, 0.0, 15.0);
607 h_tx =
new TH1F(
"h_tx",
"tx of MC track at the vertex", 50, -0.5, 0.5);
608 h_ty =
new TH1F(
"h_ty",
"ty of MC track at the vertex", 50, -0.5, 0.5);
610 h_sec_r =
new TH1F(
"h_sec_r",
"R of sec MC track at the first hit", 50, 0.0, 15.0);
612 h_notfound_mom =
new TH1F(
"h_notfound_mom",
"Momentum of not found track", 50, 0.0, 5.0);
613 h_notfound_phi =
new TH1F(
"h_notfound_phi",
"Momentum of not found track", 50, 0.0, 5.0);
614 h_notfound_nhits =
new TH1F(
"h_notfound_nhits",
"Num hits of not found track", 50, 0.0, 10.0);
615 h_notfound_station =
new TH1F(
"h_notfound_station",
"First station of not found track", 50, 0.0, 10.0);
616 h_notfound_r =
new TH1F(
"h_notfound_r",
"R at first hit of not found track", 50, 0.0, 15.0);
617 h_notfound_tx =
new TH1F(
"h_notfound_tx",
"tx of not found track at the first hit", 50, -5.0, 5.0);
618 h_notfound_ty =
new TH1F(
"h_notfound_ty",
"ty of not found track at the first hit", 50, -1.0, 1.0);
626 h_mcp =
new TH1F(
"h_mcp",
"MC P ", 500, 0.0, 5.0);
632 h_nmchits =
new TH1F(
"h_nmchits",
"N STS hits on MC track", 50, 0.0, 10.0);
636 h2_vertex =
new TH2F(
"h2_vertex",
"2D vertex distribution", 105, -5., 100., 100, -50., 50.);
637 h2_prim_vertex =
new TH2F(
"h2_primvertex",
"2D primary vertex distribution", 105, -5., 100., 100, -50., 50.);
638 h2_sec_vertex =
new TH2F(
"h2_sec_vertex",
"2D secondary vertex distribution", 105, -5., 100., 100, -50., 50.);
644 h2_reg_nhits_vs_mom_prim =
645 new TH2F(
"h2_reg_nhits_vs_mom_prim",
"NHits vs. Momentum (Reg. Primary Tracks)", 51, -0.05, 5.05, 11, -0.5, 10.5);
646 h2_reg_nhits_vs_mom_sec =
new TH2F(
"h2_reg_nhits_vs_mom_sec",
"NHits vs. Momentum (Reg. Secondary Tracks)", 51,
647 -0.05, 5.05, 11, -0.5, 10.5);
648 h2_acc_nhits_vs_mom_prim =
649 new TH2F(
"h2_acc_nhits_vs_mom_prim",
"NHits vs. Momentum (Acc. Primary Tracks)", 51, -0.05, 5.05, 11, -0.5, 10.5);
650 h2_acc_nhits_vs_mom_sec =
new TH2F(
"h2_acc_nhits_vs_mom_sec",
"NHits vs. Momentum (Acc. Secondary Tracks)", 51,
651 -0.05, 5.05, 11, -0.5, 10.5);
652 h2_reco_nhits_vs_mom_prim =
new TH2F(
"h2_reco_nhits_vs_mom_prim",
"NHits vs. Momentum (Reco Primary Tracks)", 51,
653 -0.05, 5.05, 11, -0.5, 10.5);
654 h2_reco_nhits_vs_mom_sec =
new TH2F(
"h2_reco_nhits_vs_mom_sec",
"NHits vs. Momentum (Reco Secondary Tracks)", 51,
655 -0.05, 5.05, 11, -0.5, 10.5);
656 h2_ghost_nhits_vs_mom =
657 new TH2F(
"h2_ghost_nhits_vs_mom",
"NHits vs. Momentum (Ghost Tracks)", 51, -0.05, 5.05, 11, -0.5, 10.5);
658 h2_rest_nhits_vs_mom_prim =
new TH2F(
"h2_rest_nhits_vs_mom_prim",
"NHits vs. Momentum (!Found Primary Tracks)", 51,
659 -0.05, 5.05, 11, -0.5, 10.5);
660 h2_rest_nhits_vs_mom_sec =
new TH2F(
"h2_rest_nhits_vs_mom_sec",
"NHits vs. Momentum (!Found Secondary Tracks)", 51,
661 -0.05, 5.05, 11, -0.5, 10.5);
663 h2_reg_fstation_vs_mom_prim =
664 new TH2F(
"h2_reg_fstation_vs_mom_prim",
"First Station vs. Momentum (Reg. Primary Tracks)", 51, -0.05, 5.05, 11,
666 h2_reg_fstation_vs_mom_sec =
667 new TH2F(
"h2_reg_fstation_vs_mom_sec",
"First Station vs. Momentum (Reg. Secondary Tracks)", 51, -0.05, 5.05, 11,
669 h2_acc_fstation_vs_mom_prim =
670 new TH2F(
"h2_acc_fstation_vs_mom_prim",
"First Station vs. Momentum (Acc. Primary Tracks)", 51, -0.05, 5.05, 11,
672 h2_acc_fstation_vs_mom_sec =
673 new TH2F(
"h2_acc_fstation_vs_mom_sec",
"First Station vs. Momentum (Acc. Secondary Tracks)", 51, -0.05, 5.05, 11,
675 h2_reco_fstation_vs_mom_prim =
676 new TH2F(
"h2_reco_fstation_vs_mom_prim",
"First Station vs. Momentum (Reco Primary Tracks)", 51, -0.05, 5.05, 11,
678 h2_reco_fstation_vs_mom_sec =
679 new TH2F(
"h2_reco_fstation_vs_mom_sec",
"First Station vs. Momentum (Reco Secondary Tracks)", 51, -0.05, 5.05, 11,
681 h2_ghost_fstation_vs_mom =
new TH2F(
"h2_ghost_fstation_vs_mom",
"First Station vs. Momentum (Ghost Tracks)", 51,
682 -0.05, 5.05, 11, -0.5, 10.5);
683 h2_rest_fstation_vs_mom_prim =
684 new TH2F(
"h2_rest_fstation_vs_mom_prim",
"First Station vs. Momentum (!Found Primary Tracks)", 51, -0.05, 5.05,
686 h2_rest_fstation_vs_mom_sec =
687 new TH2F(
"h2_rest_fstation_vs_mom_sec",
"First Station vs. Momentum (!Found Secondary Tracks)", 51, -0.05, 5.05,
690 h2_reg_lstation_vs_fstation_prim =
691 new TH2F(
"h2_reg_lstation_vs_fstation_prim",
"Last vs. First Station (Reg. Primary Tracks)", 11, -0.5, 10.5, 11,
693 h2_reg_lstation_vs_fstation_sec =
694 new TH2F(
"h2_reg_lstation_vs_fstation_sec",
"Last vs. First Station (Reg. Secondary Tracks)", 11, -0.5, 10.5, 11,
696 h2_acc_lstation_vs_fstation_prim =
697 new TH2F(
"h2_acc_lstation_vs_fstation_prim",
"Last vs. First Station (Acc. Primary Tracks)", 11, -0.5, 10.5, 11,
699 h2_acc_lstation_vs_fstation_sec =
700 new TH2F(
"h2_acc_lstation_vs_fstation_sec",
"Last vs. First Station (Acc. Secondary Tracks)", 11, -0.5, 10.5, 11,
702 h2_reco_lstation_vs_fstation_prim =
703 new TH2F(
"h2_reco_lstation_vs_fstation_prim",
"Last vs. First Station (Reco Primary Tracks)", 11, -0.5, 10.5, 11,
705 h2_reco_lstation_vs_fstation_sec =
706 new TH2F(
"h2_reco_lstation_vs_fstation_sec",
"Last vs. First Station (Reco Secondary Tracks)", 11, -0.5, 10.5, 11,
708 h2_ghost_lstation_vs_fstation =
new TH2F(
"h2_ghost_lstation_vs_fstation",
"Last vs. First Station (Ghost Tracks)",
709 11, -0.5, 10.5, 11, -0.5, 10.5);
710 h2_rest_lstation_vs_fstation_prim =
711 new TH2F(
"h2_rest_lstation_vs_fstation_prim",
"Last vs. First Station (!Found Primary Tracks)", 11, -0.5, 10.5,
713 h2_rest_lstation_vs_fstation_sec =
714 new TH2F(
"h2_rest_lstation_vs_fstation_sec",
"Last vs. First Station (!Found Secondary Tracks)", 11, -0.5, 10.5,
726 static int NEvents = 0;
728 h_reg_MCmom->Scale(NEvents);
729 h_acc_MCmom->Scale(NEvents);
730 h_reco_MCmom->Scale(NEvents);
731 h_ghost_Rmom->Scale(NEvents);
732 h_reg_prim_MCmom->Scale(NEvents);
733 h_acc_prim_MCmom->Scale(NEvents);
734 h_reco_prim_MCmom->Scale(NEvents);
735 h_reg_sec_MCmom->Scale(NEvents);
736 h_acc_sec_MCmom->Scale(NEvents);
737 h_reco_sec_MCmom->Scale(NEvents);
753 if ((prtra->
Hits).size() < 1)
continue;
755 if (fabs(prtra->
GetQp()) > 1.e-10)
757 fabs(1.0 / prtra->
GetQp()));
761 h_reco_phi->Fill(prtra->
GetPhi());
762 h_reco_nhits->Fill((prtra->
Hits).size());
768 h2_fst_hit_yz->Fill(
fpAlgo->
GetParameters().GetStation(fstHit.iStation).fZ[0], fstHit.GetY());
772 h2_lst_hit_yz->Fill(
fpAlgo->
GetParameters().GetStation(lstHit.iStation).fZ[0], lstHit.GetY());
774 for (
int iH : prtra->
Hits) {
778 h2_all_hit_yz->Fill(z,
y);
785 if (prtra->
GetNdf() > 0) {
788 h_ghost_prob->Fill(TMath::Prob(prtra->
GetChiSq(), prtra->
GetNdf()));
792 if (mcTrk.IsReconstructable()) {
794 h_reco_prob->Fill(TMath::Prob(prtra->
GetChiSq(), prtra->
GetNdf()));
798 h_rest_prob->Fill(TMath::Prob(prtra->
GetChiSq(), prtra->
GetNdf()));
808 if (fabs(prtra->
GetQp()) > 1.e-10) {
809 h_ghost_mom->Fill(prtra->
GetP());
810 h_ghost_phi->Fill(prtra->
GetPhi());
811 h_ghost_Rmom->Fill(prtra->
GetP());
813 h_ghost_nhits->Fill((prtra->
Hits).size());
816 h_ghost_fstation->Fill(h1.
iStation);
817 h_ghost_r->Fill(
sqrt(fabs(h1.
x * h1.
x + h1.
y * h1.
y)));
820 if (fabs(z2 - z1) > 1.e-4) {
821 h_ghost_tx->Fill((h2.
x - h1.
x) / (z2 - z1));
822 h_ghost_ty->Fill((h2.
y - h1.
y) / (z2 - z1));
827 if (fabs(prtra->
GetQp()) > 1.e-10) {
828 h2_ghost_nhits_vs_mom->Fill(prtra->
GetP(), prtra->
Hits.size());
829 h2_ghost_fstation_vs_mom->Fill(prtra->
GetP(), hf.
iStation + 1);
841 int nmchits = mcTrk.GetNofHits();
842 if (nmchits == 0)
continue;
844 double momentum = mcTrk.GetP();
845 double pt = mcTrk.GetPt();
846 double theta = mcTrk.GetTheta() * 180 / 3.1415;
847 double phi = mcTrk.GetPhi();
849 h_mcp->Fill(momentum);
850 h_nmchits->Fill(nmchits);
852 int nSta = mcTrk.GetTotNofStationsWithHit();
857 h_reg_MCmom->Fill(momentum);
858 if (mcTrk.IsPrimary()) {
859 h_reg_mom_prim->Fill(momentum);
860 h_reg_phi_prim->Fill(phi);
861 h_reg_prim_MCmom->Fill(momentum);
862 h_reg_nhits_prim->Fill(nSta);
863 h2_reg_nhits_vs_mom_prim->Fill(momentum, nSta);
864 h2_reg_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
868 h_reg_mom_sec->Fill(momentum);
869 h_reg_phi_sec->Fill(phi);
870 h_reg_sec_MCmom->Fill(momentum);
871 h_reg_nhits_sec->Fill(nSta);
872 if (momentum > 0.01) {
873 h2_reg_nhits_vs_mom_sec->Fill(momentum, nSta);
874 h2_reg_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
879 if (mcTrk.IsAdditional()) {
880 h_acc_mom_short123s->Fill(momentum);
883 if (!mcTrk.IsReconstructable())
continue;
886 h_acc_MCmom->Fill(momentum);
887 if (mcTrk.IsPrimary()) {
888 h_acc_mom_prim->Fill(momentum);
889 h_acc_phi_prim->Fill(phi);
890 h_acc_prim_MCmom->Fill(momentum);
891 h_acc_nhits_prim->Fill(nSta);
892 h2_acc_nhits_vs_mom_prim->Fill(momentum, nSta);
893 h2_acc_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
897 h_acc_mom_sec->Fill(momentum);
898 h_acc_phi_sec->Fill(phi);
899 h_acc_sec_MCmom->Fill(momentum);
900 h_acc_nhits_sec->Fill(nSta);
901 if (momentum > 0.01) {
902 h2_acc_nhits_vs_mom_sec->Fill(momentum, nSta);
903 h2_acc_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
910 h2_vertex->Fill(mcTrk.GetStartZ(), mcTrk.GetStartY());
912 if (mcTrk.GetMotherId() < 0) {
913 h2_prim_vertex->Fill(mcTrk.GetStartZ(), mcTrk.GetStartY());
917 h2_sec_vertex->Fill(mcTrk.GetStartZ(), mcTrk.GetStartY());
922 int iph = mcTrk.GetHitIndexes()[0];
925 h_sec_r->Fill(
sqrt(fabs(ph.
x * ph.
x + ph.
y * ph.
y)));
926 if (fabs(mcTrk.GetPz()) > 1.e-8) {
927 h_tx->Fill(mcTrk.GetTx());
928 h_ty->Fill(mcTrk.GetTy());
932 bool reco = (mcTrk.IsReconstructed());
933 int nMCHits = mcTrk.GetTotNofStationsWithHit();
936 p_eff_all_vs_mom->Fill(momentum, 100.0);
937 p_eff_all_vs_nhits->Fill(nMCHits, 100.0);
938 p_eff_all_vs_pt->Fill(pt, 100.0);
939 h_reco_MCmom->Fill(momentum);
940 if (mcTrk.GetMotherId() < 0) {
941 p_eff_prim_vs_mom->Fill(momentum, 100.0);
942 p_eff_prim_vs_nhits->Fill(nMCHits, 100.0);
943 p_eff_prim_vs_pt->Fill(pt, 100.0);
944 p_eff_prim_vs_theta->Fill(theta, 100.0);
947 p_eff_sec_vs_mom->Fill(momentum, 100.0);
948 p_eff_sec_vs_nhits->Fill(nMCHits, 100.0);
950 if (mcTrk.GetMotherId() < 0) {
951 h_reco_mom_prim->Fill(momentum);
952 h_reco_phi_prim->Fill(phi);
953 h_reco_prim_MCmom->Fill(momentum);
954 h_reco_nhits_prim->Fill(nSta);
955 h2_reco_nhits_vs_mom_prim->Fill(momentum, nSta);
956 h2_reco_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
960 h_reco_mom_sec->Fill(momentum);
961 h_reco_phi_sec->Fill(phi);
962 h_reco_sec_MCmom->Fill(momentum);
963 h_reco_nhits_sec->Fill(nSta);
964 if (momentum > 0.01) {
965 h2_reco_nhits_vs_mom_sec->Fill(momentum, nSta);
966 h2_reco_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
972 h_notfound_mom->Fill(momentum);
973 h_notfound_phi->Fill(phi);
974 p_eff_all_vs_mom->Fill(momentum, 0.0);
975 p_eff_all_vs_nhits->Fill(nMCHits, 0.0);
976 p_eff_all_vs_pt->Fill(pt, 0.0);
977 if (mcTrk.GetMotherId() < 0) {
978 p_eff_prim_vs_mom->Fill(momentum, 0.0);
979 p_eff_prim_vs_nhits->Fill(nMCHits, 0.0);
980 p_eff_prim_vs_pt->Fill(pt, 0.0);
981 p_eff_prim_vs_theta->Fill(theta, 0.0);
984 p_eff_sec_vs_mom->Fill(momentum, 0.0);
985 p_eff_sec_vs_nhits->Fill(nMCHits, 0.0);
987 if (mcTrk.GetMotherId() < 0) {
988 h_rest_mom_prim->Fill(momentum);
989 h_rest_phi_prim->Fill(phi);
990 h_rest_nhits_prim->Fill(nSta);
991 h2_rest_nhits_vs_mom_prim->Fill(momentum, nSta);
992 h2_rest_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
996 h_rest_mom_sec->Fill(momentum);
997 h_rest_phi_sec->Fill(phi);
998 h_rest_nhits_sec->Fill(nSta);
999 if (momentum > 0.01) {
1000 h2_rest_nhits_vs_mom_sec->Fill(momentum, nSta);
1001 h2_rest_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
1010 h_notfound_nhits->Fill(nmchits);
1011 h_notfound_station->Fill(ph.
iStation);
1012 h_notfound_r->Fill(
sqrt(fabs(ph.
x * ph.
x + ph.
y * ph.
y)));
1014 if (mcTrk.GetNofPoints() > 0) {
1016 h_notfound_tx->Fill(pMC.GetTx());
1017 h_notfound_ty->Fill(pMC.GetTy());
1034 if (mcTrk.IsSignal()) {
1035 h_reco_d0_mom->Fill(momentum);
1037 p_eff_d0_vs_mom->Fill(momentum, 100.0);
1039 p_eff_d0_vs_mom->Fill(momentum, 0.0);
1047 if (iMC < 0) NFakes++;
1054 h_reco_fakeNtr->Fill(mc_total, NFakes);
1059 h_reg_MCmom->Scale(1.f / NEvents);
1060 h_acc_MCmom->Scale(1.f / NEvents);
1061 h_reco_MCmom->Scale(1.f / NEvents);
1062 h_ghost_Rmom->Scale(1.f / NEvents);
1063 h_reg_prim_MCmom->Scale(1.f / NEvents);
1064 h_acc_prim_MCmom->Scale(1.f / NEvents);
1065 h_reco_prim_MCmom->Scale(1.f / NEvents);
1066 h_reg_sec_MCmom->Scale(1.f / NEvents);
1067 h_acc_sec_MCmom->Scale(1.f / NEvents);
1068 h_reco_sec_MCmom->Scale(1.f / NEvents);
1075 const int Nh_fit = 17;
1076 static TH1F *h_fit[Nh_fit], *h_fitL[Nh_fit], *h_fitSV[Nh_fit], *h_fitPV[Nh_fit], *h_fit_chi2;
1078 static TH2F *PRes2D, *PRes2DPrim, *PRes2DSec;
1080 static TH2F* pion_res_pt_fstDca;
1081 static TH2F* kaon_res_pt_fstDca;
1082 static TH2F* pton_res_pt_fstDca;
1084 static TH2F* pion_res_pt_vtxDca;
1085 static TH2F* kaon_res_pt_vtxDca;
1086 static TH2F* pton_res_pt_vtxDca;
1088 static TH2F* pion_res_p_fstDca;
1089 static TH2F* kaon_res_p_fstDca;
1090 static TH2F* pton_res_p_fstDca;
1092 static TH2F* pion_res_p_vtxDca;
1093 static TH2F* kaon_res_p_vtxDca;
1094 static TH2F* pton_res_p_vtxDca;
1096 static bool first_call = 1;
1107 TDirectory* currentDir = gDirectory;
1109 gDirectory->cd(
"Fit");
1111 PRes2D =
new TH2F(
"PRes2D",
"Resolution P [%] vs P", 100, 0., 20., 100, -15., 15.);
1112 PRes2DPrim =
new TH2F(
"PRes2DPrim",
"Resolution P [%] vs P", 100, 0., 20., 100, -15., 15.);
1113 PRes2DSec =
new TH2F(
"PRes2DSec",
"Resolution P [%] vs P", 100, 0., 20., 100, -15., 15.);
1115 pion_res_pt_fstDca =
new TH2F(
"pion_res_pt_fstDca",
"", 100, 0, 10, 1000, -500, 500);
1116 kaon_res_pt_fstDca =
new TH2F(
"kaon_res_pt_fstDca",
"", 100, 0, 10, 1000, -500, 500);
1117 pton_res_pt_fstDca =
new TH2F(
"pton_res_pt_fstDca",
"", 100, 0, 10, 1000, -500, 500);
1119 pion_res_pt_vtxDca =
new TH2F(
"pion_res_pt_vtxDca",
"", 100, 0, 10, 1000, -5000, 5000);
1120 kaon_res_pt_vtxDca =
new TH2F(
"kaon_res_pt_vtxDca",
"", 100, 0, 10, 1000, -5000, 5000);
1121 pton_res_pt_vtxDca =
new TH2F(
"pton_res_pt_vtxDca",
"", 100, 0, 10, 1000, -5000, 5000);
1123 pion_res_p_fstDca =
new TH2F(
"pion_res_p_fstDca",
"", 100, 0, 10, 1000, -500, 500);
1124 kaon_res_p_fstDca =
new TH2F(
"kaon_res_p_fstDca",
"", 100, 0, 10, 1000, -500, 500);
1125 pton_res_p_fstDca =
new TH2F(
"pton_res_p_fstDca",
"", 100, 0, 10, 1000, -500, 500);
1127 pion_res_p_vtxDca =
new TH2F(
"pion_res_p_vtxDca",
"", 100, 0, 10, 1000, -5000, 5000);
1128 kaon_res_p_vtxDca =
new TH2F(
"kaon_res_p_vtxDca",
"", 100, 0, 10, 1000, -5000, 5000);
1129 pton_res_p_vtxDca =
new TH2F(
"pton_res_p_vtxDca",
"", 100, 0, 10, 1000, -5000, 5000);
1136 } Table[Nh_fit] = {{
"x",
"Residual X [#mum]", 140, -40., 40.},
1137 {
"y",
"Residual Y [#mum]", 100, -450., 450.},
1138 {
"tx",
"Residual Tx [mrad]", 100, -4., 4.},
1139 {
"ty",
"Residual Ty [mrad]", 100, -3.5, 3.5},
1140 {
"P",
"Resolution P/Q [%]", 100, -15., 15.},
1141 {
"px",
"Pull X [residual/estimated_error]", 100, -6., 6.},
1142 {
"py",
"Pull Y [residual/estimated_error]", 100, -6., 6.},
1143 {
"ptx",
"Pull Tx [residual/estimated_error]", 100, -6., 6.},
1144 {
"pty",
"Pull Ty [residual/estimated_error]", 100, -6., 6.},
1145 {
"pQP",
"Pull Q/P [residual/estimated_error]", 100, -6., 6.},
1146 {
"QPreco",
"Reco Q/P ", 100, -10., 10.},
1147 {
"QPmc",
"MC Q/P ", 100, -10., 10.},
1148 {
"time",
"Residual Time [ns]", 100, -10., 10.},
1149 {
"ptime",
"Pull Time [residual/estimated_error]", 100, -10., 10.},
1150 {
"vi",
"Residual Vi [1/c]", 100, -4., 4.},
1151 {
"pvi",
"Pull Vi [residual/estimated_error]", 100, -10., 10.},
1152 {
"distrVi",
"Vi distribution [1/c]", 100, 0., 4.}};
1165 Tab TableVertex[Nh_fit] = {
1166 {
"x",
"Residual X [cm]", 2000, -1., 1.},
1168 {
"y",
"Residual Y [cm]", 2000, -1., 1.},
1170 {
"tx",
"Residual Tx [mrad]", 100, -2., 2.},
1172 {
"ty",
"Residual Ty [mrad]", 100, -2., 2.},
1173 {
"P",
"Resolution P/Q [%]", 100, -15., 15.},
1174 {
"px",
"Pull X [residual/estimated_error]", 100, -10., 10.},
1175 {
"py",
"Pull Y [residual/estimated_error]", 100, -10., 10.},
1176 {
"ptx",
"Pull Tx [residual/estimated_error]", 100, -10., 10.},
1177 {
"pty",
"Pull Ty [residual/estimated_error]", 100, -10., 10.},
1178 {
"pQP",
"Pull Q/P [residual/estimated_error]", 100, -10., 10.},
1179 {
"QPreco",
"Reco Q/P ", 100, -10., 10.},
1180 {
"QPmc",
"MC Q/P ", 100, -10., 10.},
1181 {
"time",
"Residual Time [ns]", 100, -10., 10.},
1182 {
"ptime",
"Pull Time [residual/estimated_error]", 100, -10., 10.},
1183 {
"vi",
"Residual Vi [1/c]", 100, -10., 10.},
1184 {
"pvi",
"Pull Vi [residual/estimated_error]", 100, -10., 10.},
1185 {
"distrVi",
"Vi distribution [1/c]", 100, -10., 10.}};
1188 TableVertex[4].l = -1.;
1189 TableVertex[4].r = 1.;
1192 for (
int i = 0; i < Nh_fit; i++) {
1193 char n[225], t[255];
1194 sprintf(n,
"fst_%s", Table[i].name);
1195 sprintf(t,
"First point %s", Table[i].title);
1196 h_fit[i] =
new TH1F(n, t, Table[i].n, Table[i].l, Table[i].r);
1197 sprintf(n,
"lst_%s", Table[i].name);
1198 sprintf(t,
"Last point %s", Table[i].title);
1199 h_fitL[i] =
new TH1F(n, t, Table[i].n, Table[i].l, Table[i].r);
1200 sprintf(n,
"svrt_%s", TableVertex[i].name);
1201 sprintf(t,
"Secondary vertex point %s", TableVertex[i].title);
1202 h_fitSV[i] =
new TH1F(n, t, TableVertex[i].n, TableVertex[i].l, TableVertex[i].r);
1203 sprintf(n,
"pvrt_%s", TableVertex[i].name);
1204 sprintf(t,
"Primary vertex point %s", TableVertex[i].title);
1205 h_fitPV[i] =
new TH1F(n, t, TableVertex[i].n, TableVertex[i].l, TableVertex[i].r);
1207 for (
int j = 0; j < 12; j++) {
1208 sprintf(n,
"smth_%s_sta_%i", Table[i].name, j);
1209 sprintf(t,
"Station %i %s", j, Table[i].title);
1213 h_fit_chi2 =
new TH1F(
"h_fit_chi2",
"Chi2/NDF", 50, -0.5, 10.0);
1215 gDirectory = currentDir;
1221 if (it->IsGhost())
continue;
1223 bool isTimeFitted = 0;
1226 int nTimeMeasurenments = 0;
1227 for (
unsigned int ih = 0; ih < it->Hits.size(); ih++) {
1230 nTimeMeasurenments++;
1233 isTimeFitted = (nTimeMeasurenments > 1);
1238 if (it->GetNofMCTracks() < 1) {
1242 int imcPoint =
fvHitDebugInfo[it->Hits.front()].GetBestMcPointId();
1246 imcPoint = mcTrk.GetPointIndexes()[0];
1248 if (imcPoint < 0)
break;
1255 double dx = tr.
GetX()[0] - mcP.GetXIn();
1256 double dy = tr.
GetY()[0] - mcP.GetYIn();
1257 double dca =
sqrt(dx * dx + dy * dy);
1259 if (mcTrk.GetId() % 2) dca = -dca;
1260 double pt = mcP.GetPt();
1261 double dP = (fabs(1. / tr.
GetQp()[0]) - mcP.GetP()) / mcP.GetP();
1263 PRes2D->Fill(mcP.GetP(), 100. * dP);
1265 if (mcTrk.IsPrimary()) {
1267 h_fit[4]->Fill(100. * dP);
1269 PRes2DPrim->Fill(mcP.GetP(), 100. * dP);
1271 if (abs(mcTrk.GetPdgCode()) == 211) {
1272 pion_res_p_fstDca->Fill(mcP.GetP(), dca * 1.e4);
1273 pion_res_pt_fstDca->Fill(pt, dca * 1.e4);
1275 if (abs(mcTrk.GetPdgCode()) == 321) {
1276 kaon_res_p_fstDca->Fill(mcP.GetP(), dca * 1.e4);
1277 kaon_res_pt_fstDca->Fill(pt, dca * 1.e4);
1279 if (abs(mcTrk.GetPdgCode()) == 2212) {
1280 pton_res_p_fstDca->Fill(mcP.GetP(), dca * 1.e4);
1281 pton_res_pt_fstDca->Fill(pt, dca * 1.e4);
1285 PRes2DSec->Fill(mcP.GetP(), 100. * dP);
1293 if (iMC < 0)
continue;
1301 if (it->GetNofMCTracks() < 1) {
1311 if (!mc.IsPrimary()) {
1321 for (
int iSta = fSta ;
1332 if (mc.GetStartZ() != tr.
GetZ()[0])
continue;
1346 h_fitSV[0]->Fill((tr.
GetX()[0] - mc.GetStartX()));
1347 h_fitSV[1]->Fill((tr.
GetY()[0] - mc.GetStartY()));
1348 h_fitSV[2]->Fill((tr.
GetTx()[0] - mc.GetTx()) * 1.e3);
1349 h_fitSV[3]->Fill((tr.
GetTy()[0] - mc.GetTy()) * 1.e3);
1350 h_fitSV[4]->Fill(100. * (fabs(1. / tr.
GetQp()[0]) / mc.GetP() - 1.));
1351 if (std::isfinite((
fscal) tr.
C00()[0]) && tr.
C00()[0] > 0) {
1352 h_fitSV[5]->Fill((tr.
GetX()[0] - mc.GetStartX()) / sqrt(tr.
C00()[0]));
1354 if (std::isfinite((
fscal) tr.
C11()[0]) && tr.
C11()[0] > 0)
1355 h_fitSV[6]->Fill((tr.
GetY()[0] - mc.GetStartY()) / sqrt(tr.
C11()[0]));
1356 if (std::isfinite((
fscal) tr.
C22()[0]) && tr.
C22()[0] > 0)
1357 h_fitSV[7]->Fill((tr.
GetTx()[0] - mc.GetTx()) / sqrt(tr.
C22()[0]));
1358 if (std::isfinite((
fscal) tr.
C33()[0]) && tr.
C33()[0] > 0)
1359 h_fitSV[8]->Fill((tr.
GetTy()[0] - mc.GetTy()) / sqrt(tr.
C33()[0]));
1360 if (std::isfinite((
fscal) tr.
C44()[0]) && tr.
C44()[0] > 0)
1361 h_fitSV[9]->Fill((tr.
GetQp()[0] - mc.GetCharge() / mc.GetP()) / sqrt(tr.
C44()[0]));
1362 h_fitSV[10]->Fill(tr.
GetQp()[0]);
1363 h_fitSV[11]->Fill(mc.GetCharge() / mc.GetP());
1365 h_fitSV[12]->Fill(tr.
GetTime()[0] - mc.GetStartT());
1366 if (std::isfinite((
fscal) tr.
C55()[0]) && tr.
C55()[0] > 0.) {
1367 h_fitSV[13]->Fill((tr.
GetTime()[0] - mc.GetStartT()) / sqrt(tr.
C55()[0]));
1373 if (std::isfinite((
fscal) tr.
C66()[0]) && tr.
C66()[0] > 0.) {
1374 h_fitSV[15]->Fill(dvi /
sqrt(tr.
C66()[0]));
1391 for (
int iSta = fSta + dir; (iSta >= 0) && (iSta <
fNStations)
1403 if (mc.GetStartZ() != tr.
GetZ()[0])
continue;
1405 double dx = tr.
GetX()[0] - mc.GetStartX();
1406 double dy = tr.
GetY()[0] - mc.GetStartY();
1407 double dt =
sqrt(dx * dx + dy * dy);
1409 if (mc.GetId() % 2) dt = -dt;
1411 double pt = mc.GetPt();
1413 if (abs(mc.GetPdgCode()) == 211) {
1414 pion_res_p_vtxDca->Fill(mc.GetP(), dt * 1.e4);
1415 pion_res_pt_vtxDca->Fill(pt, dt * 1.e4);
1417 if (abs(mc.GetPdgCode()) == 321) {
1418 kaon_res_p_vtxDca->Fill(mc.GetPdgCode(), dt * 1.e4);
1419 kaon_res_pt_vtxDca->Fill(mc.GetPt(), dt * 1.e4);
1421 if (abs(mc.GetPdgCode()) == 2212) {
1422 pton_res_p_vtxDca->Fill(mc.GetP(), dt * 1.e4);
1423 pton_res_pt_vtxDca->Fill(pt, dt * 1.e4);
1427 h_fitPV[0]->Fill((mc.GetStartX() - tr.
GetX()[0]));
1428 h_fitPV[1]->Fill((mc.GetStartY() - tr.
GetY()[0]));
1429 h_fitPV[2]->Fill((mc.GetTx() - tr.
GetTx()[0]) * 1.e3);
1430 h_fitPV[3]->Fill((mc.GetTy() - tr.
GetTy()[0]) * 1.e3);
1431 h_fitPV[4]->Fill(100. * (fabs(1 / tr.
GetQp()[0]) / mc.GetP() - 1.));
1432 if (std::isfinite((
fscal) tr.
C00()[0]) && tr.
C00()[0] > 0)
1433 h_fitPV[5]->Fill((mc.GetStartX() - tr.
GetX()[0]) / sqrt(tr.
C00()[0]));
1434 if (std::isfinite((
fscal) tr.
C11()[0]) && tr.
C11()[0] > 0)
1435 h_fitPV[6]->Fill((mc.GetStartY() - tr.
GetY()[0]) / sqrt(tr.
C11()[0]));
1436 if (std::isfinite((
fscal) tr.
C22()[0]) && tr.
C22()[0] > 0)
1437 h_fitPV[7]->Fill((mc.GetTx() - tr.
GetTx()[0]) / sqrt(tr.
C22()[0]));
1438 if (std::isfinite((
fscal) tr.
C33()[0]) && tr.
C33()[0] > 0)
1439 h_fitPV[8]->Fill((mc.GetTy() - tr.
GetTy()[0]) / sqrt(tr.
C33()[0]));
1440 if (std::isfinite((
fscal) tr.
C44()[0]) && tr.
C44()[0] > 0)
1441 h_fitPV[9]->Fill((mc.GetCharge() / mc.GetP() - tr.
GetQp()[0]) / sqrt(tr.
C44()[0]));
1442 h_fitPV[10]->Fill(tr.
GetQp()[0]);
1443 h_fitPV[11]->Fill(mc.GetCharge() / mc.GetP());
1445 h_fitPV[12]->Fill(tr.
GetTime()[0] - mc.GetStartT());
1446 if (std::isfinite((
fscal) tr.
C55()[0]) && tr.
C55()[0] > 0.) {
1447 h_fitPV[13]->Fill((tr.
GetTime()[0] - mc.GetStartT()) / sqrt(tr.
C55()[0]));
1453 if (std::isfinite((
fscal) tr.
C66()[0]) && tr.
C66()[0] > 0.) {
1454 h_fitPV[15]->Fill(dvi /
sqrt(tr.
C66()[0]));
1461 h_fit_chi2->Fill(it->GetChiSq() / it->GetNdf());
1573 TDirectory* curr = gDirectory;
1574 TFile* currentFile = gFile;
1575 TFile* fout =
new TFile(
"CaFieldApproxQa.root",
"RECREATE");
1578 assert(FairRunAna::Instance());
1579 FairField* MF = FairRunAna::Instance()->GetField();
1586 double z = st.
fZ[0];
1587 double Xmax = st.
Xmax[0];
1588 double Ymax = st.
Ymax[0];
1594 new TH2F(Form(
"station_%i_dB", ist), Form(
"station %i, dB, z = %0.f cm", ist, z),
1595 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax),
1596 new TH2F(Form(
"station_%i_dBx", ist), Form(
"station %i, dBx, z = %0.f cm", ist, z),
1597 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax),
1598 new TH2F(Form(
"station_%i_dBy", ist), Form(
"station %i, dBy, z = %0.f cm", ist, z),
1599 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax),
1600 new TH2F(Form(
"station_%i_dBz", ist), Form(
"station %i, dBz, z = %0.f cm", ist, z),
1601 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax)
1605 new TH2F(Form(
"station_%i_B", ist), Form(
"station %i, B, z = %0.f cm", ist, z),
1606 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax),
1607 new TH2F(Form(
"station_%i_Bx", ist), Form(
"station %i, Bx, z = %0.f cm", ist, z),
1608 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax),
1609 new TH2F(Form(
"station_%i_By", ist), Form(
"station %i, By, z = %0.f cm", ist, z),
1610 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax),
1611 new TH2F(Form(
"station_%i_Bz", ist), Form(
"station %i, Bz, z = %0.f cm", ist, z),
1612 NbinsX, -Xmax, Xmax, NbinsY, -Ymax, Ymax)
1615 for (
int i = 0; i < 4; i++) {
1616 hdB[i]->GetXaxis()->SetTitle(
"X, cm");
1617 hdB[i]->GetYaxis()->SetTitle(
"Y, cm");
1618 hdB[i]->GetXaxis()->SetTitleOffset(1);
1619 hdB[i]->GetYaxis()->SetTitleOffset(1);
1620 hdB[i]->GetZaxis()->SetTitleOffset(1.3);
1621 hB[i]->GetXaxis()->SetTitle(
"X, cm");
1622 hB[i]->GetYaxis()->SetTitle(
"Y, cm");
1623 hB[i]->GetXaxis()->SetTitleOffset(1);
1624 hB[i]->GetYaxis()->SetTitleOffset(1);
1625 hB[i]->GetZaxis()->SetTitleOffset(1.3);
1628 hdB[0]->GetZaxis()->SetTitle(
"B_map - B_L1, kGauss");
1629 hdB[1]->GetZaxis()->SetTitle(
"Bx_map - Bx_L1, kGauss");
1630 hdB[2]->GetZaxis()->SetTitle(
"By_map - By_L1, kGauss");
1631 hdB[3]->GetZaxis()->SetTitle(
"Bz_map - Bz_L1, kGauss");
1633 hdB[0]->GetZaxis()->SetTitle(
"B_map, kGauss");
1634 hdB[1]->GetZaxis()->SetTitle(
"Bx_map, kGauss");
1635 hdB[2]->GetZaxis()->SetTitle(
"By_map, kGauss");
1636 hdB[3]->GetZaxis()->SetTitle(
"Bz_map, kGauss");
1639 for (
int i = 1; i <= hdB[0]->GetXaxis()->GetNbins(); i++) {
1640 double x = hdB[0]->GetXaxis()->GetBinCenter(i);
1641 for (
int j = 1; j <= hdB[0]->GetYaxis()->GetNbins(); j++) {
1642 double y = hdB[0]->GetYaxis()->GetBinCenter(j);
1643 double r[] = {
x,
y, z};
1644 double B[] = {0., 0., 0.};
1645 MF->GetFieldValue(r, B);
1647 double bbb =
sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
1651 hdB[0]->SetBinContent(i, j, (bbb - B_L1.
GetAbs()[0]));
1652 hdB[1]->SetBinContent(i, j, (B[0] - B_L1.
GetBx()[0]));
1653 hdB[2]->SetBinContent(i, j, (B[1] - B_L1.
GetBy()[0]));
1654 hdB[3]->SetBinContent(i, j, (B[2] - B_L1.
GetBz()[0]));
1656 hB[0]->SetBinContent(i, j, bbb);
1657 hB[1]->SetBinContent(i, j, B[0]);
1658 hB[2]->SetBinContent(i, j, B[1]);
1659 hB[3]->SetBinContent(i, j, B[2]);
1663 for (
int i = 0; i < 4; i++) {
1672 gFile = currentFile;