9 static Int_t referenceMCTracks = 0;
10 static Int_t reconstructedRefTracks = 0;
11 bool hasPositiveSignalMuon =
false;
12 bool hasNegativeSignalMuon =
false;
13 hasSignalInEvent =
false;
18 Int_t pdgCode = mcTrack.
pdg;
25 memset(mcTrackMCPoints, 0,
sizeof(mcTrackMCPoints));
27 for (vector<LxMCPoint*>::iterator j = mcTrack.
Points.begin();
33 for (list<LxPoint*>::iterator k = pMCPoint->
lxPoints.begin();
42 if (0 == track)
continue;
46 if (track->
clone)
continue;
48 map<LxTrack*, int>::iterator l = recoTracks.find(track);
50 if (l != recoTracks.end())
53 recoTracks[track] = 1;
57 bool enoughHits =
true;
58 bool enoughMCPoints =
true;
67 for (Int_t k = 0; k <
LXLAYERS; ++k) {
73 if (mcTrackMCPoints[j][k]) {
85 enoughMCPoints =
false;
90 if (!enoughMCPoints || mcTrack.
mother_ID >= 0
91 || (pdgCode != 13 && pdgCode != -13)
92 || (
pPtCut && (mcTrack.
p < 3.0 || pt2 < 1.0)))
97 if (!isSignal)
continue;
100 hasPositiveSignalMuon =
true;
102 hasNegativeSignalMuon =
true;
105 Int_t matchedPoints = 0;
107 for (map<LxTrack*, Int_t>::iterator j = recoTracks.begin();
108 j != recoTracks.end();
112 matchTrack = j->first;
117 if (0 == matchTrack)
continue;
119 if (matchedPoints < mcpCount * 0.7)
continue;
121 ++reconstructedRefTracks;
124 if (hasPositiveSignalMuon && hasNegativeSignalMuon) {
125 hasSignalInEvent =
true;
129 Double_t result = 100 * reconstructedRefTracks;
130 result /= referenceMCTracks;
131 cout <<
"LxFinder::MatchMCToReco(): efficiency = " << result <<
"% ("
132 << reconstructedRefTracks <<
"/" << referenceMCTracks <<
")" << endl;
136 static Int_t recoTracksCount = 0;
137 static Int_t matchedTracksCount = 0;
140 list<LxTrack*> bgrMuPlusTracks;
141 list<LxTrack*> bgrMuMinusTracks;
148 if (recoTrack->
clone)
continue;
157 if (0 == recoPoint)
continue;
159 for (list<LxMCPoint*>::iterator k = recoPoint->
mcPoints.begin();
165 if (0 == mcTrack)
continue;
167 map<LxMCTrack*, Int_t>::iterator mcIter =
mcTracks.find(mcTrack);
177 Int_t matchedPoints = 0;
179 for (map<LxMCTrack*, Int_t>::iterator j =
mcTracks.begin();
182 if (0 == bestMatch || j->second > matchedPoints) {
183 bestMatch = j->first;
184 matchedPoints = j->second;
188 if (0 == bestMatch)
continue;
190 Int_t recoPoints = 0;
195 if (0 != recoPoint) ++recoPoints;
198 if (matchedPoints < 0.7 * recoPoints)
continue;
200 ++matchedTracksCount;
207 if (0 != bestMatch && bestMatch->
mother_ID < 0
208 && (-13 == bestMatch->
pdg || 13 == bestMatch->
pdg)) {
209 signalXAtZ0->Fill(x0);
210 signalYAtZ0->Fill(y0);
212 if (-13 == bestMatch->
pdg)
213 signalMuPlus = recoTrack;
215 signalMuMinus = recoTrack;
222 bgrMuPlusTracks.push_back(recoTrack);
224 bgrMuMinusTracks.push_back(recoTrack);
228 Double_t result = 100 * matchedTracksCount;
229 result /= recoTracksCount;
230 cout <<
"LxFinder::MatchRecoToMC(): efficiency = " << result <<
"% ("
231 << matchedTracksCount <<
"/" << recoTracksCount <<
")" << endl;
233 if (0 != signalMuPlus && 0 != signalMuMinus) {
244 signalInterTracksDistanceOn1st->Fill(
d);
249 scaltype cSq = deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;
250 scaltype cosC = (aSq + bSq - cSq) / (2 * a * b);
254 signalInterTracksAngle->Fill(C);
255 signalInterTrackCorrDA->Fill(
d, C);
261 for (list<LxTrack*>::iterator
i = bgrMuPlusTracks.begin();
262 i != bgrMuPlusTracks.end();
269 for (list<LxTrack*>::iterator j = bgrMuMinusTracks.begin();
270 j != bgrMuMinusTracks.end();
279 scaltype dSq = deltaX * deltaX + deltaY * deltaY;
281 if (dSq > bgrMuDistSq) bgrMuDistSq = dSq;
287 scaltype cSq = deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;
288 scaltype cosC = (aSq + bSq - cSq) / (2 * a * b);
293 if (C > bgrMuAngle) bgrMuAngle = C;
297 if (bgrMuDistSq > 0) bgrInterTracksDistanceOn1st->Fill(
sqrt(bgrMuDistSq));
299 if (bgrMuAngle > 0) bgrInterTracksAngle->Fill(bgrMuAngle);
301 if (bgrMuDistSq > 0 && bgrMuAngle > 0)
302 bgrInterTrackCorrDA->Fill(
sqrt(bgrMuDistSq), bgrMuAngle);
305 #endif //MAKE_EFF_CALC