19 #include "art_root_io/TFileService.h" 72 fSPEAmp = odp->GetSPECumulativeAmplitude();
108 std::vector<std::string> histnames;
111 for(
unsigned int i = 0; i < WaveformHandle->size(); ++i)
124 unsigned int pulsenum = 0;
126 sprintf(HistName,
"Event_%d_OpDet_%i_Pulse_%i", evt.
id().
event(), ThePulse.
OpChannel(), pulsenum);
127 auto p = std::find(histnames.begin(), histnames.end(), HistName);
128 if ( p != histnames.end() ) {
134 histnames.push_back(HistName);
141 TH1D* PulseHist =
nullptr;
144 PulseHist= tfs->make<TH1D>(HistName,
";t (ns);",
150 sprintf(HistName,
"Event_%d_uni_OpDet_%i_Pulse_%i", evt.
id().
event(), ThePulse.
OpChannel(), pulsenum);
151 TH1D* UnipolarHist =
nullptr;
154 UnipolarHist= tfs->make<TH1D>(HistName,
";t (ns);",
160 for(
unsigned int binNum = 0; binNum < ThePulse.
Waveform().size(); ++binNum)
165 (
double) ThePulse.
Waveform()[binNum] );
168 double BinContent = (double) ThePulse.
Waveform()[binNum] +
169 (double) UnipolarHist->GetBinContent(binNum-1);
171 UnipolarHist->SetBinContent(binNum,BinContent);
173 UnipolarHist->SetBinContent(binNum,0);
unsigned short OpChannel() const
EDAnalyzer(fhicl::ParameterSet const &pset)
const std::vector< short > & Waveform() const
std::string fInstanceName
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
OpDigiAna(const fhicl::ParameterSet &)
void analyze(const art::Event &)
EventNumber_t event() const