StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrsDeDx.hh
1 /*****************************************************************
2  *
3  * $Id: StTrsDeDx.hh,v 1.8 2012/06/11 15:04:55 fisyak Exp $
4  *
5  * Author: brian Nov 20, 1997
6  *
7  *****************************************************************
8  * Description: calculates dE/dx using a given parmeterization
9  * based on CERN/NA49 work. Cross checks in
10  * progress with GEANT, system test and P10 data
11  * He/C3H8 parameterization coming soon...
12  *
13  *****************************************************************
14  *
15  * $Log: StTrsDeDx.hh,v $
16  * Revision 1.8 2012/06/11 15:04:55 fisyak
17  * std namespace
18  *
19  * Revision 1.7 2000/01/10 23:11:31 lasiuk
20  * Include MACROS for compatibility with SUN CC5.0
21  *
22  * Revision 1.6 1999/10/21 23:52:27 calderon
23  * Added new constructor with char*
24  * instead of string so Solaris doesn't complain.
25  * Code is otherwise unaffected.
26  *
27  * Revision 1.5 1999/07/19 21:42:37 lasiuk
28  * - add tss bethe-bloche parameterization for P10. No saturation
29  * effects are included.
30  *
31  * Revision 1.4 1999/01/25 23:37:37 lasiuk
32  * sun string
33  *
34  * Revision 1.3 1999/01/23 18:47:22 fisyak
35  * Cleanup for SL98l
36  *
37  * Revision 1.2 1999/01/23 05:04:18 lasiuk
38  * provide a default constructor
39  *
40  * Revision 1.1 1998/11/10 17:12:09 fisyak
41  * Put Brian trs versin into StRoot
42  *
43  * Revision 1.9 1998/11/08 17:29:52 lasiuk
44  * allocators for SUN
45  *
46  * Revision 1.8 1998/11/02 22:48:13 lasiuk
47  * attachment coefficient as data member
48  *
49  * Revision 1.7 1998/11/01 17:37:35 lasiuk
50  * added diffusion coefficients (need them for transporter)
51  *
52  * Revision 1.6 1998/10/31 14:12:28 lasiuk
53  * add mMeanFreePath data member for nextInteraction member function;
54  * return energy in secondary member function;
55  * use SystemOfUnits in default padLength;
56  * name space considerations
57  *
58  * Revision 1.5 1998/10/22 14:56:16 lasiuk
59  * Incorporate 1/E^n distribution for primaries
60  *
61  * Revision 1.4 1998/10/22 00:23:21 lasiuk
62  * Oct 22
63  *
64  * Revision 1.3 1998/08/12 17:50:26 lasiuk
65  * incorporate units/update Bethe-Bloch
66  *
67  * Revision 1.2 1998/08/10 15:05:55 lasiuk
68  * random generators/engines static
69  *
70  * Revision 1.1 1998/06/04 23:32:20 lasiuk
71  * Initial Revision
72  *
73  ******************************************************************/
74 #ifndef ST_TRS_DEDX_HH
75 #define ST_TRS_DEDX_HH
76 
77 #include <string>
78 #include <vector>
79 
80 // SCL
81 #include "SystemOfUnits.h"
82 #ifndef ST_NO_NAMESPACES
83 using namespace units;
84 using std::string;
85 #endif
86 
87 #include "Randomize.h"
88 
89 class StTrsDeDx {
90 public:
91  enum StElectron{
92  primaries,
93  secondaries,
94  total,
95  numberOfElectrons};
96 
97 public:
98  StTrsDeDx(const string&, double = 1.95*centimeter);
99  StTrsDeDx(const char*, double = 1.95*centimeter);
100  ~StTrsDeDx();
101 
102  // access functions
103  double W() const;
104  double padLength() const;
105 
106  void setPadLength(double);
107 
108  double transverseDiffusionCoefficient() const;
109  double longitudinalDiffusionCoefficient() const;
110  double attachmentCoefficient() const;
111 
112  // member functions
113  double nextInteraction() const;
114  int primary(double bg=3) const;
115  int secondary(double*) const;
116  double betheBloch(double) const;
117  double betheBlochTSS(double,double,double) ;
118 
119 #ifndef ST_NO_TEMPLATE_DEF_ARGS
120  void electrons(vector<int>&, double bg=3) const;
121 #else
122  void electrons(vector<int, allocator<int> >&, double bg=3) const;
123 #endif
124 
125  // DIAGNOSTIC
126  void print(ostream& os = cout) const;
127 
128 protected:
129  StTrsDeDx(); // should be made private!! Do not use!!
130  void doInitialization();
131 
132 protected:
133  string mGas; // Label
134  double mPairs; // e-ion pairs per unit length
135  double mMeanFreePath; // mean free path (1/mPairs)
136  double mIonize; // ionization potential
137  double mW; // ave energy to produce e-ion pair
138  double mEndPoint; // Cut-off energy
139  double mExponent; // 1/E^n energy distribution of primaries
140  double mEReduced; // reduced Exponent (1-mExponent)
141  double mEE; // function of mIonize
142  double mDensity; // density of gas
143  double mZa; // Z/A for gas
144 
145  double mSigmaTransverse; // Transverse diffusion sigma
146  double mSigmaLongitudinal; // Longitudinal diffusion sigma
147  double mAttachment;
148 
149  double mPadLength; // Sample Length
150 
151  // Calculated Values
152  double mKonstant;
153  double mAlfat;
154 
155  static HepJamesRandom mEngine;
156  static RandFlat mFlatDistribution;
157  static RandPoisson mPoissonDistribution;
158  static RandExponential mExponentialDistribution;
159 };
160 
161 inline double StTrsDeDx::W() const {return mW;}
162 inline double StTrsDeDx::padLength() const {return mPadLength;}
163 inline double StTrsDeDx::transverseDiffusionCoefficient() const {return mSigmaTransverse;}
164 inline double StTrsDeDx::longitudinalDiffusionCoefficient() const {return mSigmaLongitudinal;}
165 inline double StTrsDeDx::attachmentCoefficient() const {return mAttachment;}
166 #endif