60 art::Handle<std::vector<recob::Hit>> hitcol;
65 std::vector<art::Ptr<recob::Hit>> hits;
66 art::fill_ptr_vector(hits, hitcol);
69 std::vector<art::Ptr<recob::Hit>>::iterator itr = hits.begin();
71 art::ServiceHandle<cheat::BackTrackerService const> bt_serv;
72 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
74 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
evt);
79 while (itr != hits.end()) {
82 mf::LogInfo(
"CheckBackTracking") << *((*itr).get()) <<
"\n channel is: " << (*itr)->Channel();
84 std::vector<sim::TrackIDE> trackides = bt_serv->HitToTrackIDEs(clockData, *itr);
85 std::vector<sim::TrackIDE> eveides = bt_serv->HitToEveTrackIDEs(clockData, *itr);
86 std::vector<double> xyz = bt_serv->HitToXYZ(clockData, *itr);
88 mf::LogInfo(
"CheckBackTracking")
89 <<
"hit weighted mean position is (" << xyz[0] <<
"," << xyz[1] <<
"," << xyz[2] <<
")";
91 for (
size_t t = 0; t < trackides.size(); ++t) {
94 int eveID = pi_serv->ParticleList().EveId(trackides[t].trackID);
96 mf::LogInfo(
"CheckBackTracking")
97 <<
"track id: " << trackides[t].trackID <<
" contributed " << trackides[t].energy <<
"/"
98 << trackides[t].energyFrac <<
" to the current hit and has eveID: " << eveID;
101 for (
size_t e = 0;
e < eveides.size(); ++
e) {
102 mf::LogInfo(
"CheckBackTracking")
103 <<
"eve id: " << eveides[
e].trackID <<
" contributed " << eveides[
e].energy <<
"/"
104 << eveides[
e].energyFrac <<
" to the current hit";
106 if (eveIDs.find(eveides[
e].trackID) == eveIDs.end()) eveIDs.insert(eveides[e].trackID);
114 std::set<int>::iterator setitr = eveIDs.begin();
115 while (setitr != eveIDs.end()) {
119 mf::LogInfo(
"CheckBackTracking")
120 <<
"eve ID: " << *setitr <<
" purity: " << bt_serv->HitCollectionPurity(clockData,
id, hits)
121 <<
" efficiency: " << bt_serv->HitCollectionEfficiency(clockData,
id, hits, hits,
geo::k3D);
std::string fHitModuleLabel
label for module creating recob::Hit objects
3-dimensional objects, potentially hits, clusters, prongs, etc.