MarlinTPC  1.2.0
ADCPulse.h
1 #ifndef ADCPULSE_H_
2 #define ADCPULSE_H_
3 
4 #include <CLHEP/Random/RandGauss.h>
5 #include <CLHEP/Random/RandLandau.h>
6 
7 namespace marlintpc
8 {
9 
16 class ADCPulse
17 {
18 
19  public:
20 
21  ADCPulse(double frequencyMHz, int ADCMaxValue, int threshold);
22  virtual ~ADCPulse() {};
23  virtual double getEndTime() const;
24  virtual int getStartBin() const
25  {
26  return _startBin;
27  }
28  virtual int getChannelNumber() const ;
29  virtual int getModuleID() const ;
30  virtual void clear(int newChannelNumber, int modID = 0, int noiseSwitch = 0, double noiseLevel = 0.0, double noiseWidth = 0.0, double noiseCutoff = 4.0);
31  virtual void add(double startTime, int nElectrons) = 0;
32  virtual void setJitterValues(std::map<int, double> timeJitter);
34 
35  virtual const std::vector<float>& getRawDataVec() const;
36 
43  virtual std::list<EVENT::TrackerRawData*> getLCIORawData() const;
44 
45  protected:
46 
47  std::vector<float> _rawData;
48  double _frequencyGHz;
50  int _startBin;
52  int _moduleID;
54  float _ADCThreshold;
60 
61  bool _addNoise;
62  double _padNoise;
63 
64  bool _useJitter;
65  std::map<int, double> _timeJitter;
66 
67 };
68 
69 }
70 
71 
72 #endif /* ADCPULSE_H_ */
int _channelNumber
The channel in which the pulse is simulated.
Definition: ADCPulse.h:51
bool _useJitter
if clock jitter should be used
Definition: ADCPulse.h:64
virtual int getModuleID() const
Returns the module ID.
Definition: ADCPulse.cc:29
bool _addNoise
whether to add noise to the ADC signal or not
Definition: ADCPulse.h:61
std::vector< float > _rawData
The raw data of the pulse, still in floats to avoid rounding errors.
Definition: ADCPulse.h:47
virtual double getEndTime() const
Get the end time of the last bin in the pulse (in ns)
Definition: ADCPulse.cc:24
double _padNoise
Central value of the pedestal width used to add noise to the ADC spectrum.
Definition: ADCPulse.h:62
int _ADCMaxValue
The maximum of the dynamic range in ADC counts.
Definition: ADCPulse.h:49
virtual std::list< EVENT::TrackerRawData * > getLCIORawData() const
Returns a vector of TrackerRawData objects to be stored in an lcio file.
Definition: ADCPulse.cc:103
virtual void clear(int newChannelNumber, int modID=0, int noiseSwitch=0, double noiseLevel=0.0, double noiseWidth=0.0, double noiseCutoff=4.0)
Clear the data vector, set startBin to -1, set the new channel number, set random noise parameters...
Definition: ADCPulse.cc:39
A base class interface which holds the raw data of the pulse and represents the ADC and its shaping a...
Definition: ADCPulse.h:16
std::map< int, double > _timeJitter
clock jitter: map of zBin, jitter
Definition: ADCPulse.h:65
virtual const std::vector< float > & getRawDataVec() const
Provides access to the raw data of the pulse.
Definition: ADCPulse.cc:96
double _ADCChargeFactor
The factor to multiply the number of electron per bin to obtain.
Definition: ADCPulse.h:53
virtual void add(double startTime, int nElectrons)=0
Add signal from charge (nElectrons) arriving.
float _ADCThreshold
The threshold of the ADC (in ADC counts)
Definition: ADCPulse.h:59
int _startBin
The bin number of the first entry in the data vector.
Definition: ADCPulse.h:50
double _frequencyGHz
Readout frequency of the ADC in GHz.
Definition: ADCPulse.h:48
virtual int getStartBin() const
Definition: ADCPulse.h:24
virtual void setJitterValues(std::map< int, double > timeJitter)
clock jitter values for an event
Definition: ADCPulse.cc:87
virtual int getChannelNumber() const
Returns the channel number.
Definition: ADCPulse.cc:34