24 m_nmatchedTracksSecondary(0),
25 m_nmatchedFakeTracks(0),
27 m_nfakeTracksHighPt(0),
28 m_nfakeTracksLowPt(0),
31 m_nmissedTracksOneStation(0),
32 m_nmissedTracksSecondary(0),
33 m_nmissedTracksOneStationSecondary(0),
34 m_nmissingStationMomLoss(0),
35 m_nmissingStationLayer(0),
36 m_nmissingCscStationLayer(0),
37 m_nmissingStationLayerTrigger(0),
39 m_nwrongStationLayer(0),
40 m_nwrongStationLayerTrigger(0),
43 m_ntruthTracksSecondary(0) {
60 "0: off, 1: missing precision layer, 2: +missing chamber");
109 return StatusCode::SUCCESS;
117 return StatusCode::FAILURE;
124 return StatusCode::SUCCESS;
133 for (
unsigned int i = 0;
i < nstations; ++
i) {
138 if (!stationSegs || stationSegs->empty())
continue;
140 Muon::MuonSegmentCombination::SegmentVec::const_iterator ipsg = stationSegs->begin();
141 Muon::MuonSegmentCombination::SegmentVec::const_iterator ipsg_end = stationSegs->end();
142 for (; ipsg != ipsg_end; ++ipsg) {
146 ATH_MSG_WARNING(
"MuonSegmentCombination contains a segment that is not a MuonSegment!!");
156 std::unique_ptr<TrackCollection> allTracks = std::make_unique<TrackCollection>();
164 ATH_MSG_DEBUG(
" Retrieved " << trackCol->size() <<
" tracks from " << trackCol.
key());
182 if (
m_trackType == (
int)xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle)
188 for (
auto muon : *muons) {
194 if (
m_trackType == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle &&
muon->author() != 1 &&
195 muon->author() != 5 &&
muon->author() != 2)
198 if (
m_trackType == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle &&
muon->author() != 1 &&
199 muon->author() != 5 &&
muon->author() != 2 &&
muon->author() != 6)
204 if (
muon->author() != 7)
continue;
211 if (
m_trackType == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle)
236 if ((!
entry.cscHits.empty() || (!
entry.mmHits.empty() && !
entry.stgcHits.empty())) &&
entry.mdtHits.empty())
return false;
238 if (!trackRecord)
return false;
253 bool didOutput =
false;
255 unsigned int ntruthTracks(0);
256 unsigned int ntruthTracksSecondary(0);
260 std::vector<const MuonSimDataCollection*> muonSimData;
262 if (!simDataMap.isValid()) {
266 if (!simDataMap.isPresent())
continue;
267 muonSimData.push_back(simDataMap.cptr());
272 if (!cscSimDataMap.
isValid()) {
275 cscSimData = cscSimDataMap.
cptr();
279 m_truthTool->createTruthTree(truthTrackCol.
cptr(), mcEventCollection.
cptr(), muonSimData, cscSimData);
282 std::map<const TrackRecord*, Muon::IMuonTrackTruthTool::TruthTreeEntry> truthTrackEntryMap;
283 Muon::IMuonTrackTruthTool::TruthTree::const_iterator
tit = truthTree.begin();
284 Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit_end = truthTree.end();
285 for (;
tit != tit_end; ++
tit) {
286 if (!
tit->second.truthTrack)
continue;
288 truthTrackEntryMap[
tit->second.truthTrack] =
tit->second;
295 ++ntruthTracksSecondary;
303 std::set<const Trk::Track*> matchedTracks;
304 std::set<const Trk::Track*> matchedFakeTracks;
305 std::map<const TrackRecord*, Muon::IMuonTrackTruthTool::MatchResult> bestMatched;
307 unsigned int nmatched(0);
308 unsigned int nmatchedSecondary(0);
313 for (; rit != rit_end; ++rit) {
323 truthTrackEntryMap.find(trackTruth.
truthTrack);
324 if (
pos == truthTrackEntryMap.end()) {
325 ATH_MSG_WARNING(
"Truth track not found in map, this should not happen!!");
332 if (!bestMatched.count(trackTruth.
truthTrack)) {
336 matchedTracks.insert(rit->first);
347 matchedFakeTracks.insert(rit->first);
369 for (; mit != mit_end; ++mit) {
372 truthTrackEntryMap.find(truthTrack.
truthTrack);
373 if (
pos == truthTrackEntryMap.end()) {
374 ATH_MSG_WARNING(
"Truth track not found in map, this should not happen!!");
380 if (!trackData)
continue;
388 if (mother->end_vertex())
390 mother->end_vertex()->position().x(), mother->end_vertex()->position().y(), mother->end_vertex()->position().z());
395 new Amg::Vector3D(original->momentum().x(), original->momentum().y(), original->momentum().z());
399 if (trackData->
allOk()) {
442 <<
print(*trackData));
448 unsigned int nmissed(0);
449 tit = truthTree.begin();
450 tit_end = truthTree.end();
451 for (;
tit != tit_end; ++
tit) {
456 if (bestMatched.count(
tit->second.truthTrack))
continue;
464 if (
tit->second.truthTrajectory) {
469 if (mother->end_vertex())
471 mother->end_vertex()->position().x(), mother->end_vertex()->position().y(), mother->end_vertex()->position().z());
476 new Amg::Vector3D(original->momentum().x(), original->momentum().y(), original->momentum().z());
502 if (ntruthTracks < nmatched)
503 ATH_MSG_WARNING(
"found more matched tracks than truth tracks: truth " << ntruthTracks <<
" matched " << nmatched);
505 if (nmissed != ntruthTracks - nmatched)
506 ATH_MSG_WARNING(
"inconsisted number of missed tracks: truth " << ntruthTracks <<
" matched " << nmatched <<
" missed " << nmissed);
511 for (; trit != trit_end; ++trit) {
512 if (matchedTracks.count(*trit))
continue;
515 if ((**trit).perigeeParameters()) {
517 pt = (**trit).perigeeParameters()->momentum().perp();
519 pt = (**trit).perigeeParameters()->momentum().mag();
527 bool matchedFake = matchedFakeTracks.count(*trit);
528 std::string fakeType = isHighPt ?
"HighPt" :
"LowPt";
529 if (isSL) fakeType =
"SL";
530 if (matchedFake) fakeType +=
" (matched)";
533 if (matchedFake)
summary.trackPars =
"(matched) ";
551 msg() << MSG::INFO <<
"Fake track " << fakeType <<
": " << std::endl
556 if (didOutput) {
msg() << MSG::INFO <<
endmsg; }
568 std::string
outfile =
"trkPerformance_";
586 for (; eit != eit_end; ++eit) {
clearEvent(*eit); }
588 return StatusCode::SUCCESS;
600 if (trackCollection.
empty())
603 msg() <<
" : " << trackCollection.
size() <<
" tracks found " << std::endl;
606 for (;
tit != tit_end; ++
tit) {
614 if (
tit == tit_end - 1)
624 if (truthTracks.empty())
627 msg() <<
" : " << truthTracks.size() <<
" truth tracks found " << std::endl;
628 Muon::IMuonTrackTruthTool::TruthTree::const_iterator
tit = truthTracks.begin();
629 Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit_end = truthTracks.end();
630 for (;
tit != tit_end; ++
tit) {
633 Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit_temp =
tit;
634 if (++tit_temp == tit_end)
643 std::ostringstream sout;
645 sout <<
" No TrackRecord found! ";
653 std::map<Identifier, std::pair<int, int> > precisionIds;
654 std::map<Identifier, std::pair<int, int> > triggerIds;
655 std::map<Identifier, std::pair<int, int> > nhitsCompIds;
657 unsigned int neta = 0;
658 unsigned int netaTrig = 0;
659 unsigned int nphi = 0;
661 std::set<Identifier> allIds;
662 MuonSimDataCollection::const_iterator mit = trackTruth.
mdtHits.begin();
663 MuonSimDataCollection::const_iterator mit_end = trackTruth.
mdtHits.end();
664 for (; mit != mit_end; ++mit) allIds.insert(mit->first);
667 CscSimDataCollection::const_iterator cit = trackTruth.
cscHits.begin();
668 CscSimDataCollection::const_iterator cit_end = trackTruth.
cscHits.end();
669 for (; cit != cit_end; ++cit) allIds.insert(
m_idHelperSvc->layerId(cit->first));
673 mit_end = trackTruth.
stgcHits.end();
674 for (; mit != mit_end; ++mit) allIds.insert(
m_idHelperSvc->layerId(mit->first));
677 mit = trackTruth.
mmHits.begin();
678 mit_end = trackTruth.
mmHits.end();
679 for (; mit != mit_end; ++mit) allIds.insert(
m_idHelperSvc->layerId(mit->first));
682 mit = trackTruth.
rpcHits.begin();
683 mit_end = trackTruth.
rpcHits.end();
684 for (; mit != mit_end; ++mit) allIds.insert(
m_idHelperSvc->layerId(mit->first));
686 mit = trackTruth.
tgcHits.begin();
687 mit_end = trackTruth.
tgcHits.end();
688 for (; mit != mit_end; ++mit) allIds.insert(
m_idHelperSvc->layerId(mit->first));
692 for (;
it != it_end; ++
it) {
697 ++nhitsCompIds[chId].first;
699 ++nhitsCompIds[chId].second;
704 ++triggerIds[chId].first;
707 ++triggerIds[chId].second;
713 ++precisionIds[chId].first;
716 ++precisionIds[chId].second;
720 sout <<
"Truth: hits " << std::setw(5) << neta + nphi + netaTrig <<
" r " << (
int)trackRecord.
GetPosition().perp() <<
" z "
728 if (mother) { sout <<
" mother " << mother->pdg_id(); }
731 sout <<
" Eta hits " << neta <<
" phi " << nphi <<
" eta trig " << netaTrig << std::endl;
732 std::map<Identifier, std::pair<int, int> >
::iterator iit = precisionIds.begin();
733 std::map<Identifier, std::pair<int, int> >
::iterator iit_end = precisionIds.end();
734 for (; iit != iit_end; ++iit) {
735 sout.setf(std::ios::left);
736 sout <<
" " << std::setw(32) <<
m_idHelperSvc->toStringChamber(iit->first) <<
" hits: eta " << std::setw(3) << iit->second.second
737 <<
" phi " << std::setw(3) << iit->second.first << std::endl;
739 iit = triggerIds.begin();
740 iit_end = triggerIds.end();
741 for (; iit != iit_end; ++iit) {
742 sout <<
" " << std::setw(32) <<
m_idHelperSvc->toStringChamber(iit->first) <<
" hits: eta " << std::setw(3)
743 << nhitsCompIds[iit->first].second <<
" phi " << std::setw(3) << nhitsCompIds[iit->first].first <<
" stations: Eta "
744 << iit->second.second <<
" Phi " << iit->second.first << std::endl;
751 const std::vector<MuonTrackPerformanceAlg::TrackData*>& tracks,
const std::string&
message)
const {
752 std::ostringstream sout;
753 if (!tracks.empty()) {
754 sout <<
" Event " <<
event.eventNumber <<
" position in file " <<
event.eventPosition <<
" has " << tracks.size() <<
" " <<
message
756 std::vector<TrackData*>::const_iterator
it = tracks.begin();
757 std::vector<TrackData*>::const_iterator it_end = tracks.end();
758 for (;
it != it_end; ++
it) { sout <<
print(**
it) << std::endl; }
764 const std::string&
message)
const {
765 std::ostringstream sout;
766 if (!tracks.empty()) {
767 sout <<
" Event " <<
event.eventNumber <<
" position in file " <<
event.eventPosition <<
" has " << tracks.size() <<
" " <<
message
769 std::vector<const Trk::Track*>::const_iterator
it = tracks.begin();
770 std::vector<const Trk::Track*>::const_iterator it_end = tracks.end();
780 filename +=
"EventListIncompleteTracks.txt";
784 msg() << MSG::INFO <<
"Summarizing events with endcap track without EI layer resulting in momentum loss, total "
786 std::vector<EventData>::const_iterator eit =
m_badEvents.begin();
787 std::vector<EventData>::const_iterator eit_end =
m_badEvents.end();
788 for (; eit != eit_end; ++eit) {
789 if (eit->missingStationMomLoss.empty())
continue;
790 msg() <<
print(*eit, eit->missingStationMomLoss,
" tracks without inner layer in endcap") << std::endl;
798 for (; eit != eit_end; ++eit) {
799 if (eit->missingStationLayer.empty())
continue;
800 msg() <<
print(*eit, eit->missingStationLayer,
" tracks with a missing layer") << std::endl;
805 msg() << MSG::INFO <<
"Summarizing events with track with missing chamber, total " <<
m_nmissingStation << std::endl;
808 for (; eit != eit_end; ++eit) {
809 if (eit->missingStation.empty())
continue;
810 msg() <<
print(*eit, eit->missingStation,
" tracks with a missing chamber") << std::endl;
815 msg() << MSG::INFO <<
"Summarizing events with track with wrong layer, total " <<
m_nwrongStationLayer << std::endl;
818 for (; eit != eit_end; ++eit) {
819 if (eit->wrongStation.empty())
continue;
820 msg() <<
print(*eit, eit->wrongStation,
" tracks with a wrong layer") << std::endl;
825 msg() << MSG::INFO <<
"Summarizing events with track with wrong chamber, total " <<
m_nwrongStation << std::endl;
828 for (; eit != eit_end; ++eit) {
829 if (eit->wrongStation.empty())
continue;
830 msg() <<
print(*eit, eit->wrongStation,
" tracks with a wrong chamber") << std::endl;
838 for (; eit != eit_end; ++eit) {
839 if (eit->missingStationLayerTrigger.empty())
continue;
840 msg() <<
print(*eit, eit->missingStationLayerTrigger,
" tracks with a missing trigger layer") << std::endl;
848 for (; eit != eit_end; ++eit) {
849 if (eit->wrongStationLayerTrigger.empty())
continue;
850 msg() <<
print(*eit, eit->wrongStationLayerTrigger,
" tracks with a wrong trigger layer") << std::endl;
860 filename +=
"EventListMissedTracks.txt";
864 msg() << MSG::INFO <<
"Summarizing events with missing track, total " <<
m_nmissedTracks << std::endl;
865 std::vector<EventData>::const_iterator eit =
m_badEvents.begin();
866 std::vector<EventData>::const_iterator eit_end =
m_badEvents.end();
867 for (; eit != eit_end; ++eit) {
868 if (eit->missingTruthTracks.empty())
continue;
869 msg() <<
print(*eit, eit->missingTruthTracks,
" missing tracks") << std::endl;
877 for (; eit != eit_end; ++eit) {
878 if (eit->missingTruthTracksOneStation.empty())
continue;
879 msg() <<
print(*eit, eit->missingTruthTracksOneStation,
" missing single station tracks") << std::endl;
889 filename +=
"EventListFakeTracks.txt";
893 msg() << MSG::INFO <<
"Summarizing events with fake tracks, high pt, total " <<
m_nfakeTracksHighPt << std::endl;
894 std::vector<EventData>::const_iterator eit =
m_badEvents.begin();
895 std::vector<EventData>::const_iterator eit_end =
m_badEvents.end();
896 for (; eit != eit_end; ++eit) {
897 if (eit->fakeTracks.empty())
continue;
898 msg() <<
print(*eit, eit->fakeTracks,
" high pt fake tracks") << std::endl;
903 msg() << MSG::INFO <<
"Summarizing events with fake tracks, low pt, total " <<
m_nfakeTracksLowPt << std::endl;
906 for (; eit != eit_end; ++eit) {
907 if (eit->fakeTracksLowPt.empty())
continue;
908 msg() <<
print(*eit, eit->fakeTracksLowPt,
" low pt fake tracks") << std::endl;
913 msg() << MSG::INFO <<
"Summarizing events with fake tracks, SL, total " <<
m_nfakeTracksSL << std::endl;
916 for (; eit != eit_end; ++eit) {
917 if (eit->fakeTracksSL.empty())
continue;
918 msg() <<
print(*eit, eit->fakeTracksSL,
" SL fake tracks") << std::endl;
925 std::ostringstream sout;
932 <<
" number of tracks " << std::setw(12) <<
m_ntracks <<
" average per event " <<
m_ntracks * evScale;
937 unsigned int nmissedTracksOneStation =
941 double trTrkScale = ntruthTracks != 0 ? 1. / ntruthTracks : 1.;
945 <<
" number of truth tracks " << std::setw(12) << ntruthTracks <<
" average per event "
946 << ntruthTracks * evScale << std::endl
947 <<
" number of good tracks " << std::setw(12) << nmatchedTracks <<
" average per event "
948 << nmatchedTracks * evScale << std::endl
949 <<
" number of missed multi station tracks " << std::setw(12) << nmissedTracks <<
" average per event "
950 << nmissedTracks * evScale << std::endl
951 <<
" number of missed one station tracks " << std::setw(12) << nmissedTracksOneStation <<
" average per event "
952 << nmissedTracksOneStation * evScale << std::endl;
954 sout <<
" number of secondary truth tracks " << std::setw(12) <<
m_ntruthTracksSecondary <<
" average per event "
958 <<
" number of secondary missed multi st tracks " << std::setw(12) <<
m_nmissedTracksSecondary <<
" average per event "
963 sout <<
" number of fake tracks " << std::setw(12) <<
m_nfakeTracks <<
" average per event "
965 <<
" number of high pt fake tracks " << std::setw(12) <<
m_nfakeTracksHighPt <<
" average per event "
967 <<
" number of low pt fake tracks " << std::setw(12) <<
m_nfakeTracksLowPt <<
" average per event "
969 <<
" number of SL fake tracks " << std::setw(12) <<
m_nfakeTracksSL <<
" average per event "
971 <<
" number of matched fake tracks " << std::setw(12) <<
m_nmatchedFakeTracks <<
" average per event "
975 <<
" number of tracks missing precision layer " << std::setw(12) <<
m_nmissingStationLayer <<
" average per truth track "
979 <<
" number of tracks missing chamber " << std::setw(12) <<
m_nmissingStation <<
" average per truth track "
981 <<
" number of tracks wrong precision layer " << std::setw(12) <<
m_nwrongStationLayer <<
" average per truth track "
985 <<
" number of tracks wrong chamber " << std::setw(12) <<
m_nwrongStation <<
" average per truth track "
987 <<
" efficiency: " << nmatchedTracks * trTrkScale <<
" fake rate " <<
m_nfakeTracks * evScale <<
" high pt "
989 << nmissedTracks * trTrkScale;
1001 std::set<Identifier>::const_iterator
it = hitIds.begin();
1002 std::set<Identifier>::const_iterator it_end = hitIds.end();
1003 for (;
it != it_end; ++
it) {
1012 return std::make_pair(nhitsEta, nhitsPhi);
1018 bool passesThreshold =
false;
1022 if (missingHits.first >= minEtaHits) passesThreshold =
true;
1023 if (missingHits.second >= minPhiHits) passesThreshold =
true;
1027 if (passesThreshold) {
1028 chamberData.
chId = chId;
1029 std::set<Identifier>::const_iterator
it =
hits.begin();
1030 std::set<Identifier>::const_iterator it_end =
hits.end();
1031 for (;
it != it_end; ++
it) {
1034 chamberData.
hits.insert(*
it);
1038 return passesThreshold;
1042 int minPhiHits, std::vector<MuonTrackPerformanceAlg::ChamberData>& chambers)
const {
1044 std::set<Identifier>::const_iterator
it = chIds.begin();
1045 std::set<Identifier>::const_iterator it_end = chIds.end();
1046 for (;
it != it_end; ++
it) {
1050 return !chambers.empty();
1054 const std::set<Muon::MuonStationIndex::StIndex>& exclusionList,
1055 std::set<Muon::MuonStationIndex::StIndex>&
layers)
const {
1056 unsigned int inputSize =
layers.size();
1058 std::set<Identifier>::const_iterator chit = chIds.begin();
1059 std::set<Identifier>::const_iterator chit_end = chIds.end();
1060 for (; chit != chit_end; ++chit) {
1062 if (!exclusionList.count(stIndex))
layers.insert(stIndex);
1065 return inputSize !=
layers.size();
1069 const std::set<Muon::MuonStationIndex::StIndex>& exclusionList,
1070 std::set<Muon::MuonStationIndex::StIndex>&
layers,
bool usePrecision)
const {
1071 std::set<Identifier> chIds;
1072 std::vector<ChamberData>::const_iterator chit = chambers.begin();
1073 std::vector<ChamberData>::const_iterator chit_end = chambers.end();
1074 for (; chit != chit_end; ++chit) {
1076 if ((usePrecision && isTrigger) || (!usePrecision && !isTrigger))
continue;
1114 std::set<Muon::MuonStationIndex::StIndex> dummyList;
1134 std::ostringstream sout;
1146 sout <<
"Truth: " <<
m_printer->print(perigee);
1161 if (trackData.
trackPars->covariance()) {
1164 double cov00 = (*trackData.
trackPars->covariance())(0, 0);
1165 double cov11 = (*trackData.
trackPars->covariance())(1, 1);
1166 double cov22 = (*trackData.
trackPars->covariance())(2, 2);
1167 double cov33 = (*trackData.
trackPars->covariance())(3, 3);
1168 double cov44 = (*trackData.
trackPars->covariance())(4, 4);
1170 sout <<
" error d0 " << std::sqrt(cov00) <<
" z0 " << std::sqrt(cov11) <<
" phi (mrad) " << 1000 * std::sqrt(cov22)
1171 <<
" theta (mrad) " << 1000 * std::sqrt(cov33) <<
" dp/p " << dpp << std::endl;
1179 sout <<
" Missing Chambers: " << std::endl;
1180 std::vector<ChamberData>::const_iterator chIt = trackData.
missingChambers.begin();
1181 std::vector<ChamberData>::const_iterator chIt_end = trackData.
missingChambers.end();
1182 for (; chIt != chIt_end; ++chIt) {
1183 sout <<
" " <<
m_idHelperSvc->toStringChamber(chIt->chId) <<
" hits " << chIt->hits.size() << std::endl;
1185 std::set<Identifier>::const_iterator hit = chIt->hits.begin();
1186 std::set<Identifier>::const_iterator hit_end = chIt->hits.end();
1187 for (; hit != hit_end; ++hit) { sout <<
" " <<
m_idHelperSvc->toString(*hit) << std::endl; }
1193 sout <<
" Wrong Chambers: " << std::endl;
1194 std::vector<ChamberData>::const_iterator chIt = trackData.
wrongChambers.begin();
1195 std::vector<ChamberData>::const_iterator chIt_end = trackData.
wrongChambers.end();
1196 for (; chIt != chIt_end; ++chIt) {
1197 sout <<
" " <<
m_idHelperSvc->toStringChamber(chIt->chId) <<
" hits " << chIt->hits.size() << std::endl;
1199 std::set<Identifier>::const_iterator hit = chIt->hits.begin();
1200 std::set<Identifier>::const_iterator hit_end = chIt->hits.end();
1201 for (; hit != hit_end; ++hit) { sout <<
" " <<
m_idHelperSvc->toString(*hit) << std::endl; }
1207 sout <<
" Missing Layers: ";
1209 sout <<
" Precision: ";
1210 std::set<Muon::MuonStationIndex::StIndex>::const_iterator
it = trackData.
missingLayers.begin();
1211 std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.
missingLayers.end();
1216 sout <<
" Trigger: ";
1218 std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.
missingLayersTrigger.end();
1225 sout <<
" TrackData.Wrong Layers: ";
1227 sout <<
" Precision: ";
1228 std::set<Muon::MuonStationIndex::StIndex>::const_iterator
it = trackData.
wrongLayers.begin();
1229 std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.
wrongLayers.end();
1234 sout <<
" Trigger: ";
1235 std::set<Muon::MuonStationIndex::StIndex>::const_iterator
it = trackData.
wrongLayersTrigger.begin();
1236 std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.
wrongLayersTrigger.end();
1248 if (
track.fitQuality() &&
track.fitQuality()->numberDoF())
1249 trackData.
chi2Ndof =
track.fitQuality()->chiSquared() /
track.fitQuality()->numberDoF();
1259 if (!trackTruth.
truthTrack) {
return nullptr; }
1263 std::map<Identifier, std::set<Identifier> > chambers;
1265 MuonSimDataCollection::const_iterator mit = trackTruth.
mdtHits.begin();
1266 MuonSimDataCollection::const_iterator mit_end = trackTruth.
mdtHits.end();
1267 for (; mit != mit_end; ++mit) {
1269 chambers[chId].insert(mit->first);
1273 CscSimDataCollection::const_iterator cit = trackTruth.
cscHits.begin();
1274 CscSimDataCollection::const_iterator cit_end = trackTruth.
cscHits.end();
1275 for (; cit != cit_end; ++cit) {
1282 mit_end = trackTruth.
stgcHits.end();
1283 for (; mit != mit_end; ++mit) {
1285 chambers[chId].insert(mit->first);
1289 mit = trackTruth.
mmHits.begin();
1290 mit_end = trackTruth.
mmHits.end();
1291 for (; mit != mit_end; ++mit) {
1293 chambers[chId].insert(mit->first);
1297 mit = trackTruth.
rpcHits.begin();
1298 mit_end = trackTruth.
rpcHits.end();
1299 for (; mit != mit_end; ++mit) {
1301 chambers[chId].insert(mit->first);
1304 mit = trackTruth.
tgcHits.begin();
1305 mit_end = trackTruth.
tgcHits.end();
1306 for (; mit != mit_end; ++mit) {
1308 chambers[chId].insert(mit->first);
1311 std::vector<ChamberData> missingChambers;
1312 std::map<Identifier, std::set<Identifier> >::const_iterator chIt = chambers.begin();
1313 std::map<Identifier, std::set<Identifier> >::const_iterator chIt_end = chambers.end();
1314 for (; chIt != chIt_end; ++chIt) {
1316 unsigned int minEtaHits = 0;
1317 unsigned int minPhiHits = 0;
1340 if (
insertChamber(chIt->first, chIt->second, minEtaHits, minPhiHits, chamberData)) {
1353 std::vector<const Trk::Track*>::const_iterator
it = tracks.begin();
1354 std::vector<const Trk::Track*>::const_iterator it_end = tracks.end();
1355 for (;
it != it_end; ++
it)
delete *
it;
1360 std::vector<TrackData*>::const_iterator
it = tracks.begin();
1361 std::vector<TrackData*>::const_iterator it_end = tracks.end();
1362 for (;
it != it_end; ++
it) {
delete *
it; }
1383 std::vector<HepMcParticleLink>::const_reverse_iterator pit = traj.rbegin();
1384 std::vector<HepMcParticleLink>::const_reverse_iterator pit_end = traj.rend();
1385 for (; pit != pit_end; ++pit) {
1386 if (std::abs((*pit)->pdg_id()) != 13)
return *pit;
1392 std::vector<HepMcParticleLink>::const_reverse_iterator pit = traj.rbegin();
1393 std::vector<HepMcParticleLink>::const_reverse_iterator pit_end = traj.rend();
1394 for (; pit != pit_end; ++pit) {
1395 if (std::abs((*pit)->pdg_id()) != 13) {
1396 if (pit != traj.rbegin())
1412 if (!
entry.truthTrajectory)
return false;
1418 if (mother && mother->end_vertex() && mother->end_vertex()->position().perp() > 100.)
return true;