1 #ifndef L1AlgoEfficiencyPerformance_h
2 #define L1AlgoEfficiencyPerformance_h
52 for (
int iih = 0; iih < NHits; iih++) {
68 for (
int ih = 0; ih < NHits; ih++) {
69 flag &= (a.
i[ih] ==
i[ih]);
113 AddCounter(
"fast_prim",
"RefPrim efficiency");
116 AddCounter(
"slow_prim",
"ExtraPrim efficiency");
117 AddCounter(
"slow_sec",
"ExtraSec efficiency");
122 template<
int NHits = 3>
134 void Print(TString title =
"Triplets performance statistic",
158 recoTracklets.clear();
162 ntra_sta[iSta] = ntra;
170 for (vector<CbmL1MCTrack>::iterator mtraIt = fL1->vMCTracks.begin();
171 mtraIt != fL1->vMCTracks.end();
176 const int NMCPoints = mtra.
Points.size();
178 int lastIterSta = -1;
179 for (
int iterOffset = 0; iterOffset < NMCPoints;
182 int iterSta = fL1->vMCPoints[mtra.
Points[iterOffset]].iStation;
183 if (iterSta == lastIterSta)
continue;
184 lastIterSta = iterSta;
190 for (
int is = 0, offset = iterOffset;
191 ((offset < NMCPoints) && (is < NHits));
193 const int mcId = mtra.
Points[offset];
198 const int NPointHits = mcPs->
hitIds.size();
199 for (
int ih = 0; ih < NPointHits; ih++) {
206 for (
int is = 0; is < NHits; is++) {
207 good &= trlet.
hitIds[is].size();
217 mcTracklets.push_back(trlet);
228 vector<int> mcIds[NHits];
231 for (
int iih = 0; iih < NHits; iih++) {
232 int nMC = fL1->vStsHits[iHits[iih]].mcPointIds.size();
233 for (
int iMC = 0; iMC < nMC; iMC++) {
234 const int iMCP = fL1->vStsHits[iHits[iih]].mcPointIds[iMC];
235 int mcId = fL1->vMCPoints[iMCP].ID;
236 mcIds[iih].push_back(mcId);
241 for (
int level = 0; level < NHits - 1; level++) {
242 vector<int>& mcs1 = mcIds[level];
243 vector<int>& mcs2 = mcIds[level + 1];
246 for (
unsigned int i2 = 0; i2 < mcs2.size(); i2++) {
250 for (
unsigned int i1 = 0; i1 < mcs1.size(); i1++) {
251 flag |= (mcs1[i1] == mc2);
258 vector<int>& mcsN = mcIds[NHits - 1];
259 for (
unsigned int i = 0;
i < mcsN.size();
i++) {
263 fL1->vMCPoints[fL1->vStsHits[iHits[0]].mcPointIds[0]].iStation;
270 recoTracklets.push_back(trlet);
283 const int NRecoTrlets = recoTracklets.size();
284 const int NMCTrlets = mcTracklets.size();
286 for (
int iReco = 0, iMC = 0; (iReco < NRecoTrlets) && (iMC < NMCTrlets);) {
294 if (recoTrlet != mcTrlet) {
295 if (recoTrlet < mcTrlet)
304 const int nReco = mcTrlet.
recoIds.size();
305 for (
int iR = 0; iR < nReco; iR++) {
306 flag &= (recoTrlet != recoTracklets[mcTrlet.
recoIds[iR]]);
319 const int NRecoTrlets = recoTracklets.size();
320 for (
int iReco = 0; iReco < NRecoTrlets; iReco++) {
322 ntra .ghosts += reco.
IsGhost();
325 const int NMCTrlets = mcTracklets.size();
326 for (
int iMC = 0; iMC < NMCTrlets; iMC++) {
335 ntra_sta[iSta].Inc(reco,
"total");
337 if (mtra.
p > fL1->MinRefMom) {
338 ntra_sta[iSta].Inc(reco,
"fast");
340 ntra_sta[iSta].Inc(reco,
"fast_prim");
357 ntra_sta[iSta].Inc(reco,
"fast_sec");
360 ntra_sta[iSta].Inc(reco,
"slow");
362 ntra_sta[iSta].Inc(reco,
"slow_prim");
364 ntra_sta[iSta].Inc(reco,
"slow_sec");
371 ntra += ntra_sta[iSta];
372 NTRA_STA[iSta] += ntra_sta[iSta];
373 ntra_sta[iSta].CalcEff();
374 NTRA_STA[iSta].CalcEff();
390 cout <<
"-------- " << title <<
" ----------" << endl;
395 for (
int iSta = 0; iSta < fL1->NStation - NHits + 1; iSta++) {
396 TString title_sta = title;
397 title_sta +=
" station ";
400 cout <<
"-------- " << title_sta <<
" ----------" << endl;
401 NTRA_STA[iSta].PrintEff();