|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "CLHEP/Random/RandFlat.h"
16 const HepPDT::ParticleDataTable* particleTable,
22 m_flukaParticle(
type),
23 m_lastFlukaParticle() {
36 std::cout <<
"Error: Could not open ascii input file " <<
m_inputFile << std::endl;
40 std::cout <<
"Info: Reading ascii input file " <<
m_inputFile << std::endl;
49 CLHEP::HepRandomEngine* engine) {
50 std::vector<BeamHaloParticle> beamHaloEvent;
54 if((ret_val =
readEvent(&beamHaloEvent, engine)) != 0)
return ret_val;
89 std::cout <<
"Warning: FlukaHaloGenerator::readParticle is not yet available: "<< beamHaloParticle << std::endl;
96 CLHEP::HepRandomEngine* engine) {
100 beamHaloEvent->clear();
110 std::cout <<
"Error: Conversion from FlukaParticle to BeamHaloParticle failed." << std::endl;
114 beamHaloEvent->push_back(beamHaloParticle);
124 std::vector<std::string>
row;
125 bool endOfFile =
false;
129 if(
row.size() == 0) {
163 std::cout <<
"Error: Conversion from FlukaParticle to BeamHaloParticle failed." << std::endl;
168 beamHaloEvent->push_back(beamHaloParticle);
176 if(beamHaloEvent->size() == 0) {
177 std::cout <<
"Error: No particles read from " <<
m_inputFile << std::endl;
188 for(;itr!=itr_end;++itr) {
189 beamHaloParticle = *itr;
195 if(
m_debug) std::cout <<
"Debug: Particle fails generator settings cuts." << std::endl;
209 if((ret_val =
readEvent(beamHaloEvent, engine)) != 0)
return ret_val;
JetConstituentVector::iterator iterator
int read(std::vector< std::string > *eventAsStringVector)
A function to read the values from a single row definition and fill the data members.
A class to describe a generic beam halo particle.
double m_wsums[NUM_COUNTERS]
Sum of weights of particles or events of dimension enumCounters.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
virtual int genFinalize()
A function to finalise the generator.
long m_counters[NUM_COUNTERS]
Particle or event counters of dimension enumCounters.
long eventId(void) const
A function to return the FLUKA event Id of this particle.
AsciiInput * m_asciiInput
A pointer to an AsciiInput object, used to read data from the Ascii input file.
FlukaHaloGenerator(int type, const HepPDT::ParticleDataTable *particleTable, const std::string &inputFile, const std::vector< std::string > &generatorSettings)
const HepPDT::ParticleDataTable * m_particleTable
A pointer to the particle data table.
An abstract base class to provide generic beam halo generator functionality.
virtual int genFinalize()
A function to finalise the generator.
int fill(const HepPDT::ParticleDataTable *particleDataTable, MarsParticle *marsParticle)
A function to fill the data members from an input MarsParticle object.
virtual int readEvent(std::vector< BeamHaloParticle > *beamHaloEvent, CLHEP::HepRandomEngine *engine)
A function to read one event in a simplified format.
bool m_debug
A flat to turn on or off debug print out.
BeamHaloGeneratorSettings * m_beamHaloGeneratorSettings
A pointer to a BeamHaloGeneratorSettings object used to filter particles.
virtual int genInitialize()
A function to initialise the generator.
long m_eventNumber
A data member to count the event number.
FlukaParticle m_lastFlukaParticle
bool checkParticle(BeamHaloParticle *beamHaloParticle)
Check if the supplied beam halo particle passes the generator settings.
int type(void) const
A function to return the type of this FlukaParticle.
FlukaParticle m_flukaParticle
virtual int genInitialize()
A function to initialise the generator.
std::string m_inputFile
Input file name.
int convertEvent(std::vector< BeamHaloParticle > *beamHaloEvent, HepMC::GenEvent *evt, CLHEP::HepRandomEngine *engine)
A member function to convert a vector of beam halo particles into a GenEvent.
int partGenNum(void) const
A function to return the particle generation number of this particle.
void set_signal_process_id(GenEvent *e, const int i)
virtual int fillEvt(HepMC::GenEvent *evt, CLHEP::HepRandomEngine *engine)
A function to create one event in HepMC format.
virtual int readParticle(BeamHaloParticle *beamHaloParticle)
A function to read one particle from the input ASCII file.