94 art::Handle< std::vector< raw::OpDetPulse > > WaveformHandle;
105 art::ServiceHandle<art::TFileService const>
tfs;
108 std::vector<std::string> histnames;
111 for(
unsigned int i = 0; i < WaveformHandle->size(); ++i)
114 art::Ptr< raw::OpDetPulse > ThePulsePtr(WaveformHandle, 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
const std::vector< short > & Waveform() const
std::string fInstanceName
art::ServiceHandle< art::TFileService > tfs