sbn::PMTFlashTriggerMaker::PMTFlashTriggerMaker |
( |
fhicl::ParameterSet const & |
p | ) |
|
|
explicit |
void sbn::PMTFlashTriggerMaker::produce |
( |
art::Event & |
e | ) |
|
|
override |
Definition at line 87 of file PMTFlashTriggerMaker_module.cc.
89 auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
e);
91 std::unique_ptr<std::vector<sbn::FlashTriggerPrimitive>> trigs(
new std::vector<sbn::FlashTriggerPrimitive>);
93 art::Handle<std::vector<raw::OpDetWaveform>> waveform_handle;
99 float offset = clock_data.TriggerTime();
104 if (waveform_handle.isValid()) {
105 const std::vector<raw::OpDetWaveform> &waveforms = *waveform_handle;
106 double tick_period = clock_data.OpticalClock().TickPeriod();
112 e.put(std::move(trigs));
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
art::InputTag fWaveformLabel
std::vector< sbn::FlashTriggerPrimitive > TriggerPrimitives(const std::vector< raw::OpDetWaveform > &waveforms, double tick_period, std::pair< double, double > &window, int thresh)
std::pair< double, double > fTriggerWindow
Definition at line 115 of file PMTFlashTriggerMaker_module.cc.
119 std::vector<sbn::FlashTriggerPrimitive> ret;
123 bool is_pmt =
fPDMapAlgPtr->pdType(wvf.ChannelNumber()) ==
"pmt";
125 if (!is_pmt)
continue;
128 double waveform_start = wvf.TimeStamp();
129 int waveform_index_start = std::max((
int)((window.first - waveform_start) /
tick_period), 0);
130 int waveform_index_end = std::min((
int)((window.second - waveform_start) /
tick_period), (
int) wvf.size());
132 if (waveform_index_start < waveform_index_end) {
134 prim.
channel = wvf.ChannelNumber();
135 for (
int i = waveform_index_start; i < waveform_index_end; i++) {
136 if (wvf[i] <= thresh) {
137 FlashTriggerPrimitive::Trig this_trig {wvf[i], i + (int)((waveform_start - window.first) /
tick_period)};
std::vector< Trig > triggers
std::unique_ptr< opdet::PDMapAlg > fPDMapAlgPtr
std::string sbn::PMTFlashTriggerMaker::fExperiment |
|
private |
bool sbn::PMTFlashTriggerMaker::fOffsetTriggerTime |
|
private |
int sbn::PMTFlashTriggerMaker::fTriggerThreshold |
|
private |
std::pair<double, double> sbn::PMTFlashTriggerMaker::fTriggerWindow |
|
private |
art::InputTag sbn::PMTFlashTriggerMaker::fWaveformLabel |
|
private |
The documentation for this class was generated from the following file: