PandaRoot
PndVolGenerator.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndVolGenerator header file -----
3 // ----- Created 22/05/07 by A. Sanchez and S. Bleser -----
4 // -------------------------------------------------------------------------
5 
18 #ifndef PND_VOLGENERATOR_H
19 #define PND_VOLGENERATOR_H
20 
21 #include "FairGenerator.h"
22 #include <iostream>
23 //#include "PndGeoHandling.h"
24 // TGeoHMatrix* fCurrentTransMat;
25 #include "TGeoMatrix.h"
26 #include "TF1.h"
27 
28 class FairPrimaryGenerator;
29 
30 class PndVolGenerator : public FairGenerator {
31  public:
34 
39  PndVolGenerator(Int_t pdgid, Int_t mult = 1);
40 
42  virtual ~PndVolGenerator(){};
43 
45  void SetPDGType(Int_t pdg) { fPDGType = pdg; };
46 
47  void SetMultiplicity(Int_t mult) { fMult = mult; };
48 
49  void SetPRange(Double32_t pmin = 0, Double32_t pmax = 10)
50  {
51  fPMin = pmin;
52  fPMax = pmax;
53  fPRangeIsSet = kTRUE;
54  }
55 
56  void SetPtRange(Double32_t ptmin = 0, Double32_t ptmax = 10)
57  {
58  fPtMin = ptmin;
59  fPtMax = ptmax;
60  fPtRangeIsSet = kTRUE;
61  };
62 
63  void SetPhiRange(Double32_t phimin = 0, Double32_t phimax = 360)
64  {
65  fPhiMin = phimin;
66  fPhiMax = phimax;
67  };
68 
69  void SetEtaRange(Double32_t etamin = -5, Double32_t etamax = 7)
70  {
71  fEtaMin = etamin;
72  fEtaMax = etamax;
73  fEtaRangeIsSet = kTRUE;
74  };
75 
76  void SetYRange(Double32_t ymin = -5, Double32_t ymax = 7)
77  {
78  fYMin = ymin;
79  fYMax = ymax;
80  fYRangeIsSet = kTRUE;
81  };
82 
83  void SetThetaRange(Double32_t thetamin = 0, Double32_t thetamax = 90)
84  {
85  fThetaMin = thetamin;
86  fThetaMax = thetamax;
87  fThetaRangeIsSet = kTRUE;
88  };
89 
90  void SetCosTheta() { fCosThetaIsSet = kTRUE; };
91 
92  void SetInverseP() { fInversePIsSet = kTRUE; };
93 
94  void SetXYZ(Double32_t x = 0, Double32_t y = 0, Double32_t z = 0)
95  {
96  fX = x;
97  fY = y;
98  fZ = z;
99  fPointVtxIsSet = kTRUE;
100  }
101 
102  void SetVolXYZ(Double32_t x1 = 0, Double32_t y1 = 0, Double32_t x2 = 0, Double32_t y2 = 0, Double32_t z = 0)
103  {
104  fX1 = x1;
105  fY1 = y1;
106  fX2 = x2;
107  fY2 = y2;
108  fZ = z;
109  fVolVtxIsSet = kTRUE;
110  }
111 
112  void SetDebug(Bool_t debug = 0) { fDebug = debug; }
113 
114  void SetVolTarg(Int_t quad = 2, Int_t abs = 5)
115  {
116  fQuad = quad;
117  fAbs = abs;
118  fExt = kTRUE;
119  }; // Absorber Volume Setter
120 
121  void SetVolTgFc(Int_t quad = 2, TF1 *func = nullptr)
122  {
123  fQuad = quad;
124  fFunc = func;
125  fExt = kFALSE;
126  }; // Absorber Volume Setter
127 
129  Bool_t Init();
130 
134  virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen);
135 
136  private:
137  Int_t fPDGType; // Particle type (PDG encoding)
138  Int_t fMult; // Multiplicity
139  Int_t fQuad; // # quadrant
140  Int_t fAbs; // # Absorber Layer
141  TF1 *fFunc;
142  TGeoHMatrix *fCurrentTransMat;
143 
144  Double32_t fPDGMass; // Particle mass [GeV]
145  Double32_t fPtMin, fPtMax; // Transverse momentum range [GeV]
146  Double32_t fPhiMin, fPhiMax; // Azimuth angle range [degree]
147  Double32_t fEtaMin, fEtaMax; // Pseudorapidity range in lab system
148  Double32_t fYMin, fYMax; // Rapidity range in lab system
149  Double32_t fPMin, fPMax; // Momentum range in lab system
150  Double32_t fThetaMin, fThetaMax; // Polar angle range in lab system [degree]
151  Double32_t fX, fY, fZ; // Point vertex coordinates [cm]
152  Double32_t fX1, fY1, fX2, fY2; // Vol vertex coords (x1,y1)->(x2,y2)
153 
154  Bool_t fEtaRangeIsSet; // True if eta range is set
155  Bool_t fYRangeIsSet; // True if rapidity range is set
156  Bool_t fThetaRangeIsSet; // True if theta range is set
157  Bool_t fCosThetaIsSet; // True if uniform distribution in cos(theta) is set (default -> uniform theta)
158  Bool_t fInversePIsSet; // True if uniform distribution in 1/p
159  Bool_t fPtRangeIsSet; // True if transverse momentum range is set
160  Bool_t fPRangeIsSet; // True if abs.momentum range is set
161  Bool_t fPointVtxIsSet; // True if point vertex is set
162  Bool_t fVolVtxIsSet; // True if box vertex is set
163  Bool_t fDebug; // Debug switch
164  Bool_t fExt; // True if abs is set externally
165  // PndGeoHandling* fGeoH;
166  ClassDef(PndVolGenerator, 3);
167 };
168 
169 #endif
virtual ~PndVolGenerator()
void SetVolTarg(Int_t quad=2, Int_t abs=5)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void SetVolXYZ(Double32_t x1=0, Double32_t y1=0, Double32_t x2=0, Double32_t y2=0, Double32_t z=0)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
void SetEtaRange(Double32_t etamin=-5, Double32_t etamax=7)
void SetDebug(Bool_t debug=0)
void SetYRange(Double32_t ymin=-5, Double32_t ymax=7)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
void SetVolTgFc(Int_t quad=2, TF1 *func=nullptr)
void SetPtRange(Double32_t ptmin=0, Double32_t ptmax=10)
void SetMultiplicity(Int_t mult)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
void SetPDGType(Int_t pdg)