Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
A class to provide conversion from a FLUKA format ASCII input record into HepMC format, with or without sampling.
More...
#include <FlukaHaloGenerator.h>
|
virtual int | readEvent (std::vector< BeamHaloParticle > *beamHaloEvent, CLHEP::HepRandomEngine *engine) |
| A function to read one event in a simplified format. More...
|
|
virtual int | readParticle (BeamHaloParticle *beamHaloParticle) |
| A function to read one particle from the input ASCII file. More...
|
|
bool | flipEvent (CLHEP::HepRandomEngine *engine) |
| A member function to check if the event should be flipped. More...
|
|
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. More...
|
|
A class to provide conversion from a FLUKA format ASCII input record into HepMC format, with or without sampling.
- Author
- W. H. Bell W.Bel.nosp@m.l@ce.nosp@m.rn.ch
Definition at line 18 of file FlukaHaloGenerator.h.
◆ enumCounters
An enum of particle counter indices.
Enumerator |
---|
TOT_READ | |
TOT_AFTER | |
TOT_GEN | |
NUM_COUNTERS | |
Definition at line 141 of file BeamHaloGenerator.h.
◆ enumGeneratorProcessIds
An enum of generator process identifiers.
_READ corresponds to no sampling and therefore simple conversion from input file to HepMC record.
Enumerator |
---|
MARS_READ | |
MARS_SINGLE | |
MARS_SHOWER | |
FLUKA_READ | |
FLUKA_SINGLE | |
FLUKA_SHOWER | |
Definition at line 86 of file BeamHaloGenerator.h.
◆ FlukaHaloGenerator()
FlukaHaloGenerator::FlukaHaloGenerator |
( |
int |
type, |
|
|
const HepPDT::ParticleDataTable * |
particleTable, |
|
|
const std::string & |
inputFile, |
|
|
const std::vector< std::string > & |
generatorSettings |
|
) |
| |
◆ ~FlukaHaloGenerator()
virtual FlukaHaloGenerator::~FlukaHaloGenerator |
( |
| ) |
|
|
virtualdefault |
◆ convertEvent()
int BeamHaloGenerator::convertEvent |
( |
std::vector< BeamHaloParticle > * |
beamHaloEvent, |
|
|
HepMC::GenEvent * |
evt, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| |
|
protectedinherited |
A member function to convert a vector of beam halo particles into a GenEvent.
Definition at line 94 of file BeamHaloGenerator.cxx.
101 const double c = 2.99792458E+11;
109 evt->weights().push_back((*itr).weight());
110 HepMC::FourVector primaryPosition = (*itr).positionAtPrimary();
111 evt->weights().push_back(primaryPosition.x());
112 evt->weights().push_back(primaryPosition.y());
113 evt->weights().push_back(primaryPosition.z());
114 evt->weights().push_back(primaryPosition.t());
118 for(;itr!=itr_end;++itr) {
119 HepMC::FourVector position = (*itr).positionAtScoringPlane();
120 HepMC::FourVector fourVector = (*itr).fourVector();
134 pz = fourVector.pz();
135 fourVector.setPz(-
pz);
148 genVertex->add_particle_out(genParticle);
149 evt->add_vertex(genVertex);
◆ fillEvt()
int FlukaHaloGenerator::fillEvt |
( |
HepMC::GenEvent * |
evt, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| |
|
virtual |
◆ flipEvent()
bool BeamHaloGenerator::flipEvent |
( |
CLHEP::HepRandomEngine * |
engine | ) |
|
|
protectedinherited |
A member function to check if the event should be flipped.
Definition at line 80 of file BeamHaloGenerator.cxx.
85 if(
m_debug) std::cout <<
"Debug: Flipping event" << std::endl;
◆ genFinalize()
int FlukaHaloGenerator::genFinalize |
( |
| ) |
|
|
virtual |
◆ genInitialize()
int FlukaHaloGenerator::genInitialize |
( |
| ) |
|
|
virtual |
◆ readEvent()
int FlukaHaloGenerator::readEvent |
( |
std::vector< BeamHaloParticle > * |
beamHaloEvent, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| |
|
protectedvirtual |
A function to read one event in a simplified format.
Implements BeamHaloGenerator.
Definition at line 95 of file FlukaHaloGenerator.cxx.
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;
◆ readParticle()
A function to read one particle from the input ASCII file.
Implements BeamHaloGenerator.
Definition at line 87 of file FlukaHaloGenerator.cxx.
89 std::cout <<
"Warning: FlukaHaloGenerator::readParticle is not yet available: "<< beamHaloParticle << std::endl;
◆ setBufferFileName()
void BeamHaloGenerator::setBufferFileName |
( |
const std::string & |
bufferFileName | ) |
|
|
inlineinherited |
Set the name of the binary buffer file, needed for sampling from a converted file.
Definition at line 76 of file BeamHaloGenerator.h.
◆ setDebugEnable()
void BeamHaloGenerator::setDebugEnable |
( |
bool |
debug | ) |
|
|
inlineinherited |
◆ setEnableFlip()
void BeamHaloGenerator::setEnableFlip |
( |
bool |
enableFlip | ) |
|
|
inlineinherited |
◆ setEnableSampling()
void BeamHaloGenerator::setEnableSampling |
( |
bool |
enableSampling | ) |
|
|
inlineinherited |
◆ setFlipProbability()
void BeamHaloGenerator::setFlipProbability |
( |
float |
flipProbability | ) |
|
|
inlineinherited |
◆ setInterfacePlane()
void BeamHaloGenerator::setInterfacePlane |
( |
double |
interfacePlane | ) |
|
|
inlineinherited |
◆ m_asciiInput
◆ m_beamHaloGeneratorSettings
◆ m_beamHaloParticleBuffer
◆ m_bufferFileName
std::string BeamHaloGenerator::m_bufferFileName |
|
protectedinherited |
The name of the binary buffer file, needed for sampling from a converted file.
Definition at line 124 of file BeamHaloGenerator.h.
◆ m_counters
◆ m_debug
bool BeamHaloGenerator::m_debug |
|
protectedinherited |
◆ m_enableFlip
bool BeamHaloGenerator::m_enableFlip |
|
protectedinherited |
◆ m_enableSampling
bool BeamHaloGenerator::m_enableSampling |
|
protectedinherited |
◆ m_eventNumber
long BeamHaloGenerator::m_eventNumber |
|
protectedinherited |
◆ m_firstEvent
bool FlukaHaloGenerator::m_firstEvent |
|
private |
◆ m_flipProbability
float BeamHaloGenerator::m_flipProbability |
|
protectedinherited |
◆ m_flukaParticle
◆ m_generatorSettings
std::vector<std::string> BeamHaloGenerator::m_generatorSettings |
|
privateinherited |
◆ m_inputFile
std::string BeamHaloGenerator::m_inputFile |
|
protectedinherited |
◆ m_interfacePlane
double BeamHaloGenerator::m_interfacePlane |
|
protectedinherited |
◆ m_lastFlukaParticle
◆ m_particleTable
const HepPDT::ParticleDataTable* BeamHaloGenerator::m_particleTable |
|
protectedinherited |
◆ m_sameEvent
bool FlukaHaloGenerator::m_sameEvent |
|
private |
◆ m_wsums
Sum of weights of particles or events of dimension enumCounters.
Definition at line 151 of file BeamHaloGenerator.h.
The documentation for this class was generated from the following files:
HepMC::GenVertex * GenVertexPtr
JetConstituentVector::iterator iterator
bool m_enableFlip
Flag for flipping event.
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.
double m_interfacePlane
The position of the interface plane in mm.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
bool m_enableSampling
Flag to enable or disable sampling.
std::string m_bufferFileName
The name of the binary buffer file, needed for sampling from a converted file.
GenParticle * GenParticlePtr
long m_counters[NUM_COUNTERS]
Particle or event counters of dimension enumCounters.
BeamHaloGenerator(const HepPDT::ParticleDataTable *particleTable, const std::string &inputFile, const std::vector< std::string > &generatorSettings)
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.
const HepPDT::ParticleDataTable * m_particleTable
A pointer to the particle data table.
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.
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
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.
float m_flipProbability
Flip probability.
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.
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
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)
bool flipEvent(CLHEP::HepRandomEngine *engine)
A member function to check if the event should be flipped.