CbmRoot
CbmPhsdGenerator Class Reference

#include <CbmPhsdGenerator.h>

Inheritance diagram for CbmPhsdGenerator:
[legend]
Collaboration diagram for CbmPhsdGenerator:
[legend]

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 &)
 
CbmPhsdGeneratoroperator= (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
 

Detailed Description

Definition at line 43 of file CbmPhsdGenerator.h.

Constructor & Destructor Documentation

◆ CbmPhsdGenerator() [1/4]

CbmPhsdGenerator::CbmPhsdGenerator ( )

Default constructor without arguments should not be used.

Definition at line 35 of file CbmPhsdGenerator.cxx.

◆ CbmPhsdGenerator() [2/4]

CbmPhsdGenerator::CbmPhsdGenerator ( const char *  fileNameInput,
const char *  fileNameBaryons,
const char *  fileNameMesons 
)

Standard constructor for reading .300 and .301 PHSD output files.

Parameters
fileNameInputThe file name of INPUT file used in HSD
fileNameBaryonsThe file name of baryons output (fort.300)
fileNameMesonsThe 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() [3/4]

CbmPhsdGenerator::CbmPhsdGenerator ( const char *  fileNameInput,
const char *  fileNameDat 
)

Standard constructor for reading .dat PHSD output file.

Parameters
fileNameDatThe file name of .dat PHSD output file

Definition at line 79 of file CbmPhsdGenerator.cxx.

References fDatFile, fReadDat, nextEvent, and ReadCollisionData().

◆ ~CbmPhsdGenerator()

CbmPhsdGenerator::~CbmPhsdGenerator ( )

Destructor.

Definition at line 98 of file CbmPhsdGenerator.cxx.

References fBaryonsFile, fDatFile, fMesonsFile, and fParticleTable.

◆ CbmPhsdGenerator() [4/4]

CbmPhsdGenerator::CbmPhsdGenerator ( const CbmPhsdGenerator )
private

Member Function Documentation

◆ ClassDef()

CbmPhsdGenerator::ClassDef ( CbmPhsdGenerator  ,
 
)
private

◆ operator=()

CbmPhsdGenerator& CbmPhsdGenerator::operator= ( const CbmPhsdGenerator )
private

◆ ReadCollisionData()

void CbmPhsdGenerator::ReadCollisionData ( const char *  fileNameInput)
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().

◆ ReadConversionTable()

void CbmPhsdGenerator::ReadConversionTable ( )
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().

◆ ReadEvent()

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.

Parameters
pStackpointer to the stack
vernot used

Definition at line 123 of file CbmPhsdGenerator.cxx.

References fReadDat, ReadEvent300(), and ReadEventDat().

◆ ReadEvent300()

Bool_t CbmPhsdGenerator::ReadEvent300 ( FairPrimaryGenerator *  primGen)

◆ ReadEventDat()

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().

◆ SkipEvents()

Bool_t CbmPhsdGenerator::SkipEvents ( Int_t  count)

Skip some events in file TODO Implement

Member Data Documentation

◆ Ap

int CbmPhsdGenerator::Ap
private

Definition at line 106 of file CbmPhsdGenerator.h.

Referenced by ReadCollisionData().

◆ At

int CbmPhsdGenerator::At
private

Definition at line 106 of file CbmPhsdGenerator.h.

Referenced by ReadCollisionData().

◆ ekin

double CbmPhsdGenerator::ekin
private

Definition at line 109 of file CbmPhsdGenerator.h.

Referenced by ReadCollisionData(), ReadEvent300(), and ReadEventDat().

◆ fBaryonsFile

FILE* CbmPhsdGenerator::fBaryonsFile
private

Whether phsd.dat or .300/301 files are used.

Definition at line 92 of file CbmPhsdGenerator.h.

Referenced by CbmPhsdGenerator(), ReadEvent300(), and ~CbmPhsdGenerator().

◆ fDatFile

FILE* CbmPhsdGenerator::fDatFile
private

HSD output files.

Definition at line 94 of file CbmPhsdGenerator.h.

Referenced by CbmPhsdGenerator(), ReadEventDat(), and ~CbmPhsdGenerator().

◆ fFileName

const Char_t* CbmPhsdGenerator::fFileName
private

Map from HSD PID to PDGPID.

Definition at line 98 of file CbmPhsdGenerator.h.

◆ fMesonsFile

FILE * CbmPhsdGenerator::fMesonsFile
private

Definition at line 92 of file CbmPhsdGenerator.h.

Referenced by CbmPhsdGenerator(), ReadEvent300(), and ~CbmPhsdGenerator().

◆ fParticleTable

std::map<Int_t, Int_t> CbmPhsdGenerator::fParticleTable
private

HSD output files.

Definition at line 96 of file CbmPhsdGenerator.h.

Referenced by ReadConversionTable(), ReadEvent300(), and ~CbmPhsdGenerator().

◆ fReadDat

Bool_t CbmPhsdGenerator::fReadDat
private

Definition at line 90 of file CbmPhsdGenerator.h.

Referenced by CbmPhsdGenerator(), and ReadEvent().

◆ IRUNS

int CbmPhsdGenerator::IRUNS
private

Definition at line 108 of file CbmPhsdGenerator.h.

Referenced by ReadCollisionData(), and ReadEvent300().

◆ ISUBS

int CbmPhsdGenerator::ISUBS
private

Definition at line 107 of file CbmPhsdGenerator.h.

Referenced by ReadCollisionData().

◆ nextBaryon

Hadron CbmPhsdGenerator::nextBaryon
private

Input file name.

Definition at line 101 of file CbmPhsdGenerator.h.

Referenced by CbmPhsdGenerator(), and ReadEvent300().

◆ nextEvent

int CbmPhsdGenerator::nextEvent
private

Definition at line 102 of file CbmPhsdGenerator.h.

Referenced by CbmPhsdGenerator(), ReadEvent300(), and ReadEventDat().

◆ nextMeson

Hadron CbmPhsdGenerator::nextMeson
private

Definition at line 101 of file CbmPhsdGenerator.h.

Referenced by CbmPhsdGenerator(), and ReadEvent300().

◆ Zp

int CbmPhsdGenerator::Zp
private

Definition at line 106 of file CbmPhsdGenerator.h.

Referenced by ReadCollisionData().

◆ Zt

int CbmPhsdGenerator::Zt
private

Definition at line 106 of file CbmPhsdGenerator.h.

Referenced by ReadCollisionData().


The documentation for this class was generated from the following files: