28 bool findData =
false, findSimHit =
false;
37 art::Handle< std::vector<CRTHit>> crtTrueHitHandle;
38 std::vector<art::Ptr<CRTHit> > crtTrueHitList;
40 art::fill_ptr_vector(crtTrueHitList, crtTrueHitHandle);
42 art::FindManyP<sim::AuxDetIDE> findManyIdes(crtTrueHitHandle, event,
fCRTTrueHitLabel);
43 std::map<art::Ptr<CRTHit>,
int> trueHitPtrMap;
45 for(
size_t hit_i = 0; hit_i < crtTrueHitList.size(); hit_i++){
47 trueHitPtrMap[crtTrueHitList[hit_i]] = hit_i;
48 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(hit_i);
50 for(
size_t i = 0; i < ides.size(); i++){
52 int id = ides[i]->trackID;
59 mf::LogWarning(
"CRTBackTracker") <<
"no CRTTrueHit products found";
62 art::Handle< std::vector<CRTData>> crtDataHandle;
63 std::vector<art::Ptr<CRTData> > crtDataList;
64 std::map<art::Ptr<CRTData>,
int> dataPtrMap;
67 art::fill_ptr_vector(crtDataList, crtDataHandle);
68 art::FindManyP<sim::AuxDetIDE> findManyIdes(crtDataHandle, event,
fCRTDataLabel);
70 for(
size_t data_i = 0; data_i < crtDataList.size(); data_i++){
72 dataPtrMap[crtDataList[data_i]] = data_i;
74 std::vector<art::Ptr<sim::AuxDetIDE>> ides = findManyIdes.at(data_i);
76 for(
size_t i = 0; i < ides.size(); i++){
78 int id = ides[i]->trackID;
86 mf::LogWarning(
"CRTBackTracker") <<
"no CRTData products found";
89 art::Handle< std::vector<CRTHit>> crtSimHitHandle;
90 std::vector<art::Ptr<CRTHit> > crtSimHitList;
91 std::map<art::Ptr<CRTHit>,
int> simHitPtrMap;
95 mf::LogError(
"CRTBackTracker")
96 <<
"no CRTData products found when some were expected (CRTSimHits found)";
98 art::fill_ptr_vector(crtSimHitList, crtSimHitHandle);
99 art::FindManyP<CRTData> findManyData(crtSimHitHandle, event,
fCRTSimHitLabel);
101 for(
size_t hit_i = 0; hit_i < crtSimHitList.size(); hit_i++){
103 simHitPtrMap[crtSimHitList[hit_i]] = hit_i;
104 std::vector<art::Ptr<CRTData>> data = findManyData.at(hit_i);
106 for(
size_t data_i = 0; data_i < data.size(); data_i++){
108 int dataID = dataPtrMap[data[data_i]];
118 mf::LogWarning(
"CRTBackTracker") <<
"no CRTSimHit products found";
121 art::Handle< std::vector<CRTTrack>> crtTrackHandle;
122 std::vector<art::Ptr<CRTTrack> > crtTrackList;
127 mf::LogError(
"CRTBackTracker")
128 <<
"no CRTSimHit products found when some were expected (CRTTracks found)";
130 art::fill_ptr_vector(crtTrackList, crtTrackHandle);
131 art::FindManyP<CRTHit> findManyHits(crtTrackHandle, event,
fCRTTrackLabel);
133 for(
size_t track_i = 0; track_i < crtTrackList.size(); track_i++){
135 std::vector<art::Ptr<CRTHit>> hits = findManyHits.at(track_i);
136 for(
size_t hit_i = 0; hit_i < hits.size(); hit_i++){
138 int hitID = simHitPtrMap[hits[hit_i]];
147 mf::LogWarning(
"CRTBackTracker") <<
"no CRTTrack products found";
art::InputTag fCRTSimHitLabel
std::map< int, std::map< int, double > > fTrueHitTrueIds
std::map< int, std::map< int, double > > fDataTrueIds
art::InputTag fCRTTrackLabel
std::map< int, std::map< int, double > > fTrackTrueIds
art::InputTag fCRTTrueHitLabel
art::InputTag fCRTDataLabel
std::map< int, std::map< int, double > > fSimHitTrueIds