20 #include "FairTrackParam.h"
32 #include "CbmTofHit.h"
61 map<int, CbmL1MCTrack*> pMCTrackMap;
65 for (vector<CbmL1MCTrack>::iterator
i =
vMCTracks.begin();
70 if (pMCTrackMap.find(MC.
ID) == pMCTrackMap.end()) {
71 pMCTrackMap.insert(pair<int, CbmL1MCTrack*>(MC.
ID, &MC));
73 cout <<
"*** L1: Track ID " << MC.
ID <<
" encountered twice! ***" << endl;
77 const int nRTracks =
vRTracks.size();
78 for (
int iR = 0; iR < nRTracks; iR++) {
83 int hitsum = prtra->
StsHits.size();
86 map<int, int>& hitmap =
89 for (vector<int>::iterator ih = (prtra->
StsHits).begin();
93 const int nMCPoints =
vStsHits[*ih].mcPointIds.size();
94 for (
int iP = 0; iP < nMCPoints; iP++) {
95 int iMC =
vStsHits[*ih].mcPointIds[iP];
100 if (hitmap.find(
ID) == hitmap.end())
111 for (map<int, int>::iterator posIt = hitmap.begin(); posIt != hitmap.end();
114 if (posIt->first < 0)
continue;
117 if (
double(posIt->second) > max_percent * double(hitsum))
118 max_percent =
double(posIt->second) / double(hitsum);
121 if (
double(posIt->second)
124 if (pMCTrackMap.find(posIt->first) == pMCTrackMap.end())
continue;
130 if (pMCTrackMap.find(posIt->first) == pMCTrackMap.end())
continue;
155 AddCounter(
"long_fast_prim",
"LongRPrim efficiency");
156 AddCounter(
"fast_prim",
"RefPrim efficiency");
160 AddCounter(
"slow_prim",
"ExtraPrim efficiency");
161 AddCounter(
"slow_sec",
"ExtraSec efficiency");
165 AddCounter(
"shortPion",
"Short123s pion eff");
166 AddCounter(
"shortProton",
"Short123s proton eff");
167 AddCounter(
"shortKaon",
"Short123s kaon eff");
169 AddCounter(
"shortRest",
"Short123s rest eff");
171 AddCounter(
"fast_sec_e",
"RefSec E efficiency");
174 AddCounter(
"slow_sec_e",
"ExtraSecE efficiency");
216 double _ratio_length,
224 const int index =
indices[name];
237 cout.setf(ios::fixed);
238 cout.setf(ios::showpoint);
240 cout.setf(ios::right);
241 cout <<
"Track category : "
258 <<
"MCl(MCps)" << endl;
261 for (
int iC = 0; iC < NCounters; iC++) {
296 static int L1_NEVENTS = 0;
297 static double L1_CATIME = 0.0;
302 for (vector<CbmL1Track>::iterator rtraIt =
vRTracks.begin();
305 ntra.
ghosts += rtraIt->IsGhost();
322 for (vector<CbmL1MCTrack>::iterator mtraIt =
vMCTracks.begin();
337 vector<CbmL1Track*>& rTracks =
339 double ratio_length = 0;
340 double ratio_fakes = 0;
341 double mc_length_hits = mtra.
NStations();
346 for (
unsigned int irt = 0; irt < rTracks.size(); irt++) {
347 ratio_length +=
static_cast<double>(rTracks[irt]->GetNOfHits())
348 * rTracks[irt]->GetMaxPurity() / mc_length_hits;
349 ratio_fakes += 1 - rTracks[irt]->GetMaxPurity();
521 if (mtra.
pdg == 11 || mtra.
pdg == -11) {
591 cout <<
"Number of true and fake hits in stations: " << endl;
593 cout << sta_nhits[
i] - sta_nfakes[
i] <<
"+" << sta_nfakes[
i] <<
" ";
598 cout <<
"L1 ACCUMULATED STAT : " << L1_NEVENTS <<
" EVENTS " << endl
601 cout <<
"MC tracks/event found : "
603 /
double(L1_NEVENTS))
606 cout <<
"CA Track Finder: " << L1_CATIME / L1_NEVENTS <<
" s/ev" << endl
617 static TProfile *p_eff_all_vs_mom, *p_eff_prim_vs_mom, *p_eff_sec_vs_mom,
618 *p_eff_d0_vs_mom, *p_eff_prim_vs_theta, *p_eff_all_vs_pt, *p_eff_prim_vs_pt,
619 *p_eff_all_vs_nhits, *p_eff_prim_vs_nhits, *p_eff_sec_vs_nhits;
621 static TH1F *h_reg_MCmom, *h_acc_MCmom, *h_reco_MCmom, *h_ghost_Rmom;
622 static TH1F *h_reg_prim_MCmom, *h_acc_prim_MCmom, *h_reco_prim_MCmom;
623 static TH1F *h_reg_sec_MCmom, *h_acc_sec_MCmom, *h_reco_sec_MCmom;
625 static TH1F* h_acc_mom_short123s;
627 static TH1F *h_reg_mom_prim, *h_reg_mom_sec, *h_reg_nhits_prim,
629 static TH1F *h_acc_mom_prim, *h_acc_mom_sec, *h_acc_nhits_prim,
631 static TH1F *h_reco_mom_prim, *h_reco_mom_sec, *h_reco_nhits_prim,
633 static TH1F *h_rest_mom_prim, *h_rest_mom_sec, *h_rest_nhits_prim,
638 static TH1F *h_ghost_mom, *h_ghost_nhits, *h_ghost_fstation, *h_ghost_chi2,
639 *h_ghost_prob, *h_ghost_tx, *h_ghost_ty;
640 static TH1F *h_reco_mom, *h_reco_d0_mom, *h_reco_nhits, *h_reco_station,
641 *h_reco_chi2, *h_reco_prob, *h_rest_prob, *h_reco_clean, *h_reco_time;
642 static TProfile *h_reco_timeNtr, *h_reco_timeNhit;
643 static TProfile *h_reco_fakeNtr, *h_reco_fakeNhit;
644 static TH1F *h_tx, *h_ty, *h_sec_r, *h_ghost_r;
646 static TH1F *h_notfound_mom, *h_notfound_nhits, *h_notfound_station,
647 *h_notfound_r, *h_notfound_tx, *h_notfound_ty;
649 static TH1F *h_mcp, *h_nmchits;
654 static TH2F *h2_vertex, *h2_prim_vertex, *h2_sec_vertex;
657 static TH2F *h2_reg_nhits_vs_mom_prim, *h2_reg_nhits_vs_mom_sec,
658 *h2_reg_fstation_vs_mom_prim, *h2_reg_fstation_vs_mom_sec,
659 *h2_reg_lstation_vs_fstation_prim, *h2_reg_lstation_vs_fstation_sec;
660 static TH2F *h2_acc_nhits_vs_mom_prim, *h2_acc_nhits_vs_mom_sec,
661 *h2_acc_fstation_vs_mom_prim, *h2_acc_fstation_vs_mom_sec,
662 *h2_acc_lstation_vs_fstation_prim, *h2_acc_lstation_vs_fstation_sec;
663 static TH2F *h2_reco_nhits_vs_mom_prim, *h2_reco_nhits_vs_mom_sec,
664 *h2_reco_fstation_vs_mom_prim, *h2_reco_fstation_vs_mom_sec,
665 *h2_reco_lstation_vs_fstation_prim, *h2_reco_lstation_vs_fstation_sec;
666 static TH2F *h2_ghost_nhits_vs_mom, *h2_ghost_fstation_vs_mom,
667 *h2_ghost_lstation_vs_fstation;
668 static TH2F *h2_rest_nhits_vs_mom_prim, *h2_rest_nhits_vs_mom_sec,
669 *h2_rest_fstation_vs_mom_prim, *h2_rest_fstation_vs_mom_sec,
670 *h2_rest_lstation_vs_fstation_prim, *h2_rest_lstation_vs_fstation_sec;
672 static bool first_call = 1;
677 TDirectory* curdir = gDirectory;
679 gDirectory->cd(
"L1");
681 p_eff_all_vs_mom =
new TProfile(
"p_eff_all_vs_mom",
682 "AllSet Efficiency vs Momentum",
688 p_eff_prim_vs_mom =
new TProfile(
"p_eff_prim_vs_mom",
689 "Primary Set Efficiency vs Momentum",
695 p_eff_sec_vs_mom =
new TProfile(
"p_eff_sec_vs_mom",
696 "Secondary Set Efficiency vs Momentum",
702 p_eff_d0_vs_mom =
new TProfile(
"p_eff_d0_vs_mom",
703 "D0 Secondary Tracks Efficiency vs Momentum",
709 p_eff_prim_vs_theta =
new TProfile(
"p_eff_prim_vs_theta",
710 "All Primary Set Efficiency vs Theta",
716 p_eff_all_vs_pt =
new TProfile(
717 "p_eff_all_vs_pt",
"AllSet Efficiency vs Pt", 100, 0.0, 5.0, 0.0, 100.0);
718 p_eff_prim_vs_pt =
new TProfile(
"p_eff_prim_vs_pt",
719 "Primary Set Efficiency vs Pt",
726 p_eff_all_vs_nhits =
new TProfile(
"p_eff_all_vs_nhits",
727 "AllSet Efficiency vs NMCHits",
733 p_eff_prim_vs_nhits =
new TProfile(
"p_eff_prim_vs_nhits",
734 "PrimSet Efficiency vs NMCHits",
740 p_eff_sec_vs_nhits =
new TProfile(
"p_eff_sec_vs_nhits",
741 "SecSet Efficiency vs NMCHits",
749 new TH1F(
"h_reg_MCmom",
"Momentum of registered tracks", 100, 0.0, 5.0);
751 new TH1F(
"h_acc_MCmom",
"Reconstructable tracks", 100, 0.0, 5.0);
753 new TH1F(
"h_reco_MCmom",
"Reconstructed tracks", 100, 0.0, 5.0);
754 h_ghost_Rmom =
new TH1F(
"h_ghost_Rmom",
"Ghost tracks", 100, 0.0, 5.0);
755 h_reg_prim_MCmom =
new TH1F(
756 "h_reg_prim_MCmom",
"Momentum of registered tracks", 100, 0.0, 5.0);
758 new TH1F(
"h_acc_prim_MCmom",
"Reconstructable tracks", 100, 0.0, 5.0);
760 new TH1F(
"h_reco_prim_MCmom",
"Reconstructed tracks", 100, 0.0, 5.0);
761 h_reg_sec_MCmom =
new TH1F(
762 "h_reg_sec_MCmom",
"Momentum of registered tracks", 100, 0.0, 5.0);
764 new TH1F(
"h_acc_sec_MCmom",
"Reconstructable tracks", 100, 0.0, 5.0);
766 new TH1F(
"h_reco_sec_MCmom",
"Reconstructed tracks", 100, 0.0, 5.0);
768 h_acc_mom_short123s =
769 new TH1F(
"h_acc_mom_short123s",
770 "Momentum of accepted tracks with 3 hits on first stations",
775 h_reg_mom_prim =
new TH1F(
776 "h_reg_mom_prim",
"Momentum of registered primary tracks", 500, 0.0, 5.0);
777 h_reg_mom_sec =
new TH1F(
"h_reg_mom_sec",
778 "Momentum of registered secondary tracks",
782 h_acc_mom_prim =
new TH1F(
783 "h_acc_mom_prim",
"Momentum of accepted primary tracks", 500, 0.0, 5.0);
784 h_acc_mom_sec =
new TH1F(
785 "h_acc_mom_sec",
"Momentum of accepted secondary tracks", 500, 0.0, 5.0);
786 h_reco_mom_prim =
new TH1F(
"h_reco_mom_prim",
787 "Momentum of reconstructed primary tracks",
791 h_reco_mom_sec =
new TH1F(
"h_reco_mom_sec",
792 "Momentum of reconstructed secondary tracks",
796 h_rest_mom_prim =
new TH1F(
797 "h_rest_mom_prim",
"Momentum of not found primary tracks", 500, 0.0, 5.0);
798 h_rest_mom_sec =
new TH1F(
"h_rest_mom_sec",
799 "Momentum of not found secondary tracks",
804 h_reg_nhits_prim =
new TH1F(
"h_reg_nhits_prim",
805 "Number of hits in registered primary track",
809 h_reg_nhits_sec =
new TH1F(
"h_reg_nhits_sec",
810 "Number of hits in registered secondary track",
814 h_acc_nhits_prim =
new TH1F(
"h_acc_nhits_prim",
815 "Number of hits in accepted primary track",
819 h_acc_nhits_sec =
new TH1F(
"h_acc_nhits_sec",
820 "Number of hits in accepted secondary track",
825 new TH1F(
"h_reco_nhits_prim",
826 "Number of hits in reconstructed primary track",
831 new TH1F(
"h_reco_nhits_sec",
832 "Number of hits in reconstructed secondary track",
836 h_rest_nhits_prim =
new TH1F(
"h_rest_nhits_prim",
837 "Number of hits in not found primary track",
841 h_rest_nhits_sec =
new TH1F(
"h_rest_nhits_sec",
842 "Number of hits in not found secondary track",
848 new TH1F(
"h_ghost_mom",
"Momentum of ghost tracks", 500, 0.0, 5.0);
849 h_ghost_nhits =
new TH1F(
850 "h_ghost_nhits",
"Number of hits in ghost track", 51, -0.1, 10.1);
851 h_ghost_fstation =
new TH1F(
852 "h_ghost_fstation",
"First station of ghost track", 50, -0.5, 10.0);
854 new TH1F(
"h_ghost_chi2",
"Chi2/NDF of ghost track", 50, -0.5, 10.0);
856 new TH1F(
"h_ghost_prob",
"Prob of ghost track", 505, 0., 1.01);
858 new TH1F(
"h_ghost_r",
"R of ghost track at the first hit", 50, 0.0, 15.0);
859 h_ghost_tx =
new TH1F(
860 "h_ghost_tx",
"tx of ghost track at the first hit", 50, -5.0, 5.0);
861 h_ghost_ty =
new TH1F(
862 "h_ghost_ty",
"ty of ghost track at the first hit", 50, -1.0, 1.0);
864 h_reco_mom =
new TH1F(
"h_reco_mom",
"Momentum of reco track", 50, 0.0, 5.0);
866 new TH1F(
"h_reco_nhits",
"Number of hits in reco track", 50, 0.0, 10.0);
868 new TH1F(
"h_reco_station",
"First station of reco track", 50, -0.5, 10.0);
870 new TH1F(
"h_reco_chi2",
"Chi2/NDF of reco track", 50, -0.5, 10.0);
871 h_reco_prob =
new TH1F(
"h_reco_prob",
"Prob of reco track", 505, 0., 1.01);
873 new TH1F(
"h_rest_prob",
"Prob of reco rest track", 505, 0., 1.01);
875 new TH1F(
"h_reco_clean",
"Percentage of correct hits", 100, -0.5, 100.5);
877 new TH1F(
"h_reco_time",
"CA Track Finder Time (s/ev)", 20, 0.0, 20.0);
878 h_reco_timeNtr =
new TProfile(
"h_reco_timeNtr",
879 "CA Track Finder Time (s/ev) vs N Tracks",
883 h_reco_timeNhit =
new TProfile(
"h_reco_timeNhit",
884 "CA Track Finder Time (s/ev) vs N Hits",
888 h_reco_fakeNtr =
new TProfile(
889 "h_reco_fakeNtr",
"N Fake hits vs N Tracks", 200, 0.0, 1000.0);
890 h_reco_fakeNhit =
new TProfile(
891 "h_reco_fakeNhit",
"N Fake hits vs N Hits", 200, 0.0, 30000.0);
894 new TH1F(
"h_reco_d0_mom",
"Momentum of reco D0 track", 150, 0.0, 15.0);
908 h_tx =
new TH1F(
"h_tx",
"tx of MC track at the vertex", 50, -0.5, 0.5);
909 h_ty =
new TH1F(
"h_ty",
"ty of MC track at the vertex", 50, -0.5, 0.5);
912 new TH1F(
"h_sec_r",
"R of sec MC track at the first hit", 50, 0.0, 15.0);
915 new TH1F(
"h_notfound_mom",
"Momentum of not found track", 50, 0.0, 5.0);
916 h_notfound_nhits =
new TH1F(
917 "h_notfound_nhits",
"Num hits of not found track", 50, 0.0, 10.0);
918 h_notfound_station =
new TH1F(
919 "h_notfound_station",
"First station of not found track", 50, 0.0, 10.0);
920 h_notfound_r =
new TH1F(
921 "h_notfound_r",
"R at first hit of not found track", 50, 0.0, 15.0);
922 h_notfound_tx =
new TH1F(
923 "h_notfound_tx",
"tx of not found track at the first hit", 50, -5.0, 5.0);
924 h_notfound_ty =
new TH1F(
925 "h_notfound_ty",
"ty of not found track at the first hit", 50, -1.0, 1.0);
933 h_mcp =
new TH1F(
"h_mcp",
"MC P ", 500, 0.0, 5.0);
939 h_nmchits =
new TH1F(
"h_nmchits",
"N STS hits on MC track", 50, 0.0, 10.0);
943 h2_vertex =
new TH2F(
944 "h2_vertex",
"2D vertex distribution", 105, -5., 100., 100, -50., 50.);
945 h2_prim_vertex =
new TH2F(
"h2_primvertex",
946 "2D primary vertex distribution",
953 h2_sec_vertex =
new TH2F(
"h2_sec_vertex",
954 "2D secondary vertex distribution",
966 h2_reg_nhits_vs_mom_prim =
967 new TH2F(
"h2_reg_nhits_vs_mom_prim",
968 "NHits vs. Momentum (Reg. Primary Tracks)",
975 h2_reg_nhits_vs_mom_sec =
976 new TH2F(
"h2_reg_nhits_vs_mom_sec",
977 "NHits vs. Momentum (Reg. Secondary Tracks)",
984 h2_acc_nhits_vs_mom_prim =
985 new TH2F(
"h2_acc_nhits_vs_mom_prim",
986 "NHits vs. Momentum (Acc. Primary Tracks)",
993 h2_acc_nhits_vs_mom_sec =
994 new TH2F(
"h2_acc_nhits_vs_mom_sec",
995 "NHits vs. Momentum (Acc. Secondary Tracks)",
1002 h2_reco_nhits_vs_mom_prim =
1003 new TH2F(
"h2_reco_nhits_vs_mom_prim",
1004 "NHits vs. Momentum (Reco Primary Tracks)",
1011 h2_reco_nhits_vs_mom_sec =
1012 new TH2F(
"h2_reco_nhits_vs_mom_sec",
1013 "NHits vs. Momentum (Reco Secondary Tracks)",
1020 h2_ghost_nhits_vs_mom =
new TH2F(
"h2_ghost_nhits_vs_mom",
1021 "NHits vs. Momentum (Ghost Tracks)",
1028 h2_rest_nhits_vs_mom_prim =
1029 new TH2F(
"h2_rest_nhits_vs_mom_prim",
1030 "NHits vs. Momentum (!Found Primary Tracks)",
1037 h2_rest_nhits_vs_mom_sec =
1038 new TH2F(
"h2_rest_nhits_vs_mom_sec",
1039 "NHits vs. Momentum (!Found Secondary Tracks)",
1047 h2_reg_fstation_vs_mom_prim =
1048 new TH2F(
"h2_reg_fstation_vs_mom_prim",
1049 "First Station vs. Momentum (Reg. Primary Tracks)",
1056 h2_reg_fstation_vs_mom_sec =
1057 new TH2F(
"h2_reg_fstation_vs_mom_sec",
1058 "First Station vs. Momentum (Reg. Secondary Tracks)",
1065 h2_acc_fstation_vs_mom_prim =
1066 new TH2F(
"h2_acc_fstation_vs_mom_prim",
1067 "First Station vs. Momentum (Acc. Primary Tracks)",
1074 h2_acc_fstation_vs_mom_sec =
1075 new TH2F(
"h2_acc_fstation_vs_mom_sec",
1076 "First Station vs. Momentum (Acc. Secondary Tracks)",
1083 h2_reco_fstation_vs_mom_prim =
1084 new TH2F(
"h2_reco_fstation_vs_mom_prim",
1085 "First Station vs. Momentum (Reco Primary Tracks)",
1092 h2_reco_fstation_vs_mom_sec =
1093 new TH2F(
"h2_reco_fstation_vs_mom_sec",
1094 "First Station vs. Momentum (Reco Secondary Tracks)",
1101 h2_ghost_fstation_vs_mom =
1102 new TH2F(
"h2_ghost_fstation_vs_mom",
1103 "First Station vs. Momentum (Ghost Tracks)",
1110 h2_rest_fstation_vs_mom_prim =
1111 new TH2F(
"h2_rest_fstation_vs_mom_prim",
1112 "First Station vs. Momentum (!Found Primary Tracks)",
1119 h2_rest_fstation_vs_mom_sec =
1120 new TH2F(
"h2_rest_fstation_vs_mom_sec",
1121 "First Station vs. Momentum (!Found Secondary Tracks)",
1129 h2_reg_lstation_vs_fstation_prim =
1130 new TH2F(
"h2_reg_lstation_vs_fstation_prim",
1131 "Last vs. First Station (Reg. Primary Tracks)",
1138 h2_reg_lstation_vs_fstation_sec =
1139 new TH2F(
"h2_reg_lstation_vs_fstation_sec",
1140 "Last vs. First Station (Reg. Secondary Tracks)",
1147 h2_acc_lstation_vs_fstation_prim =
1148 new TH2F(
"h2_acc_lstation_vs_fstation_prim",
1149 "Last vs. First Station (Acc. Primary Tracks)",
1156 h2_acc_lstation_vs_fstation_sec =
1157 new TH2F(
"h2_acc_lstation_vs_fstation_sec",
1158 "Last vs. First Station (Acc. Secondary Tracks)",
1165 h2_reco_lstation_vs_fstation_prim =
1166 new TH2F(
"h2_reco_lstation_vs_fstation_prim",
1167 "Last vs. First Station (Reco Primary Tracks)",
1174 h2_reco_lstation_vs_fstation_sec =
1175 new TH2F(
"h2_reco_lstation_vs_fstation_sec",
1176 "Last vs. First Station (Reco Secondary Tracks)",
1183 h2_ghost_lstation_vs_fstation =
1184 new TH2F(
"h2_ghost_lstation_vs_fstation",
1185 "Last vs. First Station (Ghost Tracks)",
1192 h2_rest_lstation_vs_fstation_prim =
1193 new TH2F(
"h2_rest_lstation_vs_fstation_prim",
1194 "Last vs. First Station (!Found Primary Tracks)",
1201 h2_rest_lstation_vs_fstation_sec =
1202 new TH2F(
"h2_rest_lstation_vs_fstation_sec",
1203 "Last vs. First Station (!Found Secondary Tracks)",
1215 gDirectory = curdir;
1220 static int NEvents = 0;
1222 h_reg_MCmom->Scale(NEvents);
1223 h_acc_MCmom->Scale(NEvents);
1224 h_reco_MCmom->Scale(NEvents);
1225 h_ghost_Rmom->Scale(NEvents);
1226 h_reg_prim_MCmom->Scale(NEvents);
1227 h_acc_prim_MCmom->Scale(NEvents);
1228 h_reco_prim_MCmom->Scale(NEvents);
1229 h_reg_sec_MCmom->Scale(NEvents);
1230 h_acc_sec_MCmom->Scale(NEvents);
1231 h_reco_sec_MCmom->Scale(NEvents);
1245 for (vector<CbmL1Track>::iterator rtraIt =
vRTracks.begin();
1249 if ((prtra->
StsHits).size() < 1)
continue;
1251 if (
fabs(prtra->
T[4]) > 1.e-10) h_reco_mom->Fill(
fabs(1.0 / prtra->
T[4]));
1252 h_reco_nhits->Fill((prtra->
StsHits).size());
1259 if (prtra->
NDF > 0) {
1261 h_ghost_chi2->Fill(prtra->
chi2 / prtra->
NDF);
1262 h_ghost_prob->Fill(TMath::Prob(prtra->
chi2, prtra->
NDF));
1265 h_reco_chi2->Fill(prtra->
chi2 / prtra->
NDF);
1266 h_reco_prob->Fill(TMath::Prob(prtra->
chi2, prtra->
NDF));
1269 h_rest_prob->Fill(TMath::Prob(prtra->
chi2, prtra->
NDF));
1277 if (
fabs(prtra->
T[4]) > 1.e-10) {
1278 h_ghost_mom->Fill(
fabs(1.0 / prtra->
T[4]));
1279 h_ghost_Rmom->Fill(
fabs(1.0 / prtra->
T[4]));
1281 h_ghost_nhits->Fill((prtra->
StsHits).size());
1284 h_ghost_fstation->Fill(h1.
iStation);
1285 h_ghost_r->Fill(
sqrt(
fabs(h1.
x * h1.
x + h1.
y * h1.
y)));
1289 h_ghost_tx->Fill((h2.
x - h1.
x) / (
z2 -
z1));
1290 h_ghost_ty->Fill((h2.
y - h1.
y) / (
z2 -
z1));
1293 if (
fabs(prtra->
T[4]) > 1.e-10)
1294 h2_ghost_nhits_vs_mom->Fill(
fabs(1.0 / prtra->
T[4]),
1299 if (
fabs(prtra->
T[4]) > 1.e-10)
1300 h2_ghost_fstation_vs_mom->Fill(
fabs(1.0 / prtra->
T[4]),
1309 for (vector<CbmL1MCTrack>::iterator mtraIt =
vMCTracks.begin();
1316 int nmchits = mtra.
StsHits.size();
1317 if (nmchits == 0)
continue;
1319 double momentum = mtra.
p;
1320 double pt =
sqrt(mtra.
px * mtra.
px + mtra.
py * mtra.
py);
1321 double theta =
acos(mtra.
pz / mtra.
p) * 180 / 3.1415;
1323 h_mcp->Fill(momentum);
1324 h_nmchits->Fill(nmchits);
1331 h_reg_MCmom->Fill(momentum);
1333 h_reg_mom_prim->Fill(momentum);
1334 h_reg_prim_MCmom->Fill(momentum);
1335 h_reg_nhits_prim->Fill(nSta);
1336 h2_reg_nhits_vs_mom_prim->Fill(momentum, nSta);
1337 h2_reg_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
1339 h2_reg_lstation_vs_fstation_prim->Fill(fh.
iStation + 1,
1342 h_reg_mom_sec->Fill(momentum);
1343 h_reg_sec_MCmom->Fill(momentum);
1344 h_reg_nhits_sec->Fill(nSta);
1345 if (momentum > 0.01) {
1346 h2_reg_nhits_vs_mom_sec->Fill(momentum, nSta);
1347 h2_reg_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
1349 h2_reg_lstation_vs_fstation_sec->Fill(fh.
iStation + 1,
1354 if (mtra.
IsAdditional()) { h_acc_mom_short123s->Fill(momentum); }
1359 h_acc_MCmom->Fill(momentum);
1361 h_acc_mom_prim->Fill(momentum);
1362 h_acc_prim_MCmom->Fill(momentum);
1363 h_acc_nhits_prim->Fill(nSta);
1364 h2_acc_nhits_vs_mom_prim->Fill(momentum, nSta);
1365 h2_acc_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
1367 h2_acc_lstation_vs_fstation_prim->Fill(fh.
iStation + 1,
1370 h_acc_mom_sec->Fill(momentum);
1371 h_acc_sec_MCmom->Fill(momentum);
1372 h_acc_nhits_sec->Fill(nSta);
1373 if (momentum > 0.01) {
1374 h2_acc_nhits_vs_mom_sec->Fill(momentum, nSta);
1375 h2_acc_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
1377 h2_acc_lstation_vs_fstation_sec->Fill(fh.
iStation + 1,
1384 h2_vertex->Fill(mtra.
z, mtra.
y);
1387 h2_prim_vertex->Fill(mtra.
z, mtra.
y);
1390 h2_sec_vertex->Fill(mtra.
z, mtra.
y);
1399 if (
fabs(mtra.
pz) > 1.e-8) {
1400 h_tx->Fill(mtra.
px / mtra.
pz);
1401 h_ty->Fill(mtra.
py / mtra.
pz);
1409 p_eff_all_vs_mom->Fill(momentum, 100.0);
1410 p_eff_all_vs_nhits->Fill(nMCHits, 100.0);
1411 p_eff_all_vs_pt->Fill(pt, 100.0);
1412 h_reco_MCmom->Fill(momentum);
1414 p_eff_prim_vs_mom->Fill(momentum, 100.0);
1415 p_eff_prim_vs_nhits->Fill(nMCHits, 100.0);
1416 p_eff_prim_vs_pt->Fill(pt, 100.0);
1417 p_eff_prim_vs_theta->Fill(theta, 100.0);
1419 p_eff_sec_vs_mom->Fill(momentum, 100.0);
1420 p_eff_sec_vs_nhits->Fill(nMCHits, 100.0);
1423 h_reco_mom_prim->Fill(momentum);
1424 h_reco_prim_MCmom->Fill(momentum);
1425 h_reco_nhits_prim->Fill(nSta);
1426 h2_reco_nhits_vs_mom_prim->Fill(momentum, nSta);
1427 h2_reco_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
1429 h2_reco_lstation_vs_fstation_prim->Fill(fh.
iStation + 1,
1432 h_reco_mom_sec->Fill(momentum);
1433 h_reco_sec_MCmom->Fill(momentum);
1434 h_reco_nhits_sec->Fill(nSta);
1435 if (momentum > 0.01) {
1436 h2_reco_nhits_vs_mom_sec->Fill(momentum, nSta);
1437 h2_reco_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
1439 h2_reco_lstation_vs_fstation_sec->Fill(fh.
iStation + 1,
1444 h_notfound_mom->Fill(momentum);
1445 p_eff_all_vs_mom->Fill(momentum, 0.0);
1446 p_eff_all_vs_nhits->Fill(nMCHits, 0.0);
1447 p_eff_all_vs_pt->Fill(pt, 0.0);
1449 p_eff_prim_vs_mom->Fill(momentum, 0.0);
1450 p_eff_prim_vs_nhits->Fill(nMCHits, 0.0);
1451 p_eff_prim_vs_pt->Fill(pt, 0.0);
1452 p_eff_prim_vs_theta->Fill(theta, 0.0);
1454 p_eff_sec_vs_mom->Fill(momentum, 0.0);
1455 p_eff_sec_vs_nhits->Fill(nMCHits, 0.0);
1458 h_rest_mom_prim->Fill(momentum);
1459 h_rest_nhits_prim->Fill(nSta);
1460 h2_rest_nhits_vs_mom_prim->Fill(momentum, nSta);
1461 h2_rest_fstation_vs_mom_prim->Fill(momentum, fh.
iStation + 1);
1463 h2_rest_lstation_vs_fstation_prim->Fill(fh.
iStation + 1,
1466 h_rest_mom_sec->Fill(momentum);
1467 h_rest_nhits_sec->Fill(nSta);
1468 if (momentum > 0.01) {
1469 h2_rest_nhits_vs_mom_sec->Fill(momentum, nSta);
1470 h2_rest_fstation_vs_mom_sec->Fill(momentum, fh.
iStation + 1);
1472 h2_rest_lstation_vs_fstation_sec->Fill(fh.
iStation + 1,
1481 h_notfound_nhits->Fill(nmchits);
1482 h_notfound_station->Fill(ph.
iStation);
1483 h_notfound_r->Fill(
sqrt(
fabs(ph.
x * ph.
x + ph.
y * ph.
y)));
1485 if (mtra.
Points.size() > 0) {
1487 h_notfound_tx->Fill(pMC.
px / pMC.
pz);
1488 h_notfound_ty->Fill(pMC.
py / pMC.
pz);
1506 h_reco_d0_mom->Fill(momentum);
1508 p_eff_d0_vs_mom->Fill(momentum, 100.0);
1510 p_eff_d0_vs_mom->Fill(momentum, 0.0);
1516 for (
unsigned int ih = 0; ih <
algo->
vStsHits->size(); ih++) {
1518 if (iMC < 0) NFakes++;
1522 h_reco_timeNtr->Fill(mc_total,
algo->
CATime);
1525 h_reco_fakeNtr->Fill(mc_total, NFakes);
1526 h_reco_fakeNhit->Fill(
algo->
vStsHits->size() - NFakes, NFakes);
1529 h_reg_MCmom->Scale(1.
f / NEvents);
1530 h_acc_MCmom->Scale(1.
f / NEvents);
1531 h_reco_MCmom->Scale(1.
f / NEvents);
1532 h_ghost_Rmom->Scale(1.
f / NEvents);
1533 h_reg_prim_MCmom->Scale(1.
f / NEvents);
1534 h_acc_prim_MCmom->Scale(1.
f / NEvents);
1535 h_reco_prim_MCmom->Scale(1.
f / NEvents);
1536 h_reg_sec_MCmom->Scale(1.
f / NEvents);
1537 h_acc_sec_MCmom->Scale(1.
f / NEvents);
1538 h_reco_sec_MCmom->Scale(1.
f / NEvents);
1544 const int Nh_fit = 14;
1545 static TH1F *h_fit[Nh_fit], *h_fitL[Nh_fit], *h_fitSV[Nh_fit],
1546 *h_fitPV[Nh_fit], *h_fit_chi2;
1548 static TH2F *PRes2D, *PRes2DPrim, *PRes2DSec;
1550 static bool first_call = 1;
1555 TDirectory* currentDir = gDirectory;
1557 gDirectory->cd(
"L1");
1558 gDirectory->mkdir(
"Fit");
1559 gDirectory->cd(
"Fit");
1562 new TH2F(
"PRes2D",
"Resolution P vs P", 100, 0., 20., 100, -15., 15.);
1563 PRes2DPrim =
new TH2F(
1564 "PRes2DPrim",
"Resolution P vs P", 100, 0., 20., 100, -15., 15.);
1565 PRes2DSec =
new TH2F(
1566 "PRes2DSec",
"Resolution P vs P", 100, 0., 20., 100, -15., 15.);
1574 {
"x",
"Residual X [#mum]", 140, -40., 40.},
1575 {
"y",
"Residual Y [#mum]", 100, -450., 450.},
1577 {
"tx",
"Residual Tx [mrad]", 100, -4., 4.},
1580 {
"ty",
"Residual Ty [mrad]", 100, -3.5, 3.5},
1582 {
"P",
"Resolution P/Q [100%]", 100, -0.1, 0.1},
1584 {
"px",
"Pull X [residual/estimated_error]", 100, -6., 6.},
1585 {
"py",
"Pull Y [residual/estimated_error]", 100, -6., 6.},
1586 {
"ptx",
"Pull Tx [residual/estimated_error]", 100, -6., 6.},
1587 {
"pty",
"Pull Ty [residual/estimated_error]", 100, -6., 6.},
1588 {
"pQP",
"Pull Q/P [residual/estimated_error]", 100, -6., 6.},
1589 {
"QPreco",
"Reco Q/P ", 100, -10., 10.},
1590 {
"QPmc",
"MC Q/P ", 100, -10., 10.},
1591 {
"t",
"Residual T [ns]", 100, -6., 6.},
1592 {
"pt",
"Pull T [residual/estimated_error]", 100, -6., 6.}};
1600 Tab TableVertex[Nh_fit] = {
1602 {
"x",
"Residual X [cm]", 2000, -1., 1.},
1604 {
"y",
"Residual Y [cm]", 2000, -1., 1.},
1606 {
"tx",
"Residual Tx [mrad]", 100, -2., 2.},
1608 {
"ty",
"Residual Ty [mrad]", 100, -2., 2.},
1609 {
"P",
"Resolution P/Q [100%]", 100, -0.1, 0.1},
1610 {
"px",
"Pull X [residual/estimated_error]", 100, -6., 6.},
1611 {
"py",
"Pull Y [residual/estimated_error]", 100, -6., 6.},
1612 {
"ptx",
"Pull Tx [residual/estimated_error]", 100, -6., 6.},
1613 {
"pty",
"Pull Ty [residual/estimated_error]", 100, -6., 6.},
1614 {
"pQP",
"Pull Q/P [residual/estimated_error]", 100, -6., 6.},
1615 {
"QPreco",
"Reco Q/P ", 100, -10., 10.},
1616 {
"QPmc",
"MC Q/P ", 100, -10., 10.},
1617 {
"t",
"Residual T [ns]", 100, -10., 10.},
1618 {
"pt",
"Pull T [residual/estimated_error]", 100, -6., 6.}};
1620 for (
int i = 0;
i < Nh_fit;
i++) {
1621 char n[225], t[255];
1622 sprintf(n,
"fst_%s", Table[
i].name);
1623 sprintf(t,
"First point %s", Table[
i].title);
1624 h_fit[
i] =
new TH1F(n, t, Table[
i].n, Table[
i].l, Table[
i].r);
1625 sprintf(n,
"lst_%s", Table[
i].name);
1626 sprintf(t,
"Last point %s", Table[
i].title);
1627 h_fitL[
i] =
new TH1F(n, t, Table[
i].n, Table[
i].l, Table[
i].r);
1628 sprintf(n,
"svrt_%s", TableVertex[
i].name);
1629 sprintf(t,
"Secondary vertex point %s", TableVertex[
i].title);
1631 new TH1F(n, t, TableVertex[
i].n, TableVertex[
i].l, TableVertex[
i].r);
1632 sprintf(n,
"pvrt_%s", TableVertex[
i].name);
1633 sprintf(t,
"Primary vertex point %s", TableVertex[
i].title);
1635 new TH1F(n, t, TableVertex[
i].n, TableVertex[
i].l, TableVertex[
i].r);
1637 for (
int j = 0; j < 12; j++) {
1638 sprintf(n,
"smth_%s_sta_%i", Table[
i].name, j);
1639 sprintf(t,
"Station %i %s", j, Table[
i].title);
1643 h_fit_chi2 =
new TH1F(
"h_fit_chi2",
"Chi2/NDF", 50, -0.5, 10.0);
1645 gDirectory = currentDir;
1648 for (vector<CbmL1Track>::iterator it =
vRTracks.begin(); it !=
vRTracks.end();
1651 if (it->IsGhost())
continue;
1654 #define L1FSTPARAMEXTRAPOLATE
1655 #ifdef L1FSTPARAMEXTRAPOLATE
1657 const int last_station =
vHitStore[it->StsHits.back()].iStation;
1663 float z[3] = {0.f, 0.f, 0.f};
1665 for (
unsigned int iMCPoint = 0; iMCPoint < mc.
Points.size(); iMCPoint++) {
1666 const int iMCP = mc.
Points[iMCPoint];
1670 if (ih > 0 && (z[ih] - z[ih - 1]) < 0.1)
continue;
1675 if (ih < 3)
continue;
1677 targB =
algo->vtxFieldValue;
1678 fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
1681 h_fit[0]->Fill((trPar.
x[0] - mcP.
xIn) * 1.e4);
1682 h_fit[1]->Fill((trPar.
y[0] - mcP.
yIn) * 1.e4);
1683 h_fit[2]->Fill((trPar.
tx[0] - mcP.
pxIn / mcP.
pzIn) * 1.e3);
1684 h_fit[3]->Fill((trPar.
ty[0] - mcP.
pyIn / mcP.
pzIn) * 1.e3);
1685 h_fit[4]->Fill(
fabs(1. / trPar.
qp[0]) / mcP.
p - 1);
1687 PRes2D->Fill(mcP.
p, (1. /
fabs(trPar.
qp[0]) - mcP.
p) / mcP.
p * 100.);
1691 PRes2DPrim->Fill(mcP.
p,
1692 (1. /
fabs(trPar.
qp[0]) - mcP.
p) / mcP.
p * 100.);
1694 PRes2DSec->Fill(mcP.
p, (1. /
fabs(trPar.
qp[0]) - mcP.
p) / mcP.
p * 100.);
1708 h_fit[10]->Fill(trPar.
qp[0]);
1709 h_fit[11]->Fill(mcP.
q / mcP.
p);
1716 int iMC =
vHitMCRef[it->StsHits.front()];
1717 if (iMC < 0)
continue;
1720 h_fit[0]->Fill((mc.
x - it->T[0]) * 1.e4);
1721 h_fit[1]->Fill((mc.
y - it->T[1]) * 1.e4);
1722 h_fit[2]->Fill((mc.
px / mc.
pz - it->T[2]) * 1.e3);
1723 h_fit[3]->Fill((mc.
py / mc.
pz - it->T[3]) * 1.e3);
1724 h_fit[4]->Fill(it->T[4] / mc.
q * mc.
p - 1);
1726 PRes2D->Fill(mc.
p, (1. /
fabs(it->T[4]) - mc.
p) / mc.
p * 100.);
1730 PRes2DPrim->Fill(mc.
p, (1. /
fabs(it->T[4]) - mc.
p) / mc.
p * 100.);
1732 PRes2DSec->Fill(mc.
p, (1. /
fabs(it->T[4]) - mc.
p) / mc.
p * 100.);
1734 if (
finite(it->C[0]) && it->C[0] > 0)
1735 h_fit[5]->
Fill((mc.
x - it->T[0]) /
sqrt(it->C[0]));
1736 if (
finite(it->C[2]) && it->C[2] > 0)
1737 h_fit[6]->
Fill((mc.
y - it->T[1]) /
sqrt(it->C[2]));
1738 if (
finite(it->C[5]) && it->C[5] > 0)
1739 h_fit[7]->
Fill((mc.
px / mc.
pz - it->T[2]) /
sqrt(it->C[5]));
1740 if (
finite(it->C[9]) && it->C[9] > 0)
1741 h_fit[8]->
Fill((mc.
py / mc.
pz - it->T[3]) /
sqrt(it->C[9]));
1742 if (
finite(it->C[14]) && it->C[14] > 0)
1743 h_fit[9]->
Fill((mc.
q / mc.
p - it->T[4]) /
sqrt(it->C[14]));
1744 h_fit[10]->Fill(it->T[4]);
1745 h_fit[11]->Fill(mc.
q / mc.
p);
1746 h_fit[12]->Fill(mc.
time - it->T[6]);
1747 if (
finite(it->C[20]) && it->C[20] > 0)
1748 h_fit[13]->
Fill((mc.
time - it->T[6]) /
sqrt(it->C[20]));
1754 int iMC =
vHitMCRef[it->StsHits.back()];
1755 if (iMC < 0)
continue;
1757 #define L1FSTPARAMEXTRAPOLATE
1758 #ifdef L1FSTPARAMEXTRAPOLATE
1760 const int last_station =
vHitStore[it->StsHits.back()].iStation;
1766 float z[3] = {0.f, 0.f, 0.f};
1768 for (
unsigned int iMCPoint = 0; iMCPoint < mc.
Points.size(); iMCPoint++) {
1769 const int iMCP = mc.
Points[iMCPoint];
1773 if (ih > 0 && (z[ih] - z[ih - 1]) < 0.1)
continue;
1778 if (ih < 3)
continue;
1780 targB =
algo->vtxFieldValue;
1781 fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
1784 h_fitL[0]->Fill((trPar.
x[0] - mcP.
xOut) * 1.e4);
1785 h_fitL[1]->Fill((trPar.
y[0] - mcP.
yOut) * 1.e4);
1786 h_fitL[2]->Fill((trPar.
tx[0] - mcP.
pxOut / mcP.
pzOut) * 1.e3);
1787 h_fitL[3]->Fill((trPar.
ty[0] - mcP.
pyOut / mcP.
pzOut) * 1.e3);
1788 h_fitL[4]->Fill(
fabs(1. / trPar.
qp[0]) / mcP.
p - 1);
1793 h_fitL[5]->Fill((trPar.
x[0] - mcP.
xOut) /
sqrt(trPar.
C00[0]));
1795 h_fitL[6]->Fill((trPar.
y[0] - mcP.
yOut) /
sqrt(trPar.
C11[0]));
1803 h_fitL[9]->Fill((trPar.
qp[0] - mcP.
q / mcP.
p) /
sqrt(trPar.
C44[0]));
1804 h_fitL[10]->Fill(trPar.
qp[0]);
1805 h_fitL[11]->Fill(mcP.
q / mcP.
p);
1808 h_fitL[13]->Fill((trPar.
t[0] - mcP.
time) /
sqrt(trPar.
C55[0]));
1812 h_fitL[0]->Fill((it->TLast[0] - mc.
x) * 1.e4);
1813 h_fitL[1]->Fill((it->TLast[1] - mc.
y) * 1.e4);
1814 h_fitL[2]->Fill((it->TLast[2] - mc.
px / mc.
pz) * 1.e3);
1815 h_fitL[3]->Fill((it->TLast[3] - mc.
py / mc.
pz) * 1.e3);
1816 h_fitL[4]->Fill(
fabs(1. / it->TLast[4]) / mc.
p - 1);
1817 if (
finite(it->CLast[0]) && it->CLast[0] > 0)
1818 h_fitL[5]->Fill((it->TLast[0] - mc.
x) /
sqrt(it->CLast[0]));
1819 if (
finite(it->CLast[2]) && it->CLast[2] > 0)
1820 h_fitL[6]->Fill((it->TLast[1] - mc.
y) /
sqrt(it->CLast[2]));
1821 if (
finite(it->CLast[5]) && it->CLast[5] > 0)
1822 h_fitL[7]->Fill((it->TLast[2] - mc.
px / mc.
pz) /
sqrt(it->CLast[5]));
1823 if (
finite(it->CLast[9]) && it->CLast[9] > 0)
1824 h_fitL[8]->Fill((it->TLast[3] - mc.
py / mc.
pz) /
sqrt(it->CLast[9]));
1825 if (
finite(it->CLast[14]) && it->CLast[14] > 0)
1826 h_fitL[9]->Fill((it->TLast[4] - mc.
q / mc.
p) /
sqrt(it->CLast[14]));
1827 h_fitL[10]->Fill(it->TLast[4]);
1828 h_fitL[11]->Fill(mc.
q / mc.
p);
1829 h_fitL[12]->Fill(it->TLast[6] - mc.
time);
1830 if (
finite(it->CLast[20]) && it->CLast[20] > 0)
1831 h_fitL[13]->Fill((it->TLast[6] - mc.
time) /
sqrt(it->CLast[20]));
1846 for (
unsigned int ih = 0; ih < 3; ih++) {
1847 if (ih >= mc.
Points.size())
continue;
1848 const int iMCP = mc.
Points[ih];
1854 fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
1858 const int fSta =
vHitStore[it->StsHits[0]].iStation;
1859 const int dir = int((mc.
z -
algo->vStations[fSta].z[0])
1860 /
fabs(mc.
z -
algo->vStations[fSta].z[0]));
1862 for (
int iSta = fSta ;
1864 && (dir * (mc.
z -
algo->vStations[iSta].z[0]) > 0);
1872 if (mc.
z != trPar.
z[0])
continue;
1885 h_fitSV[0]->Fill((trPar.
x[0] - mc.
x));
1886 h_fitSV[1]->Fill((trPar.
y[0] - mc.
y));
1887 h_fitSV[2]->Fill((trPar.
tx[0] - mc.
px / mc.
pz) * 1.e3);
1888 h_fitSV[3]->Fill((trPar.
ty[0] - mc.
py / mc.
pz) * 1.e3);
1889 h_fitSV[4]->Fill(
fabs(1. / trPar.
qp[0]) / mc.
p - 1);
1891 h_fitSV[5]->Fill((trPar.
x[0] - mc.
x) /
sqrt(trPar.
C00[0]));
1893 h_fitSV[6]->Fill((trPar.
y[0] - mc.
y) /
sqrt(trPar.
C11[0]));
1895 h_fitSV[7]->Fill((trPar.
tx[0] - mc.
px / mc.
pz) /
sqrt(trPar.
C22[0]));
1897 h_fitSV[8]->Fill((trPar.
ty[0] - mc.
py / mc.
pz) /
sqrt(trPar.
C33[0]));
1899 h_fitSV[9]->Fill((trPar.
qp[0] - mc.
q / mc.
p) /
sqrt(trPar.
C44[0]));
1900 h_fitSV[10]->Fill(trPar.
qp[0]);
1901 h_fitSV[11]->Fill(mc.
q / mc.
p);
1902 h_fitSV[12]->Fill(trPar.
t[0] - mc.
time);
1904 h_fitSV[13]->Fill((trPar.
t[0] - mc.
time) /
sqrt(trPar.
C55[0]));
1907 #define L1EXTRAPOLATE
1908 #ifdef L1EXTRAPOLATE
1914 targB =
algo->vtxFieldValue;
1917 for (
unsigned int iHit = 0; iHit < it->StsHits.size(); iHit++) {
1918 const int iStation =
vHitStore[it->StsHits[iHit]].iStation;
1927 if (ih < 3)
continue;
1930 const int fSta =
vHitStore[it->StsHits[0]].iStation;
1932 const int dir = (mc.
z -
algo->vStations[fSta].z[0])
1933 / abs(mc.
z -
algo->vStations[fSta].z[0]);
1936 for (
int iSta = fSta + dir;
1938 && (dir * (mc.
z -
algo->vStations[iSta].z[0]) > 0);
1941 z[0] =
algo->vStations[iSta].z[0];
1942 float dz = z[1] - z[0];
1943 algo->vStations[iSta].fieldSlice.GetFieldValue(
1944 trPar.
x - trPar.
tx * dz, trPar.
y - trPar.
ty * dz, B[0]);
1945 fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
1947 fvec mass2 = 0.1395679f * 0.1395679f;
1971 fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
1974 if (mc.
z != trPar.
z[0])
continue;
1978 h_fitPV[0]->Fill((mc.
x - trPar.
x[0]));
1979 h_fitPV[1]->Fill((mc.
y - trPar.
y[0]));
1980 h_fitPV[2]->Fill((mc.
px / mc.
pz - trPar.
tx[0]) * 1.e3);
1981 h_fitPV[3]->Fill((mc.
py / mc.
pz - trPar.
ty[0]) * 1.e3);
1982 h_fitPV[4]->Fill(
fabs(1 / trPar.
qp[0]) / mc.
p - 1);
1984 h_fitPV[5]->Fill((mc.
x - trPar.
x[0]) /
sqrt(trPar.
C00[0]));
1986 h_fitPV[6]->Fill((mc.
y - trPar.
y[0]) /
sqrt(trPar.
C11[0]));
1988 h_fitPV[7]->Fill((mc.
px / mc.
pz - trPar.
tx[0]) /
sqrt(trPar.
C22[0]));
1990 h_fitPV[8]->Fill((mc.
py / mc.
pz - trPar.
ty[0]) /
sqrt(trPar.
C33[0]));
1992 h_fitPV[9]->Fill((mc.
q / mc.
p - trPar.
qp[0]) /
sqrt(trPar.
C44[0]));
1993 h_fitPV[10]->Fill(trPar.
qp[0]);
1994 h_fitPV[11]->Fill(mc.
q / mc.
p);
1995 h_fitPV[12]->Fill(mc.
time - trPar.
t[0]);
1997 h_fitPV[13]->Fill((mc.
time - trPar.
t[0]) /
sqrt(trPar.
C55[0]));
2008 for (
int ipar = 0; ipar < 6; ipar++)
2010 for (
int ipar = 0; ipar < 15; ipar++)
2017 h_fitPV[0]->Fill((mc.
x - it2.
T[0]));
2018 h_fitPV[1]->Fill((mc.
y - it2.
T[1]));
2019 h_fitPV[2]->Fill((mc.
px / mc.
pz - it2.
T[2]) * 1.e3);
2020 h_fitPV[3]->Fill((mc.
py / mc.
pz - it2.
T[3]) * 1.e3);
2021 h_fitPV[4]->Fill(it2.
T[4] / mc.
q * mc.
p - 1);
2022 if (
finite(it2.
C[0]) && it2.
C[0] > 0)
2023 h_fitPV[5]->Fill((mc.
x - it2.
T[0]) /
sqrt(it2.
C[0]));
2024 if (
finite(it2.
C[2]) && it2.
C[2] > 0)
2025 h_fitPV[6]->Fill((mc.
y - it2.
T[1]) /
sqrt(it2.
C[2]));
2026 if (
finite(it2.
C[5]) && it2.
C[5] > 0)
2027 h_fitPV[7]->Fill((mc.
px / mc.
pz - it2.
T[2]) /
sqrt(it2.
C[5]));
2028 if (
finite(it2.
C[9]) && it2.
C[9] > 0)
2029 h_fitPV[8]->Fill((mc.
py / mc.
pz - it2.
T[3]) /
sqrt(it2.
C[9]));
2030 if (
finite(it2.
C[14]) && it2.
C[14] > 0)
2031 h_fitPV[9]->Fill((mc.
q / mc.
p - it2.
T[4]) /
sqrt(it2.
C[14]));
2032 h_fitPV[10]->Fill(it2.
T[4]);
2033 h_fitPV[11]->Fill(mc.
q / mc.
p);
2034 h_fitPV[12]->Fill(mc.
time - it2.
T[6]);
2035 if (
finite(it2.
C[20]) && it2.
C[20] > 0)
2036 h_fitPV[13]->Fill((mc.
time - it2.
T[6]) /
sqrt(it2.
C[20]));
2037 #endif // L1EXTRAPOLATE
2041 h_fit_chi2->Fill(it->chi2 / it->NDF);
2048 TDirectory* curr = gDirectory;
2049 TFile* currentFile = gFile;
2050 TFile* fout =
new TFile(
"FieldApprox.root",
"RECREATE");
2054 for (
int ist = 0; ist <
NStation; ist++) {
2056 double Xmax = -100, Ymax = -100;
2064 z = station->
GetZ();
2075 float ddx = 2 * Xmax / NbinsX;
2076 float ddy = 2 * Ymax / NbinsY;
2078 TH2F* stB =
new TH2F(Form(
"station %i, dB", ist + 1),
2079 Form(
"station %i, dB, z = %0.f cm", ist + 1, z),
2080 static_cast<int>(NbinsX + 1),
2083 static_cast<int>(NbinsY + 1),
2086 TH2F* stBx =
new TH2F(Form(
"station %i, dBx", ist + 1),
2087 Form(
"station %i, dBx, z = %0.f cm", ist + 1, z),
2088 static_cast<int>(NbinsX + 1),
2091 static_cast<int>(NbinsY + 1),
2094 TH2F* stBy =
new TH2F(Form(
"station %i, dBy", ist + 1),
2095 Form(
"station %i, dBy, z = %0.f cm", ist + 1, z),
2096 static_cast<int>(NbinsX + 1),
2099 static_cast<int>(NbinsY + 1),
2102 TH2F* stBz =
new TH2F(Form(
"station %i, dBz", ist + 1),
2103 Form(
"station %i, dBz, z = %0.f cm", ist + 1, z),
2104 static_cast<int>(NbinsX + 1),
2107 static_cast<int>(NbinsY + 1),
2111 Double_t r[3], B[3];
2114 Double_t bbb, bbb_L1;
2117 const int N = (M + 1) * (M + 2) / 2;
2119 for (
int i = 0;
i < N;
i++) {
2128 for (
int ii = 1; ii <= NbinsX + 1; ii++) {
2130 x = -Xmax + (ii - 1) * ddx;
2131 for (
int jj = 1; jj <= NbinsY + 1; jj++) {
2132 y = -Ymax + (jj - 1) * ddy;
2133 double rrr =
sqrt(
fabs(
x *
x / Xmax / Xmax +
y / Ymax *
y / Ymax));
2141 MF->GetFieldValue(r, B);
2142 bbb =
sqrt(B[0] * B[0] + B[1] * B[1] + B[2] * B[2]);
2145 bbb_L1 =
sqrt(B_L1.
x[0] * B_L1.
x[0] + B_L1.
y[0] * B_L1.
y[0]
2146 + B_L1.
z[0] * B_L1.
z[0]);
2148 stB->SetBinContent(ii, jj, (bbb - bbb_L1));
2149 stBx->SetBinContent(ii, jj, (B[0] - B_L1.
x[0]));
2150 stBy->SetBinContent(ii, jj, (B[1] - B_L1.
y[0]));
2151 stBz->SetBinContent(ii, jj, (B[2] - B_L1.
z[0]));
2157 stB->GetXaxis()->SetTitle(
"X, cm");
2158 stB->GetYaxis()->SetTitle(
"Y, cm");
2159 stB->GetXaxis()->SetTitleOffset(1);
2160 stB->GetYaxis()->SetTitleOffset(1);
2161 stB->GetZaxis()->SetTitle(
"B_map - B_L1, kGauss");
2162 stB->GetZaxis()->SetTitleOffset(1.3);
2164 stBx->GetXaxis()->SetTitle(
"X, cm");
2165 stBx->GetYaxis()->SetTitle(
"Y, cm");
2166 stBx->GetXaxis()->SetTitleOffset(1);
2167 stBx->GetYaxis()->SetTitleOffset(1);
2168 stBx->GetZaxis()->SetTitle(
"Bx_map - Bx_L1, kGauss");
2169 stBx->GetZaxis()->SetTitleOffset(1.3);
2171 stBy->GetXaxis()->SetTitle(
"X, cm");
2172 stBy->GetYaxis()->SetTitle(
"Y, cm");
2173 stBy->GetXaxis()->SetTitleOffset(1);
2174 stBy->GetYaxis()->SetTitleOffset(1);
2175 stBy->GetZaxis()->SetTitle(
"By_map - By_L1, kGauss");
2176 stBy->GetZaxis()->SetTitleOffset(1.3);
2178 stBz->GetXaxis()->SetTitle(
"X, cm");
2179 stBz->GetYaxis()->SetTitle(
"Y, cm");
2180 stBz->GetXaxis()->SetTitleOffset(1);
2181 stBz->GetYaxis()->SetTitleOffset(1);
2182 stBz->GetZaxis()->SetTitle(
"Bz_map - Bz_L1, kGauss");
2183 stBz->GetZaxis()->SetTitleOffset(1.3);
2194 gFile = currentFile;
2200 TDirectory* curr = gDirectory;
2201 TFile* currentFile = gFile;
2202 TFile* fout =
new TFile(
"FieldApprox.root",
"RECREATE");
2207 int nPointsZ = 1000;
2208 int nPointsPhi = 100;
2209 int nPointsTheta = 100;
2210 double startZ = 0, endZ = 100.;
2211 double startPhi = 0, endPhi = 2 *
TMath::Pi();
2212 double startTheta = -30. / 180. *
TMath::Pi(),
2215 double DZ = endZ - startZ;
2216 double DP = endPhi - startPhi;
2217 double DT = endTheta - startTheta;
2219 float ddp = endPhi / nPointsPhi;
2220 float ddt = 2 * endTheta / nPointsTheta;
2222 TH2F* hSb =
new TH2F(
"Field Integral",
2224 static_cast<int>(nPointsPhi),
2225 -(startPhi + ddp / 2.),
2226 (endPhi + ddp / 2.),
2227 static_cast<int>(nPointsTheta),
2228 (startTheta - ddt / 2.),
2229 (endTheta + ddt / 2.));
2231 for (
int iP = 0; iP < nPointsPhi; iP++) {
2232 double phi = startPhi + iP * DP / nPointsPhi;
2233 for (
int iT = 0; iT < nPointsTheta; iT++) {
2234 double theta = startTheta + iT * DT / nPointsTheta;
2237 for (
int iZ = 1; iZ < nPointsZ; iZ++) {
2238 double z = startZ + DZ * iZ / nPointsZ;
2239 double x = z * TMath::Tan(theta) * TMath::Cos(phi);
2240 double y = z * TMath::Tan(theta) * TMath::Sin(phi);
2241 double r[3] = {
x,
y, z};
2243 MF->GetFieldValue(r, b);
2244 double B =
sqrt(b[0] * b[0] + b[1] * b[1] + b[2] * b[2]);
2245 Sb += B * DZ / nPointsZ / 100. / 10.;
2247 hSb->SetBinContent(iP + 1, iT + 1, Sb);
2251 hSb->GetXaxis()->SetTitle(
"#phi [rad]");
2252 hSb->GetYaxis()->SetTitle(
"#theta [rad]");
2253 hSb->GetXaxis()->SetTitleOffset(1);
2254 hSb->GetYaxis()->SetTitleOffset(1);
2255 hSb->GetZaxis()->SetTitle(
"Field Integral [T#dotm]");
2256 hSb->GetZaxis()->SetTitleOffset(1.3);
2263 gFile = currentFile;
2270 static TH1F *resXsts, *resYsts, *resTsts, *resXmvd, *resYmvd ;
2271 static TH1F *pullXsts, *pullYsts, *pullTsts, *pullXmvd,
2273 static TH1F *pullXmuch, *pullYmuch, *pullTmuch, *resXmuch, *resYmuch,
2275 static TH1F *pullXtrd, *pullYtrd, *pullTtrd, *resXtrd, *resYtrd,
2277 static TH1F *pullXtof, *pullYtof, *pullTtof, *resXtof, *resYtof,
2281 static bool first_call = 1;
2285 TDirectory* currentDir = gDirectory;
2287 gDirectory->cd(
"L1");
2288 gDirectory->mkdir(
"Input");
2289 gDirectory->cd(
"Input");
2290 gDirectory->mkdir(
"STS");
2291 gDirectory->cd(
"STS");
2298 pullXsts =
new TH1F(
"Px_sts",
"STS Pull x", 100, -5, 5);
2299 pullYsts =
new TH1F(
"Py_sts",
"STS Pull y", 100, -5, 5);
2300 pullTsts =
new TH1F(
"Pt_sts",
"STS Pull t", 100, -5, 5);
2302 resXsts =
new TH1F(
"x_sts",
"STS Residual x", 100, -50, 50);
2303 resYsts =
new TH1F(
"y_sts",
"STS Residual y", 100, -500, 500);
2304 resTsts =
new TH1F(
"t_sts",
"STS Residual t", 100, -20, 20);
2306 gDirectory->cd(
"..");
2307 gDirectory->mkdir(
"MVD");
2308 gDirectory->cd(
"MVD");
2310 pullXmvd =
new TH1F(
"Px_mvd",
"MVD Pull x", 100, -5, 5);
2311 pullYmvd =
new TH1F(
"Py_mvd",
"MVD Pull y", 100, -5, 5);
2313 resXmvd =
new TH1F(
"x_mvd",
"MVD Residual x", 100, -50, 50);
2314 resYmvd =
new TH1F(
"y_mvd",
"MVD Residual y", 100, -50, 50);
2318 histo->GetXaxis()->SetTitle(
"Residual x, um");
2320 histo->GetXaxis()->SetTitle(
"Residual y, um");
2322 histo->GetXaxis()->SetTitle(
"Residual t, ns");
2324 histo->GetXaxis()->SetTitle(
"Residual x, um");
2326 histo->GetXaxis()->SetTitle(
"Residual y, um");
2328 histo->GetXaxis()->SetTitle(
"Pull x");
2330 histo->GetXaxis()->SetTitle(
"Pull y");
2332 histo->GetXaxis()->SetTitle(
"Pull t");
2334 histo->GetXaxis()->SetTitle(
"Pull x");
2336 histo->GetXaxis()->SetTitle(
"Pull y");
2339 gDirectory->cd(
"..");
2340 gDirectory->mkdir(
"MUCH");
2341 gDirectory->cd(
"MUCH");
2343 pullXmuch =
new TH1F(
"Px_much",
"MUCH Pull x", 100, -10, 10);
2344 pullYmuch =
new TH1F(
"Py_much",
"MUCH Pull y", 100, -10, 10);
2345 pullTmuch =
new TH1F(
"Pt_much",
"MUCH Pull t", 100, -10, 10);
2347 resXmuch =
new TH1F(
"x_much",
"MUCH Residual x", 100, -100000, 100000);
2348 resYmuch =
new TH1F(
"y_much",
"MUCH Residual y", 100, -100000, 100000);
2349 resTmuch =
new TH1F(
"t_much",
"MUCH Residual t", 100, -40, 40);
2353 histo->GetXaxis()->SetTitle(
"Residual x, um");
2355 histo->GetXaxis()->SetTitle(
"Residual y, um");
2357 histo->GetXaxis()->SetTitle(
"Residual t, ns");
2359 histo->GetXaxis()->SetTitle(
"Pull x");
2361 histo->GetXaxis()->SetTitle(
"Pull y");
2363 histo->GetXaxis()->SetTitle(
"Pull t");
2365 gDirectory->cd(
"..");
2366 gDirectory->mkdir(
"TRD");
2367 gDirectory->cd(
"TRD");
2369 pullXtrd =
new TH1F(
"Px_trd",
"TRD Pull x", 100, -5, 5);
2370 pullYtrd =
new TH1F(
"Py_trd",
"TRD Pull y", 100, -5, 5);
2371 pullTtrd =
new TH1F(
"Pt_trd",
"TRD Pull t", 100, -5, 5);
2373 resXtrd =
new TH1F(
"x_trd",
"TRD Residual x", 100, -200000, 200000);
2374 resYtrd =
new TH1F(
"y_trd",
"TRD Residual y", 100, -200000, 200000);
2375 resTtrd =
new TH1F(
"t_trd",
"TRD Residual t", 100, -40, 40);
2379 histo->GetXaxis()->SetTitle(
"Residual x, um");
2381 histo->GetXaxis()->SetTitle(
"Residual y, um");
2383 histo->GetXaxis()->SetTitle(
"Residual t, ns");
2385 histo->GetXaxis()->SetTitle(
"Pull x");
2387 histo->GetXaxis()->SetTitle(
"Pull y");
2389 histo->GetXaxis()->SetTitle(
"Pull t");
2391 gDirectory->cd(
"..");
2392 gDirectory->mkdir(
"TOF");
2393 gDirectory->cd(
"TOF");
2395 pullXtof =
new TH1F(
"Px_tof",
"TOF Pull x", 100, -5, 5);
2396 pullYtof =
new TH1F(
"Py_tof",
"TOF Pull y", 100, -5, 5);
2397 pullTtof =
new TH1F(
"Pt_tof",
"TOF Pull t", 100, -5, 5);
2399 resXtof =
new TH1F(
"x_tof",
"TOF Residual x", 100, -50000, 50000);
2400 resYtof =
new TH1F(
"y_tof",
"TOF Residual y", 100, -50000, 50000);
2401 resTtof =
new TH1F(
"t_tof",
"TOF Residual t", 100, -0.4, 0.4);
2405 histo->GetXaxis()->SetTitle(
"Residual x, um");
2407 histo->GetXaxis()->SetTitle(
"Residual y, um");
2409 histo->GetXaxis()->SetTitle(
"Residual t, ns");
2411 histo->GetXaxis()->SetTitle(
"Pull x");
2413 histo->GetXaxis()->SetTitle(
"Pull y");
2415 histo->GetXaxis()->SetTitle(
"Pull t");
2417 gDirectory = currentDir;
2423 map<unsigned int, unsigned int>::iterator it;
2428 for (
unsigned int iH = 0; iH <
vStsHits.size(); iH++) {
2431 if (
h.Det != 1)
continue;
2433 L1_DYNAMIC_CAST<CbmStsHit*>(
listStsHits->At(
h.extIndex));
2447 for (Int_t iFrontLink = 0;
2450 const CbmLink& frontLink = frontClusterMatch->
GetLink(iFrontLink);
2452 for (Int_t iBackLink = 0; iBackLink < backClusterMatch->
GetNofLinks();
2455 if (frontLink == backLink) {
2456 stsHitMatch.
AddLink(frontLink);
2457 stsHitMatch.
AddLink(backLink);
2464 Float_t bestWeight = 0.f;
2465 for (Int_t iLink = 0; iLink < stsHitMatch.
GetNofLinks(); iLink++) {
2471 link = stsHitMatch.
GetLink(iLink);
2480 if (pt == 0)
continue;
2482 double mcTime = pt->GetTime();
2489 TVector3 hitPos, mcPos, hitErr;
2494 mcPos.SetX(pt->
GetX(hitPos.Z()));
2495 mcPos.SetY(pt->
GetY(hitPos.Z()));
2496 mcPos.SetZ(hitPos.Z());
2498 #if 0 // standard errors
2499 if (hitErr.X() != 0) pullXsts->Fill( (hitPos.X() - mcPos.X()) / hitErr.X() );
2500 if (hitErr.Y() != 0) pullYsts->Fill( (hitPos.Y() - mcPos.Y()) / hitErr.Y() );
2501 #elif 1 // qa errors
2502 if (hitErr.X() != 0)
2503 pullXsts->Fill((hitPos.X() - mcPos.X()) / sh->
GetDx());
2504 if (hitErr.Y() != 0)
2505 pullYsts->Fill((hitPos.Y() - mcPos.Y()) / sh->
GetDy());
2508 #else // errors used in TF
2509 if (hitErr.X() != 0)
2510 pullXsts->Fill((hitPos.X() - mcPos.X())
2512 if (hitErr.Y() != 0)
2513 pullYsts->Fill((hitPos.Y() - mcPos.Y())
2517 resXsts->Fill((hitPos.X() - mcPos.X()) * 10 * 1000);
2518 resYsts->Fill((hitPos.Y() - mcPos.Y()) * 10 * 1000);
2519 resTsts->Fill((sh->
GetTime() - mcTime));
2527 for (
int j = 0; j < nEnt; j++) {
2545 if (iMC < 0)
continue;
2549 TVector3 hitPos, mcPos, hitErr;
2556 if (iMC >= 0 && iMC < nMC)
2557 pt = L1_DYNAMIC_CAST<CbmMvdPoint*>(
listMvdPts->At(iMC));
2564 mcPos.SetX((pt->GetX() + pt->
GetXOut()) / 2.);
2565 mcPos.SetY((pt->GetY() + pt->
GetYOut()) / 2.);
2566 mcPos.SetZ(hitPos.Z());
2572 if (hitErr.X() != 0)
2574 (hitPos.X() - mcPos.X())
2575 /
sqrt(
algo->vStations[0].XYInfo.C00[0]));
2576 if (hitErr.Y() != 0)
2577 pullYmvd->Fill((hitPos.Y() - mcPos.Y())
2578 /
sqrt(
algo->vStations[0].XYInfo.C11[0]));
2580 resXmvd->Fill((hitPos.X() - mcPos.X()) * 10 * 1000);
2581 resYmvd->Fill((hitPos.Y() - mcPos.Y()) * 10 * 1000);
2587 for (
unsigned int iH = 0; iH <
vStsHits.size(); iH++) {
2590 if (
h.Det != 2)
continue;
2599 Float_t bestWeight = 0.f;
2600 Float_t totalWeight = 0.f;
2604 for (
int iLink = 0; iLink < hm->
GetNofLinks(); iLink++) {
2612 if (bestWeight / totalWeight < 0.7 || iMCPoint < 0)
continue;
2616 double mcTime = pt->GetTime();
2625 TVector3 hitPos, mcPos, hitErr;
2636 mcPos.SetZ(hitPos.Z());
2638 #if 0 // standard errors
2639 if (hitErr.X() != 0) pullXmuch->Fill( (hitPos.X() - mcPos.X()) / hitErr.X() );
2640 if (hitErr.Y() != 0) pullYmuch->Fill( (hitPos.Y() - mcPos.Y()) / hitErr.Y() );
2641 #elif 1 // qa errors
2642 if (hitErr.X() != 0)
2643 pullXmuch->Fill((
h.x - mcPos.X()) / sh->
GetDx());
2644 if (hitErr.Y() != 0) pullYmuch->Fill((
h.y - mcPos.Y()) / sh->
GetDy());
2647 #else // errors used in TF
2648 if (hitErr.X() != 0)
2649 pullXmuch->Fill((hitPos.X() - mcPos.X())
2651 if (hitErr.Y() != 0)
2652 pullYmuch->Fill((hitPos.Y() - mcPos.Y())
2656 resXmuch->Fill((
h.x - mcPos.X()) * 10 * 1000);
2657 resYmuch->Fill((
h.y - mcPos.Y()) * 10 * 1000);
2658 resTmuch->Fill((
h.t - mcTime));
2664 for (
unsigned int iH = 0; iH <
vStsHits.size(); iH++) {
2667 if (
h.Det != 3)
continue;
2669 L1_DYNAMIC_CAST<CbmTrdHit*>(
listTrdHits->At(
h.extIndex));
2674 Float_t bestWeight = 0.f;
2675 Float_t totalWeight = 0.f;
2679 for (
int iLink = 0; iLink < hm->
GetNofLinks(); iLink++) {
2687 if (bestWeight / totalWeight < 0.7 || iMCPoint < 0)
continue;
2691 double mcTime = pt->GetTime();
2701 TVector3 hitPos, mcPos, hitErr;
2708 mcPos.SetZ(hitPos.Z());
2710 #if 0 // standard errors
2711 if (hitErr.X() != 0) pullXtrd->Fill( (hitPos.X() - mcPos.X()) / hitErr.X() );
2712 if (hitErr.Y() != 0) pullYtrd->Fill( (hitPos.Y() - mcPos.Y()) / hitErr.Y() );
2713 #elif 1 // qa errors
2714 if (hitErr.X() != 0)
2715 pullXtrd->Fill((
h.x - mcPos.X()) / sh->
GetDx());
2716 if (hitErr.Y() != 0) pullYtrd->Fill((
h.y - mcPos.Y()) / sh->
GetDy());
2719 #else // errors used in TF
2720 if (hitErr.X() != 0)
2721 pullXtrd->Fill((hitPos.X() - mcPos.X())
2723 if (hitErr.Y() != 0)
2724 pullYtrd->Fill((hitPos.Y() - mcPos.Y())
2728 resXtrd->Fill((
h.x - mcPos.X()) * 10 * 1000);
2729 resYtrd->Fill((
h.y - mcPos.Y()) * 10 * 1000);
2730 resTtrd->Fill((
h.t - mcTime));
2736 for (
unsigned int iH = 0; iH <
vStsHits.size(); iH++) {
2739 if (
h.Det != 4)
continue;
2747 Float_t bestWeight = 0.f;
2748 Float_t totalWeight = 0.f;
2752 for (
int iLink = 0; iLink < hm->
GetNofLinks(); iLink++) {
2763 if (iMCPoint < 0)
continue;
2767 double mcTime = pt->GetTime();
2775 TVector3 hitPos, mcPos, hitErr;
2780 mcPos.SetX((pt->GetX()));
2781 mcPos.SetY((pt->GetY()));
2782 mcPos.SetZ(hitPos.Z());
2784 #if 0 // standard errors
2785 if (hitErr.X() != 0) pullXmuch->Fill( (hitPos.X() - mcPos.X()) / hitErr.X() );
2786 if (hitErr.Y() != 0) pullYmuch->Fill( (hitPos.Y() - mcPos.Y()) / hitErr.Y() );
2787 #elif 1 // qa errors
2788 if (hitErr.X() != 0)
2789 pullXtof->Fill((
h.x - mcPos.X()) / sh->
GetDx());
2790 if (hitErr.Y() != 0) pullYtof->Fill((
h.y - mcPos.Y()) / sh->
GetDy());
2793 #else // errors used in TF
2794 if (hitErr.X() != 0)
2795 pullXtof->Fill((hitPos.X() - mcPos.X())
2797 if (hitErr.Y() != 0)
2798 pullYtof->Fill((hitPos.Y() - mcPos.Y())
2802 resXtof->Fill((
h.x - mcPos.X()) * 10 * 1000);
2803 resYtof->Fill((
h.y - mcPos.Y()) * 10 * 1000);
2804 resTtof->Fill((sh->
GetTime() - mcTime));