36 cout <<
"-I Pythia6Generator: Opening input file " << fileName << endl;
37 if ((fInputFile = fopen(fFileName,
"r")) == NULL)
40 LOG(fatal) <<
"Pythia6Generator: Cannot open input file.";
57 cout <<
"-E Pythia6Generator: Input file not open!" << endl;
62 Int_t ntracks = 0, eventID = 0, ncols = 0;
65 Int_t nLev = 0, pdgID = 0, nM1 = -1, nM2 = -1, nDF = -1, nDL = -1;
66 Float_t fPx = 0., fPy = 0., fPz = 0., fM = 0., fE = 0.;
67 Float_t fVx = 0., fVy = 0., fVz = 0., fT = 0.;
74 ncols = fscanf(fInputFile,
"%d\t%d", &eventID, &ntracks);
76 if (ncols && ntracks > 0) {
79 cout <<
"Event number: " << eventID <<
"\tNtracks: " << ntracks << endl;
81 for (Int_t ll = 0; ll < ntracks; ll++) {
82 ncols = fscanf(fInputFile,
83 "%d %d %d %d %d %d %f %f %f %f %f %f %f %f %f",
100 cout << nLev <<
"\t" << pdgID <<
"\t" << nM1 <<
"\t" << nM2 <<
"\t" << nDF <<
"\t" << nDL <<
"\t" << fPx
101 <<
"\t" << fPy <<
"\t" << fPz <<
"\t" << fE <<
"\t" << fM <<
"\t" << fVx <<
"\t" << fVy <<
"\t"
102 << fVz <<
"\t" << fT << endl;
104 primGen->
AddTrack(pdgID, fPx, fPy, fPz, fVx, fVy, fVz);
107 cout <<
"-I Pythia6Generator: End of input file reached " << endl;
113 if (feof(fInputFile)) {
114 cout <<
"-I Pythia6Generator: End of input file reached " << endl;
130 void Pythia6Generator::CloseInput()
135 cout <<
"-I Pythia6Generator: Closing input file " << fFileName << endl;
virtual ~Pythia6Generator()
ClassImp(FairEventBuilder)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz, Double_t vx, Double_t vy, Double_t vz, Int_t parent=-1, Bool_t wanttracking=true, Double_t e=-9e9, Double_t tof=0., Double_t weight=0., TMCProcess proc=kPPrimary)