Deprecated/RdStationSignalReconstructorLegacy/RdStationSignalReconstructor.h
Go to the documentation of this file.
1 #ifndef _RdStationSignalReconstructor_h_
2 #define _RdStationSignalReconstructor_h_
3 
4 #include <fwk/VModule.h>
5 
6 #include <revt/Station.h>
7 #include <revt/Channel.h>
8 
9 #include <utl/AugerUnits.h>
10 #include <utl/PhysicalConstants.h>
11 
12 #include <string>
13 #include <vector>
14 
15 #include "Minuit2/MnUserParameters.h"
16 #include "Minuit2/MnUserParameterState.h"
17 #include <Minuit2/FCNBase.h>
18 
19 
20 namespace evt {
21  class Event;
22 }
23 
24 namespace revt {
25  class Channel;
26 }
27 
29 
42 
43  public:
45 
49 
50  private:
51  unsigned int fVectorialComponent = 0;
52  bool fUseEnvelope = false;
54 
55  std::string fNoiseSubtraction = "Undefined";
56  std::string fSignalDef = "Undefined";
57  std::string fNoiseDef = "Undefined";
58  std::string fSignalToNoiseDef = "Undefined";
59  std::string fPolarizationDef = "Undefined";
60 
61  bool fAddNoiseToUncertainty = false;
62 
63  double fMinSignal = 0;
64  double fMinSignalToNoise = 0;
69 
70  bool fSelfTriggeredSNcut = true;
71  bool fAdjustSignalAmplitude = false;
72 
73  unsigned int fTotalNumberOfEvents = 0;
80 
81  int fInfoLevel = 0;
83 
84  // calculates Mean and RMS in selected noise window
85  void Noisefinder(const revt::ChannelTimeSeries& channeltrace,
86  double& RMSNoise, double& MeanNoise, double NoiseWindowStart, double NoiseWindowStop) const;
87 
88  // calculates the amplitude and the position of the maximum in the signal search window
89  void Pulsefinder(const revt::ChannelTimeSeries& channeltrace,
90  double& PeakAmplitude, double& PeakTime, double& PeakTimeError,
91  double SignalSearchWindowStart, double SignalSearchWindowStop, unsigned int& sample) const;
92 
93  // calculates the FWHM and the integral of the signal in the FWHM
94  void PulseFWHMIntegrator(const revt::ChannelTimeSeries& channeltrace,
95  unsigned int sample, const double PeakAmplitude, double& SignalFWHM, double& IntegratedSignal,
96  double& SignalWindowStart, double& SignalWindowStop) const;
97 
98  // calculates the integrated signal in a fixed window
99  void PulseFixedWindowIntegrator(const revt::ChannelTimeSeries& channeltrace,
100  unsigned int sample, double IntegrationTime, double& IntegratedSignal,
101  double& SignalWindowStart, double& SignalWindowStop, const bool usePower) const;
102 
103  void PulseSlidingWindowIntegrator(const revt::ChannelTimeSeries& channeltrace,
104  double IntegrationTime, double& IntegratedSignal,
105  double& SignalWindowStart, double& SignalWindowStop,
106  double SignalSearchWindowStart, double SignalSearchWindowStop) const;
107 
108  /* the formula is documented in GAP 2013-059
109  * the input is the SNR defined as the maximum of the Hilbert envelope squared divided by the RMS of the Hilbert envelope squared
110  */
111  double GetSignalUncertainty(const double signalAmplitude, const double SNR) const;
112 
113  /* the formula is documented in PhD thesis of C. Glaser (RWTH Aachen University 2016)
114  * the input is the SNR defined as the maximum of the Hilbert envelope squared divided by the RMS of the Hilbert envelope squared
115  */
116  double GetSignalTimeUncertainty(const double SNR) const;
117 
119  double GetAdjustedSignalAmplitude(const double signalAmpitude, const double SNR) const;
120 
121  ROOT::Minuit2::MnUserParameterState FitAnalyticSignal(utl::Trace<double>& trace,
122  const double noiseRMS,
123  revt::Station& /*station*/,
124  const int /*polarization*/,
125  const bool fixPhaseSlope,
126  const double phaseSlope);
127 
128  REGISTER_MODULE("RdStationSignalReconstructor", RdStationSignalReconstructor);
129 
130  };
131 
132 
133  class SignalObjectiveFunction : public ROOT::Minuit2::FCNBase {
134 
135  public:
136  SignalObjectiveFunction(utl::Trace<double> trace, const double noiseRMS) :
137  fTrace(trace),
138  fSigma(noiseRMS)
139  { }
140 
141  double operator()(const std::vector<double>& pars) const;
142 
143  double Up() const { return fTheErrorDef; }
144 
145  void SetErrorDef(const double def) { fTheErrorDef = def; }
146 
147  private:
149  double fSigma;
150  double fTheErrorDef = 1;
151 
152  };
153 
154 }
155 
156 
157 #endif
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
void PulseSlidingWindowIntegrator(const revt::ChannelTimeSeries &channeltrace, double IntegrationTime, double &IntegratedSignal, double &SignalWindowStart, double &SignalWindowStop, double SignalSearchWindowStart, double SignalSearchWindowStop) const
void PulseFixedWindowIntegrator(const revt::ChannelTimeSeries &channeltrace, unsigned int sample, double IntegrationTime, double &IntegratedSignal, double &SignalWindowStart, double &SignalWindowStop, const bool usePower) const
REGISTER_MODULE("RdStationSignalReconstructor", RdStationSignalReconstructor)
void PulseFWHMIntegrator(const revt::ChannelTimeSeries &channeltrace, unsigned int sample, const double PeakAmplitude, double &SignalFWHM, double &IntegratedSignal, double &SignalWindowStart, double &SignalWindowStop) const
class to hold data at the radio Station level.
void Noisefinder(const revt::ChannelTimeSeries &channeltrace, double &RMSNoise, double &MeanNoise, double NoiseWindowStart, double NoiseWindowStop) const
void Pulsefinder(const revt::ChannelTimeSeries &channeltrace, double &PeakAmplitude, double &PeakTime, double &PeakTimeError, double SignalSearchWindowStart, double SignalSearchWindowStop, unsigned int &sample) const
Module interface.
Definition: VModule.h:53
PulseFinder searches for maximum in the trace. Choose vectorial component in the xml file...
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
ROOT::Minuit2::MnUserParameterState FitAnalyticSignal(utl::Trace< double > &trace, const double noiseRMS, revt::Station &, const int, const bool fixPhaseSlope, const double phaseSlope)
double GetAdjustedSignalAmplitude(const double signalAmpitude, const double SNR) const
the formula is documented in GAP 2013-059

, generated on Tue Sep 26 2023.