PandaRoot
PndVolGenerator.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndVolGenerator header file -----
15 // ----- Created 22/05/07 by A. Sanchez and S. Bleser -----
16 // -------------------------------------------------------------------------
17 
30 #ifndef PND_VOLGENERATOR_H
31 #define PND_VOLGENERATOR_H
32 
33 #include "FairGenerator.h"
34 #include <iostream>
35 //#include "PndGeoHandling.h"
36 // TGeoHMatrix* fCurrentTransMat;
37 #include "TGeoMatrix.h"
38 #include "TF1.h"
39 
40 class FairPrimaryGenerator;
41 
42 class PndVolGenerator : public FairGenerator {
43  public:
46 
51  PndVolGenerator(Int_t pdgid, Int_t mult = 1);
52 
54  virtual ~PndVolGenerator(){};
55 
57  void SetPDGType(Int_t pdg) { fPDGType = pdg; };
58 
59  void SetMultiplicity(Int_t mult) { fMult = mult; };
60 
61  void SetPRange(Double32_t pmin = 0, Double32_t pmax = 10)
62  {
63  fPMin = pmin;
64  fPMax = pmax;
65  fPRangeIsSet = kTRUE;
66  }
67 
68  void SetPtRange(Double32_t ptmin = 0, Double32_t ptmax = 10)
69  {
70  fPtMin = ptmin;
71  fPtMax = ptmax;
72  fPtRangeIsSet = kTRUE;
73  };
74 
75  void SetPhiRange(Double32_t phimin = 0, Double32_t phimax = 360)
76  {
77  fPhiMin = phimin;
78  fPhiMax = phimax;
79  };
80 
81  void SetEtaRange(Double32_t etamin = -5, Double32_t etamax = 7)
82  {
83  fEtaMin = etamin;
84  fEtaMax = etamax;
85  fEtaRangeIsSet = kTRUE;
86  };
87 
88  void SetYRange(Double32_t ymin = -5, Double32_t ymax = 7)
89  {
90  fYMin = ymin;
91  fYMax = ymax;
92  fYRangeIsSet = kTRUE;
93  };
94 
95  void SetThetaRange(Double32_t thetamin = 0, Double32_t thetamax = 90)
96  {
97  fThetaMin = thetamin;
98  fThetaMax = thetamax;
99  fThetaRangeIsSet = kTRUE;
100  };
101 
102  void SetCosTheta() { fCosThetaIsSet = kTRUE; };
103 
104  void SetInverseP() { fInversePIsSet = kTRUE; };
105 
106  void SetXYZ(Double32_t x = 0, Double32_t y = 0, Double32_t z = 0)
107  {
108  fX = x;
109  fY = y;
110  fZ = z;
111  fPointVtxIsSet = kTRUE;
112  }
113 
114  void SetVolXYZ(Double32_t x1 = 0, Double32_t y1 = 0, Double32_t x2 = 0, Double32_t y2 = 0, Double32_t z = 0)
115  {
116  fX1 = x1;
117  fY1 = y1;
118  fX2 = x2;
119  fY2 = y2;
120  fZ = z;
121  fVolVtxIsSet = kTRUE;
122  }
123 
124  void SetDebug(Bool_t debug = 0) { fDebug = debug; }
125 
126  void SetVolTarg(Int_t quad = 2, Int_t abs = 5)
127  {
128  fQuad = quad;
129  fAbs = abs;
130  fExt = kTRUE;
131  }; // Absorber Volume Setter
132 
133  void SetVolTgFc(Int_t quad = 2, TF1 *func = nullptr)
134  {
135  fQuad = quad;
136  fFunc = func;
137  fExt = kFALSE;
138  }; // Absorber Volume Setter
139 
141  Bool_t Init();
142 
146  virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen);
147 
148  private:
149  Int_t fPDGType; // Particle type (PDG encoding)
150  Int_t fMult; // Multiplicity
151  Int_t fQuad; // # quadrant
152  Int_t fAbs; // # Absorber Layer
153  TF1 *fFunc;
154  TGeoHMatrix *fCurrentTransMat;
155 
156  Double32_t fPDGMass; // Particle mass [GeV]
157  Double32_t fPtMin, fPtMax; // Transverse momentum range [GeV]
158  Double32_t fPhiMin, fPhiMax; // Azimuth angle range [degree]
159  Double32_t fEtaMin, fEtaMax; // Pseudorapidity range in lab system
160  Double32_t fYMin, fYMax; // Rapidity range in lab system
161  Double32_t fPMin, fPMax; // Momentum range in lab system
162  Double32_t fThetaMin, fThetaMax; // Polar angle range in lab system [degree]
163  Double32_t fX, fY, fZ; // Point vertex coordinates [cm]
164  Double32_t fX1, fY1, fX2, fY2; // Vol vertex coords (x1,y1)->(x2,y2)
165 
166  Bool_t fEtaRangeIsSet; // True if eta range is set
167  Bool_t fYRangeIsSet; // True if rapidity range is set
168  Bool_t fThetaRangeIsSet; // True if theta range is set
169  Bool_t fCosThetaIsSet; // True if uniform distribution in cos(theta) is set (default -> uniform theta)
170  Bool_t fInversePIsSet; // True if uniform distribution in 1/p
171  Bool_t fPtRangeIsSet; // True if transverse momentum range is set
172  Bool_t fPRangeIsSet; // True if abs.momentum range is set
173  Bool_t fPointVtxIsSet; // True if point vertex is set
174  Bool_t fVolVtxIsSet; // True if box vertex is set
175  Bool_t fDebug; // Debug switch
176  Bool_t fExt; // True if abs is set externally
177  // PndGeoHandling* fGeoH;
178  ClassDef(PndVolGenerator, 3);
179 };
180 
181 #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)