ATLAS Offline Software
Loading...
Searching...
No Matches
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
13namespace HepPDT {
14 class ParticleDataTable;
15}
16namespace CLHEP {
17 class HepRandomEngine;
18}
20class 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
63 void setInterfacePlane(double interfacePlane) { m_interfacePlane = interfacePlane; }
64
66 void setEnableFlip(bool enableFlip) { m_enableFlip = enableFlip; }
67
69 void setFlipProbability(float flipProbability) { m_flipProbability = flipProbability; }
70
72 void setEnableSampling(bool enableSampling) { m_enableSampling = enableSampling; }
73
76 void setBufferFileName(const std::string& bufferFileName) { m_bufferFileName = bufferFileName; }
77
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
155
156 private:
157
159 std::vector<std::string> m_generatorSettings;
160
161};
162
163#endif
164
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.
BeamHaloGeneratorSettings * m_beamHaloGeneratorSettings
A pointer to a BeamHaloGeneratorSettings object used to filter particles.
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 HepPDT::ParticleDataTable *particleTable, const std::string &inputFile, const std::vector< std::string > &generatorSettings)
BeamHaloParticleBuffer * m_beamHaloParticleBuffer
Binary particle buffer for caching converted events.
void setFlipProbability(float flipProbability)
Set probability of flipping an event about Z=0.
long m_counters[NUM_COUNTERS]
Particle or event counters of dimension enumCounters.
enumCounters
An enum of particle counter indices.
AsciiInput * m_asciiInput
A pointer to an AsciiInput object, used to read data from the Ascii input file.
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.
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.
const HepPDT::ParticleDataTable * m_particleTable
A pointer to the particle data table.
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.
A class to describe a generic beam halo particle.