ATLAS Offline Software
Loading...
Searching...
No Matches
BeamHaloGenerator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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 <memory>
12#include "AtlasHepMC/GenEvent.h"
13
14class GenData;
15namespace CLHEP {
16 class HepRandomEngine;
17}
19class AsciiInput;
22
31 public:
32
34 const std::string& inputFile,
35 const std::vector<std::string>& generatorSettings);
36
37 virtual ~BeamHaloGenerator();
38
40 virtual int genInitialize();
41
43 virtual int genFinalize();
44
46 virtual int fillEvt(HepMC::GenEvent* evt,
47 CLHEP::HepRandomEngine* engine) = 0;
48
49 protected:
50
52 virtual int readEvent(std::vector<BeamHaloParticle> *beamHaloEvent,
53 CLHEP::HepRandomEngine* engine) = 0;
54
56 virtual int readParticle(BeamHaloParticle *beamHaloParticle) = 0;
57
58 public:
59
60
62 void setInterfacePlane(double interfacePlane) { m_interfacePlane = interfacePlane; }
63
65 void setEnableFlip(bool enableFlip) { m_enableFlip = enableFlip; }
66
68 void setFlipProbability(float flipProbability) { m_flipProbability = flipProbability; }
69
71 void setEnableSampling(bool enableSampling) { m_enableSampling = enableSampling; }
72
75 void setBufferFileName(const std::string& bufferFileName) { m_bufferFileName = bufferFileName; }
76
79
80 protected:
81
92
93
95 bool flipEvent(CLHEP::HepRandomEngine* engine);
96
99 int convertEvent(std::vector<BeamHaloParticle>* beamHaloEvent,
100 HepMC::GenEvent* evt,
101 CLHEP::HepRandomEngine* engine);
102
104 std::shared_ptr<GenData> m_gendata;
105
107 std::string m_inputFile;
108
111
114
117
120
123 std::string m_bufferFileName;
124
126 std::unique_ptr<BeamHaloParticleBuffer> m_beamHaloParticleBuffer;
127
130 std::unique_ptr<AsciiInput> m_asciiInput;
131
134 std::unique_ptr<BeamHaloGeneratorSettings> m_beamHaloGeneratorSettings;
135
138
145
148
151
154
155 private:
156
158 std::vector<std::string> m_generatorSettings;
159
160};
161
162#endif
163
const bool debug
A class to provide read access to an ASCII input file.
Definition AsciiInput.h:18
A GenModule algorithm to produce beam halo HepMC records from input ASCII files produced with MARS or...
A class to read a vector of strings defining particle filtering settings and provide a method for fil...
long m_eventNumber
A data member to count the event number.
double m_wsums[NUM_COUNTERS]
Sum of weights of particles or events of dimension enumCounters.
void setEnableSampling(bool enableSampling)
Turn on or off sampling from the input ASCII file.
float m_flipProbability
Flip probability.
void setBufferFileName(const std::string &bufferFileName)
Set the name of the binary buffer file, needed for sampling from a converted file.
virtual int readEvent(std::vector< BeamHaloParticle > *beamHaloEvent, CLHEP::HepRandomEngine *engine)=0
A function to read one event in a simplified format.
void setDebugEnable(bool debug)
A function to turn on or off debug print out.
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.
std::unique_ptr< AsciiInput > m_asciiInput
A pointer to an AsciiInput object, used to read data from the Ascii input file.
virtual int readParticle(BeamHaloParticle *beamHaloParticle)=0
A function to read one particle from the input ASCII file.
std::string m_inputFile
Input file name.
bool m_enableFlip
Flag for flipping event.
virtual int genInitialize()
A function to initialise the generator.
BeamHaloGenerator(const std::string &inputFile, const std::vector< std::string > &generatorSettings)
void setFlipProbability(float flipProbability)
Set probability of flipping an event about Z=0.
std::unique_ptr< BeamHaloParticleBuffer > m_beamHaloParticleBuffer
Binary particle buffer for caching converted events.
long m_counters[NUM_COUNTERS]
Particle or event counters of dimension enumCounters.
enumCounters
An enum of particle counter indices.
std::vector< std::string > m_generatorSettings
A vector of generator settings in string command form.
void setEnableFlip(bool enableFlip)
Turn on or off the event flipping code.
virtual int genFinalize()
A function to finalise the generator.
bool m_debug
A flat to turn on or off debug print out.
std::unique_ptr< BeamHaloGeneratorSettings > m_beamHaloGeneratorSettings
A pointer to a BeamHaloGeneratorSettings object used to filter particles.
virtual int fillEvt(HepMC::GenEvent *evt, CLHEP::HepRandomEngine *engine)=0
A function to create one event in HepMC format.
enumGeneratorProcessIds
An enum of generator process identifiers.
bool m_enableSampling
Flag to enable or disable sampling.
void setInterfacePlane(double interfacePlane)
Set the position of the interface plane in mm.
double m_interfacePlane
The position of the interface plane in mm.
bool flipEvent(CLHEP::HepRandomEngine *engine)
A member function to check if the event should be flipped.
std::string m_bufferFileName
The name of the binary buffer file, needed for sampling from a converted file.
std::shared_ptr< GenData > m_gendata
A shared pointer to the GenData helper object.
A class to describe a generic beam halo particle.
GenData is a class for particle data access.
Definition GenData.h:30
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39