19 #include "art_root_io/TFileService.h" 90 std::vector < art::Ptr < recob::Track > > trackList;
91 auto trackListHandle = e.
getHandle < std::vector < recob::Track > >(
"pandoraTrack");
92 if (trackListHandle) {
98 art::FindManyP < recob::Hit > hitsFromTrack(trackListHandle, e,
"pandoraTrack");
101 for (
auto const& track : trackList){
102 int this_trackid = track.key();
103 double this_tracklen = track->Length();
104 int this_trackorg = -1;
105 int this_trackpdg = 0;
107 auto const & allHits = hitsFromTrack.at(track.key());
112 std::map<int,double> trkide;
113 for(
size_t h = 0;
h < allHits.size(); ++
h){
116 for(
size_t e = 0; e < TrackIDs.size(); ++
e){
117 trkide[TrackIDs[
e].trackID] += TrackIDs[
e].energy;
125 if ((ii->second)>maxe){
134 this_trackpdg = particle->
PdgCode();
136 this_trackorg = truth->
Origin();
140 trackid.push_back(this_trackid);
151 mdmtree = fileServiceHandle->make<TTree>(
"mdmtree",
"MDM info");
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
std::vector< int > trackpdg
Handle< PROD > getHandle(SelectorBase const &) const
std::vector< TrackID > TrackIDs
const simb::MCParticle * TrackIdToParticle_P(int id) const
simb::Origin_t Origin() const
EDAnalyzer(fhicl::ParameterSet const &pset)
MDMAna(fhicl::ParameterSet const &p)
const art::Ptr< simb::MCTruth > & ParticleToMCTruth_P(const simb::MCParticle *p) const
std::vector< double > tracklen
#define DEFINE_ART_MODULE(klass)
SubRunNumber_t subRun() const
std::vector< int > trackorg
Detector simulation of raw signals on wires.
MDMAna & operator=(MDMAna const &)=delete
void analyze(art::Event const &e) override
std::vector< int > trackid
Provides recob::Track data product.
EventNumber_t event() const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Event finding and building.