|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "GaudiKernel/MsgStream.h"
30 ATH_MSG_INFO(
"================ Generator Settings =================");
43 ATH_MSG_INFO(
"=====================================================");
64 const Int_t nbins_E = 60;
67 double logxmin = std::log10(
xmin);
68 double logxmax = std::log10(
xmax);
69 double binwidth = (logxmax-logxmin)/nbins_E;
70 Double_t
xbins[nbins_E+1];
72 for (Int_t
i=1;
i<=nbins_E;
i++) {
129 return StatusCode::FAILURE;
143 return StatusCode::SUCCESS;
150 const EventContext& ctx = Gaudi::Hive::currentContext();
164 auto weightContainer =
m_evt.weights();
165 if(weightContainer.size() != 5) {
166 ATH_MSG_WARNING(
"The number of weights for this event is not equal to 5.");
167 return StatusCode::SUCCESS;
169 double weight = weightContainer[0];
170 HepMC::FourVector primaryPosition(weightContainer[1],weightContainer[2],weightContainer[3],weightContainer[4]);
177 for (
auto hepmc_part:
m_evt) {
178 auto prodVertex = hepmc_part->production_vertex();
179 if(!prodVertex)
continue;
182 values[0] = prodVertex->position().perp()/1000.;
183 values[1] = hepmc_part->momentum().e()/1000.;
184 values[2] = hepmc_part->momentum().pz()/1000.;
185 values[3] = hepmc_part->momentum().perp()/1000.;
187 pdgId = hepmc_part->pdg_id();
if(pdgId<0) pdgId = -pdgId;
198 else if(pdgId == 13) {
207 return StatusCode::SUCCESS;
214 return StatusCode::SUCCESS;
221 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
StringProperty m_inputFile
Input file name.
void setEnableSampling(bool enableSampling)
Turn on or off sampling from the input ASCII file.
FloatProperty m_flipProbability
Flip probability.
BooleanProperty m_enableFlip
Flag for flipping event.
BooleanProperty m_enableSampling
Flag to enable or disable sampling.
virtual int fillEvt(HepMC::GenEvent *evt, CLHEP::HepRandomEngine *engine)=0
A function to create one event in HepMC format.
virtual StatusCode genInitialize()
For initializing the generator, if required.
virtual StatusCode fillEvt(HepMC::GenEvent *evt)
Fill the GenEvent pointer with the contents of the GenEvent cache.
StringProperty m_bufferFileName
The name of the binary buffer file, needed for sampling from a converted file.
bool msgLvl(const MSG::Level lvl) const
StringArrayProperty m_generatorSettings
A vector of strings defining generator settings.
A class to provide conversion from a MARS format ASCII input record into HepMC format,...
DoubleProperty m_interfacePlane
The position of the interface plane in mm.
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
void setDebugEnable(bool debug)
A function to turn on or off debug print out.
Base class for common behaviour of generator interfaces.
BeamHaloGenerator * m_beamHaloGenerator
A pointer to the beam halo generator.
A class to provide conversion from a FLUKA format ASCII input record into HepMC format,...
virtual int genFinalize()
A function to finalise the generator.
StringProperty m_inputTypeStr
Input file type and therefore associated beam halo generator that should be used.
POOL::TEvent event(POOL::TEvent::kClassAccess)
virtual StatusCode genFinalize()
For finalising the generator, if required.
::StatusCode StatusCode
StatusCode definition for legacy code.
TH1F * m_validationPlots[NPLOTS]
An array of TH1F pointers for validation plots.
StringProperty m_randomStream
Name of the random number stream.
virtual StatusCode callGenerator()
Read one event from the selected input and convert it into GenEvent format.
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
void setFlipProbability(float flipProbability)
Set probability of flipping an event about Z=0.
void setBufferFileName(const std::string &bufferFileName)
Set the name of the binary buffer file, needed for sampling from a converted file.
ServiceHandle< ITHistSvc > m_tHistSvc
A pointer to the THist service for validation plots.
void setEnableFlip(bool enableFlip)
Turn on or off the event flipping code.
#define ATH_MSG_WARNING(x)
virtual int genInitialize()
A function to initialise the generator.
HepMC::GenEvent m_evt
An empty GenEvent to cache the generate output between callGenerator and fillEvt.
void setInterfacePlane(double interfacePlane)
Set the position of the interface plane in mm.
BooleanProperty m_doMonitoringPlots
A flag to allow monitoring plots to be turned on or off.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
BeamHaloGeneratorAlg(const std::string &name, ISvcLocator *svcLocator)
constexpr int pow(int base, int exp) noexcept