PandaRoot
PndGasGenerator.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 // ----- PndGasGenerator header file -----
15 // ----- Created 02/04/09 by F. Uhlig -----
16 // -------------------------------------------------------------------------
17 
33 #ifndef PND_GASGENERATOR_H
34 #define PND_GASGENERATOR_H
35 
36 #include "FairGenerator.h"
37 #include <iostream>
38 
39 class FairPrimaryGenerator;
40 class TF1;
41 
42 class PndGasGenerator : public FairGenerator {
43  public:
46 
51  PndGasGenerator(Int_t pdgid, Int_t mult = 1);
52 
54  virtual ~PndGasGenerator(){};
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 SetPhiRange(Double32_t phimin = 0, Double32_t phimax = 360)
69  {
70  fPhiMin = phimin;
71  fPhiMax = phimax;
72  };
73 
74  void SetThetaRange(Double32_t thetamin = 0, Double32_t thetamax = 90)
75  {
76  fThetaMin = thetamin;
77  fThetaMax = thetamax;
78  fThetaRangeIsSet = kTRUE;
79  };
80 
81  void SetCosTheta() { fCosThetaIsSet = kTRUE; };
82 
83  void SetZRange(Double32_t zmin = 0, Double32_t zmax = 10)
84  {
85  fZMin = zmin;
86  fZMax = zmax;
87  }
88 
89  void SetRadius(Double32_t radius = 0.2) { fRadius = radius; }
90 
91  // void SetDensityProfile(TString in)
92 
93  void SetDebug(Bool_t debug = 0) { fDebug = debug; }
94 
96  Bool_t Init();
97 
101  virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen);
102 
103  private:
104  Int_t fPDGType; // Particle type (PDG encoding)
105  Int_t fMult; // Multiplicity
106 
107  Double32_t fPDGMass; // Particle mass [GeV]
108  Double32_t fPhiMin, fPhiMax; // Azimuth angle range [degree]
109  Double32_t fPMin, fPMax; // Momentum range in lab system
110  Double32_t fThetaMin, fThetaMax; // Polar angle range in lab system [degree]
111  Double32_t fX, fY, fZ; // Point vertex coordinates [cm]
112  Double32_t fRadius; // Radius of beam profile
113 
114  Bool_t fThetaRangeIsSet; // True if theta range is set
115  Bool_t fCosThetaIsSet; // True if uniform distribution in cos(theta) is set (default -> uniform theta)
116  Bool_t fPRangeIsSet; // True if abs.momentum range is set
117  Double32_t fZMin, fZMax; // Minimum and maximum z position
118  Bool_t fDebug; // Debug switch
119 
120  // TString fProfileFunction; // function to generate density profile
121  TF1 *fDensityProfile; // density profile
122 
123  ClassDef(PndGasGenerator, 1);
124 };
125 
126 #endif
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void SetPDGType(Int_t pdg)
void SetDebug(Bool_t debug=0)
void SetZRange(Double32_t zmin=0, Double32_t zmax=10)
virtual ~PndGasGenerator()
void SetRadius(Double32_t radius=0.2)
void SetMultiplicity(Int_t mult)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)