RdStationSignalReconstructorWithBgSubtraction.h
Go to the documentation of this file.
1 #ifndef _RdStationSignalReconstructorWithBgSubtraction_RdStationSignalReconstructorWithBgSubtraction_h_
2 #define _RdStationSignalReconstructorWithBgSubtraction_RdStationSignalReconstructorWithBgSubtraction_h_
3 
4 #include <fwk/VModule.h>
5 #include <revt/Station.h>
6 #include <revt/Channel.h>
7 #include <string>
8 #include <vector>
9 
10 #include "Minuit2/MnUserParameters.h"
11 #include "Minuit2/MnUserParameterState.h"
12 #include <Minuit2/FCNBase.h>
13 #include <TF1.h>
14 
15 
16 namespace utl {
17  class AnalyticWindow;
18 }
19 
20 namespace evt {
21  class Event;
22 }
23 
24 namespace revt {
25  class Channel;
26 }
27 
28 
30 
43 
44  public:
47 
51 
52  private:
53  // calculates Mean and RMS in selected noise window
54  void Noisefinder(const revt::ChannelTimeSeries& channeltrace,
55  double& RMSNoise, double& MeanNoise, double NoiseWindowStart, double NoiseWindowStop) const;
56 
57  // calculates the amplitude and the position of the maximum in the signal search window
58  void Pulsefinder(const revt::ChannelTimeSeries& channeltrace,
59  double& PeakAmplitude, double& PeakTime, double& PeakTimeError,
60  double SignalSearchWindowStart, double SignalSearchWindowStop, unsigned int& sample) const;
61 
62  // calculates the FWHM and the integral of the signal in the FWHM
63  void PulseFWHMIntegrator(const revt::ChannelTimeSeries& channeltrace,unsigned int sample, double PeakAmplitude, double& SignalFWHM, double& IntegratedSignal, double& SignalWindowStart, double& SignalWindowStop) const;
64 
65  //void PulseFixedWindowIntegrator(const revt::ChannelTimeSeries& channeltrace, unsigned int sample, double IntegrationTime, double& IntegratedSignal, double& SignalWindowStart, double& SignalWindowStop, const bool usePower) const;
66 
67  // calculates the integrated signal in a fixed window
68  void EnergyFluenceIntegral(revt::ChannelFrequencySpectrum& channeltrace, const std::vector<double>& uncertainty, double& integratedSignal, double& energyFluenceUncertainty, const bool usePower) const;
69 
70  void CalculateTheBGAverage(revt::ChannelFFTDataContainer& Long_FFTDataContainer, unsigned int nWindows, int nBin, int ntimeBin, double* const sigmaB, double* const meanB) const;
71 
72  /* the formula is documented in GAP 2013-059
73  * the input is the SNR defined as the maximum of the Hilbert envelope squared divided by the RMS of the Hilbert envelope squared
74  */
75  double GetSignalUncertainty(const double signalAmplitude, const double snr) const;
76 
77  /* the formula is documented in PhD thesis of C. Glaser (RWTH Aachen University 2016)
78  * the input is the SNR defined as the maximum of the Hilbert envelope squared divided by the RMS of the Hilbert envelope squared
79  */
80  double GetSignalTimeUncertainty(const double snr) const;
81 
83  double GetAdjustedSignalAmplitude(const double signalAmpitude, const double snr) const;
84 
85  // xml settings
86  unsigned int fVectorialComponent = 0;
87  bool fUseEnvelope = false;
91 
92  double fMinSignal = 0;
93  double fMinSignalToNoise = 0;
99 
100  bool fSelfTriggeredSNcut = true;
102 
103  unsigned int fTotalNumberOfEvents = 0;
110 
111  int fInfoLevel = 0;
112 
113  // this factor converts the integral of the squared signal amplitudes into an energy fluence in units of [eV/m^2]
114  // a simple use of Offline's unit package is not possible in this case, because it is not just a change of units
115  // but the evaluation and integration of the Poynting vector (so a multiplication with c and mu_0
116  const double fConversionSignalToEnergyFluence = 2.65441729 * 1e-3 * 1.e-9 * 6.24150934 * 1e6;
118  TF1* f_sigmoind = nullptr;
119 
120  REGISTER_MODULE("RdStationSignalReconstructorWithBgSubtraction", RdStationSignalReconstructorWithBgSubtraction);
121 
122  };
123 
124 }
125 
126 
127 #endif
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
double GetAdjustedSignalAmplitude(const double signalAmpitude, const double snr) const
the formula is documented in GAP 2013-059
void PulseFWHMIntegrator(const revt::ChannelTimeSeries &channeltrace, unsigned int sample, double PeakAmplitude, double &SignalFWHM, double &IntegratedSignal, double &SignalWindowStart, double &SignalWindowStop) const
void CalculateTheBGAverage(revt::ChannelFFTDataContainer &Long_FFTDataContainer, unsigned int nWindows, int nBin, int ntimeBin, double *const sigmaB, double *const meanB) const
REGISTER_MODULE("RdStationSignalReconstructorWithBgSubtraction", RdStationSignalReconstructorWithBgSubtraction)
Station Signal reconstruction based on the GAP2019_076.
Module interface.
Definition: VModule.h:53
void Pulsefinder(const revt::ChannelTimeSeries &channeltrace, double &PeakAmplitude, double &PeakTime, double &PeakTimeError, double SignalSearchWindowStart, double SignalSearchWindowStop, unsigned int &sample) const
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Abstract base class for analytic windows.
void EnergyFluenceIntegral(revt::ChannelFrequencySpectrum &channeltrace, const std::vector< double > &uncertainty, double &integratedSignal, double &energyFluenceUncertainty, const bool usePower) const
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
void Noisefinder(const revt::ChannelTimeSeries &channeltrace, double &RMSNoise, double &MeanNoise, double NoiseWindowStart, double NoiseWindowStop) const

, generated on Tue Sep 26 2023.