er  dev
ERIonGenerator.h
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #ifndef ERIonGenerator_H
10 #define ERIonGenerator_H
11 
12 #include "Rtypes.h"
13 #include "TMath.h"
14 
15 #include "FairGenerator.h"
16 
17 class FairIon;
18 class FairPrimaryGenerator;
19 
29 class ERIonGenerator : public FairGenerator
30 {
31 
32  public:
33 
36 
44  ERIonGenerator(const Char_t* ionName, Int_t mult);
45 
56  ERIonGenerator(TString name, Int_t z, Int_t a, Int_t q, Int_t mult);
57 
59  virtual ~ERIonGenerator();
60 
66  void SetCharge(Int_t charge) {fQ=charge;}
67 
71  void SetExcitationEnergy(Double_t eExc);
72 
73  void SetPDGType (Int_t pdg) {fPDGType = pdg; };
74 
78  void SetMultiplicity (Int_t mult) {fMult = mult; };
79 
84  void SetPRange(Double32_t pmin = 0 , Double32_t pmax = 10)
85  {fPMin=pmin; fPMax=pmax; fPRangeIsSet=kTRUE;}
86 
91  void SetPtRange (Double32_t ptmin = 0 , Double32_t ptmax = 10)
92  {fPtMin=ptmin; fPtMax=ptmax; fPtRangeIsSet=kTRUE;};
93 
98  void SetPhiRange (Double32_t phimin = 0 , Double32_t phimax = 360)
99  {fPhiMin=phimin; fPhiMax=phimax;};
100 
105  void SetEtaRange (Double32_t etamin = -5 , Double32_t etamax = 7)
106  {fEtaMin=etamin; fEtaMax=etamax; fEtaRangeIsSet=kTRUE;};
107 
112  void SetYRange(Double32_t ymin = -5., Double32_t ymax = 7.)
113  { fYMin=ymin; fYMax=ymax; fYRangeIsSet=kTRUE; }
114 
119  void SetThetaRange(Double32_t thetamin = 0., Double32_t thetamax = 90.)
120  { fThetaMin=thetamin; fThetaMax=thetamax; fThetaRangeIsSet=kTRUE; }
121 
126  void SetThetaSigma(Double32_t theta = 0., Double32_t sigmaTheta = 1.)
127  {
128  fGausTheta = theta;
129  fSigmaTheta = sigmaTheta;
130  fSigmaThetaIsSet = kTRUE;
131  }
132 
137  void SetCosTheta ()
138  {fCosThetaIsSet=kTRUE;};
139 
146  void SetXYZ (Double32_t x = 0, Double32_t y = 0, Double32_t z = 0) {
147  fX=x;
148  fY=y;
149  fZ=z;
150  fPointVtxIsSet=kTRUE;
151  }
152 
159  void SetRoundXY (Double32_t rho = 0,
160  Double32_t centerX = 0,
161  Double32_t centerY = 0,
162  Double32_t centerZ = 0)
163  {
164  fRho = rho;
165  fCenterX = centerX;
166  fCenterY = centerY;
167  fZ = centerZ;
168  fRoundXYIsSet=kTRUE;
169  }
170 
180  void SetBoxXYZ (Double32_t x1=0, Double32_t y1=0, Double32_t x2=0, Double32_t y2=0, Double32_t z=0) {
181  fX1=x1;
182  fY1=y1;
183  fX2=x2;
184  fY2=y2;
185  fZ=z;
186  fBoxVtxIsSet=kTRUE;
187  }
188 
198  void SetSigmaXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0,
199  Double32_t sigmaX=1, Double32_t sigmaY=1)
200  {
201  fGausX = x;
202  fGausY = y;
203  fSigmaX = sigmaX;
204  fSigmaY = sigmaY;
205  fZ = z;
206  fBoxSigmaIsSet = kTRUE;
207  }
208 
213  void SetKinERange(Double32_t kinEMin, Double32_t kinEMax);
214 
219  void SetKinESigma(Double32_t kinE, Double32_t sigmaKinE);
220 
226 
232  void SetKinE(Double32_t kinE);
233 
238  void SetPSigmaOverP(Double32_t sigmaPOverP) { fSigmaP = sigmaPOverP*fGausP; fSigmaPIsSet = kTRUE;}
240 
245  void SetPSigma(Double32_t p = 0 , Double32_t sigma = 1)
246  {fGausP=p; fSigmaP=sigma; fSigmaPIsSet=kTRUE;}
247 
248  void SetDebug(Bool_t debug=0) {fDebug = debug;}
249 
255  void SpreadingOnTarget(void) {fSpreadingOnTarget = kTRUE;}
256 
261  FairIon* Ion() {return fIon;}
262 
263  public:
268  virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen);
269 
270 
271  protected:
274  void SpreadingParameters(void);
275 
276  protected:
277  Int_t fMult;
278  FairIon* fIon;
279  Int_t fQ;
280 
281  TString fName;
282  Int_t fPDGType;
283 
284  Double32_t fIonMass;
285  Double32_t fPtMin, fPtMax;
286  Double32_t fPhiMin, fPhiMax;
287  Double32_t fEtaMin, fEtaMax;
288  Double32_t fYMin, fYMax;
289  Double32_t fPMin, fPMax;
290  Double32_t fThetaMin, fThetaMax;
291  Double32_t fX, fY, fZ;
292  Double32_t fX1, fY1, fX2, fY2;
293  Double32_t fPx, fPy, fPz;
294  Double32_t fGausX, fGausY;
295  Double32_t fSigmaX, fSigmaY;
296  Double32_t fGausP;
297  Double32_t fSigmaP;
298  Double32_t fGausTheta;
299  Double32_t fSigmaTheta;
300  Double32_t fKinE;
301  Double32_t fRho, fCenterX, fCenterY;
302 
303  Bool_t fEtaRangeIsSet;
304  Bool_t fYRangeIsSet;
306  Bool_t fCosThetaIsSet;
307  Bool_t fPtRangeIsSet;
308  Bool_t fPRangeIsSet;
309  Bool_t fPointVtxIsSet;
310  Bool_t fBoxVtxIsSet;
311  Bool_t fBoxSigmaIsSet;
312  Bool_t fSigmaPIsSet;
313  Bool_t fDebug;
316  Bool_t fRoundXYIsSet;
317 
318  private:
320  ERIonGenerator& operator=(const ERIonGenerator&);
321 
322  ClassDef(ERIonGenerator,1);
323 };
324 
325 #endif // ERIonGenerator_H
326 
Bool_t fRoundXYIsSet
True if spot spreading of the start position in XY-plane is setted.
Double32_t fPhiMax
Azimuth angle range [degree].
Double32_t fGausTheta
Amplitude value of theta angle in Gauss distibution [degree].
void SetThetaRange(Double32_t thetamin=0., Double32_t thetamax=90.)
Defines uniform distribution boundaries of ion polar angle in lab system [degree].
Bool_t fPtRangeIsSet
True if transverse momentum range is set.
Double32_t fGausP
Amplitude value of momentum in Gauss distibution [GeV].
Double32_t fYMax
Rapidity range in lab system.
Bool_t fYRangeIsSet
True if rapidity range is set.
Double32_t fThetaMax
Polar angle range in lab system [degree].
void SetKinERange(Double32_t kinEMin, Double32_t kinEMax)
Defines uniform distribution boundaries of ion kinetic energy [GeV].
Bool_t fEtaRangeIsSet
True if eta range is set.
Bool_t fDebug
Debug switch.
void SetKinESigma(Double32_t kinE, Double32_t sigmaKinE)
Defines Gaussian distribution of ion kinetic energy [GeV].
void SetPSigma(Double32_t p=0, Double32_t sigma=1)
Defines Gaussian distribution of ion momentum [GeV].
void SetThetaSigma(Double32_t theta=0., Double32_t sigmaTheta=1.)
Defines Gaussian distribution of ion polar angle in lab system [degree].
Int_t fMult
Multiplicity per event.
Double32_t fGausY
Amplitude values of coordinates in Gauss distibution [cm].
void SetKinE(Double32_t kinE)
Defines fixed ion kinetic energy that is recalculated to the momentum according to equation ...
Double32_t fZ
Point vertex coordinates [cm].
void SetBoxXYZ(Double32_t x1=0, Double32_t y1=0, Double32_t x2=0, Double32_t y2=0, Double32_t z=0)
Defines uniform distribution boundaries of ion start position on X and Y axis and fixed poition on Z ...
void SetYRange(Double32_t ymin=-5., Double32_t ymax=7.)
Defines uniform distribution boundaries of ion rapidity in lab system.
Bool_t fPRangeIsSet
True if abs momentum range is set.
void SetMultiplicity(Int_t mult)
Defines number of ions generated per event.
void SetEtaRange(Double32_t etamin=-5, Double32_t etamax=7)
Defines uniform distribution boundaries of ion pseudorapidity in lab system.
Bool_t fThetaRangeIsSet
True if theta range is set.
Double32_t fIonMass
Ion mass + Ion Exitation [GeV].
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
Defines uniform distribution boundaries of ion momentum[GeV].
Bool_t fSigmaThetaIsSet
True if Gauss distribution for theta angle is set.
Int_t fPDGType
Particle type (PDG encoding)
Double32_t fKinE
Kinetic energy [GeV].
Double32_t fSigmaY
Coordinates normal deviation [cm].
Bool_t fSpreadingOnTarget
True if parameters are spreaded on target and reconstructed to beam start position.
virtual ~ERIonGenerator()
Destructor.
Double32_t fSigmaTheta
Theta angle normal deviation [degree].
Bool_t fPointVtxIsSet
True if point vertex is set.
Double32_t fPtMax
Transverse momentum range [GeV].
void SetSigmaXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0, Double32_t sigmaX=1, Double32_t sigmaY=1)
Defines Gaussian distribution of ion start position on X and Y axis and fixed poition on Z axie in Ca...
void SetExcitationEnergy(Double_t eExc)
Defines ion excitation energy of generated FairIon object.
void SetCosTheta()
Defines kTRUE flag .
TString fName
Ion name.
FairIon * fIon
Pointer to the FairIon to be generated.
void SpreadingParameters(void)
Spreads parameters recieved by accessor methods.
Int_t fQ
Electric charge [e].
void SetCharge(Int_t charge)
Defines ion charge.
Bool_t fBoxSigmaIsSet
True if Gauss distribution for coordinates is set.
Bool_t fCosThetaIsSet
True if uniform distribution in cos(theta) is set (default -> not set)
Bool_t fBoxVtxIsSet
True if box vertex is set.
Double32_t fPz
Momentum projection [GeV].
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
Defines fixed start position of ion beam in Cartesian coordinates relative to the global cave сoordin...
FairIon * Ion()
Returns FairIon object.
void SetPSigmaOverP(Double32_t sigmaPOverP)
Defines standard deviation of ion momentum as a percentage of full momentum.
void SetPtRange(Double32_t ptmin=0, Double32_t ptmax=10)
Defines uniform distribution boundaries of ion transverse momentum[GeV].
Double32_t fPMax
Momentum range in lab system.
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
Defines uniform distribution boundaries of ion azimuth angle[degree].
ERIonGenerator()
Default constructor.
Double32_t fY2
Box vertex coords (x1,y1)->(x2,y2)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
Double32_t fSigmaP
Momentum normal deviation [GeV].
void SpreadingOnTarget(void)
Sets spreading of x and y coordinates on target (where z-position is zero) and reconstruct them to th...
Double32_t fEtaMax
Pseudorapidity range in lab system.
Class for the generation ion.
void SetRoundXY(Double32_t rho=0, Double32_t centerX=0, Double32_t centerY=0, Double32_t centerZ=0)
Defines the round spreading in XY plane.
Bool_t fSigmaPIsSet
True if Gauss distribution for momentum is set.