18 #include "nug4/ParticleNavigation/ParticleList.h" 63 std::vector<art::Ptr<recob::Hit>> hits;
67 std::vector<art::Ptr<recob::Hit>>
::iterator itr = hits.begin();
77 while (itr != hits.end()) {
80 mf::LogInfo(
"CheckBackTracking") << *((*itr).get()) <<
"\n channel is: " << (*itr)->Channel();
82 std::vector<sim::TrackIDE> trackides = bt_serv->
HitToTrackIDEs(clockData, *itr);
84 std::vector<double> xyz = bt_serv->
HitToXYZ(clockData, *itr);
87 <<
"hit weighted mean position is (" << xyz[0] <<
"," << xyz[1] <<
"," << xyz[2] <<
")";
89 for (
size_t t = 0;
t < trackides.size(); ++
t) {
92 int eveID = pi_serv->
ParticleList().EveId(trackides[
t].trackID);
95 <<
"track id: " << trackides[
t].trackID <<
" contributed " << trackides[
t].energy <<
"/" 96 << trackides[
t].energyFrac <<
" to the current hit and has eveID: " << eveID;
99 for (
size_t e = 0;
e < eveides.size(); ++
e) {
101 <<
"eve id: " << eveides[
e].trackID <<
" contributed " << eveides[
e].energy <<
"/" 102 << eveides[
e].energyFrac <<
" to the current hit";
104 if (eveIDs.find(eveides[
e].trackID) == eveIDs.end()) eveIDs.insert(eveides[e].trackID);
113 while (setitr != eveIDs.end()) {
118 <<
"eve ID: " << *setitr <<
" purity: " << bt_serv->
HitCollectionPurity(clockData,
id, hits)
std::string fHitModuleLabel
label for module creating recob::Hit objects
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
double HitCollectionEfficiency(detinfo::DetectorClocksData const &clockData, std::set< int > const &trackIds, std::vector< art::Ptr< recob::Hit >> const &hits, std::vector< art::Ptr< recob::Hit >> const &allhits, geo::View_t const &view) const
CheckBackTracking(fhicl::ParameterSet const &pset)
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
EDAnalyzer(fhicl::ParameterSet const &pset)
3-dimensional objects, potentially hits, clusters, prongs, etc.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
double HitCollectionPurity(detinfo::DetectorClocksData const &clockData, std::set< int > const &trackIds, std::vector< art::Ptr< recob::Hit >> const &hits) const
T get(std::string const &key) const
std::string fG4ModuleLabel
label for module running G4 and making particles, etc
Definition of data types for geometry description.
const sim::ParticleList & ParticleList() const
Declaration of signal hit object.
code to link reconstructed objects back to the MC truth information
std::vector< sim::TrackIDE > HitToEveTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void analyze(art::Event const &evt)