ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
BeamHaloGeneratorAlg Class Reference

A GenModule algorithm to produce beam halo HepMC records from input ASCII files produced with MARS or FLUKA beam background simulations. More...

#include <BeamHaloGeneratorAlg.h>

Inheritance diagram for BeamHaloGeneratorAlg:
Collaboration diagram for BeamHaloGeneratorAlg:

Public Member Functions

 BeamHaloGeneratorAlg (const std::string &name, ISvcLocator *svcLocator)
 
virtual ~BeamHaloGeneratorAlg ()=default
 
virtual StatusCode genInitialize ()
 For initializing the generator, if required. More...
 
virtual StatusCode genFinalize ()
 For finalising the generator, if required. More...
 
virtual StatusCode callGenerator ()
 Read one event from the selected input and convert it into GenEvent format. More...
 
virtual StatusCode fillEvt (HepMC::GenEvent *evt)
 Fill the GenEvent pointer with the contents of the GenEvent cache. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

enum  validationPlotsEnum {
  PRI_R, PRI_Z, PRI_Z_TCT, SP_R_ALL,
  SP_E_ALL, SP_PZ_ALL, SP_PT_ALL, SP_R_PROTONS,
  SP_E_PROTONS, SP_PZ_PROTONS, SP_PT_PROTONS, SP_R_MUONS,
  SP_E_MUONS, SP_PZ_MUONS, SP_PT_MUONS, NPLOTS
}
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StringProperty m_inputTypeStr {this, "inputType", "MARS-NM"}
 Input file type and therefore associated beam halo generator that should be used. More...
 
StringProperty m_inputFile {this, "inputFile", "bgi-b2l1.1"}
 Input file name. More...
 
DoubleProperty m_interfacePlane {this, "interfacePlane", 20850.0}
 The position of the interface plane in mm. More...
 
BooleanProperty m_enableFlip {this, "enableFlip", false}
 Flag for flipping event. More...
 
FloatProperty m_flipProbability {this, "flipProbability", 0.0}
 Flip probability. More...
 
BooleanProperty m_enableSampling {this, "enableSampling", false}
 Flag to enable or disable sampling. More...
 
StringProperty m_bufferFileName {this, "bufferFileName", "BinaryBuffer.bin"}
 The name of the binary buffer file, needed for sampling from a converted file. More...
 
StringArrayProperty m_generatorSettings {this, "generatorSettings", {}, "A set of cuts to be applied to generated particles."}
 A vector of strings defining generator settings. More...
 
BooleanProperty m_doMonitoringPlots {this, "doMonitoringPlots", false}
 A flag to allow monitoring plots to be turned on or off. More...
 
ServiceHandle< ITHistSvc > m_tHistSvc {this, "THistSvc", "THistSvc"}
 A pointer to the THist service for validation plots. More...
 
StringProperty m_randomStream {this, "randomStream", "BeamHalo"}
 Name of the random number stream. More...
 
BeamHaloGeneratorm_beamHaloGenerator {}
 A pointer to the beam halo generator. More...
 
HepMC::GenEvent m_evt {}
 An empty GenEvent to cache the generate output between callGenerator and fillEvt. More...
 
TH1F * m_validationPlots [NPLOTS]
 An array of TH1F pointers for validation plots. More...
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Utility event-mangling functions

Todo:
Replace with HepMC units when available
ServiceHandle< IPartPropSvc > m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
 Handle on the particle property service. More...
 
SG::ReadHandleKey< McEventCollectionm_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
 Const handle to the MC event collection. More...
 
void GeVToMeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1000. More...
 
void MeVToGeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1/1000. More...
 
void cmTomm (HepMC::GenEvent *evt)
 Scale event lengths by x 10. More...
 
void mmTocm (HepMC::GenEvent *evt)
 Scale event lengths by x 1/10. More...
 

Features for derived classes to use internally

ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
 Data members. More...
 
ServiceHandle< IIncidentSvc > m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
 Handle on the incident service. More...
 
IntegerProperty m_randomSeed {this, "RandomSeed", 1234567, "Random seed for the built-in random engine"}
 Seed for random number engine. More...
 
BooleanProperty m_isAfterburner {this, "IsAfterburner", false, "Set true if generator modifies existing events rather than creating new ones"}
 Flag for normal vs. afterburner generators. More...
 
CLHEP::HepRandomEngine * getRandomEngine (const std::string &streamName, const EventContext &ctx) const
 
CLHEP::HepRandomEngine * getRandomEngine (const std::string &streamName, unsigned long int randomSeedOffset, const EventContext &ctx) const
 
CLHEP::HepRandomEngine * getRandomEngineDuringInitialize (const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const
 

Detailed Description

A GenModule algorithm to produce beam halo HepMC records from input ASCII files produced with MARS or FLUKA beam background simulations.

Author
W. H. Bell W.Bel.nosp@m.l@ce.nosp@m.rn.ch

Definition at line 26 of file BeamHaloGeneratorAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ validationPlotsEnum

Enumerator
PRI_R 
PRI_Z 
PRI_Z_TCT 
SP_R_ALL 
SP_E_ALL 
SP_PZ_ALL 
SP_PT_ALL 
SP_R_PROTONS 
SP_E_PROTONS 
SP_PZ_PROTONS 
SP_PT_PROTONS 
SP_R_MUONS 
SP_E_MUONS 
SP_PZ_MUONS 
SP_PT_MUONS 
NPLOTS 

Definition at line 87 of file BeamHaloGeneratorAlg.h.

87  {
88  PRI_R,
89  PRI_Z,
90  PRI_Z_TCT,
91  SP_R_ALL,
92  SP_E_ALL,
93  SP_PZ_ALL,
94  SP_PT_ALL,
99  SP_R_MUONS,
100  SP_E_MUONS,
101  SP_PZ_MUONS,
102  SP_PT_MUONS,
103  NPLOTS};

Constructor & Destructor Documentation

◆ BeamHaloGeneratorAlg()

BeamHaloGeneratorAlg::BeamHaloGeneratorAlg ( const std::string &  name,
ISvcLocator *  svcLocator 
)

Definition at line 17 of file BeamHaloGeneratorAlg.cxx.

18  : GenModule(name,svcLocator)
19 {
20  for (int i=0;i<NPLOTS;i++) {
21  m_validationPlots[i] = nullptr;
22  }
23 }

◆ ~BeamHaloGeneratorAlg()

virtual BeamHaloGeneratorAlg::~BeamHaloGeneratorAlg ( )
virtualdefault

Member Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/2]

HepMC::GenEvent* event GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inlineinherited

Access the current signal event (first in the McEventCollection)

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

Definition at line 76 of file GenBase.h.

76  {
77  if (events()->empty())
78  ATH_MSG_ERROR("McEventCollection is empty during first event access");
79  return *(events()->begin());
80  }

◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]

McEventCollection* events GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inherited

Access the current event's McEventCollection.

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

◆ callGenerator()

StatusCode BeamHaloGeneratorAlg::callGenerator ( )
virtual

Read one event from the selected input and convert it into GenEvent format.

If the end of file is reached the status code returned will not be success.

Reimplemented from GenModule.

Definition at line 148 of file BeamHaloGeneratorAlg.cxx.

148  {
149 
150  const EventContext& ctx = Gaudi::Hive::currentContext();
151  CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine(m_randomStream, ctx);
152 
153 
154  // Clear the event ready for it to be filled with the next beam halo event.
155  m_evt.clear();
156 
157  // Fill an event with particles from the converted ASCII input file.
158  // (If the end of file has already been reached this will return a
159  // non-zero value.)
160  if(m_beamHaloGenerator->fillEvt(&m_evt, rndmEngine) != 0) return StatusCode::FAILURE;
161 
162  // Fill monitoring plots if requested
163  if(m_doMonitoringPlots) {
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;
168  }
169  double weight = weightContainer[0];
170  HepMC::FourVector primaryPosition(weightContainer[1],weightContainer[2],weightContainer[3],weightContainer[4]);
171  m_validationPlots[PRI_R]->Fill(primaryPosition.perp()/1000.0,weight);
172  m_validationPlots[PRI_Z]->Fill(weightContainer[3]/1000.0,weight);
173  m_validationPlots[PRI_Z_TCT]->Fill(std::fabs(weightContainer[3]/1000.0),weight);
174 
175  double values[4];
176  int pdgId;
177  for (auto hepmc_part: m_evt) {
178  auto prodVertex = hepmc_part->production_vertex();
179  if(!prodVertex) continue;
180 
181  // Store the values for use in the if conditions that follow
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.;
186 
187  pdgId = hepmc_part->pdg_id(); if(pdgId<0) pdgId = -pdgId;
192  if(pdgId == 2212) {
197  }
198  else if(pdgId == 13) {
203  }
204  }
205  }
206 
207  return StatusCode::SUCCESS;
208 }

◆ cmTomm()

void GenBase::cmTomm ( HepMC::GenEvent *  evt)
protectedinherited

Scale event lengths by x 10.

Definition at line 78 of file GenBase.cxx.

78  {
79  for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
80  const HepMC::FourVector fv((*vtx)->position().x() * 10,
81  (*vtx)->position().y() * 10,
82  (*vtx)->position().z() * 10,
83  (*vtx)->position().t() * 10);
84  (*vtx)->set_position(fv);
85  }
86 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ event_const()

const HepMC::GenEvent* GenBase::event_const ( ) const
inlineinherited

Access the current signal event (const)

Definition at line 83 of file GenBase.h.

83  {
84  if (events_const()->empty())
85  ATH_MSG_ERROR("Const McEventCollection is empty during first event access");
86  return *(events_const()->begin());
87  }

◆ events_const() [1/2]

const McEventCollection* GenBase::events_const ( ) const
inlineinherited

Access the current event's McEventCollection (const)

Definition at line 96 of file GenBase.h.

96  {
97  return events_const( getContext() );
98  }

◆ events_const() [2/2]

const McEventCollection* GenBase::events_const ( const EventContext &  ctx) const
inlineinherited

Definition at line 99 of file GenBase.h.

99  {
101  if (!ret.isValid())
102  ATH_MSG_ERROR("No McEventCollection found in StoreGate with key " << m_mcevents_const.key());
103  return ret.cptr();
104  }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode GenModule::execute ( )
virtualinherited
Todo:
Remove hard-coded alg name checking (already incomplete)

Reimplemented from GenBase.

Definition at line 70 of file GenModule.cxx.

70  {
71  // Examples of how to retrieve the random number engine for a given
72  // stream.
73  // NB getRandomEngine should only be called once per event for a
74  // given stream, as it causes the stream to be re-seeded each time
75  // it is called.
76 
77  // Example 1 - seeded based on the current event number (+ slot, run, streamName)
78  //const EventContext& ctx = Gaudi::Hive::currentContext();
79  //CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine("MyStream", ctx);
80 
81  // Example 2 - seeded based on the m_randomSeed property (+ slot, run, streamName)
82  //const EventContext& ctx = Gaudi::Hive::currentContext();
83  //CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine("MyStream", m_randomSeed.value(), ctx);
84 
85  // Call the code that generates an event
86  CHECK(this->callGenerator());
87 
88  // Create the MC event and send the GeneratorEvent stored in it to fillEvt
89  HepMC::GenEvent* evt = HepMC::newGenEvent(1,1);
90  CHECK(this->fillEvt(evt));
92 
93  // Add the event to the MC event collection
94  if (events()) {
95  // If this is an "afterburner" generator, replace the last event rather than add a new one
97  if (m_isAfterburner.value() || name() == "Tauola" || name() == "Photos") {
98  events()->pop_back();
99  }
100  // Add the event to the end of the collection
101  events()->push_back(evt);
102  ATH_MSG_DEBUG("MC event added to McEventCollection");
103 
104  // remove the empty event in case of ParticleDecayer
105  if (name() == "ParticleDecayer") {
106  events()->pop_back();
107  }
108  }
109 
110  // Call the incident service to notify that an event has been made
111  m_incidentSvc->fireIncident( Incident(name(), "McEventGenerated") );
112  return StatusCode::SUCCESS;
113 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ fillEvt()

StatusCode BeamHaloGeneratorAlg::fillEvt ( HepMC::GenEvent *  evt)
virtual

Fill the GenEvent pointer with the contents of the GenEvent cache.

The GenEvent cache is filled by calling callGenerator()

Implements GenModule.

Definition at line 212 of file BeamHaloGeneratorAlg.cxx.

212  {
213  *event = m_evt;
214  return StatusCode::SUCCESS;
215 }

◆ finalize()

StatusCode GenModule::finalize ( )
inlineinherited

Definition at line 55 of file GenModule.h.

55 { return genFinalize(); }

◆ genFinalize()

StatusCode BeamHaloGeneratorAlg::genFinalize ( )
virtual

For finalising the generator, if required.

Reimplemented from GenModule.

Definition at line 219 of file BeamHaloGeneratorAlg.cxx.

219  {
220  if(m_beamHaloGenerator->genFinalize() != 0) return StatusCode::FAILURE;
221  return StatusCode::SUCCESS;
222 }

◆ genInitialize()

StatusCode BeamHaloGeneratorAlg::genInitialize ( )
virtual

For initializing the generator, if required.

Todo:
Use ServiceHandle system instead

Reimplemented from GenModule.

Definition at line 27 of file BeamHaloGeneratorAlg.cxx.

27  {
28  ATH_MSG_INFO("Initialising this BeamHaloGeneratorAlg: " << name());
29 
30  ATH_MSG_INFO("================ Generator Settings =================");
31  ATH_MSG_INFO(" input type ------------------ " << m_inputTypeStr);
32  ATH_MSG_INFO(" input file ------------------ " << m_inputFile);
33  ATH_MSG_INFO(" interface plane ------------- " << m_interfacePlane << " (mm)");
34  ATH_MSG_INFO(" enable flip about z=0 ------- " << (m_enableFlip ? "True" : "False"));
35  ATH_MSG_INFO(" flip probability ----------- " << m_flipProbability);
36  ATH_MSG_INFO(" enable sampling ------------- " << (m_enableSampling ? "True" : "False"));
37  ATH_MSG_INFO(" binary buffer file ---------- " << m_bufferFileName);
40  for(;itr!=itr_end;++itr) ATH_MSG_INFO((*itr));
41  ATH_MSG_INFO(" Produce monitoring plots ---- " << (m_doMonitoringPlots ? "True" : "False"));
42  ATH_MSG_INFO(" Random stream name ---------- " << m_randomStream);
43  ATH_MSG_INFO("=====================================================");
44 
45  // Check the flip probability
46  if(m_flipProbability <= 0) {
47  ATH_MSG_INFO("Event flipping will be disabled.");
48  m_enableFlip = false;
49  }
50  else if(m_flipProbability > 1) {
51  ATH_MSG_WARNING("Flip probability " << m_flipProbability << " is out of range. Event flipping will be disabled.");
52  m_enableFlip = false;
53  }
54  else {
55  m_enableFlip = true;
56  }
57 
58  // Retrieve pointer to THistSvc if monitoring plots are requested
61  ATH_CHECK(m_tHistSvc.retrieve());
62 
63  // Create log10 bins for x-axis of E plots.
64  const Int_t nbins_E = 60;
65  double xmin = 1e-2;
66  double xmax = 3.5e3;
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];
71  xbins[0] = xmin;
72  for (Int_t i=1;i<=nbins_E;i++) {
73  xbins[i] = xmin + std::pow(10,logxmin+i*binwidth);
74  }
75 
76  // Create the monitoring plots
77  m_validationPlots[PRI_R] = new TH1F("primaryR",";Radius [m];Events/[m]",100,0., 0.2);
78  m_validationPlots[PRI_Z] = new TH1F("primaryZ",";z [m];Events/[m]",1100,0., 550.); // Beam gas and TCT
79  m_validationPlots[PRI_Z_TCT] = new TH1F("primaryZ_TCT",";z [m];Events/[m]",100,144., 149.); // TCT region
80  m_validationPlots[SP_R_ALL] = new TH1F("scoringPlaneR_all",";Radius [m];Particles/[m]",240,0., 24.);
81  m_validationPlots[SP_E_ALL] = new TH1F("scoringPlaneE_all",";Energy [GeV];Particles/[GeV]",nbins_E,xbins);
82  m_validationPlots[SP_PZ_ALL] = new TH1F("scoringPlanePz_all",";p_{z} [GeV];Particles/[GeV]",350,0., 3500.);
83  m_validationPlots[SP_PT_ALL] = new TH1F("scoringPlanePt_all",";p_{T} [GeV];Particles/[GeV]",500,0., 50.);
84  m_validationPlots[SP_R_PROTONS] = new TH1F("scoringPlaneR_protons",";Radius [m];Particles/[m]",240,0., 24.);
85  m_validationPlots[SP_E_PROTONS] = new TH1F("scoringPlaneE_protons",";Energy [GeV];Particles/[GeV]",nbins_E,xbins);
86  m_validationPlots[SP_PZ_PROTONS] = new TH1F("scoringPlanePz_protons",";p_{z} [GeV];Particles/[GeV]",350,0., 3500.);
87  m_validationPlots[SP_PT_PROTONS] = new TH1F("scoringPlanePt_protons",";p_{T} [GeV];Particles/[GeV]",500,0., 50.);
88  m_validationPlots[SP_R_MUONS] = new TH1F("scoringPlaneR_muons",";Radius [m];Particles/[m]",240,0., 24.);
89  m_validationPlots[SP_E_MUONS] = new TH1F("scoringPlaneE_muons",";Energy [GeV];Particles/[GeV]",nbins_E,xbins);
90  m_validationPlots[SP_PZ_MUONS] = new TH1F("scoringPlanePz_muons",";p_{z} [GeV];Particles/[GeV]",350,0., 3500.);
91  m_validationPlots[SP_PT_MUONS] = new TH1F("scoringPlanePt_muons",";p_{T} [GeV];Particles/[GeV]",500,0., 50.);
92 
93  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/primaryR", m_validationPlots[PRI_R]));
94  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/primaryZ", m_validationPlots[PRI_Z]));
95  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/primaryZ_TCT", m_validationPlots[PRI_Z_TCT]));
96  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlaneR_all", m_validationPlots[SP_R_ALL]));
97  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlaneE_all", m_validationPlots[SP_E_ALL]));
98  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlanePz_all", m_validationPlots[SP_PZ_ALL]));
99  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlanePt_all", m_validationPlots[SP_PT_ALL]));
100  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlaneR_protons", m_validationPlots[SP_R_PROTONS]));
101  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlaneE_protons", m_validationPlots[SP_E_PROTONS]));
102  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlanePz_protons", m_validationPlots[SP_PZ_PROTONS]));
103  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlanePt_protons", m_validationPlots[SP_PT_PROTONS]));
104  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlaneR_muons", m_validationPlots[SP_R_MUONS]));
105  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlaneE_muons", m_validationPlots[SP_E_MUONS]));
106  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlanePz_muons", m_validationPlots[SP_PZ_MUONS]));
107  ATH_CHECK(m_tHistSvc->regHist("/BeamHalo/scoringPlanePt_muons", m_validationPlots[SP_PT_MUONS]));
108  }
109 
110  // Check the input type string
111  if (m_inputTypeStr == "MARS-NM") {
113  m_inputFile,
115  }
116  else if (m_inputTypeStr == "FLUKA-VT") {
118  m_inputFile,
120  }
121  else if (m_inputTypeStr == "FLUKA-RB") {
123  m_inputFile,
125  }
126  else {
128  ATH_MSG_FATAL("Input type " << m_inputTypeStr << " is not known. Available types are: MARS-NM or FLUKA-VT");
129  return StatusCode::FAILURE;
130  }
131 
132  // Set the options using those specified to this algorithm
139 
140  // Initialise the generator.
141  if(m_beamHaloGenerator->genInitialize() != 0) return StatusCode::FAILURE;
142 
143  return StatusCode::SUCCESS;
144 }

◆ genuserInitialize()

virtual StatusCode GenModule::genuserInitialize ( )
inlinevirtualinherited

For initialization of user code, if required. Called after genInitialize.

Reimplemented in Pythia8B_i.

Definition at line 64 of file GenModule.h.

64 { return StatusCode::SUCCESS; }

◆ getRandomEngine() [1/2]

CLHEP::HepRandomEngine * GenModule::getRandomEngine ( const std::string &  streamName,
const EventContext &  ctx 
) const
protectedinherited

Definition at line 34 of file GenModule.cxx.

36 {
37  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
38  std::string rngName = name()+streamName;
39  rngWrapper->setSeed( rngName, ctx );
40  return rngWrapper->getEngine(ctx);
41 }

◆ getRandomEngine() [2/2]

CLHEP::HepRandomEngine * GenModule::getRandomEngine ( const std::string &  streamName,
unsigned long int  randomSeedOffset,
const EventContext &  ctx 
) const
protectedinherited

Definition at line 44 of file GenModule.cxx.

46 {
47  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
48  rngWrapper->setSeed( streamName, ctx.slot(), randomSeedOffset, ctx.eventID().run_number() );
49  return rngWrapper->getEngine(ctx);
50 }

◆ getRandomEngineDuringInitialize()

CLHEP::HepRandomEngine * GenModule::getRandomEngineDuringInitialize ( const std::string &  streamName,
unsigned long int  randomSeedOffset,
unsigned int  conditionsRun = 1,
unsigned int  lbn = 1 
) const
protectedinherited

Definition at line 53 of file GenModule.cxx.

54 {
55  const size_t slot=0;
56  EventContext ctx;
57  ctx.setSlot( slot );
58  ctx.setEventID (EventIDBase (conditionsRun,
59  EventIDBase::UNDEFEVT, // event
60  EventIDBase::UNDEFNUM, // timestamp
61  EventIDBase::UNDEFNUM, // timestamp ns
62  lbn));
64  Atlas::ExtendedEventContext( evtStore()->hiveProxyDict(),
65  conditionsRun) );
66  return getRandomEngine(streamName, randomSeedOffset, ctx);
67 }

◆ GeVToMeV()

void GenBase::GeVToMeV ( HepMC::GenEvent *  evt)
protectedinherited

Scale event energies/momenta by x 1000.

Todo:
Add HepMC units awareness and do it differently when HepMC provides this functionality directly (and reference-based FourVector accessors)

Definition at line 58 of file GenBase.cxx.

58  {
59  for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
60  const HepMC::FourVector fv((*p)->momentum().px() * 1000,
61  (*p)->momentum().py() * 1000,
62  (*p)->momentum().pz() * 1000,
63  (*p)->momentum().e() * 1000);
64  (*p)->set_momentum(fv);
65  (*p)->set_generated_mass(1000 * (*p)->generated_mass());
66  }
67 }

◆ initialize()

StatusCode GenModule::initialize ( )
virtualinherited

Reimplemented from GenBase.

Definition at line 21 of file GenModule.cxx.

21  {
22  // Base class initializations
24  // Get the random number service
25  CHECK(m_rndmSvc.retrieve());
26  // Get the incident service
27  CHECK(m_incidentSvc.retrieve());
30  return StatusCode::SUCCESS;
31 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ MeVToGeV()

void GenBase::MeVToGeV ( HepMC::GenEvent *  evt)
protectedinherited

Scale event energies/momenta by x 1/1000.

Definition at line 68 of file GenBase.cxx.

68  {
69  for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
70  const HepMC::FourVector fv((*p)->momentum().px() / 1000,
71  (*p)->momentum().py() / 1000,
72  (*p)->momentum().pz() / 1000,
73  (*p)->momentum().e() / 1000);
74  (*p)->set_momentum(fv);
75  (*p)->set_generated_mass((*p)->generated_mass() / 1000);
76  }
77 }

◆ mmTocm()

void GenBase::mmTocm ( HepMC::GenEvent *  evt)
protectedinherited

Scale event lengths by x 1/10.

Definition at line 87 of file GenBase.cxx.

87  {
88  for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
89  const HepMC::FourVector fv((*vtx)->position().x() / 10,
90  (*vtx)->position().y() / 10,
91  (*vtx)->position().z() / 10,
92  (*vtx)->position().t() / 10);
93  (*vtx)->set_position(fv);
94  }
95 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ particleData()

const HepPDT::ParticleData* GenBase::particleData ( int  pid) const
inlineinherited

Access an element in the particle data table.

Definition at line 126 of file GenBase.h.

126  {
127  return pdt().particle(HepPDT::ParticleID(std::abs(pid)));
128  }

◆ particleTable()

const HepPDT::ParticleDataTable& GenBase::particleTable ( ) const
inlineinherited

Get a particle data table.

Definition at line 118 of file GenBase.h.

118  {
119  return *(m_ppSvc->PDT());
120  }

◆ partPropSvc()

const ServiceHandle<IPartPropSvc> GenBase::partPropSvc ( ) const
inlineinherited

Access the particle property service.

Definition at line 113 of file GenBase.h.

113  {
114  return m_ppSvc;
115  }

◆ pdt()

const HepPDT::ParticleDataTable& GenBase::pdt ( ) const
inlineinherited

Shorter alias to get a particle data table.

Definition at line 123 of file GenBase.h.

123 { return particleTable(); }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_beamHaloGenerator

BeamHaloGenerator* BeamHaloGeneratorAlg::m_beamHaloGenerator {}
private

A pointer to the beam halo generator.

Definition at line 81 of file BeamHaloGeneratorAlg.h.

◆ m_bufferFileName

StringProperty BeamHaloGeneratorAlg::m_bufferFileName {this, "bufferFileName", "BinaryBuffer.bin"}
private

The name of the binary buffer file, needed for sampling from a converted file.

Definition at line 66 of file BeamHaloGeneratorAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doMonitoringPlots

BooleanProperty BeamHaloGeneratorAlg::m_doMonitoringPlots {this, "doMonitoringPlots", false}
private

A flag to allow monitoring plots to be turned on or off.

Definition at line 72 of file BeamHaloGeneratorAlg.h.

◆ m_enableFlip

BooleanProperty BeamHaloGeneratorAlg::m_enableFlip {this, "enableFlip", false}
private

Flag for flipping event.

Definition at line 56 of file BeamHaloGeneratorAlg.h.

◆ m_enableSampling

BooleanProperty BeamHaloGeneratorAlg::m_enableSampling {this, "enableSampling", false}
private

Flag to enable or disable sampling.

Definition at line 62 of file BeamHaloGeneratorAlg.h.

◆ m_evt

HepMC::GenEvent BeamHaloGeneratorAlg::m_evt {}
private

An empty GenEvent to cache the generate output between callGenerator and fillEvt.

Definition at line 85 of file BeamHaloGeneratorAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_flipProbability

FloatProperty BeamHaloGeneratorAlg::m_flipProbability {this, "flipProbability", 0.0}
private

Flip probability.

Definition at line 59 of file BeamHaloGeneratorAlg.h.

◆ m_generatorSettings

StringArrayProperty BeamHaloGeneratorAlg::m_generatorSettings {this, "generatorSettings", {}, "A set of cuts to be applied to generated particles."}
private

A vector of strings defining generator settings.

Definition at line 69 of file BeamHaloGeneratorAlg.h.

◆ m_incidentSvc

ServiceHandle<IIncidentSvc> GenModule::m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
privateinherited

Handle on the incident service.

Definition at line 101 of file GenModule.h.

◆ m_inputFile

StringProperty BeamHaloGeneratorAlg::m_inputFile {this, "inputFile", "bgi-b2l1.1"}
private

Input file name.

Definition at line 50 of file BeamHaloGeneratorAlg.h.

◆ m_inputTypeStr

StringProperty BeamHaloGeneratorAlg::m_inputTypeStr {this, "inputType", "MARS-NM"}
private

Input file type and therefore associated beam halo generator that should be used.

Definition at line 47 of file BeamHaloGeneratorAlg.h.

◆ m_interfacePlane

DoubleProperty BeamHaloGeneratorAlg::m_interfacePlane {this, "interfacePlane", 20850.0}
private

The position of the interface plane in mm.

Definition at line 53 of file BeamHaloGeneratorAlg.h.

◆ m_isAfterburner

BooleanProperty GenModule::m_isAfterburner {this, "IsAfterburner", false, "Set true if generator modifies existing events rather than creating new ones"}
protectedinherited

Flag for normal vs. afterburner generators.

Definition at line 87 of file GenModule.h.

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

StoreGate key for the MC event collection (defaults to GEN_EVENT)

Definition at line 137 of file GenBase.h.

◆ m_mcevents_const

SG::ReadHandleKey<McEventCollection> GenBase::m_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
privateinherited

Const handle to the MC event collection.

Definition at line 163 of file GenBase.h.

◆ m_mkMcEvent

BooleanProperty GenBase::m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"}
protectedinherited

Flag to determine if a new MC event collection should be made if it doesn't exist.

Definition at line 139 of file GenBase.h.

◆ m_ppSvc

ServiceHandle<IPartPropSvc> GenBase::m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
privateinherited

Handle on the particle property service.

Definition at line 160 of file GenBase.h.

◆ m_randomSeed

IntegerProperty GenModule::m_randomSeed {this, "RandomSeed", 1234567, "Random seed for the built-in random engine"}
protectedinherited

Seed for random number engine.

Definition at line 84 of file GenModule.h.

◆ m_randomStream

StringProperty BeamHaloGeneratorAlg::m_randomStream {this, "randomStream", "BeamHalo"}
private

Name of the random number stream.

Definition at line 78 of file BeamHaloGeneratorAlg.h.

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> GenModule::m_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
privateinherited

Data members.

Definition at line 99 of file GenModule.h.

◆ m_tHistSvc

ServiceHandle<ITHistSvc> BeamHaloGeneratorAlg::m_tHistSvc {this, "THistSvc", "THistSvc"}
private

A pointer to the THist service for validation plots.

Definition at line 75 of file BeamHaloGeneratorAlg.h.

◆ m_validationPlots

TH1F* BeamHaloGeneratorAlg::m_validationPlots[NPLOTS]
private

An array of TH1F pointers for validation plots.

Definition at line 106 of file BeamHaloGeneratorAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
BeamHaloGeneratorAlg::m_inputFile
StringProperty m_inputFile
Input file name.
Definition: BeamHaloGeneratorAlg.h:50
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
BeamHaloGenerator::setEnableSampling
void setEnableSampling(bool enableSampling)
Turn on or off sampling from the input ASCII file.
Definition: BeamHaloGenerator.h:72
BeamHaloGeneratorAlg::m_flipProbability
FloatProperty m_flipProbability
Flip probability.
Definition: BeamHaloGeneratorAlg.h:59
BeamHaloGeneratorAlg::m_enableFlip
BooleanProperty m_enableFlip
Flag for flipping event.
Definition: BeamHaloGeneratorAlg.h:56
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
BeamHaloGeneratorAlg::m_enableSampling
BooleanProperty m_enableSampling
Flag to enable or disable sampling.
Definition: BeamHaloGeneratorAlg.h:62
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
GenModule::fillEvt
virtual StatusCode fillEvt(HepMC::GenEvent *evt)=0
For filling the HepMC event object.
GenModule::callGenerator
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
Definition: GenModule.h:66
BeamHaloGenerator::fillEvt
virtual int fillEvt(HepMC::GenEvent *evt, CLHEP::HepRandomEngine *engine)=0
A function to create one event in HepMC format.
GenBase::events_const
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Definition: GenBase.h:96
SG::ReadHandle< McEventCollection >
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
binwidth
bool binwidth
Definition: listroot.cxx:58
BeamHaloGeneratorAlg::SP_PZ_MUONS
@ SP_PZ_MUONS
Definition: BeamHaloGeneratorAlg.h:101
GenModule::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
Definition: GenModule.h:101
BeamHaloGeneratorAlg::m_bufferFileName
StringProperty m_bufferFileName
The name of the binary buffer file, needed for sampling from a converted file.
Definition: BeamHaloGeneratorAlg.h:66
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
HepMC::newGenEvent
GenEvent * newGenEvent(const int a, const int b)
Definition: GenEvent.h:624
BeamHaloGeneratorAlg::m_generatorSettings
StringArrayProperty m_generatorSettings
A vector of strings defining generator settings.
Definition: BeamHaloGeneratorAlg.h:69
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
BeamHaloGeneratorAlg::SP_PZ_ALL
@ SP_PZ_ALL
Definition: BeamHaloGeneratorAlg.h:93
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MarsHaloGenerator
A class to provide conversion from a MARS format ASCII input record into HepMC format,...
Definition: MarsHaloGenerator.h:18
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
BeamHaloGeneratorAlg::SP_R_MUONS
@ SP_R_MUONS
Definition: BeamHaloGeneratorAlg.h:99
HepMC::fillBarcodesAttribute
void fillBarcodesAttribute(GenEvent *)
Definition: GenEvent.h:626
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
BeamHaloGeneratorAlg::PRI_Z
@ PRI_Z
Definition: BeamHaloGeneratorAlg.h:89
BeamHaloGeneratorAlg::m_interfacePlane
DoubleProperty m_interfacePlane
The position of the interface plane in mm.
Definition: BeamHaloGeneratorAlg.h:53
GenModule::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: GenModule.cxx:34
BeamHaloGenerator::setDebugEnable
void setDebugEnable(bool debug)
A function to turn on or off debug print out.
Definition: BeamHaloGenerator.h:79
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
BeamHaloGeneratorAlg::SP_R_ALL
@ SP_R_ALL
Definition: BeamHaloGeneratorAlg.h:91
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
GenModule::genuserInitialize
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
Definition: GenModule.h:64
GenModule::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Data members.
Definition: GenModule.h:99
GenBase::m_ppSvc
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
Definition: GenBase.h:160
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
BeamHaloGeneratorAlg::m_beamHaloGenerator
BeamHaloGenerator * m_beamHaloGenerator
A pointer to the beam halo generator.
Definition: BeamHaloGeneratorAlg.h:81
BeamHaloGeneratorAlg::SP_PT_ALL
@ SP_PT_ALL
Definition: BeamHaloGeneratorAlg.h:94
GenModule::genInitialize
virtual StatusCode genInitialize()
For initializing the generator, if required.
Definition: GenModule.h:62
FlukaHaloGenerator
A class to provide conversion from a FLUKA format ASCII input record into HepMC format,...
Definition: FlukaHaloGenerator.h:18
BeamHaloGenerator::genFinalize
virtual int genFinalize()
A function to finalise the generator.
Definition: BeamHaloGenerator.cxx:57
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
BeamHaloGeneratorAlg::m_inputTypeStr
StringProperty m_inputTypeStr
Input file type and therefore associated beam halo generator that should be used.
Definition: BeamHaloGeneratorAlg.h:47
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
xmin
double xmin
Definition: listroot.cxx:60
Atlas::ExtendedEventContext
Definition: ExtendedEventContext.h:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
GenBase::m_mcevents_const
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition: GenBase.h:163
GenModule::m_isAfterburner
BooleanProperty m_isAfterburner
Flag for normal vs. afterburner generators.
Definition: GenModule.h:87
BeamHaloGeneratorAlg::NPLOTS
@ NPLOTS
Definition: BeamHaloGeneratorAlg.h:103
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
BeamHaloGeneratorAlg::m_validationPlots
TH1F * m_validationPlots[NPLOTS]
An array of TH1F pointers for validation plots.
Definition: BeamHaloGeneratorAlg.h:106
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
GenModule::genFinalize
virtual StatusCode genFinalize()
For finalising the generator, if required.
Definition: GenModule.h:70
BeamHaloGeneratorAlg::m_randomStream
StringProperty m_randomStream
Name of the random number stream.
Definition: BeamHaloGeneratorAlg.h:78
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
BeamHaloGeneratorAlg::PRI_Z_TCT
@ PRI_Z_TCT
Definition: BeamHaloGeneratorAlg.h:90
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
BeamHaloGeneratorAlg::SP_R_PROTONS
@ SP_R_PROTONS
Definition: BeamHaloGeneratorAlg.h:95
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
BeamHaloGeneratorAlg::PRI_R
@ PRI_R
Definition: BeamHaloGeneratorAlg.h:88
BeamHaloGeneratorAlg::SP_E_MUONS
@ SP_E_MUONS
Definition: BeamHaloGeneratorAlg.h:100
GenBase::particleTable
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
Definition: GenBase.h:118
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
BeamHaloGeneratorAlg::SP_E_ALL
@ SP_E_ALL
Definition: BeamHaloGeneratorAlg.h:92
BeamHaloGeneratorAlg::SP_E_PROTONS
@ SP_E_PROTONS
Definition: BeamHaloGeneratorAlg.h:96
GenModule::GenModule
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: GenModule.cxx:14
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
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
BeamHaloGeneratorAlg::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
A pointer to the THist service for validation plots.
Definition: BeamHaloGeneratorAlg.h:75
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
BeamHaloGeneratorAlg::SP_PZ_PROTONS
@ SP_PZ_PROTONS
Definition: BeamHaloGeneratorAlg.h:97
LArCellBinning.xbins
int xbins
Definition: LArCellBinning.py:163
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
BeamHaloGenerator::setEnableFlip
void setEnableFlip(bool enableFlip)
Turn on or off the event flipping code.
Definition: BeamHaloGenerator.h:66
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
BeamHaloGenerator::genInitialize
virtual int genInitialize()
A function to initialise the generator.
Definition: BeamHaloGenerator.cxx:48
BeamHaloGeneratorAlg::SP_PT_PROTONS
@ SP_PT_PROTONS
Definition: BeamHaloGeneratorAlg.h:98
GenBase::pdt
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition: GenBase.h:123
BeamHaloGeneratorAlg::m_evt
HepMC::GenEvent m_evt
An empty GenEvent to cache the generate output between callGenerator and fillEvt.
Definition: BeamHaloGeneratorAlg.h:85
xmax
double xmax
Definition: listroot.cxx:61
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
BeamHaloGeneratorAlg::SP_PT_MUONS
@ SP_PT_MUONS
Definition: BeamHaloGeneratorAlg.h:102
BeamHaloGenerator::setInterfacePlane
void setInterfacePlane(double interfacePlane)
Set the position of the interface plane in mm.
Definition: BeamHaloGenerator.h:63
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
BeamHaloGeneratorAlg::m_doMonitoringPlots
BooleanProperty m_doMonitoringPlots
A flag to allow monitoring plots to be turned on or off.
Definition: BeamHaloGeneratorAlg.h:72
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Atlas::setExtendedEventContext
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
Definition: ExtendedEventContext.cxx:50
GenBase::initialize
virtual StatusCode initialize() override
Definition: GenBase.cxx:17
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >