simple-tof-analysis
 All Classes Namespaces Functions Variables Groups Pages
TSParticleFld.h
1 /*
2  * TSParticleFld.h
3  *
4  * Created on: Aug 27, 2014
5  * Author: Silvestro di Luise
6  * Silvestro.Di.Luise@cern.ch
7  *
8  *
9  * Mass default is [GeV]
10  *
11  * Lengths in [m]
12  *
13  * Times in [s]
14  *
15  * The option SetUnitMeV will change only the
16  * mass values and labels, not the computation of
17  * the decay len etc where it is assumed that
18  * momentum and mass are in GeV
19  *
20  */
21 
22 #ifndef TSPARTICLEFLD_H_
23 #define TSPARTICLEFLD_H_
24 
25 
26 #include <TString.h>
27 #include <TRandom.h>
28 
29 #include "StringUtils.h"
30 #include "TSArgList.h"
31 
32 #include "TSNamed.h"
33 
34 /*
35  *
36  */
37 
38 class TSParticle: public TSNamed{
39 
40  public:
41  TSParticle(TString name,TString label,double mass, double charge, double tau=0);
42 
43  void Init();
44 
45  int Q() const {return fQ;}
46 
47  double M() const {return fM;}//default unit
48  double M2() const {return fM2;}//default unit
49 
50  double MMeV() {return fMMeV;}
51  double M2MeV() {return fM2MeV;}
52 
53  double MGeV() const {return fMGeV;}
54  double M2GeV() const {return fM2GeV;}
55 
56  TString LabelQ() const {return lQ;}//q=-2
57  TString LabelQSign() const {return lQsign;}//q<0
58 
59  TString LabelMassUnits() const { return unitMass;}
60  TString LabelMass2Units() const { return unitMass2;}
61 
62  TString LabelMass() const {return lM;}//m=... default unit
63  TString LabelMass2() const {return lM2;}//m=... default unit
64 
65  TString LabelMassMeV() const {return lMGeV;}//m= ... GeV/c2
66  TString LabelMassGeV() const {return lMMeV;}//m= ... MeV/c2
67 
68  TString LabelMass2MeV() const {return lM2GeV;}//m = ... GeV^2/c4
69  TString LabelMass2GeV() const {return lM2MeV;}//m^2 = ... MeV^2/c4
70 
71  bool IsUnitMeV() const {return unitIsMeV;}
72  bool IsUnitGeV() const {return unitIsGeV;}
73 
74  void Print() const;
75 
76  double ScaleToGeV() const {return gev;}
77  double ScaleToMeV() const {return mev;}
78 
79  void SetCharge(int);
80  void SetMass(double);
81  void SetTau(double);//s
82  double GetBeta(double P) const;
83  double GetGamma(double P) const;
84  double GetBetaGamma(double) const;
85  double GetE(double P) const; //GeV
86  double GetTau() const;//s
87  double GetCTau() const;//m
88  double GetDecayTime(double P) const; //s
89  double GetDecayLength(double P) const;//P in GeV, Len in m
90  double GetToF(double P) const;//in s
91  double GenerateDecayLength(double P);//GeV, m
92 
93  void SetUnitMeV();
94  void SetUnitGeV();
95 
96  static TString GetReactionForm(const TSArgList &initial,TString,const TSArgList &final);
97 
98  static double MassP;
99  static double MassN;
100  static double MassDe;
101  static double MassPiPlus;
102  static double MassPiMinus;
103  static double MassPi0;
104  static double MassKPlus;
105  static double MassKMinus;
106  static double MassK0;
107  static double MassK0S;
108  static double MassK0L;
109  static double MassEle;
110  static double MassPosit;
111  static double MassMuPlus;
112  static double MassMuMinus;
113 
114 
115  static double TauP;
116  static double TauN;
117  static double TauDe;
118  static double TauPiPlus;
119  static double TauPiMinus;
120  static double TauPi0;
121  static double TauKPlus;
122  static double TauKMinus;
123  static double TauK0;
124  static double TauK0S;
125  static double TauK0L;
126  static double TauEle;
127  static double TauPosit;
128  static double TauMuPlus;
129  static double TauMuMinus;
130 
131 
132 
133  static int PDGP;
134  static int PDGN;
135  static int PDGDe;
136  static int PDGPiPlus;
137  static int PDGPiMinus;
138  static int PDGPi0;
139  static int PDGKPlus;
140  static int PDGKMinus;
141  static int PDGK0;
142  static int PDGK0S;
143  static int PDGK0L;
144  static int PDGEle;
145  static int PDGPosit;
146  static int PDGMuPlus;
147  static int PDGMuMinus;
148 
149  static int IdP;
150  static int IdN;
151  static int IdDe;
152  static int IdPiPlus;
153  static int IdPiMinus;
154  static int IdPi0;
155  static int IdKPlus;
156  static int IdKMinus;
157  static int IdK0;
158  static int IdK0S;
159  static int IdK0L;
160  static int IdEle;
161  static int IdPosit;
162  static int IdMuPlus;
163  static int IdMuMinus;
164 
165  private:
166 
167  //
168  //values
169  //
170  int fQ;
171  double fM;
172  double fM2;
173  double fMMeV;
174  double fM2MeV;
175  double fMGeV;
176  double fM2GeV;
177 
178  double fTau;
179 
180 
181  //
182  // Utility Labels String
183  //
184  TString lM; // default
185  TString lM2; // default
186  TString lMGeV; // m= ... GeV/c2
187  TString lMMeV; // m= ... MeV/c2
188  TString lM2GeV; // m = ... GeV^2/c4
189  TString lM2MeV; // m = ... MeV^2/c4
190 
191  TString lQ; //q=-2
192  TString lQsign; //q<0
193 
194 
195  //
196 
197  double mev;
198  double gev;
199 
200  bool unitIsMeV;
201  bool unitIsGeV;
202 
203  TString lMname;
204  TString lM2name;
205  TString unitM;
206  TString unitM2;
207  TString unitMass;
208  TString unitMass2;
209  TString unitMeV;
210  TString unitGeV;
211  TString unitMeV2;
212  TString unitGeV2;
213  TString unitMassMeV;
214  TString unitMass2MeV;
215  TString unitMassGeV;
216  TString unitMass2GeV;
217 
218 
219  TString lQname;
220  TString lQpos;
221  TString lQneg;
222  TString lQzero;
223 
224  TRandom rand;
225 
226 
227 };
228 
229 
230 
231 
233 
234 
235 public:
236  TSParticleFld();
237  virtual ~TSParticleFld();
238 };
239 
240 #endif /* TSPARTICLEFLD_H_ */
Definition: TSArgList.h:30
Definition: TSParticleFld.h:232
double GenerateDecayLength(double P)
Definition: TSParticleFld.cc:195
Definition: TSNamed.h:38
Definition: TSParticleFld.h:38