13 #include "art/Framework/Core/EDAnalyzer.h"
14 #include "art/Framework/Core/ModuleMacros.h"
15 #include "art/Framework/Principal/Event.h"
16 #include "art/Framework/Principal/Handle.h"
17 #include "art/Framework/Services/Registry/ServiceHandle.h"
18 #include "art_root_io/TFileService.h"
19 #include "canvas/Persistency/Common/Ptr.h"
20 #include "fhiclcpp/ParameterSet.h"
21 #include "messagefacility/MessageLogger/MessageLogger.h"
25 #include "TLorentzVector.h"
37 OpHitAna(
const fhicl::ParameterSet&);
40 void analyze (
const art::Event&);
80 DEFINE_ART_MODULE(OpHitAna)
94 art::ServiceHandle<OpDigiProperties> odp;
108 art::ServiceHandle<art::TFileService const>
tfs;
109 fHitTree = tfs->make<TTree>(
"HitTree",
"HitTree");
124 art::Handle< std::vector< recob::OpHit > > HitHandle;
135 art::ServiceHandle<art::TFileService const>
tfs;
137 art::ServiceHandle<geo::Geometry const> geom;
138 int NOpChannels = geom->NOpChannels();
140 std::vector<TH1D*> HitHist;
142 sprintf(HistName,
"Event %d AllOpDets", evt.id().event());
144 TH1D * AllHits =
nullptr;
147 AllHits = tfs->make<TH1D>(HistName,
";t (ns);",
153 for(
int i=0; i!=NOpChannels; ++i)
156 sprintf(HistName,
"Event %d OpDet %i", evt.id().event(), i);
169 for(
unsigned int i = 0; i < HitHandle->size(); ++i)
172 art::Ptr< recob::OpHit > TheHitPtr(HitHandle, i);
186 mf::LogError(
"OpHitAna")<<
"Error : Trying to fill channel out of range, " <<
fOpChannel;
void analyze(const art::Event &)
art::ServiceHandle< art::TFileService > tfs
OpHitAna(const fhicl::ParameterSet &)
art framework interface to geometry description
bool fMakeHistAllChannels