FairRoot/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 {
32 public:
33 
36 
41  PndVolGenerator(Int_t pdgid, Int_t mult=1);
42 
44  virtual ~PndVolGenerator() {};
45 
47  void SetPDGType (Int_t pdg) {fPDGType = pdg; };
48 
49  void SetMultiplicity (Int_t mult) {fMult = mult; };
50 
51  void SetPRange(Double32_t pmin=0 , Double32_t pmax=10)
52  {fPMin=pmin; fPMax=pmax; fPRangeIsSet=kTRUE;}
53 
54  void SetPtRange (Double32_t ptmin=0 , Double32_t ptmax=10)
55  {fPtMin=ptmin; fPtMax=ptmax; fPtRangeIsSet=kTRUE;};
56 
57  void SetPhiRange (Double32_t phimin=0 , Double32_t phimax=360)
58  {fPhiMin=phimin; fPhiMax=phimax;};
59 
60  void SetEtaRange (Double32_t etamin=-5 , Double32_t etamax=7)
61  {fEtaMin=etamin; fEtaMax=etamax; fEtaRangeIsSet=kTRUE;};
62 
63  void SetYRange (Double32_t ymin=-5 , Double32_t ymax=7)
64  {fYMin=ymin; fYMax=ymax; fYRangeIsSet=kTRUE;};
65 
66  void SetThetaRange (Double32_t thetamin=0, Double32_t thetamax=90)
67  {fThetaMin=thetamin; fThetaMax=thetamax; fThetaRangeIsSet=kTRUE;};
68 
69  void SetCosTheta ()
70  {fCosThetaIsSet=kTRUE;};
71 
72  void SetInverseP ()
73  {fInversePIsSet=kTRUE;};
74 
75  void SetXYZ (Double32_t x=0, Double32_t y=0, Double32_t z=0) {
76  fX=x; fY=y; fZ=z; fPointVtxIsSet=kTRUE;}
77 
78  void SetVolXYZ (Double32_t x1=0, Double32_t y1=0, Double32_t x2=0, Double32_t y2=0, Double32_t z=0) {
79  fX1=x1; fY1=y1; fX2=x2; fY2=y2; fZ=z; fVolVtxIsSet=kTRUE;}
80 
81  void SetDebug(Bool_t debug=0) {fDebug = debug;}
82 
83  void SetVolTarg (Int_t quad=2 , Int_t abs=5)
84  {fQuad=quad; fAbs=abs;fExt=kTRUE;}; // Absorber Volume Setter
85 
86  void SetVolTgFc (Int_t quad=2 , TF1* func =0)
87  {fQuad=quad; fFunc=func;fExt=kFALSE;}; // Absorber Volume Setter
88 
90  Bool_t Init();
91 
95  virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen);
96 
97 private:
98  Int_t fPDGType; // Particle type (PDG encoding)
99  Int_t fMult; // Multiplicity
100  Int_t fQuad; // # quadrant
101  Int_t fAbs; // # Absorber Layer
102  TF1* fFunc;
103  TGeoHMatrix* fCurrentTransMat;
104 
105  Double32_t fPDGMass; // Particle mass [GeV]
106  Double32_t fPtMin, fPtMax; // Transverse momentum range [GeV]
107  Double32_t fPhiMin, fPhiMax; // Azimuth angle range [degree]
108  Double32_t fEtaMin, fEtaMax; // Pseudorapidity range in lab system
109  Double32_t fYMin, fYMax; // Rapidity range in lab system
110  Double32_t fPMin, fPMax; // Momentum range in lab system
111  Double32_t fThetaMin, fThetaMax; // Polar angle range in lab system [degree]
112  Double32_t fX, fY, fZ; // Point vertex coordinates [cm]
113  Double32_t fX1, fY1, fX2, fY2; // Vol vertex coords (x1,y1)->(x2,y2)
114 
115 
116  Bool_t fEtaRangeIsSet; // True if eta range is set
117  Bool_t fYRangeIsSet; // True if rapidity range is set
118  Bool_t fThetaRangeIsSet; // True if theta range is set
119  Bool_t fCosThetaIsSet; // True if uniform distribution in cos(theta) is set (default -> uniform theta)
120  Bool_t fInversePIsSet; // True if uniform distribution in 1/p
121  Bool_t fPtRangeIsSet; // True if transverse momentum range is set
122  Bool_t fPRangeIsSet; // True if abs.momentum range is set
123  Bool_t fPointVtxIsSet; // True if point vertex is set
124  Bool_t fVolVtxIsSet; // True if box vertex is set
125  Bool_t fDebug; // Debug switch
126  Bool_t fExt; // True if abs is set externally
127  //PndGeoHandling* fGeoH;
129 
130 };
131 
132 
133 #endif
virtual ~PndVolGenerator()
ClassDef(PndVolGenerator, 3)
void SetVolTarg(Int_t quad=2, Int_t abs=5)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
TF1 * func
Double32_t fThetaMin
Double32_t fThetaMax
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)
TGeoHMatrix * fCurrentTransMat
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
void SetEtaRange(Double32_t etamin=-5, Double32_t etamax=7)
void SetVolTgFc(Int_t quad=2, TF1 *func=0)
void SetDebug(Bool_t debug=0)
void SetYRange(Double32_t ymin=-5, Double32_t ymax=7)
Double_t z
Double32_t fEtaMin
Double32_t fEtaMax
Double_t x
Double32_t fPDGMass
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)
Double_t y
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
Double32_t fPhiMax
Double32_t fPhiMin
Double_t mult
void SetPDGType(Int_t pdg)