CbmRoot
|
#include <CbmPhsdGenerator.h>
Public Member Functions | |
CbmPhsdGenerator () | |
CbmPhsdGenerator (const char *fileNameInput, const char *fileNameBaryons, const char *fileNameMesons) | |
CbmPhsdGenerator (const char *fileNameInput, const char *fileNameDat) | |
~CbmPhsdGenerator () | |
Bool_t | ReadEvent (FairPrimaryGenerator *primGen) |
Bool_t | ReadEvent300 (FairPrimaryGenerator *primGen) |
Bool_t | ReadEventDat (FairPrimaryGenerator *primGen) |
Bool_t | SkipEvents (Int_t count) |
Private Member Functions | |
void | ReadConversionTable () |
void | ReadCollisionData (const char *fileNameInput) |
CbmPhsdGenerator (const CbmPhsdGenerator &) | |
CbmPhsdGenerator & | operator= (const CbmPhsdGenerator &) |
ClassDef (CbmPhsdGenerator, 1) | |
Private Attributes | |
Bool_t | fReadDat |
FILE * | fBaryonsFile |
Whether phsd.dat or .300/301 files are used. More... | |
FILE * | fMesonsFile |
FILE * | fDatFile |
HSD output files. More... | |
std::map< Int_t, Int_t > | fParticleTable |
HSD output files. More... | |
const Char_t * | fFileName |
Map from HSD PID to PDGPID. More... | |
Hadron | nextBaryon |
Input file name. More... | |
Hadron | nextMeson |
int | nextEvent |
int | Ap |
int | Zp |
int | At |
int | Zt |
int | ISUBS |
int | IRUNS |
double | ekin |
Definition at line 43 of file CbmPhsdGenerator.h.
CbmPhsdGenerator::CbmPhsdGenerator | ( | ) |
Default constructor without arguments should not be used.
Definition at line 35 of file CbmPhsdGenerator.cxx.
CbmPhsdGenerator::CbmPhsdGenerator | ( | const char * | fileNameInput, |
const char * | fileNameBaryons, | ||
const char * | fileNameMesons | ||
) |
Standard constructor for reading .300 and .301 PHSD output files.
fileNameInput | The file name of INPUT file used in HSD |
fileNameBaryons | The file name of baryons output (fort.300) |
fileNameMesons | The file name of mesons output (fort.301) |
Definition at line 47 of file CbmPhsdGenerator.cxx.
References fBaryonsFile, fMesonsFile, fReadDat, Hadron::init, nextBaryon, nextEvent, nextMeson, ReadCollisionData(), and ReadConversionTable().
CbmPhsdGenerator::CbmPhsdGenerator | ( | const char * | fileNameInput, |
const char * | fileNameDat | ||
) |
Standard constructor for reading .dat PHSD output file.
fileNameDat | The file name of .dat PHSD output file |
Definition at line 79 of file CbmPhsdGenerator.cxx.
References fDatFile, fReadDat, nextEvent, and ReadCollisionData().
CbmPhsdGenerator::~CbmPhsdGenerator | ( | ) |
Destructor.
Definition at line 98 of file CbmPhsdGenerator.cxx.
References fBaryonsFile, fDatFile, fMesonsFile, and fParticleTable.
|
private |
|
private |
|
private |
|
private |
Private method ReadCollisionData. Reads the following information about colliding system: ebeam, Ap, Zp, At, Zt. Is called from the constructor.
Definition at line 566 of file CbmPhsdGenerator.cxx.
References Ap, At, ekin, IRUNS, ISUBS, Zp, and Zt.
Referenced by CbmPhsdGenerator().
|
private |
Private method ReadConversionTable. Reads the conversion table from HSD particle code to PDG particle code and fills the conversion map. The conversion is mostly based on subroutine TRANSPOSECODES from fritzi.F in HSD-2.5. Open charm is not included. Is called from the constructor.
--— Public method ReadEvent -----------------------------------— Bool_t CbmPhsdGenerator::SkipEvents(Int_t count) { if (count<=0) { return kTRUE; }
for(Int_t ii=0; ii<count; ii++) { —> Check for input file if ( ! fInputFile ) { cout << "-E FairUrqmdGenerator: Input file not open! " << endl; return kFALSE; }
—> Define event variables to be read from file int evnr=0, ntracks=0, aProj=0, zProj=0, aTarg=0, zTarg=0; float b = 0., ekin = 0.;
—> Read and check first event header line from input file char read[200]; fgets(read, 200, fInputFile); if ( feof(fInputFile) ) { cout << "-I FairUrqmdGenerator : End of input file reached." << endl; fclose(fInputFile); fInputFile = nullptr; return kFALSE; } if ( read[0] != 'U' ) { cout << "-E FairUrqmdGenerator: Wrong event header" << endl; return kFALSE; }
—> Read rest of event header fgets(read, 26, fInputFile); fscanf(fInputFile, "%d", &aProj); fscanf(fInputFile, "%d", &zProj); fgets(read, 25, fInputFile); fscanf(fInputFile, "%d", &aTarg); fscanf(fInputFile, "%d", &zTarg); fgets(read, 200, fInputFile); fgets(read, 200, fInputFile); fgets(read, 36, fInputFile); fscanf(fInputFile, "%f", &b); fgets(read, 200, fInputFile); fgets(read, 39, fInputFile); fscanf(fInputFile, "%e", &ekin); fgets(read, 200, fInputFile); fgets(read, 7, fInputFile); fscanf(fInputFile, "%d", &evnr); fgets(read, 200, fInputFile); for (int iline=0; iline<8; iline++) { fgets(read, 200,fInputFile); } fscanf(fInputFile, "%d", &ntracks); fgets(read, 200, fInputFile); fgets(read, 200, fInputFile);
cout << "-I FairUrqmdGenerator: Event " << evnr << " skipped!" << endl;
—> Loop over tracks in the current event for(int itrack=0; itrack<ntracks; itrack++) {
Read momentum and PID from file fgets(read, 81, fInputFile); fgets(read, 200, fInputFile); } } return kTRUE; }
Definition at line 534 of file CbmPhsdGenerator.cxx.
References fParticleTable.
Referenced by CbmPhsdGenerator().
Bool_t CbmPhsdGenerator::ReadEvent | ( | FairPrimaryGenerator * | primGen | ) |
Reads on event from the input file and pushes the tracks onto the stack. Abstract method in base class.
pStack | pointer to the stack |
ver | not used |
Definition at line 123 of file CbmPhsdGenerator.cxx.
References fReadDat, ReadEvent300(), and ReadEventDat().
Bool_t CbmPhsdGenerator::ReadEvent300 | ( | FairPrimaryGenerator * | primGen | ) |
Reads the event from .300 and .301 PHSD output files.
Definition at line 219 of file CbmPhsdGenerator.cxx.
References Hadron::b, Hadron::charge, ekin, fBaryonsFile, fMesonsFile, fParticleTable, Hadron::globalEvent, Hadron::id, Hadron::init, Hadron::IRUN, IRUNS, Hadron::ISUB, kProtonMass, nextBaryon, nextEvent, nextMeson, Hadron::p0, Hadron::px, Hadron::py, Hadron::pz, and sqrt().
Referenced by ReadEvent().
Bool_t CbmPhsdGenerator::ReadEventDat | ( | FairPrimaryGenerator * | primGen | ) |
Reads the event from .dat PHSD output file.
Definition at line 133 of file CbmPhsdGenerator.cxx.
References ekin, fDatFile, i, kProtonMass, nextEvent, and sqrt().
Referenced by ReadEvent().
Bool_t CbmPhsdGenerator::SkipEvents | ( | Int_t | count | ) |
Skip some events in file TODO Implement
|
private |
Definition at line 106 of file CbmPhsdGenerator.h.
Referenced by ReadCollisionData().
|
private |
Definition at line 106 of file CbmPhsdGenerator.h.
Referenced by ReadCollisionData().
|
private |
Definition at line 109 of file CbmPhsdGenerator.h.
Referenced by ReadCollisionData(), ReadEvent300(), and ReadEventDat().
|
private |
Whether phsd.dat or .300/301 files are used.
Definition at line 92 of file CbmPhsdGenerator.h.
Referenced by CbmPhsdGenerator(), ReadEvent300(), and ~CbmPhsdGenerator().
|
private |
HSD output files.
Definition at line 94 of file CbmPhsdGenerator.h.
Referenced by CbmPhsdGenerator(), ReadEventDat(), and ~CbmPhsdGenerator().
|
private |
Map from HSD PID to PDGPID.
Definition at line 98 of file CbmPhsdGenerator.h.
|
private |
Definition at line 92 of file CbmPhsdGenerator.h.
Referenced by CbmPhsdGenerator(), ReadEvent300(), and ~CbmPhsdGenerator().
|
private |
HSD output files.
Definition at line 96 of file CbmPhsdGenerator.h.
Referenced by ReadConversionTable(), ReadEvent300(), and ~CbmPhsdGenerator().
|
private |
Definition at line 90 of file CbmPhsdGenerator.h.
Referenced by CbmPhsdGenerator(), and ReadEvent().
|
private |
Definition at line 108 of file CbmPhsdGenerator.h.
Referenced by ReadCollisionData(), and ReadEvent300().
|
private |
Definition at line 107 of file CbmPhsdGenerator.h.
Referenced by ReadCollisionData().
|
private |
Input file name.
Definition at line 101 of file CbmPhsdGenerator.h.
Referenced by CbmPhsdGenerator(), and ReadEvent300().
|
private |
Definition at line 102 of file CbmPhsdGenerator.h.
Referenced by CbmPhsdGenerator(), ReadEvent300(), and ReadEventDat().
|
private |
Definition at line 101 of file CbmPhsdGenerator.h.
Referenced by CbmPhsdGenerator(), and ReadEvent300().
|
private |
Definition at line 106 of file CbmPhsdGenerator.h.
Referenced by ReadCollisionData().
|
private |
Definition at line 106 of file CbmPhsdGenerator.h.
Referenced by ReadCollisionData().