CbmRoot
CbmPhsdGenerator.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmPHSDGenerator header file -----
3 // ----- Created 24/01/14, updated on 17/11/16 by V. Vovchenko -----
4 // -------------------------------------------------------------------------
5 
6 
18 #ifndef CBMPHSDGENERATOR_H
19 #define CBMPHSDGENERATOR_H
20 
21 
22 #include "FairGenerator.h"
23 
24 #include <fstream>
25 #include <map>
26 
27 class TVirtualMCStack;
28 class FairPrimaryGenerator;
29 
30 // This structure holds information about hadron from HSD output file
31 struct Hadron {
32  bool init; // Are parameters initialised?
33  int id; // HSD particle id
34  int charge;
35  int ISUB; // Number of subsequent parallel run
36  int IRUN; // Number of run in subsequent run
37  int globalEvent; // = (ISUB-1)*IRUNS + IRUN
38  double px, py, pz, p0; // 4-momentum
39  double b; // impact parameter of event
40 };
41 
42 
43 class CbmPhsdGenerator : public FairGenerator {
44 
45 public:
48 
49 
55  CbmPhsdGenerator(const char* fileNameInput,
56  const char* fileNameBaryons,
57  const char* fileNameMesons);
58 
62  CbmPhsdGenerator(const char* fileNameInput, const char* fileNameDat);
63 
64 
67 
68 
74  Bool_t ReadEvent(FairPrimaryGenerator* primGen);
75 
78  Bool_t ReadEvent300(FairPrimaryGenerator* primGen);
79 
82  Bool_t ReadEventDat(FairPrimaryGenerator* primGen);
83 
87  Bool_t SkipEvents(Int_t count);
88 
89 private:
90  Bool_t fReadDat;
91 
93 
94  FILE* fDatFile;
95 
96  std::map<Int_t, Int_t> fParticleTable;
97 
98  const Char_t* fFileName;
99 
100  // Necessary to have because of HSD output structure
101  Hadron nextBaryon, nextMeson; // Baryons and mesons read from next event
102  int nextEvent; // Id of the next event
103 
104 
105  // Data about HSD simulation, is read from HSD input file
106  int Ap, Zp, At, Zt;
107  int ISUBS; // Number of subsequent parallel runs in HSD
108  int IRUNS; // Number of runs in one parallel batch in HSD
109  double ekin; // Kinetic energy per projectile nucleon in lab frame
110 
111 
117  void ReadConversionTable();
118 
121  void ReadCollisionData(const char* fileNameInput);
122 
125 
127 };
128 
129 #endif
CbmPhsdGenerator::ReadConversionTable
void ReadConversionTable()
Definition: CbmPhsdGenerator.cxx:534
CbmPhsdGenerator::fParticleTable
std::map< Int_t, Int_t > fParticleTable
HSD output files.
Definition: CbmPhsdGenerator.h:96
Hadron::p0
double p0
Definition: CbmPhsdGenerator.h:38
CbmPhsdGenerator::Ap
int Ap
Definition: CbmPhsdGenerator.h:106
Hadron::id
int id
Definition: CbmPhsdGenerator.h:33
CbmPhsdGenerator::nextBaryon
Hadron nextBaryon
Input file name.
Definition: CbmPhsdGenerator.h:101
Hadron::init
bool init
Definition: CbmPhsdGenerator.h:32
CbmPhsdGenerator::Zp
int Zp
Definition: CbmPhsdGenerator.h:106
CbmPhsdGenerator::fMesonsFile
FILE * fMesonsFile
Definition: CbmPhsdGenerator.h:92
CbmPhsdGenerator::ISUBS
int ISUBS
Definition: CbmPhsdGenerator.h:107
CbmPhsdGenerator::operator=
CbmPhsdGenerator & operator=(const CbmPhsdGenerator &)
CbmPhsdGenerator
Definition: CbmPhsdGenerator.h:43
Hadron::pz
double pz
Definition: CbmPhsdGenerator.h:38
CbmPhsdGenerator::SkipEvents
Bool_t SkipEvents(Int_t count)
Hadron::IRUN
int IRUN
Definition: CbmPhsdGenerator.h:36
Hadron::px
double px
Definition: CbmPhsdGenerator.h:38
CbmPhsdGenerator::ReadEvent300
Bool_t ReadEvent300(FairPrimaryGenerator *primGen)
Definition: CbmPhsdGenerator.cxx:219
CbmPhsdGenerator::ClassDef
ClassDef(CbmPhsdGenerator, 1)
CbmPhsdGenerator::ekin
double ekin
Definition: CbmPhsdGenerator.h:109
Hadron::b
double b
Definition: CbmPhsdGenerator.h:39
CbmPhsdGenerator::fDatFile
FILE * fDatFile
HSD output files.
Definition: CbmPhsdGenerator.h:94
Hadron::charge
int charge
Definition: CbmPhsdGenerator.h:34
CbmPhsdGenerator::Zt
int Zt
Definition: CbmPhsdGenerator.h:106
CbmPhsdGenerator::fReadDat
Bool_t fReadDat
Definition: CbmPhsdGenerator.h:90
CbmPhsdGenerator::ReadEvent
Bool_t ReadEvent(FairPrimaryGenerator *primGen)
Definition: CbmPhsdGenerator.cxx:123
CbmPhsdGenerator::nextMeson
Hadron nextMeson
Definition: CbmPhsdGenerator.h:101
Hadron
Definition: CbmPhsdGenerator.h:31
CbmPhsdGenerator::CbmPhsdGenerator
CbmPhsdGenerator()
Definition: CbmPhsdGenerator.cxx:35
CbmPhsdGenerator::ReadEventDat
Bool_t ReadEventDat(FairPrimaryGenerator *primGen)
Definition: CbmPhsdGenerator.cxx:133
Hadron::ISUB
int ISUB
Definition: CbmPhsdGenerator.h:35
CbmPhsdGenerator::IRUNS
int IRUNS
Definition: CbmPhsdGenerator.h:108
CbmPhsdGenerator::CbmPhsdGenerator
CbmPhsdGenerator(const CbmPhsdGenerator &)
CbmPhsdGenerator::~CbmPhsdGenerator
~CbmPhsdGenerator()
Definition: CbmPhsdGenerator.cxx:98
CbmPhsdGenerator::nextEvent
int nextEvent
Definition: CbmPhsdGenerator.h:102
CbmPhsdGenerator::fBaryonsFile
FILE * fBaryonsFile
Whether phsd.dat or .300/301 files are used.
Definition: CbmPhsdGenerator.h:92
CbmPhsdGenerator::At
int At
Definition: CbmPhsdGenerator.h:106
Hadron::py
double py
Definition: CbmPhsdGenerator.h:38
CbmPhsdGenerator::ReadCollisionData
void ReadCollisionData(const char *fileNameInput)
Definition: CbmPhsdGenerator.cxx:566
CbmPhsdGenerator::fFileName
const Char_t * fFileName
Map from HSD PID to PDGPID.
Definition: CbmPhsdGenerator.h:98
Hadron::globalEvent
int globalEvent
Definition: CbmPhsdGenerator.h:37