ALERT
Loading...
Searching...
No Matches
ahdcSignal.h
1#ifndef AHDC_SIGNAL_H
2#define AHDC_SIGNAL_H
3
4
18 // MHit or wires identifiers
19 public :
20 int hitn;
21 int sector;
22 int layer;
24 int nsteps;
25 // vectors
26 private :
27 std::vector<double> Edep;
28 std::vector<double> G4Time;
29 std::vector<double> Doca;
30 std::vector<double> DriftTime;
31
41 void ComputeDocaAndTime(MHit * aHit);
42 std::vector<short> Dgtz;
43 std::vector<short> Noise;
44 // setting parameters for digitization
45 private :
46 const double tmin;
47 const double tmax;
48 const double timeOffset;
49 const double samplingTime;
50 const double Landau_width;
51 double electronYield = 9500;
52 static const int ADC_LIMIT = 4095;
53 // public methods
54 public :
56 ahdcSignal() = default;
57
59 ahdcSignal(MHit * aHit, int _hitn, double _tmin, double _tmax, double _timeOffset, double _samplingTime, double _Landau_width)
60 : tmin(_tmin), tmax(_tmax), timeOffset(_timeOffset), samplingTime(_samplingTime), Landau_width(_Landau_width) {
61 // read identifiers
62 hitn = _hitn;
63 vector<identifier> identity = aHit->GetId();
64 sector = 0;
65 layer = 10 * identity[0].id + identity[1].id ; // 10*superlayer + layer
66 component = identity[2].id;
67 // fill vectors
68 Edep = aHit->GetEdep();
69 nsteps = Edep.size();
70 for (int s=0;s<nsteps;s++){Edep.at(s) = Edep.at(s)*1000;} // convert MeV to keV
71 G4Time = aHit->GetTime();
72 this->ComputeDocaAndTime(aHit); // fills Doca and DriftTime
73 }
74
77
79 double GetElectronYield() {return electronYield;}
80
82 std::vector<double> GetEdep() {return Edep;}
83
85 std::vector<double> GetG4Time() {return G4Time;}
86
88 std::vector<double> GetDoca() {return Doca;}
89
91 std::vector<double> GetDriftTime() {return DriftTime;}
92
94 std::vector<short> GetNoise() {return Noise;}
95
97 std::vector<short> GetDgtz() {return Dgtz;}
98
104 void SetElectronYield(double electronYield_) {electronYield = electronYield_;}
105
113 double operator()(double timePoint){
114 using namespace Genfun;
115 double signalValue = 0;
116 for (int s=0; s<nsteps; s++){
117 // setting Landau's parameters
118 Landau L;
119 L.peak() = Parameter("Peak",DriftTime.at(s),tmin,tmax);
120 L.width() = Parameter("Width",Landau_width,0,400);
121 signalValue += Edep.at(s)*L(timePoint-timeOffset);
122 }
123 return signalValue;
124 }
125
136 void Digitize();
137
142 void GenerateNoise(double mean, double stdev);
143
144 double GetMCTime(); // tmp
145 double GetMCEtot(); // tmp
146
154 std::map<std::string,double> Extract(bool expression = true);
155
156 void PrintBeforeProcessing(bool expression = true); // e.g : this->PrintBeforeProcessing(this->nsteps > 10)
157 void PrintAllShapes(bool expression = true);
158 void PrintAfterProcessing(bool expression = true);
159 void PrintNoise(bool expression = true);
160 void PrintSignal(bool expression = true);
161};
162
163
164
165#endif
166
167
ahdc signal simulation
Definition ahdcSignal.h:17
void GenerateNoise(double mean, double stdev)
Generate gaussian noise.
int hitn
n-th MHit of the event, also corresponds to the n-th activated wire
Definition ahdcSignal.h:20
~ahdcSignal()
Destructor.
Definition ahdcSignal.h:76
std::vector< double > GetDriftTime()
Return the content of the attribut DriftTime
Definition ahdcSignal.h:91
double operator()(double timePoint)
Overloaded () operator to get the value of the signal at a given time.
Definition ahdcSignal.h:113
void Digitize()
Digitize the simulated signal.
std::map< std::string, double > Extract(bool expression=true)
Extract various informations from the digitized signal.
int layer
layer, second wire identifer
Definition ahdcSignal.h:22
std::vector< short > GetDgtz()
Return the content of the attribut Dgtz
Definition ahdcSignal.h:97
std::vector< double > GetG4Time()
Return the content of the attribut G4Time
Definition ahdcSignal.h:85
std::vector< double > GetEdep()
Return the content of the attribut Edep
Definition ahdcSignal.h:82
double GetElectronYield()
Return the value of the attribut electronYield
Definition ahdcSignal.h:79
int nsteps
number of steps in this MHit, i.e number of Geant4 calculation steps in the sensitive area of the wir...
Definition ahdcSignal.h:24
void SetElectronYield(double electronYield_)
Set the electron yield.
Definition ahdcSignal.h:104
ahdcSignal()=default
Default constructor.
std::vector< short > GetNoise()
Return the content of the attribut Noise
Definition ahdcSignal.h:94
int component
component, third wire identifier
Definition ahdcSignal.h:23
std::vector< double > GetDoca()
Return the content of the attribut Doca
Definition ahdcSignal.h:88
int sector
sector, first wire identifier
Definition ahdcSignal.h:21
ahdcSignal(MHit *aHit, int _hitn, double _tmin, double _tmax, double _timeOffset, double _samplingTime, double _Landau_width)
Constructor.
Definition ahdcSignal.h:59