MpdTofMatchingQA.cxx 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. //------------------------------------------------------------------------------------------------------------------------
  2. #include <map>
  3. #include <iostream>
  4. #include <algorithm>
  5. #include <TGraph.h>
  6. #include <TClonesArray.h>
  7. #include <TFile.h>
  8. #include "FairLogger.h"
  9. #include "MpdMCTrack.h"
  10. #include "MpdTpcKalmanTrack.h"
  11. #include "MpdTof.h"
  12. #include "MpdTofMatching.h"
  13. #include "MpdTofMatchingQA.h"
  14. using namespace std;
  15. //------------------------------------------------------------------------------------------------------------------------
  16. void Lsets::Reset()
  17. {
  18. for_each(fData.begin(), fData.end(), [](std::set<size_t>& s){ s.clear(); });
  19. }
  20. //------------------------------------------------------------------------------------------------------------------------
  21. void Lsets::Insert(size_t index, size_t value)
  22. {
  23. fData.at(index).insert(value);
  24. }
  25. //------------------------------------------------------------------------------------------------------------------------
  26. void Lsets::Print(const char* comment, ostream& os) const
  27. {
  28. if(comment != nullptr) os<<comment;
  29. Ts unionSet;
  30. for(auto it = fData.begin(), itEnd = fData.end(); it != itEnd; it++) unionSet.insert((*it).begin(), (*it).end());
  31. os<<"\n sizes: "; size_t n = 0;
  32. for(auto it = fData.begin(), itEnd = fData.end(); it != itEnd; it++) os<<n++<<":("<<(*it).size()<<"), ";
  33. os<<"\tall=("<<unionSet.size()<<")";
  34. for(auto it = unionSet.begin(), itEnd = unionSet.end(); it != itEnd; it++)
  35. {
  36. os<<"\n ("<<(*it)<<") ";
  37. for(size_t i=0, iEnd = fData.size(); i != iEnd; i++)
  38. {
  39. if(fData.at(i).find(*it) != fData.at(i).end()) os<<" +";
  40. else os<<" -";
  41. }
  42. }
  43. }
  44. //------------------------------------------------------------------------------------------------------------------------
  45. //------------------------------------------------------------------------------------------------------------------------
  46. MpdTofMatchingQA::MpdTofMatchingQA(const char *flnm, bool isEndcap)
  47. : fFlnm(flnm), fIsEndcap(isEndcap)
  48. {
  49. const double Pmax = 5.; // [GeV/c]
  50. const double EtaMax = 5.;
  51. fList.SetOwner(); // all objects will be deleted whenever the collection itself is delete.
  52. Add(pEff1P = new TEfficiency(mangling("Eff1P"), ";P, GeV/c;Efficiency", 100, 0., Pmax));
  53. Add(pEff1Eta = new TEfficiency(mangling("Eff1Eta"), ";#eta;Efficiency", 100, -EtaMax, EtaMax));
  54. Add(pEff1EtaP = new TEfficiency(mangling("Eff1EtaP"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  55. Add(pCont1P = new TEfficiency(mangling("Cont1P"), ";P, GeV/c;Contamination", 100, 0., Pmax));
  56. Add(pCont1Eta = new TEfficiency(mangling("Cont1Eta"), ";#eta;Contamination", 100, -EtaMax, EtaMax));
  57. Add(pCont1EtaP = new TEfficiency(mangling("Cont1EtaP"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  58. Add(pEff2P = new TEfficiency(mangling("Eff2P"), ";P, GeV/c;Efficiency", 100, 0., Pmax));
  59. Add(pEff2Eta = new TEfficiency(mangling("Eff2Eta"), ";#eta;Efficiency", 100, -EtaMax, EtaMax));
  60. Add(pEff2EtaP = new TEfficiency(mangling("Eff2EtaP"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  61. Add(pCont2P = new TEfficiency(mangling("Cont2P"), ";P, GeV/c;Contamination", 100, 0., Pmax));
  62. Add(pCont2Eta = new TEfficiency(mangling("Cont2Eta"), ";#eta;Contamination", 100, -EtaMax, EtaMax));
  63. Add(pCont2EtaP = new TEfficiency(mangling("Cont2EtaP"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  64. Add(pEffEtaPIdeal = (TEfficiency*) pEff1P->Clone(mangling("Eff_EtaP_Ideal")));
  65. pEffEtaPIdeal->SetTitle("ideal matching by using MC data");
  66. Add(pContEtaPIdeal = (TEfficiency*) pCont1P->Clone(mangling("Cont_EtaP_Ideal")));
  67. pContEtaPIdeal->SetTitle("ideal matching by using MC data");
  68. Add(hDeltaPoint = new TH2D(mangling("DeltaPoint"), "MC point - est. point;#Delta_{Z}, cm;#Delta_{#phi}, cm", 1000, -300., 300., 1000, -300., 300.));
  69. Add(hDeltaPoint_Dev = new TH2D(mangling("DeltaPoint_Dev"), "MC point - est. point;#Delta, cm;P, GeV/c", 1000, 0., 10., 1000, 0., Pmax));
  70. Add(hDeltaPoint_dR = new TH2D(mangling("DeltaPoint_dR"), "MC point - est. point;#Delta_{R}, cm;P, GeV/c", 1000, -10., 10., 1000, 0., Pmax));
  71. Add(hDeltaPoint_dZ = new TH2D(mangling("DeltaPoint_dZ"), "MC point - est. point;#Delta_{Z}, cm;P, GeV/c", 1000, -10., 10., 1000, 0., Pmax));
  72. Add(hDeltaPoint_dPhi = new TH2D(mangling("DeltaPoint_dPhi"), "MC point - est. point;#Delta_{#phi}, cm;P, GeV/c", 1000, -10., 10., 1000, 0., Pmax));
  73. Add(hDeltaHitTrue = new TH2D(mangling("DeltaHitTrue"), "est. point <-> Hit point;#Delta_{Z}, cm;#Delta_{#phi}, cm", 1000, -25., 25., 1000, -25., 25.));
  74. Add(hDeltaHitMis = (TH2D*) hDeltaHitTrue->Clone(mangling("DeltaHitMis")));
  75. Add(hNMcKfTracks = new TH2D(mangling("NMcKfTracks"), "count tracks with Tof points only;N mc tacks;N kf tracks", 1000, 0.5, 2000.5, 1000, 0.5, 2000.5));
  76. Add(htKFTrack = new TH2D(mangling("KFTrack"), ";#eta;P, GeV/c", 1000, -EtaMax, EtaMax, 1000, 0., Pmax));
  77. htKFTrack->SetTitle("[MpdTofMatching::FillWeightMatrix] cycle by TmPt& mPt");
  78. Add(htKFTrackPoint = (TH2D*) htKFTrack->Clone(mangling("KFTrackPoint")));
  79. htKFTrackPoint->SetTitle("[MpdTofMatching::FillWeightMatrix] cycle by TmPt& mPt(cuts: mcInfo::TofTouch=true)");
  80. Add(htMisMatch = (TH2D*) htKFTrack->Clone(mangling("MisMatchings")));
  81. htMisMatch->SetTitle("[MpdTofMatchingQA::FillMatchingEfficiency] cycle by aTPCkfTracks(cuts: IsMatchingExist && MpdTofHit::CheckTid(tid)=false)");
  82. Add(htTrueMatch = (TH2D*) htKFTrack->Clone(mangling("TrueMatchings")));
  83. htTrueMatch->SetTitle("[MpdTofMatchingQA::FillMatchingEfficiency] cycle by aTPCkfTracks(cuts: IsMatchingExist && MpdTofHit::CheckTid(tid)=true)");
  84. Add(hPointInsideDetector = new TH2D(mangling("test_IsPointInsideDetectors_function"), "; Z, cm; #Phi, degree", 1000, -300., 300., 1000, -180., 180.));
  85. // matching weight parameter tests
  86. const double maxWeight = 1.5E+3;
  87. Add(hWeightT = new TH1D(mangling("WeightTrue"), ";weight;Events", 10000, 0., maxWeight));
  88. Add(hWeightF = (TH1D*) hWeightT->Clone(mangling("WeightFalse")));
  89. Add(hNormWeightT = new TH1D(mangling("NormWeightTrue"), ";norm. weight;Events", 1000, 0., 1.01));
  90. Add(hNormWeightF = (TH1D*) hNormWeightT->Clone(mangling("NormWeightFalse")));
  91. // kf tracks tests
  92. const double Ptmax = 3., dPmin = -20., dPmax = 10.;
  93. Add(hPvsPt = new TH2D(mangling("dP_dPt"), "; #Delta P, %; #Delta Pt, %", 1000, dPmin, dPmax, 1000, dPmin, dPmax));
  94. Add(hPvsNp = new TH2D(mangling("dP_Np"), "; #Delta P, %; NofTrHits", 1000, dPmin, dPmax, 60, 0.5, 60.5));
  95. Add(hPtvsNp = new TH2D(mangling("Pt_Np"), "; #Delta Pt, %; NofTrHits", 1000, dPmin, dPmax, 60, 0.5, 60.5));
  96. Add(hPvsP = new TH2D(mangling("dP_P"), "; #Delta P, % (mc<est|0|mc>est); P, GeV/c", 1000, dPmin, dPmax, 1000, 0., Ptmax));
  97. Add(hPtvsPt = new TH2D(mangling("dPt_Pt"), "; #Delta Pt, % (mc<est|0|mc>est); Pt, GeV/c", 1000, dPmin, dPmax, 1000, 0., Ptmax));
  98. // smeared tracks tests
  99. Add(hSmeared_dZ = new TH2D(mangling("Smeared_dZ"), "; #Delta Z1 - Z2, cm; #Delta Z1 - est. point, cm", 1000, 0., 50., 1000, 0., 25.));
  100. Add(hSmeared_dPhi = new TH2D(mangling("Smeared_dPhi"), "; #Delta #phi1 - #phi2, cm; #Delta #phi1 - est. point, cm", 1000, 0., 50., 1000, 0., 25.));
  101. Add(hSmeared_dZPhi = new TH2D(mangling("Smeared_dZ_dPhi"), "; #Delta Z, cm; #Delta #phi, cm", 1000, 0., 50., 1000, 0., 50.));
  102. Add(h1 = new TH2D(mangling("h1"), "; #Delta Z, cm; #Delta #phi, cm", 1000, -100., 100., 1000, -100., 100.));
  103. Add(h2 = new TH2D(mangling("h2"), "; #Delta Z, cm; #Delta #phi, cm", 1000, -100., 100., 1000, -100., 100.));
  104. Add(h3 = new TH2D(mangling("h3"), "; #Delta Z, cm; #Delta #phi, cm", 1000, -100., 100., 1000, -100., 100.));
  105. Add(pEffKalman = new TEfficiency(mangling("EffKalman"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  106. Add(pEffMatch = new TEfficiency(mangling("EffMatch"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  107. Add(pEffKalmanP = new TEfficiency(mangling("EffKalman_P"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  108. Add(pEffMatchP = new TEfficiency(mangling("EffMatch_P"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  109. Add(pEffKalmanPi = new TEfficiency(mangling("EffKalman_Pi"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  110. Add(pEffMatchPi = new TEfficiency(mangling("EffMatch_Pi"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  111. Add(pEffKalmanK = new TEfficiency(mangling("EffKalman_K"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  112. Add(pEffMatchK = new TEfficiency(mangling("EffMatch_K"), ";#eta;P, GeV/c", 100, -EtaMax, EtaMax, 100, 0., Pmax));
  113. }
  114. //------------------------------------------------------------------------------------------------------------------------
  115. void MpdTofMatchingQA::FillParameter(bool isTrueMatching, double weight, double normWeight)
  116. {
  117. if(isTrueMatching) { hWeightT->Fill(weight); hNormWeightT->Fill(normWeight); }
  118. else { hWeightF->Fill(weight); hNormWeightF->Fill(normWeight); }
  119. }
  120. //------------------------------------------------------------------------------------------------------------------------
  121. void MpdTofMatchingQA::FillHitDeviation(const MpdTofMatchingData& data)
  122. {
  123. double delta, deltaZ, deltaR, deltaPhi;
  124. MpdTof::GetDelta(data.fHitPosition, data.fEstPoint, delta, deltaZ, deltaR, deltaPhi);
  125. if(data.fIsTrueMatching) hDeltaHitTrue->Fill(deltaZ, deltaPhi);
  126. else hDeltaHitMis->Fill(deltaZ, deltaPhi);
  127. }
  128. //------------------------------------------------------------------------------------------------------------------------
  129. void MpdTofMatchingQA::FillSmearedPoints(const TVector3& estPosition, const TVector3 *smearedPosition, const TVector3 *smearedMomentum)
  130. {
  131. const double dZ = (smearedPosition[0] - smearedPosition[2]).Mag(), dPhi = (smearedPosition[1] - smearedPosition[3]).Mag();
  132. hSmeared_dZ->Fill(dZ, (estPosition - smearedPosition[0]).Mag());
  133. hSmeared_dPhi->Fill(dPhi, (estPosition - smearedPosition[1]).Mag());
  134. hSmeared_dZPhi->Fill(dZ, dPhi);
  135. double delta, deltaZ1, deltaZ2, deltaR, deltaPhi;
  136. MpdTof::GetDelta(estPosition, smearedPosition[0], delta, deltaZ1, deltaR, deltaPhi);
  137. h1->Fill(deltaZ1, deltaPhi);
  138. MpdTof::GetDelta(estPosition, smearedPosition[1], delta, deltaZ2, deltaR, deltaPhi);
  139. h2->Fill(deltaZ2, deltaPhi);
  140. MpdTof::GetDelta(smearedPosition[0], smearedPosition[1], delta, deltaZ1, deltaR, deltaPhi);
  141. h3->Fill(deltaZ1, deltaPhi);
  142. }
  143. //------------------------------------------------------------------------------------------------------------------------
  144. void MpdTofMatchingQA::FillMcPointDeviation(const TVector3& mcPosition, const TVector3& estPointOnPlate, const TVector3& mcMom, const TVector3& kfMom, int NofTrHits)
  145. {
  146. double delta, deltaZ, deltaR, deltaPhi;
  147. MpdTof::GetDelta(mcPosition, estPointOnPlate, delta, deltaZ, deltaR, deltaPhi);
  148. const double kfP = kfMom.Mag();
  149. hDeltaPoint_Dev->Fill(delta, kfP);
  150. hDeltaPoint_dR->Fill(deltaR, kfP);
  151. hDeltaPoint_dZ->Fill(deltaZ, kfP);
  152. hDeltaPoint_dPhi->Fill(deltaPhi, kfP);
  153. hDeltaPoint->Fill(deltaZ, deltaPhi);
  154. const double dP = (mcMom.Mag() - kfMom.Mag())/ mcMom.Mag() * 100.; //[%]
  155. const double dPt = (mcMom.Perp() - kfMom.Perp())/ mcMom.Perp() * 100.; //[%]
  156. hPvsPt->Fill(dP, dPt);
  157. hPvsNp->Fill(dP, NofTrHits);
  158. hPtvsNp->Fill(dPt, NofTrHits);
  159. hPvsP->Fill(dP, mcMom.Mag());
  160. hPtvsPt->Fill(dPt, mcMom.Perp());
  161. }
  162. //------------------------------------------------------------------------------------------------------------------------
  163. void MpdTofMatchingQA::FillNtracks(const TClonesArray *aTracks, size_t NkfTracks)
  164. {
  165. size_t NmcTracks = 0;
  166. for(Int_t i = 0, iMax = aTracks->GetEntriesFast(); i < iMax; i++) if(((MpdMCTrack*) aTracks->UncheckedAt(i))->GetNPoints(kTOF)) NmcTracks++;
  167. hNMcKfTracks->Fill(NmcTracks, NkfTracks);
  168. }
  169. //------------------------------------------------------------------------------------------------------------------------
  170. void MpdTofMatchingQA::FillTrackEfficiency(bool kalman, bool matched, int pdgcode, const TVector3& momentum)
  171. {
  172. pEffKalman->Fill(kalman, momentum.Eta(), momentum.Mag());
  173. pEffMatch->Fill(matched, momentum.Eta(), momentum.Mag());
  174. if(2212 == pdgcode || -2212 == pdgcode)
  175. {
  176. pEffKalmanP->Fill(kalman, momentum.Eta(), momentum.Mag());
  177. pEffMatchP->Fill(matched, momentum.Eta(), momentum.Mag());
  178. }
  179. else if(211 == pdgcode || -211 == pdgcode)
  180. {
  181. pEffKalmanPi->Fill(kalman, momentum.Eta(), momentum.Mag());
  182. pEffMatchPi->Fill(matched, momentum.Eta(), momentum.Mag());
  183. }
  184. else if(321 == pdgcode || -321 == pdgcode)
  185. {
  186. pEffKalmanK->Fill(kalman, momentum.Eta(), momentum.Mag());
  187. pEffMatchK->Fill(matched, momentum.Eta(), momentum.Mag());
  188. }
  189. }
  190. //------------------------------------------------------------------------------------------------------------------------
  191. void MpdTofMatchingQA::Finish()
  192. {
  193. // fill weigh thresh. parameter graph
  194. double Ntracks = htKFTrackPoint->Integral();
  195. if(Ntracks > 0.)
  196. {
  197. double Eff[100], Cont[100], matchT, matchF;
  198. TAxis *xaxis = hNormWeightT->GetXaxis();
  199. Int_t binLast = xaxis->FindBin(1.);
  200. for(int i=0; i < 100; i++)
  201. {
  202. double param = 0.01 * (i+1); // [0.01;1]
  203. Int_t binThres = xaxis->FindBin(param);
  204. matchT = hNormWeightT->Integral(binThres, binLast);
  205. matchF = hNormWeightF->Integral(binThres, binLast);
  206. Eff[i] = matchT / Ntracks;
  207. Cont[i] = matchF / (matchT + matchF);
  208. cout<<"\n par="<<param<<" Eff.= "<<Eff[i]<<" Cont.= "<<Cont[i];
  209. }
  210. TGraph *graph = new TGraph(100, Eff, Cont); fList.Add(graph);
  211. graph->SetMarkerStyle(21);
  212. graph->SetMarkerColor(kRed);
  213. graph->SetName(mangling("Eff_vs_Cont(thresh)"));
  214. graph->SetTitle("Efficiency vs Contamination as function of weight threshould.");
  215. graph->GetHistogram()->SetXTitle("efficiency");
  216. graph->GetHistogram()->SetYTitle("contamination");
  217. }
  218. // write histo to file
  219. LOG(DEBUG2)<<"[MpdTofMatchingQA::Finish] Update "<<fFlnm.Data()<<" file. ";
  220. auto tmp = gFile;
  221. TFile file(fFlnm.Data(), "RECREATE");
  222. fList.Write();
  223. file.Close();
  224. gFile = tmp;
  225. }
  226. //------------------------------------------------------------------------------------------------------------------------
  227. void MpdTofMatchingQA::FillIdealMatching(const TmPt& mPt, const TmmT2H& mmT2H, const TClonesArray* aMCTracks)
  228. {
  229. TVector3 momentum;
  230. for(const auto& it : mPt) // cycle by TPC KF tracks
  231. {
  232. auto pKfTrack = (const MpdTpcKalmanTrack*) it.first;
  233. //Int_t KfIndex = it.second;
  234. Int_t mcTrackIndex = pKfTrack->GetTrackID();
  235. size_t Nhits = mmT2H.count(mcTrackIndex); // number of hits for current tid
  236. if(Nhits == 0) continue;
  237. auto pMCtrack = (MpdMCTrack*) aMCTracks->UncheckedAt(mcTrackIndex);
  238. pMCtrack->GetMomentum(momentum);
  239. //double Eta = momentum.Eta(),
  240. double P = momentum.Mag();
  241. bool IsTrueMatching = (Nhits == 1);
  242. pEffEtaPIdeal->Fill(IsTrueMatching, P); // = 1 hit per track
  243. pContEtaPIdeal->Fill(!IsTrueMatching, P); // > 1 hit per track
  244. }
  245. }
  246. //------------------------------------------------------------------------------------------------------------------------
  247. void MpdTofMatchingQA::FillMatchingEfficiency(const TmPt& tids, const TClonesArray* aTofMatching, const TClonesArray* aTofHits, const TClonesArray* aMCTracks)
  248. {
  249. // Sorting & mapping matchings
  250. map<int, const MpdTofHit*> mMatchings; // pair <kfTrackIndex, MpdTofHit*>
  251. multimap<const MpdTofHit*, int> mmHitCounter; // pair <MpdTofHit*, matchingIndex>
  252. for(int index = 0, iEnd = aTofMatching->GetEntriesFast(); index != iEnd; index++) // cycle by the matching N
  253. {
  254. auto pData = (const MpdTofMatchingData*) aTofMatching->At(index);
  255. Int_t hitIndex = pData->GetTofHitIndex();
  256. if(hitIndex >= 0) // matching with the fired strip, i.e. with the hit
  257. {
  258. auto hit = (MpdTofHit*) aTofHits->At(hitIndex);
  259. mMatchings.insert(make_pair(pData->GetKFTrackIndex(), hit));
  260. mmHitCounter.insert(make_pair(hit, index));
  261. }
  262. }
  263. //--------------------------------------------------------------------------------------------------------------------
  264. // algorithm efficiency definition:
  265. //
  266. // efficiency = N true matchings / N tpc kf tracks having TOF hit
  267. // contamination = N wrong matchings / ( N true matchings + N wrong matchings)
  268. //
  269. // ALICE TDR TOF 2000 definitions:
  270. //
  271. // N = N mis + N match
  272. // N mis = N0 + N2 ( matched to to blank strip or dead regions + matched to fired strip was more than one track)
  273. // N match = N t + N w ( N true matching + N wrong matching)
  274. //
  275. // efficiency = N t / N
  276. // contamination = N w / N match
  277. //--------------------------------------------------------------------------------------------------------------------
  278. TVector3 momentum;
  279. for(const auto& iter : tids) // cycle by TPC KF tracks(Pt descending)
  280. {
  281. auto pKfTrack = (const MpdTpcKalmanTrack*) iter.first;
  282. Int_t KfIndex = iter.second;
  283. Int_t mcTrackIndex = pKfTrack->GetTrackID();
  284. auto pMCtrack = (MpdMCTrack*) aMCTracks->UncheckedAt(mcTrackIndex);
  285. bool mcTofTouch = pMCtrack->GetNPoints(fIsEndcap ? kETOF : kTOF);
  286. //if(mcTofTouch) tidsTofTouch.Insert(2, mcTrackIndex);
  287. pMCtrack->GetMomentum(momentum);
  288. double Eta = momentum.Eta(), P = momentum.Mag();
  289. auto Iter = mMatchings.find(KfIndex);
  290. bool IsMatchingExist = (Iter != mMatchings.end());
  291. bool IsTrueMatching = false;
  292. bool IsNmatch = false;
  293. if(IsMatchingExist)
  294. {
  295. const MpdTofHit *hit = Iter->second;
  296. IsTrueMatching = hit->CheckTid(mcTrackIndex);
  297. IsNmatch = (1 == mmHitCounter.count(hit)); // hit linked ONLY ONE matching
  298. if(IsTrueMatching) htTrueMatch->Fill(Eta, P);
  299. else htMisMatch->Fill(Eta, P);
  300. }
  301. if(mcTofTouch)
  302. {
  303. pEff1P->Fill(IsTrueMatching, P);
  304. pEff1Eta->Fill(IsTrueMatching, Eta);
  305. pEff1EtaP->Fill(IsTrueMatching, Eta, P);
  306. }
  307. if(-1.35 < Eta && Eta < 1.35)
  308. {
  309. pEff2P->Fill(IsTrueMatching, P);
  310. pEff2Eta->Fill(IsTrueMatching, Eta);
  311. pEff2EtaP->Fill(IsTrueMatching, Eta, P);
  312. }
  313. if(IsMatchingExist)
  314. {
  315. pCont1P->Fill( !IsTrueMatching, P);
  316. pCont1Eta->Fill( !IsTrueMatching, Eta);
  317. pCont1EtaP->Fill( !IsTrueMatching, Eta, P);
  318. }
  319. if(IsNmatch)
  320. {
  321. pCont2P->Fill( !IsTrueMatching, P);
  322. pCont2Eta->Fill( !IsTrueMatching, Eta);
  323. pCont2EtaP->Fill( !IsTrueMatching, Eta, P);
  324. }
  325. } // cycle by TPC KF tracks
  326. }
  327. //------------------------------------------------------------------------------------------------------------------------