14#include "FairPrimaryGenerator.h"
28 cout <<
"-I Pythia6Generator: Opening input file " << fileName << endl;
33 Fatal(
"Pythia6Generator",
"Cannot open input file.");
48 cout <<
"-E Pythia6Generator: Input file not open!" << endl;
53 Int_t ntracks = 0, eventID = 0, ncols = 0;
56 Int_t nLev = 0, pdgID = 0, nM1 = -1, nM2 = -1, nDF = -1, nDL = -1;
57 Float_t fPx = 0., fPy = 0., fPz = 0., fM = 0., fE = 0.;
58 Float_t fVx = 0., fVy = 0., fVz = 0., fT = 0.;
62 ncols = fscanf(
fInputFile,
"%d\t%d", &eventID, &ntracks);
64 if (ncols && ntracks > 0) {
66 cout <<
"Event number: " << eventID <<
"\tNtracks: " << ntracks << endl;
68 for (Int_t ll = 0; ll < ntracks; ll++) {
69 (void)fscanf(
fInputFile,
"%d %d %d %d %d %d %f %f %f %f %f %f %f %f %f",
70 &nLev, &pdgID, &nM1, &nM2, &nDF, &nDL, &fPx, &fPy, &fPz, &fE,
71 &fM, &fVx, &fVy, &fVz, &fT);
73 cout << nLev <<
"\t" << pdgID <<
"\t" << nM1 <<
"\t" << nM2 <<
"\t"
74 << nDF <<
"\t" << nDL <<
"\t" << fPx <<
"\t" << fPy <<
"\t" << fPz
75 <<
"\t" << fE <<
"\t" << fM <<
"\t" << fVx <<
"\t" << fVy <<
"\t"
76 << fVz <<
"\t" << fT << endl;
77 if (nLev == 1) primGen->AddTrack(pdgID, fPx, fPy, fPz, fVx, fVy, fVz);
80 cout <<
"-I Pythia6Generator: End of input file reached " << endl;
87 cout <<
"-I Pythia6Generator: End of input file reached " << endl;
107 cout <<
"-I Pythia6Generator: Closing input file " <<
fFileName << endl;
FILE * fInputFile
Input file Name.
Bool_t ReadEvent(FairPrimaryGenerator *primGen) override
void CloseInput()
Verbose Level.
~Pythia6Generator() override