PandaRoot
PndOtSingleStraw.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
14 // PndOtSingleStraw header file
15 //
16 // Copied from PndFtsSingleStraw
17 //
18 // authors: Radoslaw Karabowicz, GSI, 2024
20 
21 #ifndef __PNDOTSINGLESTRAW__
22 #define __PNDOTSINGLESTRAW__
23 // from ROOT
24 #include <TH2.h>
25 #include <TMatrix.h>
26 #include <TMatrixD.h>
27 #include <TNamed.h>
28 #include <TVector3.h>
29 // standard
30 #include <vector>
31 
32 // ClassImp(TMatrixDBase)
33 // class TMatrixD;;
34 
35 class TH2F;
36 
37 class PndOtSingleStraw : public TNamed {
38 
39  // --------------------------------------------------------------------
40  public:
42  virtual ~PndOtSingleStraw(){};
44 
45  // Get methods
46 
47  Double_t GetCDist(Int_t k) { return CDist[k]; };
48  Double_t GetCNele(Int_t k) { return CNele[k]; };
49  Double_t GetCNeleT(Int_t k) { return CNeleT[k]; };
50  Double_t GetTeleTime(Int_t k) { return TeleTime[k]; };
51  Double_t GetPulse(Int_t k) { return Pulse[k]; };
52  Double_t GetPulseT(Int_t k) { return PulseT[k]; };
53  Double_t GetWi() { return Wi * 1.e-09; }; // in GeV
54  Double_t GetGasGain() { return GasGain; };
55  Double_t GetXmax() { return Xmax; };
56  Double_t GetDx() { return Dx; };
57  Double_t GetEmed() { return Emed; };
58  Double_t GetEmin() { return Emin; };
59  Double_t GetNcl() { return Ncl; };
60  Double_t GetCsi() { return Csi; };
61  Double_t GetDelta() { return Delta; };
62  Double_t GetEmax() { return Emax; };
63  Double_t GetIAr() { return IAr; };
64  Int_t GetNNClus() { return NNClus; };
65  Int_t GetNchann() { return Nchann; };
66  Double_t GetPulseMax() { return PulseMax; };
67  Double_t GetGamma() { return gamma; };
68  Double_t GetBeta() { return beta; };
69  Double_t GetpSTP() { return pSTP; };
70  Double_t GetPulseTime() { return PulseTime; };
71  Double_t GetbPolya() { return bPolya; };
72  Double_t GetSigUrb() { return SigUrb; };
73  Double_t GetNUrban() { return NUrban; };
74  Double_t GetEup() { return Eup; };
75  Double_t GetAvUrb() { return AvUrb; };
76 
77  // coordinates
78  Double_t GetXin() { return Xin; };
79  Double_t GetYin() { return Yin; };
80  Double_t GetZin() { return Zin; };
81  Double_t GetXout() { return Xout; };
82  Double_t GetYout() { return Yout; };
83  Double_t GetZout() { return Zout; };
84  Double_t GetRpath() { return Rpath; };
85 
86  TVector3 GetWDist(Int_t k) { return WDist[k]; };
87 
88  // put methods
89  void PutTrackXYZ(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5, Double_t v6)
90  {
91  Xin = v1;
92  Yin = v2;
93  Zin = v3;
94  Xout = v4;
95  Yout = v5;
96  Zout = v6;
97  };
98  void PutRpath(Double_t value) { Rpath = value; };
99 
100  void PutPolya(Double_t par) { bPolya = par; };
101 
102  void PutRadius(Double_t value) { Radius = value; };
103  void PutPress(Double_t value) { pSTP = value; };
104 
105  // ----------------------------------------------------------------------------
106  // calls at each track for MC applications
107 
108  // define the wire
109  void PutWireXYZ(Double_t w1, Double_t w2, Double_t w3, Double_t w4, Double_t w5, Double_t w6);
110  // straw time
111  Double_t PartToTime(Double_t Mass, Double_t Momentum, Double_t InOut[]);
112  // ADC signal corresponding to the energy loss of StrawCharge
113  Double_t PartToADC();
114 
115  // fast reconstructed distance in cm
116  Double_t FastRec(Double_t TrueDcm, Int_t Flag);
117 
118  // ADC signal charge fast simulation
119  Double_t FastPartToADC();
120 
121  // ----------------------------------------------------------------------------
122  // standard calls
123 
124  // once to set constants
125 
126  void TConst(Double_t Radius, Double_t pSTP, Double_t ArP, Double_t CO2P);
127 
128  // to define the track
129  void TInit(Double_t Mass, Double_t Momentum, Double_t InOut[]); // for each track
130 
131  // other possible calls
132 
133  Double_t StrawCharge(); // total discharge electron calculation
134 
135  Int_t StrawSignal(Int_t nsteps); // oscilloscope signal generation (ns)
136  // Pulse[PulseT] in ns
137  // return number of primary electrons
138  Int_t StrawTime(); // output time of the straw (ns) &
139  // PulseTime[Int_t] in ns
140  // Int_t StrawTot(); // Time over threshold time of the straw (ns) not implemented
141 
142  Double_t TimnsToDiscm(Double_t time); // from time (ns) to radius in cm
143 
144  //-----------------------------------------------------------------------------
145  // utility methods
146 
147  void TDirCos(); // track director cosines
148  Double_t TrueDist(Double_t Point[]); // true distance wire-track
149  Double_t DiffLong(Double_t distcm); // longituinal diffusion in microns
150  Double_t DiffTran(Double_t distcm); // transverse diffusion in microns
151  void Polya(Double_t bpar); // Polya cumulative calculation
152  Double_t PolyaSamp(); // sampling from Polya distribution
153  Double_t RRise(Double_t gamma); // relativistic rise calculation
154  Int_t Cluster(); // cluster generation
155  Int_t Eject(); // primary electron generation
156  TVector3 WDistCalc(Double_t d); // distance electron-wire
157  Double_t Signal(Double_t t, Double_t t0); // signal functional form
158  Double_t STEloss(); // Landau energy loss
159  Double_t STUrban(); // Urban energy loss
160  Int_t TimeEle(); // arrivals times of all the electrons
161  Double_t DistEle(Double_t tns); // distance of all the electrons
162 
163  //------------------------------------------------------------------------------
164 
165  private:
166  //-----------------------------------------------------------------
167 
168  // distance, number of electrons (with delta rays),
169  // distance from wire of the cluster
170  std::vector<Double_t> CDist, CDistC, CNele, CNeleT, TeleTime, AmplSig;
171  std::vector<Double_t> Pulse, PulseT;
172  std::vector<TVector3> WDist;
173 
174  // set constants
175  // masses in GeV, energies in GeV, cgs system
176 
177  // Input for the medium
178 
179  // Double_t PClus[20], CO2Clus[20], CumClus[21], CH4Clus[20];
180  Double_t CumClus[21], CH4Clus[20]; // shadows deleted
181 
182  Double_t Wi;
183  Double_t ArPerc, CO2Perc, CH4Perc; // volume percentages
184  Double_t ArWPerc, CO2WPerc, CH4WPerc; // weight percentages
185  Double_t pSTP; // pressure (STP reference)
186  Double_t Radius; // straw radius
187  Double_t AAr; // Argon
188  Double_t ZAr; // Argon
189  Double_t RhoAr; // g/cm3 (1.78 mg/cm3)
190  Double_t NclAr; // clusters/cm
191 
192  Double_t EmedAr;
193  Double_t EminAr;
194  Double_t EmpAr;
195  Double_t CsiAr;
196  Double_t IAr; // ionization potential (188 eV)
197  Double_t WiAr; // energy to reate an ion pair in Argon
198  Double_t Ncl; // mean number of cluster in the mixture
199  Double_t Ecl; // electron per cluster
200  Double_t Lcl; // mean free path between clusters
201  Double_t Ntote; // mean total number of eletrons
202  Double_t GasGain; // gain of the gas
203  Double_t Cutoff; // limit the number of primry electrons
204  // CO2
205  Double_t EmedCO2;
206  Double_t EminCO2;
207  Double_t EmpCO2;
208  Double_t CsiCO2;
209  Double_t ACO2; // CO2 (39.948)
210  Double_t ZCO2; // CO2 (18)
211  Double_t RhoCO2; // g/cm3 CO2 (1.98 mg/cm3)
212  Double_t ICO2; // ionization potential (GeV) (188 eV)
213  Double_t WiCO2; // energy to create an ion pair
214  Double_t NclCO2; // clusters/cm
215 
216  // Methane CH4 ------------------------------------------------
217  Double_t EmedCH4;
218  Double_t EmpCH4;
219  Double_t CsiCH4;
220  Double_t EminCH4;
221  Double_t ACH4; // CO2 (39.948)
222  Double_t ZCH4; // CO2 (18)
223  Double_t RhoCH4; // g/cm3 CO2 (0.71 mg/cm3)
224  Double_t ICH4; // ionization potential (GeV) (188 eV)
225  Double_t WiCH4; // energy to create an ion pair
226  Double_t NclCH4; // clusters/cm
227 
228  Double_t RhoMixCO2;
229  Double_t RhoMixCH4;
230  //----------------------------------------------------------------------
231  // Input for the particle (Gev, energy loses in Kev
232 
233  Double_t PZeta; // charge
234  Double_t piMass; // particle mass (GeV)
235  Double_t PMass; // incident particle mass
236  Double_t PMom; // particle momentum (GeV)
237  Double_t Dx; // distance travelled in gas (cm)
238  Double_t eMass; // electron mass (GeV) (0.511 MeV)
239  Double_t prMass; // proton mass
240  Double_t Delta; // polarization Sternheimer parameter
241  Int_t CNumb; // current number of clusters
242 
243  // ------------------------------------------------------
244  // quantities for each track
245  // calculated in TInit
246 
247  Double_t PEn; // particle energy GeV
248  Double_t beta;
249  Double_t gamma;
250  Double_t Emed; // GeV
251  Double_t Emin; // GeV/cm (2.7 keV)
252  Double_t Csi;
253  Double_t Emax;
254  Double_t Emp; // most probable energy
255  Int_t NNClus; // number of clusters
256 
257  // ---------------------------------------------------------------------
258  // mathematical and statistical parameters
259 
260  Double_t PolyaCum[100], Xs[100];
261  Double_t Xin, Yin, Zin, Xout, Yout, Zout, Rpath;
262  Int_t NPolya;
263  Double_t Xmax;
264  Double_t bPolya;
265  Double_t Calpha, Cbeta, Cgamma;
266  Double_t NUrban; // total number of collision in the Urban model
267  Double_t SigUrb; // std dev of the Urban distribution (routine STUrban)
268  Double_t Eup; // upper limit of the Urban distribution (routine STUrban)
269  Double_t AvUrb; // average of the Urban distribution (routine STUrban)
270 
271  // --------------------------------------------------------------
272  // for the straws
273 
274  Double_t Wx1, Wy1, Wz1, Wx2, Wy2, Wz2; // wire coordinates
275  Double_t Wp, Wq, Wr; // director cosine of the wire
276  Double_t PulseMax;
277  Double_t PulseTime;
278  Double_t Thresh1; // first threshold
279  Double_t Thresh2;
280  Int_t Nchann; // number of channels for the straw signal
281 
282  // ----------------------------------------------------------------------
283  // dummy
284 
285  Double_t Out1;
286  Int_t Out2, Out3;
287 };
288 
289 #endif
Double_t DistEle(Double_t tns)
void PutPolya(Double_t par)
Double_t DiffTran(Double_t distcm)
void PutPress(Double_t value)
Double_t DiffLong(Double_t distcm)
Double_t TrueDist(Double_t Point[])
Double_t FastPartToADC()
Double_t Signal(Double_t t, Double_t t0)
Int_t StrawSignal(Int_t nsteps)
Double_t GetPulseMax()
Double_t GetCDist(Int_t k)
void PutTrackXYZ(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5, Double_t v6)
Double_t FastRec(Double_t TrueDcm, Int_t Flag)
Double_t GetTeleTime(Int_t k)
Double_t GetGasGain()
void TInit(Double_t Mass, Double_t Momentum, Double_t InOut[])
Double_t GetSigUrb()
virtual ~PndOtSingleStraw()
ClassDef(PndOtSingleStraw, 1)
void PutRadius(Double_t value)
void TConst(Double_t Radius, Double_t pSTP, Double_t ArP, Double_t CO2P)
Double_t GetbPolya()
Double_t StrawCharge()
Double_t GetCNeleT(Int_t k)
Double_t PolyaSamp()
Double_t PartToADC()
Double_t GetNUrban()
Double_t GetCNele(Int_t k)
Double_t GetPulseTime()
void PutRpath(Double_t value)
TVector3 GetWDist(Int_t k)
void Polya(Double_t bpar)
TVector3 WDistCalc(Double_t d)
Double_t RRise(Double_t gamma)
Double_t GetPulseT(Int_t k)
Double_t GetPulse(Int_t k)
Double_t STEloss()
void PutWireXYZ(Double_t w1, Double_t w2, Double_t w3, Double_t w4, Double_t w5, Double_t w6)
Double_t PartToTime(Double_t Mass, Double_t Momentum, Double_t InOut[])
Double_t STUrban()
Double_t TimnsToDiscm(Double_t time)