10 #include "art/Framework/Core/EDAnalyzer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "art/Framework/Principal/SubRun.h"
16 #include "canvas/Utilities/InputTag.h"
17 #include "fhiclcpp/ParameterSet.h"
18 #include "messagefacility/MessageLogger/MessageLogger.h"
24 #include "art_root_io/TFileService.h"
44 void analyze(art::Event
const&
e)
override;
60 , fPurityInfoLabel(
p.get<art::InputTag>(
"PurityInfoLabel"))
61 , fPrintInfo(
p.get<
bool>(
"PrintInfo",
false))
63 consumes< std::vector<anab::TPCPurityInfo> >(fPurityInfoLabel);
70 art::ServiceHandle<art::TFileService>
tfs;
72 fPurityTuple = tfs->make<TNtuple>(
"purityTuple",
"Purity Tuple",
"run:subrun:ev:cryo:tpc:wires:ticks:att:err");
80 <<
", Subrun " << e.subRun()
81 <<
", Event " << e.event()
84 art::Handle< std::vector<anab::TPCPurityInfo> > purityInfoHandle;
85 e.getByLabel(fPurityInfoLabel,purityInfoHandle);
86 auto const& purityInfoVec(*purityInfoHandle);
89 std::cout <<
"\tThere are " << purityInfoVec.size() <<
" purity info objects in the event."
92 for(
auto const& pinfo : purityInfoVec){
93 if(fPrintInfo) pinfo.Print();
94 fPurityTuple->Fill(e.run(),e.subRun(),e.event(),pinfo.Cryostat,pinfo.TPC,pinfo.Wires,pinfo.Ticks,pinfo.Attenuation,pinfo.FracError);
void analyze(art::Event const &e) override
process_name opflashCryoW ana
TPCPurityInfoAna(fhicl::ParameterSet const &p)
art::ServiceHandle< art::TFileService > tfs
TPCPurityInfoAna & operator=(TPCPurityInfoAna const &)=delete
art::InputTag const fPurityInfoLabel
BEGIN_PROLOG could also be cout