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 "canvas/Persistency/Common/FindManyP.h"
15 #include "fhiclcpp/ParameterSet.h"
21 class PrintCalorimetry;
39 void analyze(art::Event
const &
e)
override;
50 fTrackModuleLabel(p.
get<
std::string>(
"TrackModuleLabel")),
51 fCaloModuleLabels(p.
get<
std::
vector<
std::string> >(
"CaloModuleLabels"))
56 art::Handle< std::vector<recob::Track> > trackHandle;
57 e.getByLabel(fTrackModuleLabel,trackHandle);
59 std::vector< art::FindManyP<anab::Calorimetry> > caloAssnVector;
61 for(
size_t i_cm=0; i_cm<fCaloModuleLabels.size(); i_cm++)
62 caloAssnVector.emplace_back(trackHandle,e,fCaloModuleLabels[i_cm]);
64 for(
size_t i_trk=0; i_trk<trackHandle->size(); i_trk++){
65 std::cout <<
"(Run,Event,Track) = (" << e.run() <<
"," << e.event() <<
"," << i_trk <<
")" << std::endl;
66 std::cout <<
"-------------------" << std::endl;
68 for(
size_t i_cm=0; i_cm<caloAssnVector.size(); i_cm++){
69 std::cout <<
"Calorimetry module " << i_cm << std::endl;
70 for(
auto const& caloptr : caloAssnVector[i_cm].at(i_trk))
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
std::string fTrackModuleLabel
process_name can override from command line with o or output calo
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Provides recob::Track data product.
void analyze(art::Event const &e) override
PrintCalorimetry(fhicl::ParameterSet const &p)
std::vector< std::string > fCaloModuleLabels
PrintCalorimetry & operator=(PrintCalorimetry const &)=delete
BEGIN_PROLOG could also be cout