BmnRoot
Loading...
Searching...
No Matches
MpdLAQGSMGenerator.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- MpdLAQGSMGenerator header file -----
3// -------------------------------------------------------------------------
4
13#ifndef MPDLAQGSMGENERATOR_H
14#define MPDLAQGSMGENERATOR_H 1
15
16#include "FairGenerator.h"
17
18#include <fstream>
19#include <map>
20#include <vector>
21
22#ifndef __CLING__
23#include <zlib.h>
24#endif
25
26class TDatabasePDG;
27class FairPrimaryGenerator;
28class FairIon;
29
30class MpdLAQGSMGenerator : public FairGenerator
31{
32
33 struct la_tab_t
34 {
35 Int_t pdg;
36 Int_t Z;
37 Int_t strange;
38 Int_t lepton;
39 Int_t A;
40 Float_t mass;
41 char name[10];
42 };
43
44 public:
47
51 MpdLAQGSMGenerator(const char* fileName,
52 const Bool_t use_collider_system = kTRUE,
53 Int_t QGSM_format_ID = 0,
54 Int_t Max_Event_Number = 0);
55
58
59 // static la_tab_t la_tab[78]; //! list of light particles known for MpdLAQGSMGenerator
60
61 virtual Bool_t Init()
62 {
63 InitGenerator(nullptr);
64 return kTRUE;
65 }
66 void InitGenerator(const char* light_particles_filename); // fill list of known light particles
67
72 virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen);
73
74 virtual Bool_t GetEventHeader(char* ss);
75
76 Bool_t SkipEvents(Int_t nSkip); // AZ
77
78 Bool_t general_fgets(char* ss, Int_t nn = 250, FILE* p = 0);
79 Bool_t general_feof(void* p);
80
81 void SetXYZ(Double_t x = 0., Double_t y = 0., Double_t z = 0.)
82 {
83 fX = x;
84 fY = y;
85 fZ = z;
86 }
87
88 protected:
89 FILE* fInputFile;
90#ifndef __CLING__
91 gzFile fGZInputFile;
92#endif
93 const Char_t* fFileName;
94 TDatabasePDG* fPDG;
95 Int_t fQGSM_format_ID; // Reflect format changes
96 Bool_t fUseColliderSystem; // kTRUE- for NICA/MPD, kFALSE - for lab system (CBM)
97 // la_tab_t la_tab[84]; //! list of light particles known for MpdLAQGSMGenerator
98 std::vector<la_tab_t*> fLa_tab;
99 Bool_t fGZ_input;
100
101 Double_t fX, fY, fZ; // Point vertex coordinates [cm]
102
106
109 Int_t RegisterIons(Int_t Max_Event_Number = 0);
110 Int_t RegisterIons1(); // AZ
111
112 Int_t CreatePdgCode(Int_t Z, Int_t A, Int_t Strange, Int_t user = 0);
113 Bool_t FindParticle(Int_t Z, Int_t strange, Int_t lepton, Int_t A, Float_t mass, Int_t& PDG, char name[11]);
114 Bool_t CreateNucleus(Int_t Z, Float_t mass, Int_t pdgCode, char pdgName[11]);
115
117 std::map<TString, FairIon*> fIonMap;
118
120};
121
122#endif
void SetXYZ(Double_t x=0., Double_t y=0., Double_t z=0.)
Bool_t SkipEvents(Int_t nSkip)
Int_t CreatePdgCode(Int_t Z, Int_t A, Int_t Strange, Int_t user=0)
ClassDef(MpdLAQGSMGenerator, 1)
Double_t fX
0: ascii input, 1: gzipped input
Bool_t CreateNucleus(Int_t Z, Float_t mass, Int_t pdgCode, char pdgName[11])
virtual ~MpdLAQGSMGenerator()
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
Int_t fQGSM_format_ID
PDG database.
Int_t RegisterIons(Int_t Max_Event_Number=0)
virtual Bool_t Init()
Bool_t FindParticle(Int_t Z, Int_t strange, Int_t lepton, Int_t A, Float_t mass, Int_t &PDG, char name[11])
void InitGenerator(const char *light_particles_filename)
Bool_t general_feof(void *p)
MpdLAQGSMGenerator(const char *fileName, const Bool_t use_collider_system=kTRUE, Int_t QGSM_format_ID=0, Int_t Max_Event_Number=0)
gzFile fGZInputFile
Input file.
const Char_t * fFileName
GZ Input file.
std::vector< la_tab_t * > fLa_tab
virtual Bool_t GetEventHeader(char *ss)
std::map< TString, FairIon * > fIonMap
Bool_t fGZ_input
list of light particles known for MpdLAQGSMGenerator
TDatabasePDG * fPDG
Input file Name.
Bool_t general_fgets(char *ss, Int_t nn=250, FILE *p=0)
name
Definition setup.py:7