17 #include "art/Framework/Core/EDAnalyzer.h"
18 #include "art/Framework/Core/ModuleMacros.h"
19 #include "art/Framework/Principal/Event.h"
20 #include "art/Framework/Principal/Handle.h"
21 #include "art/Framework/Principal/Run.h"
22 #include "art/Framework/Principal/SubRun.h"
23 #include "art_root_io/TFileService.h"
24 #include "canvas/Utilities/InputTag.h"
25 #include "fhiclcpp/ParameterSet.h"
26 #include "messagefacility/MessageLogger/MessageLogger.h"
28 #include "canvas/Utilities/Exception.h"
29 #include "art/Framework/Services/Registry/ServiceHandle.h"
52 class wvfAna :
public art::EDAnalyzer {
54 explicit wvfAna(fhicl::ParameterSet
const &
p);
65 void analyze(art::Event
const &
e)
override;
98 fOpDetsToPlot = p.get<std::vector<std::string> >(
"OpDetsToPlot");
100 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
101 fSampling = clockData.OpticalClock().Frequency();
113 std::cout <<
"My module on event #" << e.id().event() << std::endl;
115 art::ServiceHandle<art::TFileService>
tfs;
118 art::Handle< std::vector< raw::OpDetWaveform > > waveHandle;
121 if(!waveHandle.isValid()) {
122 std::cout << Form(
"Did not find any G4 photons from a producer: %s",
"largeant") << std::endl;
148 std::cout <<
"Number of waveforms: " << waveHandle->size() << std::endl;
155 for(
auto const& wvf : (*waveHandle)) {
159 if (std::find(fOpDetsToPlot.begin(), fOpDetsToPlot.end(),
opdetType) == fOpDetsToPlot.end()) {
continue;}
176 for(
unsigned int i = 0; i < wvf.size(); i++) {
177 wvfHist->SetBinContent(i + 1, (
double)wvf[i]);
std::string fInputModuleName
wvfAna & operator=(wvfAna const &)=delete
wvfAna(fhicl::ParameterSet const &p)
std::string opdetElectronics
std::stringstream histname
std::vector< std::string > fOpDetsToPlot
Simulation objects for optical detectors.
Service to provide microboone-specific signal shaping for simulation (convolution) and reconstruction...
opdet::sbndPDMapAlg pdMap
std::string electronicsType(size_t ch) const
object containing MC truth information necessary for making RawDigits and doing back tracking ...
void analyze(art::Event const &e) override
art::ServiceHandle< art::TFileService > tfs
std::string pdType(size_t ch) const override
Tools and modules for checking out the basics of the Monte Carlo.
art framework interface to geometry description
BEGIN_PROLOG could also be cout