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/Services/Registry/ServiceHandle.h"
15 #include "fhiclcpp/ParameterSet.h"
16 #include "art_root_io/TFileService.h"
40 void analyze(art::Event
const &
e)
override;
55 fCaloModuleLabel(p.
get<
std::string>(
"CaloModuleLabel")),
56 fPIDAAlg(p.
get<fhicl::ParameterSet>(
"PIDAAlg"))
60 art::ServiceHandle<art::TFileService const>
tfs;
62 std::vector<TH1F*> kde_hists;
63 for(
size_t i_b=0; i_b<fPIDAAlg.getNKDEBandwidths(); i_b++){
64 std::stringstream hname;
65 hname <<
"hkde_" << i_b;
66 kde_hists.push_back(tfs->make<TH1F>(hname.str().c_str(),
"PIDA KDE Distribution",100,0,30));
69 fPIDAAlg.SetPIDATree(tfs->make<TTree>(
"pida",
"PIDAPropertiesTree"),
70 tfs->make<TH1F>(
"hvals",
"PIDA Distribution",100,0,30),
77 art::Handle< std::vector<anab::Calorimetry> > caloHandle;
78 e.getByLabel(fCaloModuleLabel,caloHandle);
79 std::vector<anab::Calorimetry>
const& caloVector(*caloHandle);
81 for(
size_t i_calo=0; i_calo<caloVector.size(); i_calo++){
82 fPIDAAlg.FillPIDATree(e.run(),e.event(),i_calo,caloVector[i_calo]);
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
PIDAAnalyzer(fhicl::ParameterSet const &p)
PIDAAnalyzer & operator=(PIDAAnalyzer const &)=delete
std::string fCaloModuleLabel
art::ServiceHandle< art::TFileService > tfs
void analyze(art::Event const &e) override