CbmRoot
Loading...
Searching...
No Matches
CbmPhsdGenerator.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volodymyr Vovchenko, Florian Uhlig [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmPHSDGenerator header file -----
7// ----- Created 24/01/14, updated on 17/11/16 by V. Vovchenko -----
8// -------------------------------------------------------------------------
9
10
22#ifndef CBMPHSDGENERATOR_H
23#define CBMPHSDGENERATOR_H
24
25
26#include "FairGenerator.h"
27
28#include <fstream>
29#include <map>
30
31class TVirtualMCStack;
32class FairPrimaryGenerator;
33
34// This structure holds information about hadron from HSD output file
35struct Hadron {
36 bool init; // Are parameters initialised?
37 int id; // HSD particle id
38 int charge;
39 int ISUB; // Number of subsequent parallel run
40 int IRUN; // Number of run in subsequent run
41 int globalEvent; // = (ISUB-1)*IRUNS + IRUN
42 double px, py, pz, p0; // 4-momentum
43 double b; // impact parameter of event
44};
45
46
47class CbmPhsdGenerator : public FairGenerator {
48
49public:
52
53
59 CbmPhsdGenerator(const char* fileNameInput, const char* fileNameBaryons, const char* fileNameMesons);
60
64 CbmPhsdGenerator(const char* fileNameInput, const char* fileNameDat);
65
66
69
70
76 Bool_t ReadEvent(FairPrimaryGenerator* primGen);
77
80 Bool_t ReadEvent300(FairPrimaryGenerator* primGen);
81
84 Bool_t ReadEventDat(FairPrimaryGenerator* primGen);
85
89 Bool_t SkipEvents(Int_t count);
90
91private:
92 Bool_t fReadDat;
93
95
96 FILE* fDatFile;
97
98 std::map<Int_t, Int_t> fParticleTable;
99
100 const Char_t* fFileName;
101
102 // Necessary to have because of HSD output structure
103 Hadron nextBaryon, nextMeson; // Baryons and mesons read from next event
104 int nextEvent; // Id of the next event
105
106
107 // Data about HSD simulation, is read from HSD input file
108 int Ap, Zp, At, Zt;
109 int ISUBS; // Number of subsequent parallel runs in HSD
110 int IRUNS; // Number of runs in one parallel batch in HSD
111 double ekin; // Kinetic energy per projectile nucleon in lab frame
112
113
119 void ReadConversionTable();
120
123 void ReadCollisionData(const char* fileNameInput);
124
127
129};
130
131#endif
FILE * fBaryonsFile
Whether phsd.dat or .300/301 files are used.
ClassDef(CbmPhsdGenerator, 1)
Hadron nextBaryon
Input file name.
Bool_t ReadEvent300(FairPrimaryGenerator *primGen)
CbmPhsdGenerator(const CbmPhsdGenerator &)
const Char_t * fFileName
Map from HSD PID to PDGPID.
Bool_t SkipEvents(Int_t count)
void ReadCollisionData(const char *fileNameInput)
CbmPhsdGenerator & operator=(const CbmPhsdGenerator &)
std::map< Int_t, Int_t > fParticleTable
HSD output files.
FILE * fDatFile
HSD output files.
Bool_t ReadEventDat(FairPrimaryGenerator *primGen)
Bool_t ReadEvent(FairPrimaryGenerator *primGen)