7 #include "FairLogger.h"
8 #include "FairPrimaryGenerator.h"
15 #include "TClonesArray.h"
16 #include "TDatabasePDG.h"
18 #include "TLorentzVector.h"
34 , fInputChain(nullptr)
46 , fInputChain(nullptr)
47 , fParticles(new TClonesArray(
"PParticle", 100))
64 , fInputChain(nullptr)
65 , fParticles(new TClonesArray(
"PParticle", 100))
68 for (
auto& name : fileNames) {
91 LOG(error) <<
"CbmPlutoGenerator: Input file not open!";
97 LOG(error) <<
"CbmPlutoGenerator: No more events in input file!";
104 TDatabasePDG* dataBase = TDatabasePDG::Instance();
110 for (Int_t iPart = 0; iPart < nParts; iPart++) {
113 Int_t* pdgType = 0x0;
119 LOG(warn) <<
"CbmPlutoGenerator: Unknown type " << part->
ID()
120 <<
", skipping particle.";
123 LOG(info) << iPart <<
" Particle (geant " << part->
ID() <<
" PDG "
124 << *pdgType <<
" -> "
125 << dataBase->GetParticle(*pdgType)->GetName();
128 Int_t dielectron = 99009911;
129 Int_t dimuon = 99009913;
132 LOG(warn) <<
"PDG code changed by user defintion to " << *pdgType;
133 }
else if (part->
ID() == 51)
134 pdgType = &dielectron;
135 else if (part->
ID() == 50)
143 TLorentzVector mom = part->
Vect4();
144 Double_t px = mom.Px();
145 Double_t py = mom.Py();
146 Double_t pz = mom.Pz();
147 Double_t ee = mom.E();
150 Double_t vx = vertex.x();
151 Double_t vy = vertex.y();
152 Double_t vz = vertex.z();
154 Bool_t wanttracking = kTRUE;
155 if (idx > -1) wanttracking = kFALSE;
156 Int_t parent = parIdx;
157 LOG(info) <<
"Add particle with parent at index " << parIdx
158 <<
" and do tracking " << wanttracking;
162 *pdgType, px, py, pz, vx, vy, vz, parent, wanttracking, ee);
174 LOG(info) <<
"CbmPlutoGenerator: Closing input file " <<
fFileName;
183 if (stat(filename.c_str(), &
buffer) == 0) {
184 LOG(info) <<
"CbmPlutoGenerator: Add file " << filename
185 <<
" to input chain";
187 LOG(fatal) <<
"Input File " << filename <<
" not found";