10 #ifndef OpDetDigiAnaDUNE_H 11 #define OpDetDigiAnaDUNE_H 1 20 #include "art_root_io/TFileService.h" 21 #include "art_root_io/TFileDirectory.h" 95 ,
fMaxEvents { pset.get<
int >(
"MaxEvents", -1) }
103 fSampleFreq = clockData.OpticalClock().Frequency();
110 arvore = tfs->make<TTree>(
"TriggerData",
"TriggerInfo");
133 std::map< int, int > mapChannelWF;
137 auto waveformHandle = evt.
getHandle< std::vector< raw::OpDetWaveform > >(itag1);
144 double firstWaveformTime = -9999;
146 for (
auto const& waveform : *waveformHandle)
148 if (firstWaveformTime < 0) firstWaveformTime = waveform.TimeStamp();
153 std::cout <<
"Event #" << evt.
id().
event() <<
", firstTime: " << firstWaveformTime <<
std::endl;
156 for (
auto const& waveform : *waveformHandle)
159 int channel = waveform.ChannelNumber();
162 double startTime = waveform.TimeStamp() - firstWaveformTime;
163 double endTime = double(waveform.size())/
fSampleFreq + startTime;
167 wf_inicio.emplace_back(firstWaveformTime);
169 wf_end.emplace_back(endTime);
170 wf_size.emplace_back(waveform.size());
177 std::stringstream histName;
178 histName <<
"event_" << evt.
id().
event()
179 <<
"_opchannel_" << channel
180 <<
"_waveform_" << mapChannelWF[
channel];
184 TH1D *waveformHist = tfs->make< TH1D >(histName.str().c_str(),
186 waveform.size(), startTime, endTime);
190 waveformHist->SetBinContent(
tick + 1, waveform[
tick]);
std::vector< double > wf_end
std::vector< double > wf_start
Handle< PROD > getHandle(SelectorBase const &) const
EDAnalyzer(fhicl::ParameterSet const &pset)
std::vector< int > canal_op
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
void analyze(art::Event const &)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
std::string fInstanceName
std::vector< double > wf_inicio
EventNumber_t event() const
std::vector< int > wf_size
OpDetDigiAnaDUNE(fhicl::ParameterSet const &)
virtual ~OpDetDigiAnaDUNE()
QTextStream & endl(QTextStream &s)