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