RdChannelRiseTimeCalculator.h
Go to the documentation of this file.
1 #ifndef _RdChannelRiseTimeCalculator_h_
2 #define _RdChannelRiseTimeCalculator_h_
3 
4 #include <fwk/VModule.h>
5 #include <revt/Channel.h>
6 #include <vector>
7 
8 
9 namespace evt {
10  class Event;
11 }
12 
13 namespace revt {
14  class REvent;
15  class Channel;
16 }
17 
19 
28 
29  public:
32 
33  fwk::VModule::ResultFlag Init() override;
34  fwk::VModule::ResultFlag Run(evt::Event& event) override;
35  fwk::VModule::ResultFlag Finish() override { return eSuccess; }
36 
37  private:
38  unsigned int fRiseTimeWindow = 0;
39 
40  // calculates Mean and RMS in selected noise window
41  void Noisefinder(const revt::ChannelTimeSeries& channeltrace,
42  double& noiseRMS, const double noiseWindowStart, const double noiseWindowStop) const;
43 
44  // calculates the amplitude and the position of the maximum in the signal search window
45  void Pulsefinder(const revt::ChannelTimeSeries& channeltrace,
46  double& peakAmplitude, double& peakTime, double& peakTimeError,
47  const double signalSearchWindowStart, const double signalSearchWindowStop,
48  unsigned int& sample) const;
49 
50  // Construction of the cumulative function in the rise time window
51  void MakeCumulative(const revt::ChannelTimeSeries& channeltrace,
52  const unsigned int startRiseTimeWindow, const unsigned int stopRiseTimeWindow,
53  std::vector<double>& cumulative, double& cumulativeSum) const;
54 
55  // Rise time calculation
56  void GetRiseTime(const unsigned int startCumulative, const unsigned int stopCumulative,
57  std::vector<double>& normalizedCumulative, double &riseTime, const double samplingFrequency) const;
58 
59  REGISTER_MODULE("RdChannelRiseTimeCalculator", RdChannelRiseTimeCalculator);
60 
61  };
62 
63 }
64 
65 
66 #endif
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
void Pulsefinder(const revt::ChannelTimeSeries &channeltrace, double &peakAmplitude, double &peakTime, double &peakTimeError, const double signalSearchWindowStart, const double signalSearchWindowStop, unsigned int &sample) const
Report success to RunController.
Definition: VModule.h:62
void Noisefinder(const revt::ChannelTimeSeries &channeltrace, double &noiseRMS, const double noiseWindowStart, const double noiseWindowStop) const
Calculation of the rise time of the main pulse in a given time window.
void MakeCumulative(const revt::ChannelTimeSeries &channeltrace, const unsigned int startRiseTimeWindow, const unsigned int stopRiseTimeWindow, std::vector< double > &cumulative, double &cumulativeSum) const
REGISTER_MODULE("RdChannelRiseTimeCalculator", RdChannelRiseTimeCalculator)
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
Module interface.
Definition: VModule.h:53
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
void GetRiseTime(const unsigned int startCumulative, const unsigned int stopCumulative, std::vector< double > &normalizedCumulative, double &riseTime, const double samplingFrequency) const
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.

, generated on Tue Sep 26 2023.