|
ATLAS Offline Software
|
An abstract base class to provide generic beam halo generator functionality.
More...
#include <BeamHaloGenerator.h>
|
virtual int | readEvent (std::vector< BeamHaloParticle > *beamHaloEvent, CLHEP::HepRandomEngine *engine)=0 |
| A function to read one event in a simplified format. More...
|
|
virtual int | readParticle (BeamHaloParticle *beamHaloParticle)=0 |
| 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...
|
|
An abstract base class to provide generic beam halo generator functionality.
- Author
- W. H. Bell W.Bel.nosp@m.l@ce.nosp@m.rn.ch
Definition at line 31 of file BeamHaloGenerator.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.
◆ BeamHaloGenerator()
BeamHaloGenerator::BeamHaloGenerator |
( |
const HepPDT::ParticleDataTable * |
particleTable, |
|
|
const std::string & |
inputFile, |
|
|
const std::vector< std::string > & |
generatorSettings |
|
) |
| |
◆ ~BeamHaloGenerator()
BeamHaloGenerator::~BeamHaloGenerator |
( |
| ) |
|
|
virtual |
◆ convertEvent()
int BeamHaloGenerator::convertEvent |
( |
std::vector< BeamHaloParticle > * |
beamHaloEvent, |
|
|
HepMC::GenEvent * |
evt, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| |
|
protected |
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()
virtual int BeamHaloGenerator::fillEvt |
( |
HepMC::GenEvent * |
evt, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| |
|
pure virtual |
◆ flipEvent()
bool BeamHaloGenerator::flipEvent |
( |
CLHEP::HepRandomEngine * |
engine | ) |
|
|
protected |
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 BeamHaloGenerator::genFinalize |
( |
| ) |
|
|
virtual |
A function to finalise the generator.
Reimplemented in FlukaHaloGenerator, and MarsHaloGenerator.
Definition at line 57 of file BeamHaloGenerator.cxx.
59 std::cout <<
"=================================================================" << std::endl;
60 std::cout <<
"| | Total Number | Total Weight |" << std::endl;
61 std::cout <<
"|---------------------------------------------------------------|" << std::endl;
62 std::cout <<
"| Particles read from input file | ";
64 std::cout << std::setw(12) << std::setprecision(8) <<
m_wsums[
TOT_READ] <<
" |" << std::endl;
65 std::cout <<
"| Particles after cuts | ";
67 std::cout << std::setw(12) << std::setprecision(8) <<
m_wsums[
TOT_AFTER] <<
" |" << std::endl;
68 std::cout <<
"| Particles generated | ";
70 std::cout << std::setw(12) << std::setprecision(8) <<
m_wsums[
TOT_GEN] <<
" |" << std::endl;
71 std::cout <<
"=================================================================" << std::endl;
73 std::cout << std::setprecision(6);
◆ genInitialize()
int BeamHaloGenerator::genInitialize |
( |
| ) |
|
|
virtual |
◆ readEvent()
virtual int BeamHaloGenerator::readEvent |
( |
std::vector< BeamHaloParticle > * |
beamHaloEvent, |
|
|
CLHEP::HepRandomEngine * |
engine |
|
) |
| |
|
protectedpure virtual |
◆ readParticle()
virtual int BeamHaloGenerator::readParticle |
( |
BeamHaloParticle * |
beamHaloParticle | ) |
|
|
protectedpure virtual |
◆ setBufferFileName()
void BeamHaloGenerator::setBufferFileName |
( |
const std::string & |
bufferFileName | ) |
|
|
inline |
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 | ) |
|
|
inline |
◆ setEnableFlip()
void BeamHaloGenerator::setEnableFlip |
( |
bool |
enableFlip | ) |
|
|
inline |
◆ setEnableSampling()
void BeamHaloGenerator::setEnableSampling |
( |
bool |
enableSampling | ) |
|
|
inline |
◆ setFlipProbability()
void BeamHaloGenerator::setFlipProbability |
( |
float |
flipProbability | ) |
|
|
inline |
◆ setInterfacePlane()
void BeamHaloGenerator::setInterfacePlane |
( |
double |
interfacePlane | ) |
|
|
inline |
◆ m_asciiInput
◆ m_beamHaloGeneratorSettings
◆ m_beamHaloParticleBuffer
◆ m_bufferFileName
std::string BeamHaloGenerator::m_bufferFileName |
|
protected |
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 |
|
protected |
◆ m_enableFlip
bool BeamHaloGenerator::m_enableFlip |
|
protected |
◆ m_enableSampling
bool BeamHaloGenerator::m_enableSampling |
|
protected |
◆ m_eventNumber
long BeamHaloGenerator::m_eventNumber |
|
protected |
◆ m_flipProbability
float BeamHaloGenerator::m_flipProbability |
|
protected |
◆ m_generatorSettings
std::vector<std::string> BeamHaloGenerator::m_generatorSettings |
|
private |
◆ m_inputFile
std::string BeamHaloGenerator::m_inputFile |
|
protected |
◆ m_interfacePlane
double BeamHaloGenerator::m_interfacePlane |
|
protected |
◆ m_particleTable
const HepPDT::ParticleDataTable* BeamHaloGenerator::m_particleTable |
|
protected |
◆ 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.
A class to read a vector of strings defining particle filtering settings and provide a method for fil...
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 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.
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.
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
bool m_debug
A flat to turn on or off debug print out.
std::vector< std::string > m_generatorSettings
A vector of generator settings in string command form.
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.
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
std::string m_inputFile
Input file name.
BeamHaloParticleBuffer * m_beamHaloParticleBuffer
Binary particle buffer for caching converted events.
bool flipEvent(CLHEP::HepRandomEngine *engine)
A member function to check if the event should be flipped.