PandaRoot
PndSttSingleStraw.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 __PNDSTTSINGLESTRAW__
14 #define __PNDSTTSINGLESTRAW__
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 PndSttSingleStraw : public TNamed {
30 
31  // --------------------------------------------------------------------
32  public:
34  virtual ~PndSttSingleStraw(){};
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  // energy loss in GeV
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 window over threshold of the signal
133  Double_t TimnsToDiscm(Double_t time); // from time (ns) to radius in cm
134 
135  //-----------------------------------------------------------------------------
136  // utility methods
137 
138  void TDirCos(); // track director cosines
139  Double_t TrueDist(Double_t Point[]); // true distance wire-track
140  Double_t DiffLong(Double_t distcm); // longituinal diffusion in microns
141  Double_t DiffTran(Double_t distcm); // transverse diffusion in microns
142  void Polya(Double_t bpar); // Polya cumulative calculation
143  Double_t PolyaSamp(); // sampling from Polya distribution
144  Double_t RRise(Double_t gamma); // relativistic rise calculation
145  Int_t Cluster(); // cluster generation
146  Int_t Eject(); // primary electron generation
147  TVector3 WDistCalc(Double_t d); // distance electron-wire
148  Double_t Signal(Double_t t, Double_t t0); // signal functional form
149  Double_t STEloss(); // Landau energy loss
150  Double_t STUrban(); // Urban energy loss
151  Int_t TimeEle(); // arrivals times of all the electrons
152  Double_t DistEle(Double_t tns); // distance of all the electrons
153  //------------------------------------------------------------------------------
154 
155  private:
156  //-----------------------------------------------------------------
157 
158  // distance, number of electrons (with delta rays),
159  // distance from wire of the cluster
160  std::vector<Double_t> CDist, CDistC, CNele, CNeleT, TeleTime, AmplSig;
161  std::vector<Double_t> Pulse, PulseT;
162  std::vector<TVector3> WDist;
163 
164  // set constants
165  // masses in GeV, energies in GeV, cgs system
166 
167  // Input for the medium
168 
169  // Double_t PClus[20], CO2Clus[20], CumClus[21], CH4Clus[20];
170  Double_t CumClus[21], CH4Clus[20]; // shadows deleted
171 
172  Double_t Wi;
173  Double_t ArPerc, CO2Perc, CH4Perc; // volume percentages
174  Double_t ArWPerc, CO2WPerc, CH4WPerc; // weight percentages
175  Double_t pSTP; // pressure (STP reference)
176  Double_t Radius; // straw radius
177  Int_t Field; // flag for magnetic field --> if =1, magnetic field on
178  Double_t AAr; // Argon
179  Double_t ZAr; // Argon
180  Double_t RhoAr; // g/cm3 (1.78 mg/cm3)
181  Double_t NclAr; // clusters/cm
182 
183  Double_t EmedAr;
184  Double_t EminAr;
185  Double_t EmpAr;
186  Double_t CsiAr;
187  Double_t IAr; // ionization potential (188 eV)
188  Double_t WiAr; // energy to reate an ion pair in Argon
189  Double_t Ncl; // mean number of cluster in the mixture
190  Double_t Ecl; // electron per cluster
191  Double_t Lcl; // mean free path between clusters
192  Double_t Ntote; // mean total number of eletrons
193  Double_t GasGain; // gain of the gas
194  Double_t Cutoff; // limit the number of primry electrons
195  // CO2
196  Double_t EmedCO2;
197  Double_t EminCO2;
198  Double_t EmpCO2;
199  Double_t CsiCO2;
200  Double_t ACO2; // CO2 (39.948)
201  Double_t ZCO2; // CO2 (18)
202  Double_t RhoCO2; // g/cm3 CO2 (1.98 mg/cm3)
203  Double_t ICO2; // ionization potential (GeV) (188 eV)
204  Double_t WiCO2; // energy to create an ion pair
205  Double_t NclCO2; // clusters/cm
206 
207  // Methane CH4 ------------------------------------------------
208  Double_t EmedCH4;
209  Double_t EmpCH4;
210  Double_t CsiCH4;
211  Double_t EminCH4;
212  Double_t ACH4; // CO2 (39.948)
213  Double_t ZCH4; // CO2 (18)
214  Double_t RhoCH4; // g/cm3 CO2 (0.71 mg/cm3)
215  Double_t ICH4; // ionization potential (GeV) (188 eV)
216  Double_t WiCH4; // energy to create an ion pair
217  Double_t NclCH4; // clusters/cm
218 
219  Double_t RhoMixCO2;
220  Double_t RhoMixCH4;
221  //----------------------------------------------------------------------
222  // Input for the particle (Gev, energy loses in Kev
223 
224  Double_t PZeta; // charge
225  Double_t piMass; // particle mass (GeV)
226  Double_t PMass; // incident particle mass
227  Double_t PMom; // particle momentum (GeV)
228  Double_t Dx; // distance travelled in gas (cm)
229  Double_t eMass; // electron mass (GeV) (0.511 MeV)
230  Double_t prMass; // proton mass
231  Double_t Delta; // polarization Sternheimer parameter
232  Int_t CNumb; // current number of clusters
233 
234  // ------------------------------------------------------
235  // quantities for each track
236  // calculated in TInit
237 
238  Double_t PEn; // particle energy GeV
239  Double_t beta;
240  Double_t gamma;
241  Double_t Emed; // GeV
242  Double_t Emin; // GeV/cm (2.7 keV)
243  Double_t Csi;
244  Double_t Emax;
245  Double_t Emp; // most probable energy
246  Int_t NNClus; // number of clusters
247 
248  // ---------------------------------------------------------------------
249  // mathematical and statistical parameters
250 
251  Double_t PolyaCum[100], Xs[100];
252  Double_t Xin, Yin, Zin, Xout, Yout, Zout, Rpath;
253  Int_t NPolya;
254  Double_t Xmax;
255  Double_t bPolya;
256  Double_t Calpha, Cbeta, Cgamma;
257  Double_t NUrban; // total number of collision in the Urban model
258  Double_t SigUrb; // std dev of the Urban distribution (routine STUrban)
259  Double_t Eup; // upper limit of the Urban distribution (routine STUrban)
260  Double_t AvUrb; // average of the Urban distribution (routine STUrban)
261 
262  // --------------------------------------------------------------
263  // for the straws
264 
265  Double_t Wx1, Wy1, Wz1, Wx2, Wy2, Wz2; // wire coordinates
266  Double_t Wp, Wq, Wr; // director cosine of the wire
267  Double_t PulseMax;
268  Double_t PulseTime, PulseTime1;
269  Double_t Thresh1; // first threshold
270  Double_t Thresh2;
271  Double_t OffT; // time offset
272  Int_t Nchann; // number of channels for the straw signal
273 
274  // ----------------------------------------------------------------------
275  // dummy
276 
277  Double_t Out1, Out4;
278  Int_t Out2, Out3;
279 };
280 
281 #endif
ClassDef(PndSttSingleStraw, 1)
virtual ~PndSttSingleStraw()
Double_t GetTeleTime(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 GetPulse(Int_t k)
void PutPress(Double_t value)
Double_t GetCDist(Int_t k)
TVector3 WDistCalc(Double_t d)
Double_t TrueDist(Double_t Point[])
Double_t GetCNele(Int_t k)
Double_t FastPartToADC()
TVector3 GetWDist(Int_t k)
Double_t PolyaSamp()
Int_t StrawSignal(Int_t nsteps)
Double_t Signal(Double_t t, Double_t t0)
Double_t DiffLong(Double_t distcm)
void PutRadius(Double_t value)
Double_t DistEle(Double_t tns)
void PutPolya(Double_t par)
Double_t DiffTran(Double_t distcm)
Double_t TimnsToDiscm(Double_t time)
void TInit(Double_t Mass, Double_t Momentum, Double_t InOut[])
Double_t GetCNeleT(Int_t k)
Double_t GetPulseT(Int_t k)
void Polya(Double_t bpar)
Double_t PartToADC()
Double_t StrawCharge()
Double_t FastRec(Double_t TrueDcm, Int_t Flag)
void TConst(Double_t Radius, Double_t pSTP, Double_t ArP, Double_t CO2P)
Double_t STEloss()
Double_t RRise(Double_t gamma)
Double_t PartToTime(Double_t Mass, Double_t Momentum, Double_t InOut[])
void PutTrackXYZ(Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5, Double_t v6)
void PutRpath(Double_t value)
Double_t STUrban()