Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Sherpa_i Class Reference

#include <Sherpa_i.h>

Inheritance diagram for Sherpa_i:
Collaboration diagram for Sherpa_i:

Public Member Functions

 Sherpa_i (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode genInitialize ()
 For initializing the generator, if required. More...
 
StatusCode callGenerator ()
 For calling the generator on each iteration of the event loop. More...
 
StatusCode genFinalize ()
 For finalising the generator, if required. More...
 
StatusCode fillEvt (HepMC::GenEvent *evt)
 For filling the HepMC event object. More...
 
void getParameters (int &argc, char **&argv)
 
void compilePlugin (const std::string &)
 
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...
 

Protected Attributes

SHERPA::Sherpa * p_sherpa {}
 
std::string m_basefragment
 Sherpa base settings (read from base fragment file) More...
 
StringProperty m_runcard {this, "RunCard", ""}
 FIXME unused? More...
 
StringArrayProperty m_params {this, "Parameters", {} }
 List of additional Sherpa parameters beyond run card snippet (from JO file) More...
 
StringArrayProperty m_openloopslibs {this, "OpenLoopsLibs", {} }
 List of needed OpenLoops process libraries (from JO file) More...
 
StringArrayProperty m_extrafiles {this, "ExtraFiles", {} }
 List of any additional needed files, e.g. custom libraries, PDF sets (from JO file) More...
 
IntegerProperty m_ncores {this, "NCores", 1}
 Number of cores recommended for multi-core integration file. More...
 
DoubleProperty m_memorymb {this, "MemoryMB", 2500.}
 Memory required for integration/evgen. More...
 
StringProperty m_plugincode {this, "PluginCode", ""}
 Optional code for plugin library to compile and load at run time. More...
 
DoubleProperty m_variation_weight_cap {this, "VariationWeightCap", 10.0}
 Variation weight cap factor. More...
 
DoubleProperty m_xsscale {this, "CrossSectionScaleFactor", 1.0}
 
BooleanProperty m_cleanup {this, "CleanupGeneratedFiles", true}
 
IntegerProperty m_dsid {this, "Dsid", 999999, "Dataset ID number"}
 

Private Types

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

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

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...
 
ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
 Data members. More...
 
ServiceHandle< IIncidentSvc > m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
 Handle on the incident service. 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

Definition at line 18 of file Sherpa_i.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ Sherpa_i()

Sherpa_i::Sherpa_i ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 39 of file Sherpa_i.cxx.

40  : GenModule(name, pSvcLocator)
41 {
42  #ifdef IS_SHERPA_3
43  declareProperty("BaseFragment", m_inputfiles["Base.yaml"] = "");
44  declareProperty("RunCard", m_inputfiles["Sherpa.yaml"] = "");
45  #endif
46 }

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 Sherpa_i::callGenerator ( )
virtual

For calling the generator on each iteration of the event loop.

Reimplemented from GenModule.

Definition at line 201 of file Sherpa_i.cxx.

201  {
202  ATH_MSG_DEBUG("Sherpa_i in callGenerator()");
203  //Re-seed the random number stream
204  long seeds[7];
205  const EventContext& ctx = Gaudi::Hive::currentContext();
206  ATHRNG::calculateSeedsMC21(seeds, "SHERPA", ctx.eventID().event_number(), m_dsid, m_randomSeed);
207  p_rndEngine->setSeeds(seeds, 0); // NOT THREAD-SAFE
208 
209  do {
210  ATH_MSG_DEBUG("Trying to generate event with Sherpa");
211  } while (p_sherpa->GenerateOneEvent()==false);
212 
213  const size_t genEvents = ATOOLS::rpa->gen.NumberOfGeneratedEvents();
214  if (genEvents%1000==0) {
215  ATH_MSG_INFO("Passed "<<genEvents<<" events.");
216  }
217 
218  return StatusCode::SUCCESS;
219 }

◆ 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 }

◆ compilePlugin()

void Sherpa_i::compilePlugin ( const std::string &  pluginCode)

Definition at line 354 of file Sherpa_i.cxx.

354  {
355  // TODO: not very pretty, should we eventually do this in Python instead (base fragment)
356  FILE *file = fopen("Sherpa_iPlugin.C","w");
357  fputs(pluginCode.c_str(),file);
358  fclose(file);
359  std::string command;
360  // Python -> C++ string conversion seems to add quote character as first
361  // and last line if the string contains quotes (like always in a plugin)
362  // thus removing them here
363  command += "tail -n +2 Sherpa_iPlugin.C | head -n -1 > Sherpa_iPlugin.C.tmp; mv Sherpa_iPlugin.C.tmp Sherpa_iPlugin.C; ";
364  command += "g++ -shared -std=c++0x -g ";
365  command += "-I`Sherpa-config --incdir` ";
366  command += "`Sherpa-config --ldflags` ";
367  command += "-I$FASTJETPATH/include ";
368  command += "-fPIC -o libSherpa_iPlugin.so Sherpa_iPlugin.C";
369  ATH_MSG_INFO("Now compiling plugin library using: "+command);
370  if (system(command.c_str())!=0) {
371  ATH_MSG_ERROR("Error compiling plugin library.");
372  }
373 }

◆ 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 Sherpa_i::fillEvt ( HepMC::GenEvent *  evt)
virtual

For filling the HepMC event object.

Implements GenModule.

Definition at line 221 of file Sherpa_i.cxx.

221  {
222  ATH_MSG_DEBUG( "Sherpa_i Filling event");
223 #ifdef HEPMC3
224  if (!event->run_info()) event->set_run_info(m_runinfo);
225 #endif
226  p_sherpa->FillHepMCEvent(*event);
227 
228 
229 #ifdef HEPMC3
230 //Weight, MEWeight, WeightNormalisation, NTrials
231  if (event->weights().size()>2) {
232  double nominal = event->weight("Weight");
233  for (const auto& name: event->weight_names()) {
234  if (name == "WeightNormalisation") continue;
235  if (name == "NTrials") continue;
236  if (name == "Weight") continue;
237  if (name == "NTrials") continue;
238  if (std::abs(event->weight(name)) > m_variation_weight_cap*std::abs(nominal)) {
239  ATH_MSG_INFO("Capping variation" << name << " = " << event->weight(name)/nominal << "*nominal");
240  event->weight(name) *= m_variation_weight_cap*std::abs(nominal)/std::abs(event->weight(name));
241  }
242  ATH_MSG_DEBUG("Sherpa WEIGHT " << name << " value="<< event->weight(name));
243  }
244  }
245 #else
246  if (event->weights().size()>2) {
247  for (size_t i=0; i<event->weights().size(); ++i) {
248  if (i>3) { // cap variation weights
249  // cap variation weights at m_variation_weight_cap*nominal to avoid spikes from numerical instability
250  if (std::abs(event->weights()[i]) > m_variation_weight_cap*std::abs(event->weights()[0])) {
251  ATH_MSG_INFO("Capping variation" << i << " = " << event->weights()[i]/event->weights()[0] << "*nominal");
252  event->weights()[i] *= m_variation_weight_cap*std::abs(event->weights()[0])/std::abs(event->weights()[i]);
253  }
254  }
255  ATH_MSG_DEBUG("Sherpa WEIGHT " << i << " value="<< event->weights()[i]);
256  }
257  }
258 #endif
259 
260 #ifdef HEPMC3
261  event->set_units(HepMC3::Units::MEV, HepMC3::Units::MM);
262 #else
263  GeVToMeV(event); //unit check
264 #endif
265 
266 
267  return StatusCode::SUCCESS;
268 }

◆ finalize()

StatusCode GenModule::finalize ( )
inlineinherited

Definition at line 55 of file GenModule.h.

55 { return genFinalize(); }

◆ genFinalize()

StatusCode Sherpa_i::genFinalize ( )
virtual

For finalising the generator, if required.

Reimplemented from GenModule.

Definition at line 270 of file Sherpa_i.cxx.

270  {
271 
272  ATH_MSG_INFO("Sherpa_i finalize()");
273 
274  std::cout << "MetaData: generator = Sherpa" << SHERPA_VERSION << "." << SHERPA_SUBVERSION << std::endl;
275  std::cout << "MetaData: cross-section (nb)= " << p_sherpa->TotalXS()/1000.0*m_xsscale << std::endl;
276 
277  std::cout << "MetaData: PDF = " << p_sherpa->PDFInfo() << std::endl;
278 
279  std::cout << "Named variations initialised by Sherpa:" << std::endl;
280  std::cout << *p_sherpa->GetInitHandler()->GetVariations() << std::endl;
281 
282  p_sherpa->SummarizeRun();
283  delete p_sherpa;
284 
285  if (m_cleanup) {
286  ATH_MSG_INFO("Deleting left-over files from working directory.");
287  system("rm -rf Results.db Process MIG_*.db MPI_*.dat libSherpa*.so libProc*.so");
288  }
289 
290  return StatusCode::SUCCESS;
291 }

◆ genInitialize()

StatusCode Sherpa_i::genInitialize ( )
virtual

For initializing the generator, if required.

Reimplemented from GenModule.

Definition at line 50 of file Sherpa_i.cxx.

50  {
51  if (m_plugincode != "") {
53  #ifndef IS_SHERPA_3
54  m_params.value().push_back("SHERPA_LDADD=Sherpa_iPlugin");
55  #endif
56  }
57 
58  ATH_MSG_INFO("Sherpa initialising...");
59 
60  #ifdef IS_SHERPA_3
61  for (auto& inputfile : m_inputfiles) {
62  // remove first line and last character containing '"'
63  // TODO fix Python/C++ string passing, to not contain " in first place
64  inputfile.second.erase(0, inputfile.second.find("\n") + 1);
65  inputfile.second.pop_back();
66  }
67  #endif
68 
69  ATH_MSG_DEBUG("... compiling plugin code");
70  if (m_plugincode != "") {
72  #ifdef IS_SHERPA_3
73  m_inputfiles["Base.yaml"] += "SHERPA_LDADD: Sherpa_iPlugin \n";
74  #else
75  m_params.value().push_back("SHERPA_LDADD=Sherpa_iPlugin");
76  #endif
77  }
78 
79  ATH_MSG_DEBUG("... seeding Athena random number generator");
80  p_rndEngine = getRandomEngineDuringInitialize("SHERPA", m_randomSeed, m_dsid); // NOT THREAD-SAFE
81 
82  #ifdef IS_SHERPA_3
83  ATH_MSG_DEBUG("... adapting output level");
84  if( msg().level()==MSG::FATAL || msg().level()==MSG::ERROR || msg().level()==MSG::WARNING ){
85  m_inputfiles["Base.yaml"] += "\nEVT_OUTPUT: 0 \n";
86  }
87  else if(msg().level()==MSG::INFO){
88  m_inputfiles["Base.yaml"] += "\nEVT_OUTPUT: 2 \n";
89  }
90  else if(msg().level()==MSG::DEBUG){
91  m_inputfiles["Base.yaml"] += "\nEVT_OUTPUT: 15 \n";
92  }
93  else{
94  m_inputfiles["Base.yaml"] += "\nEVT_OUTPUT: 15 \n";
95  }
96 
97  ATH_MSG_DEBUG("... writing input files to directory");
98  for (auto& inputfile : m_inputfiles) {
99  // write input content to file in working directory
100  FILE *file = fopen(inputfile.first.c_str(),"w");
101  fputs(inputfile.second.c_str(),file);
102  fclose(file);
103  ATH_MSG_INFO("Sherpa_i using the following settings in "+inputfile.first);
104  ATH_MSG_INFO("\n"+inputfile.second+"\n");
105  }
106 
107  ATH_MSG_DEBUG("... go Sherpa!");
108  int argc = 2;
109  char** argv = new char*[2];
110  argv[0] = new char[7];
111  argv[1] = new char[34];
112  strcpy(argv[0], "Sherpa");
113  strcpy(argv[1], "RUNDATA: [Base.yaml, Sherpa.yaml]");
114  p_sherpa = new SHERPA::Sherpa(argc, argv);
115  delete [] argv;
116  #else
117  p_sherpa = new SHERPA::Sherpa();
118  #endif
119 
120 
121  /***
122  translate ATOOLS:SignalHandler
123  ***/
124  std::set_terminate(ATOOLS::Terminate);
125  std::set_unexpected(ATOOLS::Terminate);
126  #ifdef IS_SHERPA_3
127  signal(SIGSEGV,ATOOLS::HandleSignal);
128  signal(SIGINT,ATOOLS::HandleSignal);
129  signal(SIGPIPE,ATOOLS::HandleSignal);
130  signal(SIGBUS,ATOOLS::HandleSignal);
131  signal(SIGFPE,ATOOLS::HandleSignal);
132  signal(SIGABRT,ATOOLS::HandleSignal);
133  signal(SIGTERM,ATOOLS::HandleSignal);
134  signal(SIGXCPU,ATOOLS::HandleSignal);
135  signal(SIGUSR1,ATOOLS::HandleSignal);
136 
137  try {
138  p_sherpa->InitializeTheRun();
139  p_sherpa->InitializeTheEventHandler();
140  }
141  catch (const ATOOLS::normal_exit& exception) {
142  ATH_MSG_ERROR("Normal exit caught, this probably means:");
143  ATH_MSG_ERROR("Have to compile Amegic libraries");
144  ATH_MSG_ERROR("You probably want to run ./makelibs");
145  return StatusCode::FAILURE;
146  }
147  catch (const ATOOLS::Exception& exception) {
148  ATH_MSG_ERROR("Unwanted ATOOLS::exception caught.");
150  return StatusCode::FAILURE;
151  }
152  #else
153  signal(SIGSEGV,ATOOLS::SignalHandler);
154  signal(SIGINT,ATOOLS::SignalHandler);
155  signal(SIGBUS,ATOOLS::SignalHandler);
156  signal(SIGFPE,ATOOLS::SignalHandler);
157  signal(SIGABRT,ATOOLS::SignalHandler);
158  signal(SIGTERM,ATOOLS::SignalHandler);
159  signal(SIGXCPU,ATOOLS::SignalHandler);
160 
161  try {
162  int argc;
163  char** argv;
165  p_sherpa->InitializeTheRun(argc,(char **)argv);
166  delete [] argv;
167 
168  p_sherpa->InitializeTheEventHandler();
169  }
170  catch (const ATOOLS::Exception& exception) {
171  if (exception.Class()=="Matrix_Element_Handler" && exception.Type()==ATOOLS::ex::normal_exit) {
172  ATH_MSG_ERROR("Have to compile Amegic libraries");
173  ATH_MSG_ERROR("You probably want to run ./makelibs");
174  }
175  else {
176  ATH_MSG_ERROR("Unwanted ATOOLS::exception caught.");
178  }
179  return StatusCode::FAILURE;
180  }
181  #endif
182  catch (const std::exception& exception) {
183  ATH_MSG_ERROR("std::exception caught.");
184  return StatusCode::FAILURE;
185  }
186 
187  #ifdef HEPMC3
188  m_runinfo = std::make_shared<HepMC3::GenRunInfo>();
190  struct HepMC3::GenRunInfo::ToolInfo generator = {
191  std::string("SHERPA"),
192  std::string(SHERPA_VERSION)+ "." + std::string(SHERPA_SUBVERSION),
193  std::string("Used generator")
194  };
195  m_runinfo->tools().push_back(generator);
196  #endif
197  return StatusCode::SUCCESS;
198 }

◆ 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; }

◆ getParameters()

void Sherpa_i::getParameters ( int &  argc,
char **&  argv 
)

Definition at line 295 of file Sherpa_i.cxx.

295  {
296  std::vector<std::string> params;
297 
298  // set some ATLAS specific default values as a starting point
299  params.push_back("EXTERNAL_RNG=Atlas_RNG");
300 
301  /***
302  Adopt Atlas Debug Level Scheme
303  ***/
304 
305  std::string verbose_arg;
306  MsgStream log(msgSvc(), name());
307  if( log.level()==MSG::FATAL || log.level()==MSG::ERROR || log.level()==MSG::WARNING ){
308  params.push_back("OUTPUT=0");
309  }
310  else if(log.level()==MSG::INFO){
311  params.push_back("OUTPUT=2");
312  }
313  else if(log.level()==MSG::DEBUG){
314  params.push_back("OUTPUT=3");
315  }
316  else{
317  params.push_back("OUTPUT=15");
318  }
319 
320  // disregard manual RUNDATA setting if run card given in JO
321  if (m_runcard != "") m_params.value().push_back("RUNDATA=Run.dat");
322 
323  // allow to overwrite all parameters from JO file
324  params.insert(params.begin()+params.size(), m_params.begin(), m_params.end());
325 
326  // create Run.dat file if runcard explicitely given
327  if (m_runcard != "") {
328  FILE *file = fopen("Run.dat","w");
329  fputs(m_runcard.value().c_str(),file);
330  fclose(file);
331  }
332 
333  /***
334  Convert into Sherpas argc/argv arguments
335  ***/
336  argc = 1+params.size();
337  argv = new char * [ 1+params.size() ];
338  argv[0] = new char[7];
339  strcpy(argv[0], "Sherpa");
340 
341  ATH_MSG_INFO("Sherpa_i using the following Arguments");
343  for(size_t i=0; i<params.size(); i++) {
344  ATH_MSG_INFO(" [ " << params[i] << " ] ");
345  argv[i+1] = new char[params[i].size()+1];
346  strcpy(argv[i+1], params[i].c_str());
347  }
348  ATH_MSG_INFO("End Sherpa_i Argument List");
349  ATH_MSG_INFO("Further Sherpa initialisation output will be redirected to the LOG_FILE specified above.");
350 
351 }

◆ 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_basefragment

std::string Sherpa_i::m_basefragment
protected

Sherpa base settings (read from base fragment file)

Definition at line 39 of file Sherpa_i.h.

◆ m_cleanup

BooleanProperty Sherpa_i::m_cleanup {this, "CleanupGeneratedFiles", true}
protected

Definition at line 67 of file Sherpa_i.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_dsid

IntegerProperty Sherpa_i::m_dsid {this, "Dsid", 999999, "Dataset ID number"}
protected

Definition at line 70 of file Sherpa_i.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_extrafiles

StringArrayProperty Sherpa_i::m_extrafiles {this, "ExtraFiles", {} }
protected

List of any additional needed files, e.g. custom libraries, PDF sets (from JO file)

Definition at line 52 of file Sherpa_i.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_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_memorymb

DoubleProperty Sherpa_i::m_memorymb {this, "MemoryMB", 2500.}
protected

Memory required for integration/evgen.

Definition at line 58 of file Sherpa_i.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_ncores

IntegerProperty Sherpa_i::m_ncores {this, "NCores", 1}
protected

Number of cores recommended for multi-core integration file.

Definition at line 55 of file Sherpa_i.h.

◆ m_openloopslibs

StringArrayProperty Sherpa_i::m_openloopslibs {this, "OpenLoopsLibs", {} }
protected

List of needed OpenLoops process libraries (from JO file)

Definition at line 49 of file Sherpa_i.h.

◆ m_params

StringArrayProperty Sherpa_i::m_params {this, "Parameters", {} }
protected

List of additional Sherpa parameters beyond run card snippet (from JO file)

Definition at line 45 of file Sherpa_i.h.

◆ m_plugincode

StringProperty Sherpa_i::m_plugincode {this, "PluginCode", ""}
protected

Optional code for plugin library to compile and load at run time.

Definition at line 61 of file Sherpa_i.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_rndmSvc

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

Data members.

Definition at line 99 of file GenModule.h.

◆ m_runcard

StringProperty Sherpa_i::m_runcard {this, "RunCard", ""}
protected

FIXME unused?

Sherpa run card snippet (from JO file)

Definition at line 42 of file Sherpa_i.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_variation_weight_cap

DoubleProperty Sherpa_i::m_variation_weight_cap {this, "VariationWeightCap", 10.0}
protected

Variation weight cap factor.

Definition at line 64 of file Sherpa_i.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_xsscale

DoubleProperty Sherpa_i::m_xsscale {this, "CrossSectionScaleFactor", 1.0}
protected

Definition at line 66 of file Sherpa_i.h.

◆ p_sherpa

SHERPA::Sherpa* Sherpa_i::p_sherpa {}
protected

Definition at line 32 of file Sherpa_i.h.


The documentation for this class was generated from the following files:
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
Sherpa_i::m_runcard
StringProperty m_runcard
FIXME unused?
Definition: Sherpa_i.h:42
Sherpa_i::compilePlugin
void compilePlugin(const std::string &)
Definition: Sherpa_i.cxx:354
Sherpa_i::getParameters
void getParameters(int &argc, char **&argv)
Definition: Sherpa_i.cxx:295
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:18
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
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
GenBase::GeVToMeV
void GeVToMeV(HepMC::GenEvent *evt)
Scale event energies/momenta by x 1000.
Definition: GenBase.cxx:58
GenBase::events_const
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Definition: GenBase.h:96
SG::ReadHandle< McEventCollection >
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
GenModule::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
Definition: GenModule.h:101
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
MM
@ MM
Definition: RegSelEnums.h:38
HepMC::newGenEvent
GenEvent * newGenEvent(const int a, const int b)
Definition: GenEvent.h:624
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
Sherpa_i::p_sherpa
SHERPA::Sherpa * p_sherpa
Definition: Sherpa_i.h:32
Sherpa_i::m_xsscale
DoubleProperty m_xsscale
Definition: Sherpa_i.h:66
HepMC::fillBarcodesAttribute
void fillBarcodesAttribute(GenEvent *)
Definition: GenEvent.h:626
Sherpa_i::m_plugincode
StringProperty m_plugincode
Optional code for plugin library to compile and load at run time.
Definition: Sherpa_i.h:61
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
Sherpa_i::m_variation_weight_cap
DoubleProperty m_variation_weight_cap
Variation weight cap factor.
Definition: Sherpa_i.h:64
GenModule::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: GenModule.cxx:34
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
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:274
GenModule::genuserInitialize
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
Definition: GenModule.h:64
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
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
GenModule::genInitialize
virtual StatusCode genInitialize()
For initializing the generator, if required.
Definition: GenModule.h:62
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
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
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
calibdata.exception
exception
Definition: calibdata.py:496
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
file
TFile * file
Definition: tile_monitor.h:29
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
GenModule::genFinalize
virtual StatusCode genFinalize()
For finalising the generator, if required.
Definition: GenModule.h:70
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Sherpa_i::m_dsid
IntegerProperty m_dsid
Definition: Sherpa_i.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
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
GenModule::GenModule
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: GenModule.cxx:14
Sherpa_i::m_cleanup
BooleanProperty m_cleanup
Definition: Sherpa_i.h:67
WriteHiveWithMetaData.streamName
string streamName
Definition: WriteHiveWithMetaData.py:22
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
Cut::signal
@ signal
Definition: SUSYToolsAlg.cxx:67
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
mc.generator
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
Definition: mc.MGH7_FxFx_H71-DEFAULT_test.py:18
a
TList * a
Definition: liststreamerinfos.cxx:10
columnar::empty
bool empty() const noexcept
Definition: ObjectRange.h:129
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
GenModule::m_randomSeed
IntegerProperty m_randomSeed
Seed for random number engine.
Definition: GenModule.h:84
FullCPAlgorithmsTest_CA.inputfile
dictionary inputfile
Definition: FullCPAlgorithmsTest_CA.py:62
DEBUG
#define DEBUG
Definition: page_access.h:11
GenBase::pdt
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition: GenBase.h:123
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
ATHRNG::calculateSeedsMC21
void calculateSeedsMC21(long *seeds, const std::string &algName, uint64_t ev, uint64_t run, uint64_t offset=0)
Set the random seed using a string (e.g.
Definition: RNGWrapper.cxx:37
Sherpa_i::m_params
StringArrayProperty m_params
List of additional Sherpa parameters beyond run card snippet (from JO file)
Definition: Sherpa_i.h:45
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
get_generator_info.command
string command
Definition: get_generator_info.py:38
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
GenModule::getRandomEngineDuringInitialize
CLHEP::HepRandomEngine * getRandomEngineDuringInitialize(const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const
Definition: GenModule.cxx:53
ServiceHandle< ICondSvc >
p_rndEngine
CLHEP::HepRandomEngine * p_rndEngine
Definition: Sherpa_i.cxx:37