7 #include "TClonesArray.h"
9 #include "TLorentzVector.h"
12 #include "TParticle.h"
14 #include "FairPrimaryGenerator.h"
35 fInputFile =
new TFile(fFileName);
36 fInputTree = (TTree*) fInputFile->Get(
"data");
37 fParticles =
new TClonesArray(
"TParticle",100);
38 fInputTree->SetBranchAddress(
"Particles", &
fParticles);
57 cout <<
"-E PndDpmGenerator: Input file nor open!" << endl;
62 if ( iEvent > fInputTree->GetEntries() ) {
63 cout <<
"-E PndDpmGenerator: No more events in input file!" << endl;
69 fInputTree->GetEntry(iEvent++);
76 for (Int_t iPart=0; iPart < nParts; iPart++) {
77 TParticle* part = (TParticle*)
fParticles->At(iPart);
78 Int_t pdgType = part->GetPdgCode();
82 cout <<
"-W PndDpmGenerator: Unknown type " << part->GetPdgCode()
83 <<
", skipping particle." << endl;
96 primGen->AddTrack(pdgType, px, py, pz, vx, vy, vz);
111 cout <<
"-I PndDpmGenerator: Closing input file " << fFileName
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
void CloseInput()
Particle array from PLUTO.
FairPrimaryGenerator * primGen
virtual ~PndDpmGenerator()