130 TClonesArray* realisticPoints, TClonesArray* pointsMatches)
132 if (!(
points && realisticPoints && pointsMatches))
return;
134 Int_t iNbTracks =
tracks->GetEntriesFast();
135 Int_t iNbTofPoints =
points->GetEntriesFast();
146 for (Int_t iTrk = 0; iTrk < iNbTracks; iTrk++) {
150 fTofPntTrkMap.insert(std::pair<Int_t, std::vector<Int_t>>(iTrk, std::vector<Int_t>()));
157 std::vector<Int_t> vMeanIdPnts(iNbTofPoints, -1);
160 for (Int_t iPnt = 0; iPnt < iNbTofPoints; iPnt++) {
163 iTrackId = pPnt->GetTrackID();
170 Int_t iMeanMcPointId = 0;
171 Int_t iMeanChannel = 0;
172 Double_t dMeanPosX = 0;
173 Double_t dMeanPosY = 0;
174 Double_t dMeanPosZ = 0;
175 Double_t dMeanTime = 0;
176 Double_t dMeanMomX = 0;
177 Double_t dMeanMomY = 0;
178 Double_t dMeanMomZ = 0;
179 Double_t dMeanLen = 0;
180 Double_t dTotELoss = 0;
181 Int_t iNbPntInMean = 0;
182 Int_t iMeanModType = -1;
183 Int_t iMeanModule = -1;
184 Int_t iMeanCounter = -1;
189 while (0 < (it->second).size()) {
193 Int_t iPntIdxList = (it->second).
size() - 1;
195 iDetId = pPnt->GetDetectorID();
204 dMeanPosX = pPnt->GetX();
205 dMeanPosY = pPnt->GetY();
206 dMeanPosZ = pPnt->GetZ();
207 dMeanTime = pPnt->GetTime();
208 dMeanMomX = pPnt->GetPx();
209 dMeanMomY = pPnt->GetPy();
210 dMeanMomZ = pPnt->GetPz();
211 dMeanLen = pPnt->GetLength();
212 dTotELoss = pPnt->GetEnergyLoss();
214 vMeanIdPnts[(it->second)[iPntIdxList]] = iMeanMcPointId;
216 (it->second).pop_back();
221 iPntIdxList = (it->second).
size() - 1;
222 while (0 <= iPntIdxList && 0 < (it->second).size()) {
226 iDetId = pPnt->GetDetectorID();
231 if ((iMeanModType == iModType) && (iMeanModule == iModule) && (iMeanCounter == iCounter)) {
235 dMeanPosX += pPnt->GetX();
236 dMeanPosY += pPnt->GetY();
237 dMeanPosZ += pPnt->GetZ();
238 dMeanTime += pPnt->GetTime();
239 dMeanMomX += pPnt->GetPx();
240 dMeanMomY += pPnt->GetPy();
241 dMeanMomZ += pPnt->GetPz();
242 dMeanLen += pPnt->GetLength();
243 dTotELoss += pPnt->GetEnergyLoss();
246 vMeanIdPnts[(it->second)[iPntIdxList]] = iMeanMcPointId;
249 (it->second).erase((it->second).begin() + iPntIdxList);
250 iPntIdxList = (it->second).
size() - 1;
259 iMeanChannel /= iNbPntInMean;
260 dMeanPosX /= iNbPntInMean;
261 dMeanPosY /= iNbPntInMean;
262 dMeanPosZ /= iNbPntInMean;
263 dMeanTime /= iNbPntInMean;
264 dMeanMomX /= iNbPntInMean;
265 dMeanMomY /= iNbPntInMean;
266 dMeanMomZ /= iNbPntInMean;
267 dMeanLen /= iNbPntInMean;
270 TVector3 meanPos(dMeanPosX, dMeanPosY, dMeanPosZ);
271 TVector3 meanMom(dMeanMomX, dMeanMomY, dMeanMomZ);
273 new ((*realisticPoints)[iMeanMcPointId])
284 for (Int_t iPnt = 0; iPnt < iNbTofPoints; iPnt++) {