ATLAS Offline Software
BeamHaloGenerator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef BEAMHALOGENERATOR_H
6 #define BEAMHALOGENERATOR_H
7 
9 #include <string>
10 #include <vector>
11 #include "AtlasHepMC/GenEvent.h"
12 
13 namespace HepPDT {
14  class ParticleDataTable;
15 }
16 namespace CLHEP {
17  class HepRandomEngine;
18 }
20 class AsciiInput;
23 
32  public:
33 
34  BeamHaloGenerator(const HepPDT::ParticleDataTable* particleTable,
35  const std::string& inputFile,
36  const std::vector<std::string>& generatorSettings);
37 
38  virtual ~BeamHaloGenerator();
39 
41  virtual int genInitialize();
42 
44  virtual int genFinalize();
45 
47  virtual int fillEvt(HepMC::GenEvent* evt,
48  CLHEP::HepRandomEngine* engine) = 0;
49 
50  protected:
51 
53  virtual int readEvent(std::vector<BeamHaloParticle> *beamHaloEvent,
54  CLHEP::HepRandomEngine* engine) = 0;
55 
57  virtual int readParticle(BeamHaloParticle *beamHaloParticle) = 0;
58 
59  public:
60 
61 
64 
66  void setEnableFlip(bool enableFlip) { m_enableFlip = enableFlip; }
67 
70 
72  void setEnableSampling(bool enableSampling) { m_enableSampling = enableSampling; }
73 
76  void setBufferFileName(const std::string& bufferFileName) { m_bufferFileName = bufferFileName; }
77 
79  void setDebugEnable(bool debug) { m_debug = debug; }
80 
81  protected:
82 
93 
94 
96  bool flipEvent(CLHEP::HepRandomEngine* engine);
97 
100  int convertEvent(std::vector<BeamHaloParticle>* beamHaloEvent,
101  HepMC::GenEvent* evt,
102  CLHEP::HepRandomEngine* engine);
103 
105  const HepPDT::ParticleDataTable* m_particleTable;
106 
108  std::string m_inputFile;
109 
112 
115 
118 
121 
124  std::string m_bufferFileName;
125 
128 
132 
136 
139 
146 
149 
152 
154  bool m_debug;
155 
156  private:
157 
159  std::vector<std::string> m_generatorSettings;
160 
161 };
162 
163 #endif
164 
BeamHaloGenerator::m_enableFlip
bool m_enableFlip
Flag for flipping event.
Definition: BeamHaloGenerator.h:114
BeamHaloGeneratorSettings
A class to read a vector of strings defining particle filtering settings and provide a method for fil...
Definition: BeamHaloGeneratorSettings.h:25
BeamHaloParticle
A class to describe a generic beam halo particle.
Definition: BeamHaloParticle.h:22
BeamHaloGenerator::setEnableSampling
void setEnableSampling(bool enableSampling)
Turn on or off sampling from the input ASCII file.
Definition: BeamHaloGenerator.h:72
GenEvent.h
BeamHaloGenerator::m_wsums
double m_wsums[NUM_COUNTERS]
Sum of weights of particles or events of dimension enumCounters.
Definition: BeamHaloGenerator.h:151
BeamHaloGenerator::m_interfacePlane
double m_interfacePlane
The position of the interface plane in mm.
Definition: BeamHaloGenerator.h:111
BeamHaloGenerator::m_enableSampling
bool m_enableSampling
Flag to enable or disable sampling.
Definition: BeamHaloGenerator.h:120
BeamHaloGenerator::fillEvt
virtual int fillEvt(HepMC::GenEvent *evt, CLHEP::HepRandomEngine *engine)=0
A function to create one event in HepMC format.
BeamHaloGenerator::MARS_SHOWER
@ MARS_SHOWER
Definition: BeamHaloGenerator.h:89
BeamHaloGenerator::m_bufferFileName
std::string m_bufferFileName
The name of the binary buffer file, needed for sampling from a converted file.
Definition: BeamHaloGenerator.h:124
BeamHaloGenerator::m_counters
long m_counters[NUM_COUNTERS]
Particle or event counters of dimension enumCounters.
Definition: BeamHaloGenerator.h:148
BeamHaloGenerator::TOT_AFTER
@ TOT_AFTER
Definition: BeamHaloGenerator.h:143
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
BeamHaloGenerator::enumCounters
enumCounters
An enum of particle counter indices.
Definition: BeamHaloGenerator.h:141
BeamHaloGenerator::BeamHaloGenerator
BeamHaloGenerator(const HepPDT::ParticleDataTable *particleTable, const std::string &inputFile, const std::vector< std::string > &generatorSettings)
Definition: BeamHaloGenerator.cxx:16
BeamHaloGenerator::readEvent
virtual int readEvent(std::vector< BeamHaloParticle > *beamHaloEvent, CLHEP::HepRandomEngine *engine)=0
A function to read one event in a simplified format.
BeamHaloGenerator::TOT_GEN
@ TOT_GEN
Definition: BeamHaloGenerator.h:144
BeamHaloGenerator::FLUKA_READ
@ FLUKA_READ
Definition: BeamHaloGenerator.h:90
BeamHaloGenerator::FLUKA_SHOWER
@ FLUKA_SHOWER
Definition: BeamHaloGenerator.h:92
BeamHaloGenerator::setDebugEnable
void setDebugEnable(bool debug)
A function to turn on or off debug print out.
Definition: BeamHaloGenerator.h:79
BeamHaloGenerator::MARS_READ
@ MARS_READ
Definition: BeamHaloGenerator.h:87
BeamHaloGenerator::m_asciiInput
AsciiInput * m_asciiInput
A pointer to an AsciiInput object, used to read data from the Ascii input file.
Definition: BeamHaloGenerator.h:131
BeamHaloGenerator::~BeamHaloGenerator
virtual ~BeamHaloGenerator()
Definition: BeamHaloGenerator.cxx:40
jobOptions_CavernBackground.generatorSettings
generatorSettings
Definition: jobOptions_CavernBackground.py:35
BeamHaloGenerator::m_particleTable
const HepPDT::ParticleDataTable * m_particleTable
A pointer to the particle data table.
Definition: BeamHaloGenerator.h:105
BeamHaloParticle.h
BeamHaloGenerator
An abstract base class to provide generic beam halo generator functionality.
Definition: BeamHaloGenerator.h:31
BeamHaloGenerator::genFinalize
virtual int genFinalize()
A function to finalise the generator.
Definition: BeamHaloGenerator.cxx:57
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
BeamHaloGenerator::MARS_SINGLE
@ MARS_SINGLE
Definition: BeamHaloGenerator.h:88
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
BeamHaloGenerator::readParticle
virtual int readParticle(BeamHaloParticle *beamHaloParticle)=0
A function to read one particle from the input ASCII file.
BeamHaloGenerator::m_debug
bool m_debug
A flat to turn on or off debug print out.
Definition: BeamHaloGenerator.h:154
BeamHaloGenerator::m_generatorSettings
std::vector< std::string > m_generatorSettings
A vector of generator settings in string command form.
Definition: BeamHaloGenerator.h:159
BeamHaloGenerator::m_beamHaloGeneratorSettings
BeamHaloGeneratorSettings * m_beamHaloGeneratorSettings
A pointer to a BeamHaloGeneratorSettings object used to filter particles.
Definition: BeamHaloGenerator.h:135
BeamHaloGenerator::m_flipProbability
float m_flipProbability
Flip probability.
Definition: BeamHaloGenerator.h:117
HepPDT
Definition: BeamHaloGenerator.h:13
BeamHaloGenerator::m_eventNumber
long m_eventNumber
A data member to count the event number.
Definition: BeamHaloGenerator.h:138
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
BeamHaloParticleBuffer
Definition: BeamHaloParticleBuffer.h:45
BeamHaloGenerator::setFlipProbability
void setFlipProbability(float flipProbability)
Set probability of flipping an event about Z=0.
Definition: BeamHaloGenerator.h:69
BeamHaloGenerator::setBufferFileName
void setBufferFileName(const std::string &bufferFileName)
Set the name of the binary buffer file, needed for sampling from a converted file.
Definition: BeamHaloGenerator.h:76
jobOptions_CavernBackground.interfacePlane
interfacePlane
Definition: jobOptions_CavernBackground.py:23
AsciiInput
A class to provide read access to an ASCII input file.
Definition: AsciiInput.h:18
BeamHaloGenerator::NUM_COUNTERS
@ NUM_COUNTERS
Definition: BeamHaloGenerator.h:145
BeamHaloGenerator::setEnableFlip
void setEnableFlip(bool enableFlip)
Turn on or off the event flipping code.
Definition: BeamHaloGenerator.h:66
BeamHaloGenerator::FLUKA_SINGLE
@ FLUKA_SINGLE
Definition: BeamHaloGenerator.h:91
BeamHaloGenerator::genInitialize
virtual int genInitialize()
A function to initialise the generator.
Definition: BeamHaloGenerator.cxx:48
jobOptions_CavernBackground.flipProbability
flipProbability
Definition: jobOptions_CavernBackground.py:24
BeamHaloGenerator::m_inputFile
std::string m_inputFile
Input file name.
Definition: BeamHaloGenerator.h:108
BeamHaloGenerator::setInterfacePlane
void setInterfacePlane(double interfacePlane)
Set the position of the interface plane in mm.
Definition: BeamHaloGenerator.h:63
BeamHaloGenerator::enumGeneratorProcessIds
enumGeneratorProcessIds
An enum of generator process identifiers.
Definition: BeamHaloGenerator.h:86
BeamHaloGenerator::convertEvent
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.
Definition: BeamHaloGenerator.cxx:94
BeamHaloGenerator::m_beamHaloParticleBuffer
BeamHaloParticleBuffer * m_beamHaloParticleBuffer
Binary particle buffer for caching converted events.
Definition: BeamHaloGenerator.h:127
BeamHaloGenerator::flipEvent
bool flipEvent(CLHEP::HepRandomEngine *engine)
A member function to check if the event should be flipped.
Definition: BeamHaloGenerator.cxx:80
BeamHaloGenerator::TOT_READ
@ TOT_READ
Definition: BeamHaloGenerator.h:142
BeamHaloGeneratorAlg
A GenModule algorithm to produce beam halo HepMC records from input ASCII files produced with MARS or...
Definition: BeamHaloGeneratorAlg.h:26