PandaRoot
PndBoxGenerator.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndBoxGenerator header file -----
3 // ----- Created 22/05/07 by S.Spataro -----
4 // -------------------------------------------------------------------------
5 
17 #ifndef PND_BOXGENERATOR_H
18 #define PND_BOXGENERATOR_H
19 
20 #include "PndTargetGenerator.h"
21 #include <iostream>
22 
23 class FairPrimaryGenerator;
24 
26  public:
29 
34  PndBoxGenerator(Int_t pdgid, Int_t mult = 1);
35 
37  virtual ~PndBoxGenerator(){};
38 
40  void SetPDGType(Int_t pdg) { fPDGType = pdg; };
41 
42  void SetMultiplicity(Int_t mult) { fMult = mult; };
43 
44  void SetPRange(Double32_t pmin = 0, Double32_t pmax = 10)
45  {
46  fPMin = pmin;
47  fPMax = pmax;
48  fPRangeIsSet = kTRUE;
49  }
50 
51  void SetPtRange(Double32_t ptmin = 0, Double32_t ptmax = 10)
52  {
53  fPtMin = ptmin;
54  fPtMax = ptmax;
55  fPtRangeIsSet = kTRUE;
56  };
57 
58  void SetPhiRange(Double32_t phimin = 0, Double32_t phimax = 360)
59  {
60  fPhiMin = phimin;
61  fPhiMax = phimax;
62  };
63 
64  void SetEtaRange(Double32_t etamin = -5, Double32_t etamax = 7)
65  {
66  fEtaMin = etamin;
67  fEtaMax = etamax;
68  fEtaRangeIsSet = kTRUE;
69  };
70 
71  void SetYRange(Double32_t ymin = -5, Double32_t ymax = 7)
72  {
73  fYMin = ymin;
74  fYMax = ymax;
75  fYRangeIsSet = kTRUE;
76  };
77 
78  void SetThetaRange(Double32_t thetamin = 0, Double32_t thetamax = 90)
79  {
80  fThetaMin = thetamin;
81  fThetaMax = thetamax;
82  fThetaRangeIsSet = kTRUE;
83  };
84 
85  void SetCosTheta() { fCosThetaIsSet = kTRUE; };
86 
87  void SetInverseP() { fInversePIsSet = kTRUE; };
88 
89  void SetXYZ(Double32_t x = 0, Double32_t y = 0, Double32_t z = 0)
90  {
91  fX = x;
92  fY = y;
93  fZ = z;
94  fPointVtxIsSet = kTRUE;
95  }
96 
97  void SetBoxXYZ(Double32_t x1 = 0, Double32_t y1 = 0, Double32_t x2 = 0, Double32_t y2 = 0, Double32_t z = 0)
98  {
99  fX1 = x1;
100  fY1 = y1;
101  fX2 = x2;
102  fY2 = y2;
103  fZ = z;
104  fBoxVtxIsSet = kTRUE;
105  }
106 
107  void SetDebug(Bool_t debug = 0) { fDebug = debug; }
108 
110  Bool_t Init();
111 
115  virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen);
116 
117  private:
118  Int_t fPDGType; // Particle type (PDG encoding)
119  Int_t fMult; // Multiplicity
120 
121  Double32_t fPDGMass; // Particle mass [GeV]
122  Double32_t fPtMin, fPtMax; // Transverse momentum range [GeV]
123  Double32_t fPhiMin, fPhiMax; // Azimuth angle range [degree]
124  Double32_t fEtaMin, fEtaMax; // Pseudorapidity range in lab system
125  Double32_t fYMin, fYMax; // Rapidity range in lab system
126  Double32_t fPMin, fPMax; // Momentum range in lab system
127  Double32_t fThetaMin, fThetaMax; // Polar angle range in lab system [degree]
128  Double32_t fX, fY, fZ; // Point vertex coordinates [cm]
129  Double32_t fX1, fY1, fX2, fY2; // Box vertex coords (x1,y1)->(x2,y2)
130 
131  Bool_t fEtaRangeIsSet; // True if eta range is set
132  Bool_t fYRangeIsSet; // True if rapidity range is set
133  Bool_t fThetaRangeIsSet; // True if theta range is set
134  Bool_t fCosThetaIsSet; // True if uniform distribution in cos(theta) is set (default -> uniform theta)
135  Bool_t fInversePIsSet; // True if uniform distribution in 1/p
136  Bool_t fPtRangeIsSet; // True if transverse momentum range is set
137  Bool_t fPRangeIsSet; // True if abs.momentum range is set
138  Bool_t fPointVtxIsSet; // True if point vertex is set
139  Bool_t fBoxVtxIsSet; // True if box vertex is set
140  Bool_t fDebug; // Debug switch
141 
142  ClassDef(PndBoxGenerator, 1);
143 };
144 
145 #endif
void SetPDGType(Int_t pdg)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void SetBoxXYZ(Double32_t x1=0, Double32_t y1=0, Double32_t x2=0, Double32_t y2=0, Double32_t z=0)
void SetYRange(Double32_t ymin=-5, Double32_t ymax=7)
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
void SetEtaRange(Double32_t etamin=-5, Double32_t etamax=7)
void SetPtRange(Double32_t ptmin=0, Double32_t ptmax=10)
void SetMultiplicity(Int_t mult)
void SetDebug(Bool_t debug=0)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
virtual ~PndBoxGenerator()
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)