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

#include <Pythia8_i.h>

Inheritance diagram for Pythia8_i:
Collaboration diagram for Pythia8_i:

Classes

class  CommandException
 

Public Member Functions

 Pythia8_i (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~Pythia8_i ()
 
virtual StatusCode genInitialize ()
 For initializing the generator, if required. More...
 
virtual StatusCode callGenerator ()
 For calling the generator on each iteration of the event loop. More...
 
virtual StatusCode fillEvt (HepMC::GenEvent *evt)
 For filling the HepMC event object. More...
 
virtual StatusCode fillWeights (HepMC::GenEvent *evt)
 
virtual StatusCode genFinalize ()
 For finalising the generator, if required. More...
 
double pythiaVersion () const
 
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, V, H > &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
 

Static Public Member Functions

static const std::string & pythia_stream ()
 
static std::string xmlpath ()
 

Protected Member Functions

bool useRndmGenSvc () const
 
bool useReseed () const
 
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

std::unique_ptr< Pythia8::Pythia > m_pythia {}
 
HepMC::Pythia8ToHepMC m_pythiaToHepMC
 
UnsignedIntegerProperty m_maxFailures {this, "MaxFailures", 10}
 
BooleanProperty m_useRndmGenSvc {this, "useRndmGenSvc", true, "the max number of consecutive failures"}
 
std::shared_ptr< customRndmm_atlasRndmEngine {}
 
BooleanProperty m_useReseed {this,"useReseed", false}
 
IntegerProperty m_dsid {this, "Dsid", 999999, "Dataset ID number"}
 
StringArrayProperty m_userHooks {this, "UserHooks", {} }
 
DoubleProperty m_pt0timesMPI {this,"pT0timesMPI", 1.0}
 
DoubleProperty m_numberAlphaS {this,"numberAlphaS", 3.0}
 
BooleanProperty m_sameAlphaSAsMPI {this,"useSameAlphaSasMPI", false}
 

Private Types

enum  PDGID {
  PROTON =2212, ANTIPROTON =-2212, LEAD =1000822080, OXYGEN =1000080160,
  HELIUM = 1000020040, NEUTRON =2112, ANTINEUTRON =-2112, MUON =13,
  ANTIMUON =-13, ELECTRON =11, POSITRON =-11, INVALID =0
}
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

Static Private Member Functions

static std::string findValue (const std::string &command, const std::string &key)
 
static int s_allowedTunes (double version)
 

Private Attributes

int m_internal_event_number {0}
 
double m_version {-1.}
 
StringArrayProperty m_commands {this, "Commands", {} }
 
std::vector< std::string > m_userParams
 
std::vector< std::string > m_userModes
 
DoubleProperty m_collisionEnergy {this, "CollisionEnergy", 14000.0}
 
StringProperty m_beam1 {this, "Beam1", "PROTON"}
 
StringProperty m_beam2 {this, "Beam2", "PROTON"}
 
bool m_override_transform_beamenergy {false}
 
StringProperty m_lheFile {this, "LHEFile", ""}
 
BooleanProperty m_doCKKWLAcceptance {this, "CKKWLAcceptance", false}
 
BooleanProperty m_doFxFxXS {this, "FxFxXS", false}
 
BooleanProperty m_computeEfficiency {this, "computeEfficiency", false}
 
double m_nAccepted {0.}
 
double m_nMerged {0.}
 
double m_sigmaTotal {0.}
 
double m_conversion {1.}
 
unsigned int m_failureCount {0}
 
std::map< std::string, PDGIDm_particleIDs
 
std::vector< long int > m_seeds {}
 
StringProperty m_userProcess {this, "UserProcess", ""}
 
std::shared_ptr< Pythia8::Sigma2Process > m_procPtr {}
 
std::vector< UserHooksPtrTypem_userHooksPtrs {}
 
StringProperty m_userResonances {this, "UserResonances", ""}
 
std::vector< std::shared_ptr< Pythia8::ResonanceWidths > > m_userResonancePtrs
 
BooleanProperty m_useLHAPDF {this, "UseLHAPDF", true}
 
StringProperty m_particleDataFile {this, "ParticleData", ""}
 
StringProperty m_outputParticleDataFile {this, "OutputParticleData", "ParticleData.local.xml"}
 
double m_mergingWeight {1.0}
 
double m_enhanceWeight {1.0}
 
std::vector< std::string > m_weightIDs {}
 
std::vector< std::string > m_weightNames {}
 
bool m_doLHE3Weights {false}
 
std::vector< std::string > m_weightCommands {}
 
std::vector< std::string > m_showerWeightNames {"nominal"}
 
StringArrayProperty m_showerWeightNamesProp {this, "ShowerWeightNames", {} }
 
PublicToolHandle< IPythia8Customm_athenaTool {this, "CustomInterface", ""}
 
BooleanProperty m_saveLHE {this, "SaveLHERecord", false}
 
Pythia8::SuppressSmallPT * m_SuppressSmallPT {}
 
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 62 of file Pythia8_i.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

◆ PDGID

enum Pythia8_i::PDGID
private
Enumerator
PROTON 
ANTIPROTON 
LEAD 
OXYGEN 
HELIUM 
NEUTRON 
ANTINEUTRON 
MUON 
ANTIMUON 
ELECTRON 
POSITRON 
INVALID 

Definition at line 120 of file Pythia8_i.h.

120 {PROTON=2212, ANTIPROTON=-2212, LEAD=1000822080, OXYGEN=1000080160, HELIUM= 1000020040, NEUTRON=2112, ANTINEUTRON=-2112, MUON=13, ANTIMUON=-13, ELECTRON=11, POSITRON=-11, INVALID=0};

Constructor & Destructor Documentation

◆ Pythia8_i()

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

Definition at line 68 of file Pythia8_i.cxx.

69 : GenModule(name, pSvcLocator)
70 {
71  m_particleIDs["PROTON"] = PROTON;
72  m_particleIDs["ANTIPROTON"] = ANTIPROTON;
73  m_particleIDs["ELECTRON"] = ELECTRON;
74  m_particleIDs["POSITRON"] = POSITRON;
75  m_particleIDs["NEUTRON"] = NEUTRON;
76  m_particleIDs["ANTINEUTRON"] = ANTINEUTRON;
77  m_particleIDs["MUON"] = MUON;
78  m_particleIDs["ANTIMUON"] = ANTIMUON;
79  m_particleIDs["LEAD"] = LEAD;
80  m_particleIDs["OXYGEN"] = OXYGEN;
81  m_particleIDs["HELIUM"] = HELIUM;
82 
83 }

◆ ~Pythia8_i()

Pythia8_i::~Pythia8_i ( )

Definition at line 86 of file Pythia8_i.cxx.

86  {
87 
88  #ifndef PYTHIA8_3SERIES
89 // if(m_userHookPtr != 0) delete m_userHookPtr;
90 
91 // for(UserHooksPtrType ptr: m_userHooksPtrs){
92 // delete ptr;
93 // }
94  #endif
95 }

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

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

Reimplemented from GenModule.

Reimplemented in MultiPy8Pileup, and Pythia8B_i.

Definition at line 363 of file Pythia8_i.cxx.

363  {
364 
365  ATH_MSG_DEBUG(">>> Pythia8_i from callGenerator");
367  //Re-seed the random number stream
368  long seeds[7];
369  const EventContext& ctx = Gaudi::Hive::currentContext();
370  ATHRNG::calculateSeedsMC21(seeds, s_pythia_stream, ctx.eventID().event_number(), m_dsid, m_randomSeed);
371  m_atlasRndmEngine->getEngine()->setSeeds(seeds, 0); // NOT THREAD-SAFE
372  m_seeds.clear();
373  m_seeds.push_back(seeds[0]);
374  m_seeds.push_back(seeds[1]);
375  }
376 
377  bool status = m_pythia->next();
378 
379  StatusCode returnCode = StatusCode::SUCCESS;
380 
381  if(!status){
382  ++m_failureCount;
384  ATH_MSG_ERROR("Exceeded the max number of consecutive event failures.");
385  returnCode = StatusCode::FAILURE;
386  }else{
387  ATH_MSG_INFO("Event generation failed - re-trying.");
388  returnCode = this->callGenerator();
389  }
390  }
391 
392  ATH_MSG_DEBUG("Now checking with Tool.empty() second time");
393  if( ! m_athenaTool.empty() ){
394  StatusCode stat = m_athenaTool->ModifyPythiaEvent(*m_pythia);
395  if(stat != StatusCode::SUCCESS) returnCode = stat;
396  }
397 
398  m_failureCount = 0;
399 
400  m_nAccepted += 1.;
401  // some CKKWL merged events have zero weight (or unfilled event).
402  // start again with such events
403 
404  double eventWeight = m_pythia->info.mergingWeight()*m_pythia->info.weight();
405 
406 
407  if(returnCode != StatusCode::FAILURE &&
408  // Here this is a double, but it may be converted into float at some point downstream
409  (std::abs(eventWeight) < std::numeric_limits<float>::min() ||
410  m_pythia->event.size() < 2)){
411 
412  returnCode = this->callGenerator();
413  } else if ( std::abs(eventWeight) < std::numeric_limits<float>::min() &&
414  std::abs(eventWeight) > std::numeric_limits<double>::min() ){
415  ATH_MSG_WARNING("Found event weight " << eventWeight << " between the float and double precision limits. Rejecting event.");
416  } else {
417  m_nMerged += eventWeight;
419 
420  // For FxFx cross section:
421  m_sigmaTotal+=m_pythia->info.weight();
422  }
423 
424  return returnCode;
425 }

◆ 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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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 Pythia8_i::fillEvt ( HepMC::GenEvent *  evt)
virtual

For filling the HepMC event object.

Implements GenModule.

Reimplemented in MultiPy8Pileup, and Pythia8B_i.

Definition at line 428 of file Pythia8_i.cxx.

428  {
429 
430  ATH_MSG_DEBUG(">>> Pythia8_i from fillEvt");
431 
432  evt->set_event_number(m_internal_event_number);
433 
434  // if using "getGroupWeight" and | lhastrategy | = 4, then need to convert mb to pb ( done otherwise when calling info.weight(), [...] )
435  if( m_internal_event_number == 1 && std::abs(m_pythia->info.lhaStrategy()) == 4 ) {
437  ATH_MSG_DEBUG(" LHA strategy needs a conversion to fix Pythia8 shower weights bug(s) equal to " << m_conversion);
438  }
439 
440 
441  if(m_pythia->event.size() < 2){
442  ATH_MSG_ERROR("Something wrong with this event - it contains fewer than 2 particles!");
443  ATH_MSG_ERROR("internal event number is "<<m_internal_event_number);
444  return StatusCode::FAILURE;
445  }
446 
448 
449  // In case we're asked, save the LHE event as an attribute. This only works in HEPMC3.
450  if(m_saveLHE){
451 #ifdef HEPMC3
452  auto evtlhe = std::make_shared<HepMC::GenEvent>();
453  m_pythiaToHepMC.fill_next_event(m_pythia->process, evtlhe.get(), m_internal_event_number, &m_pythia->info, &m_pythia->settings);
454  auto extra = std::make_shared<HepMC::ShortEventAttribute>(evtlhe.get());
455  evt->add_attribute("LHERecord", extra);
456 #else
457  ATH_MSG_WARNING("LHE record saving requested, but not implemented with HEPMC2 functionality.");
458 #endif
459  }
460 
461  // in debug mode you can check whether the pdf information is stored
462  if(evt->pdf_info()){
463 #ifdef HEPMC3
464  ATH_MSG_DEBUG("PDFinfo id1:" << evt->pdf_info()->parton_id[0]);
465  ATH_MSG_DEBUG("PDFinfo id2:" << evt->pdf_info()->parton_id[1]);
466  ATH_MSG_DEBUG("PDFinfo x1:" << evt->pdf_info()->x[0]);
467  ATH_MSG_DEBUG("PDFinfo x2:" << evt->pdf_info()->x[1]);
468  ATH_MSG_DEBUG("PDFinfo scalePDF:" << evt->pdf_info()->scale);
469  ATH_MSG_DEBUG("PDFinfo pdf1:" << evt->pdf_info()->pdf_id[0]);
470  ATH_MSG_DEBUG("PDFinfo pdf2:" << evt->pdf_info()->pdf_id[1]);
471 #else
472  ATH_MSG_DEBUG("PDFinfo id1:" << evt->pdf_info()->id1());
473  ATH_MSG_DEBUG("PDFinfo id2:" << evt->pdf_info()->id2());
474  ATH_MSG_DEBUG("PDFinfo x1:" << evt->pdf_info()->x1());
475  ATH_MSG_DEBUG("PDFinfo x2:" << evt->pdf_info()->x2());
476  ATH_MSG_DEBUG("PDFinfo scalePDF:" << evt->pdf_info()->scalePDF());
477  ATH_MSG_DEBUG("PDFinfo pdf1:" << evt->pdf_info()->pdf1());
478  ATH_MSG_DEBUG("PDFinfo pdf2:" << evt->pdf_info()->pdf2());
479 #endif
480  }
481  else
482  ATH_MSG_DEBUG("No PDF information available in HepMC::GenEvent!");
483 
484  // set the randomseeds
486 
487  // fill weights
489 
490  return StatusCode::SUCCESS;
491 }

◆ fillWeights()

StatusCode Pythia8_i::fillWeights ( HepMC::GenEvent *  evt)
virtual

mismatch in weight name!

Definition at line 494 of file Pythia8_i.cxx.

494  {
495 
496  // reset
497  m_mergingWeight = m_pythia->info.mergingWeightNLO(); // first initialisation, good for the nominal weight in any case (see Merging:includeWeightInXsection).
498  m_enhanceWeight = 1.0; // better to keep the enhancement from UserHooks in a separate variable, to keep the code clear
499 
500 #ifndef PYTHIA8_304SERIES
501  // include Enhance userhook weight
502  for(const auto &hook: m_userHooksPtrs) {
503  if (hook->canEnhanceEmission()) {
504  m_enhanceWeight *= hook->getEnhancedEventWeight();
505  }
506  }
507 #endif // not PYTHIA8_304SERIES
508 
509  // DO NOT try to distinguish between phase space and merging contributions: only their product contains both, so always multiply them in order to be robust
510  double eventWeight = m_pythia->info.weight() * m_mergingWeight * m_enhanceWeight;
511 
512  std::map<std::string,double> fWeights; // temporary weight vector, needed while managing hepmc2 and 3 simultaneously
513 
514  // save as Default the usual pythia8 weight, including enhancements
515  // NB: info.weight() is built upon info.eventWeightLHEF (but includes shower "decorations"), not from the rwgt LHE vector.
516  size_t atlas_specific_weights = 1;
517  fWeights["Default"]=eventWeight;
518  if(m_internal_event_number == 1) {
519  ATH_MSG_INFO("found LHEF version "<< m_pythia->info.LHEFversion() );
520  if (m_pythia->info.LHEFversion() > 1) m_doLHE3Weights = true;
521  m_weightIDs.clear();
522  m_weightIDs.push_back("Default"); // notice that we are assigning a weightname = weightID
523  }
524 
525  // Now systematic weights: a) generator and b) shower variations
526  // merging implies reading from lhe files (while the opposite is not true, ok, but still works)
527  if (m_lheFile!="") {
528  // remember that the true merging component can be disentangled only when there are LHE input events
529 
530  // make sure to get the merging weight correctly: this is needed -only- for systematic weights (generator and parton shower variations)
531  // NB: most robust way, regardless of the specific value of Merging:includeWeightInXsection (if on, info.mergingWeight() is always 1.0 ! )
532  m_mergingWeight *= ( m_pythia->info.weight() / m_pythia->info.eventWeightLHEF ); // this is the actual merging component, regardless of conventions,
533  // needed by systematic variation weights
534  // this includes rare compensation or selection-biased weights
535  }
536 
537 
538  ATH_MSG_DEBUG("Event weights: enhancing weight, merging weight, total weight = "<<m_enhanceWeight<<", "<<m_mergingWeight<<", "<<eventWeight);
539 
540  // we already filled the "Default" weight
541  std::vector<std::string>::const_iterator id = m_weightIDs.begin()+atlas_specific_weights;
542 
543  // a) fill generator weights
544  if(m_pythia->info.getWeightsDetailedSize() != 0){
545  for(std::map<std::string, Pythia8::LHAwgt>::const_iterator wgt = m_pythia->info.rwgt->wgts.begin();
546  wgt != m_pythia->info.rwgt->wgts.end(); ++wgt){
547 
548  if(m_internal_event_number == 1){
549  m_weightIDs.push_back(wgt->first);
550  }else{
551  if(*id != wgt->first){
552  ATH_MSG_ERROR("Mismatch in LHE3 weight id. Found "<<wgt->first<<", expected "<<*id);
553  return StatusCode::FAILURE;
554  }
555  ++id;
556  }
557 
558  std::map<std::string, Pythia8::LHAweight>::const_iterator weightName = m_pythia->info.init_weights->find(wgt->first);
559  if(weightName != m_pythia->info.init_weights->end()){
560  fWeights[weightName->second.contents] = m_mergingWeight * m_enhanceWeight * wgt->second.contents;
561  }else{
562  // if no name was assigned/found, assign a weightname = weightid
563  fWeights[wgt->first] = m_mergingWeight * m_enhanceWeight * wgt->second.contents;
564  }
565 
566  }
567  }
568 
569  // b) shower weight variations
570  // always start from second shower weight: the first was saved already as "Default"
571 
572  for(int iw = 1; iw < m_pythia->info.PYTHIA8_NWEIGHTS(); ++iw){
573 
574  std::string wtName = ((int)m_showerWeightNames.size() == m_pythia->info.PYTHIA8_NWEIGHTS())? m_showerWeightNames[iw]: "ShowerWt_" +std::to_string(iw);
575 
576  fWeights[wtName] = m_mergingWeight * m_enhanceWeight * m_pythia->info.PYTHIA8_WEIGHT(iw)*m_conversion;
577 
578  if(m_internal_event_number == 1) {
579  m_weightIDs.push_back(wtName);
580  ATH_MSG_DEBUG("Shower weight name, value, conversion: "<<wtName<<", "<< fWeights[wtName] <<","<<m_conversion );
581  }
582  }
583 
584  // Now save, as a backup, also the LHEF weight without enhancements (useful for possible, rare, non-default cases)
585  // to make clear that it should not be used in analyses, save it always with a -10 factor (so that its goal is clear even if not checking its name)
586  if (m_lheFile!="")
587  {
588  fWeights["EXTRA_bare_LHE_weight"]=(-10.0)*m_pythia->info.eventWeightLHEF;
589  if(m_internal_event_number == 1) m_weightIDs.push_back("EXTRA_bare_LHE_weight");
590  }
591 
592  // Sad, but needed: create a string vector with acceptable order of weight names
593  if(m_internal_event_number == 1){
594  m_weightNames.clear();
595  for(const std::string &id : m_weightIDs){
596  if(m_doLHE3Weights) {
597  std::map<std::string, Pythia8::LHAweight>::const_iterator weight = m_pythia->info.init_weights->find(id);
598  if(weight != m_pythia->info.init_weights->end()) m_weightNames.push_back(weight->second.contents);
599  else m_weightNames.push_back(id);
600  }
601  else {
602  m_weightNames.push_back(id);
603  }
604  }
605  if (m_weightNames.size() != fWeights.size() ) {
606  ATH_MSG_ERROR("Something wrong when building list of weight names: " << m_weightNames.size() << " vs "<< fWeights.size() << ", exiting ...");
607  return StatusCode::FAILURE;
608  }
609  }
610 
611  // The following depends on the specific hepmc2/3 implementation
612 #ifdef HEPMC3
613  if (!evt->run_info()) {
614  evt->set_run_info(m_runinfo);
615  }
616  evt->run_info()->set_weight_names(m_weightNames);
617 
618  // for the first event, weight EXTRA_bare_LHE_weight is not present in evt->weights(), so we need to book a place for it by hand
619  if (m_internal_event_number == 1 && evt->run_info()->weight_names().size() == evt->weights().size()+1 ) {
620  evt->weights().push_back(1.0);
621  }
622 
623  // added conversion GeV -> MeV to ensure correct units
624  evt->set_units(HepMC3::Units::MEV, HepMC3::Units::MM);
625 
626  evt->weights().resize(fWeights.size(), 1.0);
627  for (auto w: fWeights) {
628  evt->weight(w.first)=w.second;
629  }
630 
631  auto beams=evt->beams();
632  ATH_MSG_DEBUG( " Energy of the beams " << beams[0]->momentum().e() );
633 
634 //uncomment to list HepMC events
635 // std::cout << " print::listing Pythia8 " << std::endl;
636 // HepMC3::Print::listing(std::cout, *evt);
637 
638 #else
639  evt->weights().clear();
640  for (const auto& w: m_weightNames ) {evt->weights()[w]=fWeights[w];}
641  auto beams=evt->beam_particles();
642  ATH_MSG_DEBUG( " Energy of the beams " << beams.first->momentum().e() );
643 
644 //uncomment to list HepMC events
645 // std::cout << " print::listing Pythia8 " << std::endl;
646 // evt->print();
647 #endif
648 
649  return StatusCode::SUCCESS;
650 }

◆ finalize()

StatusCode GenModule::finalize ( )
inlineinherited

Definition at line 55 of file GenModule.h.

55 { return genFinalize(); }

◆ findValue()

static std::string Pythia8_i::findValue ( const std::string &  command,
const std::string &  key 
)
staticprivate

◆ genFinalize()

StatusCode Pythia8_i::genFinalize ( )
virtual

For finalising the generator, if required.

Reimplemented from GenModule.

Reimplemented in MultiPy8Pileup, and Pythia8B_i.

Definition at line 653 of file Pythia8_i.cxx.

653  {
654 
655  ATH_MSG_INFO(">>> Pythia8_i from genFinalize");
656  m_pythia->stat();
657 
658  Pythia8::Info info = m_pythia->info;
659  double xs = info.sigmaGen(); // in mb
660 
662  const double accfactor = m_nMerged / info.nAccepted();
663  ATH_MSG_DEBUG("Multiplying cross-section by CKKWL merging acceptance of "<<m_nMerged <<"/" <<info.nAccepted() << " = " << accfactor
664  << ": " << xs << " -> " << xs*accfactor);
665  xs *= accfactor;
666  }
667 
668  if(m_doFxFxXS){
669  ATH_MSG_DEBUG("Using FxFx cross section recipe: xs = "<< m_sigmaTotal << " / " << 1e9*info.nTried());
670  xs = m_sigmaTotal / (1e9*info.nTried());
671  std::cout << "Using FxFx cross section recipe: xs = "<< m_sigmaTotal << " / " << 1e9*info.nTried() << std::endl;
672  }
673 
674  if( ! m_athenaTool.empty()){
675  double xsmod = m_athenaTool->CrossSectionScaleFactor();
676  ATH_MSG_DEBUG("Multiplying cross-section by Pythia Modifier tool factor " << xsmod );
677  xs *= xsmod;
678  }
679 
680  xs *= 1000. * 1000.;//convert to nb
681 
682  std::cout << "MetaData: cross-section (nb)= " << xs <<std::endl;
683  std::cout << "MetaData: generator= Pythia 8." << std::string(py8version()) <<std::endl;
684 
685  if(m_doLHE3Weights || m_weightIDs.size()>1 ){
686  std::cout<<"MetaData: weights = ";
687  for (const auto& w : m_weightNames ) std::cout<< w <<" | ";
688  std::cout<<std::endl;
689  }
690 
691  if (m_computeEfficiency){
692  if (info.nTried()>0) ATH_MSG_INFO("Pythia8 efficiency (nAccepted/nTried %) = " << info.nAccepted()*100./info.nTried());
693  else ATH_MSG_INFO("Pythia8 efficiency cannot be computed, nTried <=0");
694  }
695 
696 if(m_useRndmGenSvc){
697  ATH_MSG_INFO("Number of random numbers produced " << m_atlasRndmEngine->getRNCalls());
698  if (m_useReseed) ATH_MSG_INFO("Each event was reseeded ");
699  else ATH_MSG_INFO("Events were not reseeded ");
700 }
701 
702  return StatusCode::SUCCESS;
703 }

◆ genInitialize()

StatusCode Pythia8_i::genInitialize ( )
virtual

For initializing the generator, if required.

Reimplemented from GenModule.

Reimplemented in MultiPy8Pileup, and Pythia8B_i.

Definition at line 98 of file Pythia8_i.cxx.

98  {
99 
100  ATH_MSG_DEBUG("Pythia8_i from genInitialize()");
101 
102  ATH_MSG_INFO("XML Path is " + xmlpath());
103  m_pythia = std::make_unique<Pythia8::Pythia> (xmlpath());
104 #ifdef HEPMC3
105  m_runinfo = std::make_shared<HepMC3::GenRunInfo>();
107  struct HepMC3::GenRunInfo::ToolInfo generator={std::string("Pythia8"),py8version(),std::string("Used generator")};
108  m_runinfo->tools().push_back(generator);
109 #endif
110 
111  bool canInit = true;
112 
113  m_version = m_pythia->settings.parm("Pythia:versionNumber");
114 
115  s_pythia_stream = "PYTHIA8_INIT";
116 
117  // By default add "nominal" to the list of shower weight names
119  m_showerWeightNames.insert(m_showerWeightNames.begin(), "nominal");
120 
121  // We do explicitly set tune 4C, since it is the starting point for many other tunes
122  // Tune 4C for pp collisions
123  m_pythia->readString("Tune:pp = 5");
124 
125  // also use CTEQ6L1 from LHAPDF 6 by default
126  // can be over-written using JO
127  m_pythia->readString("PDF:pSet= LHAPDF6:cteq6l1");
128 
129  // switch off verbose event print out
130  m_pythia->readString("Next:numberShowEvent = 0");
131 
132  // Add flag to switch off from JO the Pythia8ToHepMC::print_inconsistency internal variable
133  m_pythia->settings.addFlag("AthenaPythia8ToHepMC:print_inconsistency",true);
134 
135  // Revert the recoil strategy to the old default of 1, ie. 'recoil to color'
136  // In 8.314, the default option was changed to 0, 'recoil to top' and we
137  // revert it back unless 'recoil to top'
138  // is explicitly needed for the samples
139  if (m_version > 8.313) m_pythia->readString("TimeShower:recoilStrategyRF = 1");
140 
141  // Add UserHooks first because these potentially add new settings that must exist prior to parsing commands
142 
143  for(const auto &hook: m_userHooks){
144  ATH_MSG_INFO("Adding user hook " + hook + ".");
145  bool canSetHook = true;
146  if (hook == "SuppressSmallPT") {
148  canSetHook=m_pythia->setUserHooksPtr(PYTHIA8_PTRWRAP(m_SuppressSmallPT));
149 }
150  else {
152  canSetHook = m_pythia->addUserHooksPtr(m_userHooksPtrs.back());
153 }
154  if(!canSetHook){
155  ATH_MSG_ERROR("Unable to set requested user hook.");
156  ATH_MSG_ERROR("Pythia 8 initialisation will FAIL!");
157  canInit=false;
158  }
159  }
160 
161  for(const std::pair<const std::string, double> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<double>()){
162  m_pythia->settings.addParm(param.first, param.second, false, false, 0., 0.);
163  }
164 
165  for(const std::pair<const std::string, int> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<int>()){
166  m_pythia->settings.addMode(param.first, param.second, false, false, 0., 0.);
167  }
168 
169  for(const std::pair<const std::string, bool> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<bool>()){
170  m_pythia->settings.addFlag(param.first, param.second);
171  }
172 
173  for(const std::pair<const std::string, std::string> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<std::string>()){
174  m_pythia->settings.addWord(param.first, param.second);
175  }
176 
177  if( ! m_athenaTool.empty() ){
178  if(m_athenaTool.retrieve().isFailure()){
179  ATH_MSG_ERROR("Unable to retrieve Athena Tool for custom Pythia processing");
180  return StatusCode::FAILURE;
181  }
182  else {
183  StatusCode status = m_athenaTool->InitializePythiaInfo(*m_pythia);
184  if(status != StatusCode::SUCCESS) return status;
185  }
186  }
187 
188  // Now apply the settings from the JO
189  for(const std::string &cmd : m_commands){
190 
191  if(cmd.compare("")==0) continue;
192  else if (cmd.find("Beams:id") != std::string::npos ) {
193  ATH_MSG_ERROR("With command '" << cmd << "' you are trying to set a beam different from p: please use the Beam1/Beam2 properties instead:");
194  ATH_MSG_ERROR(" example: genSeq.Pythia8.Beam1 = 'LEAD'");
195  ATH_MSG_ERROR(" genSeq.Pythia8.Beam2 = 'ANTINEUTRON'");
196  return StatusCode::FAILURE;
197  }
198  else if (cmd.find("Beams:frameType") != std::string::npos ) {
200  ATH_MSG_WARNING(" Found an explicit 'Beams:frameType' command: this will override transform beams momenta/energy parameters, regardless of its requested value. ");
201  }
202 
203  bool read = m_pythia->readString(cmd);
204 
205  if(!read){
206  ATH_MSG_ERROR("Pythia could not understand the command '"<< cmd<<"'");
207  return StatusCode::FAILURE;
208  }
209  }
210 
213 
214  ATH_MSG_INFO("Beam1 = "<<beam1);
215  ATH_MSG_INFO("Beam2 = "<<beam2);
216 
217  if(beam1 == 0 || beam2 == 0){
218  ATH_MSG_ERROR("Invalid beam particle!");
219  return StatusCode::FAILURE;
220  }
221 
222 
223 
224  if(m_useRndmGenSvc){
225 
226  ATH_MSG_INFO(" !!!!!!!!!!!! WARNING ON PYTHIA RANDOM NUMBERS !!!!!!!!!! ");
227  ATH_MSG_INFO(" THE ATHENA SERVICE AthRNGenSvc IS USED.");
228  ATH_MSG_INFO(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ");
229 
230  m_atlasRndmEngine = std::make_shared<customRndm>();
231  CLHEP::HepRandomEngine* rndmEngine = getRandomEngineDuringInitialize(s_pythia_stream, m_randomSeed, m_dsid); // NOT THREAD-SAFE
232  m_atlasRndmEngine->init(rndmEngine);
233 #if PYTHIA_VERSION_INTEGER >= 8310
234  m_pythia->setRndmEnginePtr(m_atlasRndmEngine);
235 #else
236  m_pythia->setRndmEnginePtr(m_atlasRndmEngine.get());
237 #endif
238  s_pythia_stream = "PYTHIA8";
239  }else{
240  ATH_MSG_INFO(" !!!!!!!!!!!! WARNING ON PYTHIA RANDOM NUMBERS !!!!!!!!!! ");
241  ATH_MSG_INFO(" THE STANDARD PYTHIA8 RANDOM NUMBER SERVICE IS USED.");
242  ATH_MSG_INFO(" THE ATHENA SERVICE AthRNGSvc IS ***NOT*** USED.");
243  ATH_MSG_INFO(" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ");
244  }
245 
246  if(m_userProcess != ""){
248  }
249 
250 
251 
252  if(m_userResonances.value() != ""){
253 
254  std::vector<std::string> resonanceArgs;
255 
256  boost::split(resonanceArgs, m_userResonances.value(), boost::is_any_of(":"));
257  if(resonanceArgs.size() != 2){
258  ATH_MSG_ERROR("Cannot Understand UserResonance job option!");
259  ATH_MSG_ERROR("You should specify it as a 'name:id1,id2,id3...'");
260  ATH_MSG_ERROR("Where name is the name of your UserResonance, and id1,id2,id3 are a comma separated list of PDG IDs to which it is applied");
261  canInit = false;
262  }
263  std::vector<std::string> resonanceIds;
264  boost::split(resonanceIds, resonanceArgs.back(), boost::is_any_of(","));
265  if(resonanceIds.size()==0){
266  ATH_MSG_ERROR("You did not specifiy any PDG ids to which your user resonance width should be applied!");
267  ATH_MSG_ERROR("You should specify a list as 'name:id1,id2,id3...'");
268  ATH_MSG_ERROR("Where name is the name of your UserResonance, and id1,id2,id3 are a comma separated list of PDG IDs to which it is applied");
269  canInit=false;
270  }
271 
272  for(std::vector<std::string>::const_iterator sId = resonanceIds.begin();
273  sId != resonanceIds.end(); ++sId){
274  int idResIn = boost::lexical_cast<int>(*sId);
275  m_userResonancePtrs.push_back(Pythia8_UserResonance::UserResonanceFactory::create(resonanceArgs.front(), idResIn));
276  }
277 
278  for(std::shared_ptr<Pythia8::ResonanceWidths>& resonance : m_userResonancePtrs) {
279 #if PYTHIA_VERSION_INTEGER >= 8310
280  m_pythia->setResonancePtr(resonance);
281 #else
282  m_pythia->setResonancePtr(resonance.get());
283 #endif
284  }
285 
286  }
287 
288  if(m_particleDataFile != "") {
289  if(!m_pythia->particleData.reInit(m_particleDataFile, true)){
290  ATH_MSG_ERROR("Unable to read requested particle data table: " + m_particleDataFile + " !!");
291  ATH_MSG_ERROR("Pythia 8 initialisation will FAIL!");
292  canInit = false;
293  }
294  }
295 
296  if(m_lheFile != ""){
297  if(m_procPtr){
298  ATH_MSG_ERROR("Both LHE file and user process have been specified");
299  ATH_MSG_ERROR("LHE input does not make sense with a user process!");
300  canInit = false;
301  }
302 
303  canInit = canInit && m_pythia->readString("Beams:frameType = 4");
304  canInit = canInit && m_pythia->readString("Beams:LHEF = " + m_lheFile);
305  if(!canInit){
306  ATH_MSG_ERROR("Unable to read requested LHE file: " + m_lheFile + " !");
307  ATH_MSG_ERROR("Pythia 8 initialisation will FAIL!");
308  }
309  }else{
311  canInit = canInit && m_pythia->readString("Beams:frameType = 1");
312  canInit = canInit && m_pythia->readString("Beams:eCM = " + std::to_string(m_collisionEnergy));
313  }
314  canInit = canInit && m_pythia->readString("Beams:idA = " + std::to_string(beam1));
315  canInit = canInit && m_pythia->readString("Beams:idB = " + std::to_string(beam2));
316  }
317 
318  if(m_procPtr){
319 #if PYTHIA_VERSION_INTEGER >= 8310
320  if(!m_pythia->setSigmaPtr(m_procPtr))
321 #else
322  if(!m_pythia->setSigmaPtr(m_procPtr.get()))
323 #endif
324  {
325  ATH_MSG_ERROR("Unable to set requested user process: " + m_userProcess + " !!");
326  ATH_MSG_ERROR("Pythia 8 initialisation will FAIL!");
327  canInit = false;
328  }
329  }
330 
331  StatusCode returnCode = StatusCode::SUCCESS;
332 
333  m_pythia->particleData.listXML(m_outputParticleDataFile.value().substr(0,m_outputParticleDataFile.value().find("xml"))+"orig.xml");
334  m_pythia->settings.writeFile("Settings_before.log",true);
335 
336  if(canInit){
337  canInit = m_pythia->init();
338  }
339 
340  if(!canInit){
341  returnCode = StatusCode::FAILURE;
342  ATH_MSG_ERROR(" *** Unable to initialise Pythia !! ***");
343  }
344 
345  m_pythia->particleData.listXML(m_outputParticleDataFile);
346  m_pythia->settings.writeFile("Settings_after.log",true);
347 
348  //counter for event failures;
349  m_failureCount = 0;
350 
352 
353  // Set set_print_inconsistency to Athena corresponding flag (allowing to change it from JO)
354  m_pythiaToHepMC.set_print_inconsistency( m_pythia->settings.flag("AthenaPythia8ToHepMC:print_inconsistency") );
355 
356  m_pythiaToHepMC.set_store_pdf(true);
357  m_pythiaToHepMC.set_store_weights(false);
358 
359  return returnCode;
360 }

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

◆ pythia_stream()

const std::string & Pythia8_i::pythia_stream ( )
static

Definition at line 711 of file Pythia8_i.cxx.

711  {
712  return s_pythia_stream;
713 }

◆ pythiaVersion()

double Pythia8_i::pythiaVersion ( ) const

Definition at line 706 of file Pythia8_i.cxx.

706  {
707  return m_version;
708 }

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

◆ s_allowedTunes()

static int Pythia8_i::s_allowedTunes ( double  version)
staticprivate

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

◆ useReseed()

bool Pythia8_i::useReseed ( ) const
inlineprotected

Definition at line 90 of file Pythia8_i.h.

90 {return m_useReseed; }

◆ useRndmGenSvc()

bool Pythia8_i::useRndmGenSvc ( ) const
inlineprotected

Definition at line 89 of file Pythia8_i.h.

89 { return m_useRndmGenSvc; }

◆ xmlpath()

std::string Pythia8_i::xmlpath ( )
static

Definition at line 716 of file Pythia8_i.cxx.

716  {
717 
718 
719  std::string foundpath = "";
720 
721 // Try to find the xmldoc directory using PathResolver:
722  foundpath = PathResolverFindCalibDirectory( "Pythia8/xmldoc" );
723 
724  return foundpath;
725 }

Member Data Documentation

◆ m_athenaTool

PublicToolHandle<IPythia8Custom> Pythia8_i::m_athenaTool {this, "CustomInterface", ""}
private

Definition at line 170 of file Pythia8_i.h.

◆ m_atlasRndmEngine

std::shared_ptr<customRndm> Pythia8_i::m_atlasRndmEngine {}
protected

Definition at line 97 of file Pythia8_i.h.

◆ m_beam1

StringProperty Pythia8_i::m_beam1 {this, "Beam1", "PROTON"}
private

Definition at line 125 of file Pythia8_i.h.

◆ m_beam2

StringProperty Pythia8_i::m_beam2 {this, "Beam2", "PROTON"}
private

Definition at line 126 of file Pythia8_i.h.

◆ m_collisionEnergy

DoubleProperty Pythia8_i::m_collisionEnergy {this, "CollisionEnergy", 14000.0}
private

Definition at line 122 of file Pythia8_i.h.

◆ m_commands

StringArrayProperty Pythia8_i::m_commands {this, "Commands", {} }
private

Definition at line 116 of file Pythia8_i.h.

◆ m_computeEfficiency

BooleanProperty Pythia8_i::m_computeEfficiency {this, "computeEfficiency", false}
private

Definition at line 133 of file Pythia8_i.h.

◆ m_conversion

double Pythia8_i::m_conversion {1.}
private

Definition at line 137 of file Pythia8_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_doCKKWLAcceptance

BooleanProperty Pythia8_i::m_doCKKWLAcceptance {this, "CKKWLAcceptance", false}
private

Definition at line 131 of file Pythia8_i.h.

◆ m_doFxFxXS

BooleanProperty Pythia8_i::m_doFxFxXS {this, "FxFxXS", false}
private

Definition at line 132 of file Pythia8_i.h.

◆ m_doLHE3Weights

bool Pythia8_i::m_doLHE3Weights {false}
private

Definition at line 165 of file Pythia8_i.h.

◆ m_dsid

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

Definition at line 101 of file Pythia8_i.h.

◆ m_enhanceWeight

double Pythia8_i::m_enhanceWeight {1.0}
private

Definition at line 162 of file Pythia8_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_failureCount

unsigned int Pythia8_i::m_failureCount {0}
private

Definition at line 139 of file Pythia8_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_internal_event_number

int Pythia8_i::m_internal_event_number {0}
private

Definition at line 112 of file Pythia8_i.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_lheFile

StringProperty Pythia8_i::m_lheFile {this, "LHEFile", ""}
private

Definition at line 129 of file Pythia8_i.h.

◆ m_maxFailures

UnsignedIntegerProperty Pythia8_i::m_maxFailures {this, "MaxFailures", 10}
protected

Definition at line 94 of file Pythia8_i.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_mergingWeight

double Pythia8_i::m_mergingWeight {1.0}
private

Definition at line 161 of file Pythia8_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_nAccepted

double Pythia8_i::m_nAccepted {0.}
private

Definition at line 134 of file Pythia8_i.h.

◆ m_nMerged

double Pythia8_i::m_nMerged {0.}
private

Definition at line 135 of file Pythia8_i.h.

◆ m_numberAlphaS

DoubleProperty Pythia8_i::m_numberAlphaS {this,"numberAlphaS", 3.0}
protected

Definition at line 105 of file Pythia8_i.h.

◆ m_outputParticleDataFile

StringProperty Pythia8_i::m_outputParticleDataFile {this, "OutputParticleData", "ParticleData.local.xml"}
private

Definition at line 159 of file Pythia8_i.h.

◆ m_override_transform_beamenergy

bool Pythia8_i::m_override_transform_beamenergy {false}
private

Definition at line 127 of file Pythia8_i.h.

◆ m_particleDataFile

StringProperty Pythia8_i::m_particleDataFile {this, "ParticleData", ""}
private

Definition at line 158 of file Pythia8_i.h.

◆ m_particleIDs

std::map<std::string, PDGID> Pythia8_i::m_particleIDs
private

Definition at line 141 of file Pythia8_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_procPtr

std::shared_ptr<Pythia8::Sigma2Process> Pythia8_i::m_procPtr {}
private

Definition at line 148 of file Pythia8_i.h.

◆ m_pt0timesMPI

DoubleProperty Pythia8_i::m_pt0timesMPI {this,"pT0timesMPI", 1.0}
protected

Definition at line 104 of file Pythia8_i.h.

◆ m_pythia

std::unique_ptr<Pythia8::Pythia> Pythia8_i::m_pythia {}
protected

Definition at line 92 of file Pythia8_i.h.

◆ m_pythiaToHepMC

HepMC::Pythia8ToHepMC Pythia8_i::m_pythiaToHepMC
protected

Definition at line 93 of file Pythia8_i.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_sameAlphaSAsMPI

BooleanProperty Pythia8_i::m_sameAlphaSAsMPI {this,"useSameAlphaSasMPI", false}
protected

Definition at line 106 of file Pythia8_i.h.

◆ m_saveLHE

BooleanProperty Pythia8_i::m_saveLHE {this, "SaveLHERecord", false}
private

Definition at line 172 of file Pythia8_i.h.

◆ m_seeds

std::vector<long int> Pythia8_i::m_seeds {}
private

Definition at line 143 of file Pythia8_i.h.

◆ m_showerWeightNames

std::vector<std::string> Pythia8_i::m_showerWeightNames {"nominal"}
private

Definition at line 167 of file Pythia8_i.h.

◆ m_showerWeightNamesProp

StringArrayProperty Pythia8_i::m_showerWeightNamesProp {this, "ShowerWeightNames", {} }
private

Definition at line 168 of file Pythia8_i.h.

◆ m_sigmaTotal

double Pythia8_i::m_sigmaTotal {0.}
private

Definition at line 136 of file Pythia8_i.h.

◆ m_SuppressSmallPT

Pythia8::SuppressSmallPT* Pythia8_i::m_SuppressSmallPT {}
private

Definition at line 176 of file Pythia8_i.h.

◆ m_useLHAPDF

BooleanProperty Pythia8_i::m_useLHAPDF {this, "UseLHAPDF", true}
private

Definition at line 156 of file Pythia8_i.h.

◆ m_useReseed

BooleanProperty Pythia8_i::m_useReseed {this,"useReseed", false}
protected

Definition at line 99 of file Pythia8_i.h.

◆ m_userHooks

StringArrayProperty Pythia8_i::m_userHooks {this, "UserHooks", {} }
protected

Definition at line 102 of file Pythia8_i.h.

◆ m_userHooksPtrs

std::vector<UserHooksPtrType> Pythia8_i::m_userHooksPtrs {}
private

Definition at line 150 of file Pythia8_i.h.

◆ m_userModes

std::vector<std::string> Pythia8_i::m_userModes
private

Definition at line 118 of file Pythia8_i.h.

◆ m_useRndmGenSvc

BooleanProperty Pythia8_i::m_useRndmGenSvc {this, "useRndmGenSvc", true, "the max number of consecutive failures"}
protected

Definition at line 96 of file Pythia8_i.h.

◆ m_userParams

std::vector<std::string> Pythia8_i::m_userParams
private

Definition at line 117 of file Pythia8_i.h.

◆ m_userProcess

StringProperty Pythia8_i::m_userProcess {this, "UserProcess", ""}
private

Definition at line 145 of file Pythia8_i.h.

◆ m_userResonancePtrs

std::vector<std::shared_ptr<Pythia8::ResonanceWidths> > Pythia8_i::m_userResonancePtrs
private

Definition at line 154 of file Pythia8_i.h.

◆ m_userResonances

StringProperty Pythia8_i::m_userResonances {this, "UserResonances", ""}
private

Definition at line 152 of file Pythia8_i.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_version

double Pythia8_i::m_version {-1.}
private

Definition at line 114 of file Pythia8_i.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_weightCommands

std::vector<std::string> Pythia8_i::m_weightCommands {}
private

Definition at line 166 of file Pythia8_i.h.

◆ m_weightIDs

std::vector<std::string> Pythia8_i::m_weightIDs {}
private

Definition at line 163 of file Pythia8_i.h.

◆ m_weightNames

std::vector<std::string> Pythia8_i::m_weightNames {}
private

Definition at line 164 of file Pythia8_i.h.


The documentation for this class was generated from the following files:
Pythia8_i::NEUTRON
@ NEUTRON
Definition: Pythia8_i.h:120
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
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
Pythia8_i::m_maxFailures
UnsignedIntegerProperty m_maxFailures
Definition: Pythia8_i.h:94
Pythia8_i::m_enhanceWeight
double m_enhanceWeight
Definition: Pythia8_i.h:162
Pythia8_i::m_nMerged
double m_nMerged
Definition: Pythia8_i.h:135
Pythia8_i::m_saveLHE
BooleanProperty m_saveLHE
Definition: Pythia8_i.h:172
ForwardTracker::beam1
@ beam1
Definition: ForwardTrackerConstants.h:13
Pythia8_i::fillWeights
virtual StatusCode fillWeights(HepMC::GenEvent *evt)
Definition: Pythia8_i.cxx:494
Pythia8_i::MUON
@ MUON
Definition: Pythia8_i.h:120
Pythia8_i::m_version
double m_version
Definition: Pythia8_i.h:114
Pythia8_i::m_procPtr
std::shared_ptr< Pythia8::Sigma2Process > m_procPtr
Definition: Pythia8_i.h:148
ForwardTracker::beam2
@ beam2
Definition: ForwardTrackerConstants.h:13
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Pythia8_i::xmlpath
static std::string xmlpath()
Definition: Pythia8_i.cxx:716
Pythia8_i::m_particleDataFile
StringProperty m_particleDataFile
Definition: Pythia8_i.h:158
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Pythia8_i::m_weightNames
std::vector< std::string > m_weightNames
Definition: Pythia8_i.h:164
Pythia8_i::m_useReseed
BooleanProperty m_useReseed
Definition: Pythia8_i.h:99
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::events_const
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Definition: GenBase.h:96
SG::ReadHandle< McEventCollection >
rerun_display.cmd
string cmd
Definition: rerun_display.py:67
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
Pythia8_i::m_failureCount
unsigned int m_failureCount
Definition: Pythia8_i.h:139
Pythia8_i::ELECTRON
@ ELECTRON
Definition: Pythia8_i.h:120
GenModule::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
Definition: GenModule.h:101
Pythia8_i::m_athenaTool
PublicToolHandle< IPythia8Custom > m_athenaTool
Definition: Pythia8_i.h:170
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
Pythia8_i::m_userHooks
StringArrayProperty m_userHooks
Definition: Pythia8_i.h:102
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
Pythia8_i::m_pt0timesMPI
DoubleProperty m_pt0timesMPI
Definition: Pythia8_i.h:104
HepMC::fillBarcodesAttribute
void fillBarcodesAttribute(GenEvent *)
Definition: GenEvent.h:626
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
Pythia8_i::m_showerWeightNamesProp
StringArrayProperty m_showerWeightNamesProp
Definition: Pythia8_i.h:168
Pythia8_i::ANTIPROTON
@ ANTIPROTON
Definition: Pythia8_i.h:120
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
GenModule::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: GenModule.cxx:34
Pythia8_i::ANTINEUTRON
@ ANTINEUTRON
Definition: Pythia8_i.h:120
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Pythia8_i::m_userHooksPtrs
std::vector< UserHooksPtrType > m_userHooksPtrs
Definition: Pythia8_i.h:150
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
PathResolverFindCalibDirectory
std::string PathResolverFindCalibDirectory(const std::string &logical_file_name)
Definition: PathResolver.cxx:288
Pythia8_i::m_doFxFxXS
BooleanProperty m_doFxFxXS
Definition: Pythia8_i.h:132
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:190
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Pythia8_UserResonance::UserResonanceFactory::create
static std::shared_ptr< ResonanceWidths > create(const std::string &name, int pdgid)
Call this with the name of the ResonanceWidth and PDG ID to which it will be applied e....
Definition: UserResonanceFactory.cxx:13
Pythia8_i::m_doLHE3Weights
bool m_doLHE3Weights
Definition: Pythia8_i.h:165
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
Pythia8_i::m_userResonancePtrs
std::vector< std::shared_ptr< Pythia8::ResonanceWidths > > m_userResonancePtrs
Definition: Pythia8_i.h:154
GenModule::genuserInitialize
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
Definition: GenModule.h:64
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
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:209
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
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Pythia8_i::m_numberAlphaS
DoubleProperty m_numberAlphaS
Definition: Pythia8_i.h:105
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Pythia8_i::m_showerWeightNames
std::vector< std::string > m_showerWeightNames
Definition: Pythia8_i.h:167
Pythia8_UserProcess::UserProcessFactory::create
static std::shared_ptr< Sigma2Process > create(const std::string &procName)
Definition: UserProcessFactory.cxx:11
Atlas::ExtendedEventContext
Definition: ExtendedEventContext.h:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Pythia8_i::OXYGEN
@ OXYGEN
Definition: Pythia8_i.h:120
Pythia8_i::m_atlasRndmEngine
std::shared_ptr< customRndm > m_atlasRndmEngine
Definition: Pythia8_i.h:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
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
PYTHIA8_CONVERSION
#define PYTHIA8_CONVERSION
Definition: Pythia8_i.cxx:32
Pythia8_i::callGenerator
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
Definition: Pythia8_i.cxx:363
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
Pythia8_i::m_nAccepted
double m_nAccepted
Definition: Pythia8_i.h:134
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
ppToJpsimu0mu0.SuppressSmallPT
SuppressSmallPT
Definition: ppToJpsimu0mu0.py:26
beamspotman.stat
stat
Definition: beamspotman.py:262
Pythia8_i::m_beam2
StringProperty m_beam2
Definition: Pythia8_i.h:126
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Pythia8_i::m_lheFile
StringProperty m_lheFile
Definition: Pythia8_i.h:129
Pythia8_i::m_sigmaTotal
double m_sigmaTotal
Definition: Pythia8_i.h:136
Pythia8_i::m_SuppressSmallPT
Pythia8::SuppressSmallPT * m_SuppressSmallPT
Definition: Pythia8_i.h:176
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
python.handimod.extra
int extra
Definition: handimod.py:521
GenModule::GenModule
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: GenModule.cxx:14
WriteHiveWithMetaData.streamName
string streamName
Definition: WriteHiveWithMetaData.py:23
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
Pythia8_i::m_weightIDs
std::vector< std::string > m_weightIDs
Definition: Pythia8_i.h:163
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
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Pythia8_i::HELIUM
@ HELIUM
Definition: Pythia8_i.h:120
Pythia8_i::LEAD
@ LEAD
Definition: Pythia8_i.h:120
PYTHIA8_PTRWRAP
#define PYTHIA8_PTRWRAP(A)
Definition: UserHooksFactory.h:14
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
Pythia8_i::PDGID
PDGID
Definition: Pythia8_i.h:120
Pythia8_i::INVALID
@ INVALID
Definition: Pythia8_i.h:120
Pythia8_i::m_userProcess
StringProperty m_userProcess
Definition: Pythia8_i.h:145
Pythia8_i::m_seeds
std::vector< long int > m_seeds
Definition: Pythia8_i.h:143
Pythia8_i::m_particleIDs
std::map< std::string, PDGID > m_particleIDs
Definition: Pythia8_i.h:141
Pythia8_i::POSITRON
@ POSITRON
Definition: Pythia8_i.h:120
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
Pythia8_i::m_mergingWeight
double m_mergingWeight
Definition: Pythia8_i.h:161
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
Pythia8_i::ANTIMUON
@ ANTIMUON
Definition: Pythia8_i.h:120
a
TList * a
Definition: liststreamerinfos.cxx:10
columnar::empty
bool empty() const noexcept
Definition: ObjectRange.h:163
h
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
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
Pythia8_i::m_outputParticleDataFile
StringProperty m_outputParticleDataFile
Definition: Pythia8_i.h:159
GenBase::pdt
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition: GenBase.h:123
Pythia8_i::m_conversion
double m_conversion
Definition: Pythia8_i.h:137
Pythia8_i::m_dsid
IntegerProperty m_dsid
Definition: Pythia8_i.h:101
Pythia8_i::m_override_transform_beamenergy
bool m_override_transform_beamenergy
Definition: Pythia8_i.h:127
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
Pythia8_i::m_sameAlphaSAsMPI
BooleanProperty m_sameAlphaSAsMPI
Definition: Pythia8_i.h:106
Pythia8_i::m_userResonances
StringProperty m_userResonances
Definition: Pythia8_i.h:152
Pythia8_i::m_doCKKWLAcceptance
BooleanProperty m_doCKKWLAcceptance
Definition: Pythia8_i.h:131
Pythia8_i::m_commands
StringArrayProperty m_commands
Definition: Pythia8_i.h:116
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
merge.status
status
Definition: merge.py:16
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Pythia8_i::m_collisionEnergy
DoubleProperty m_collisionEnergy
Definition: Pythia8_i.h:122
Pythia8_i::m_useRndmGenSvc
BooleanProperty m_useRndmGenSvc
Definition: Pythia8_i.h:96
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:198
Pythia8_i::PROTON
@ PROTON
Definition: Pythia8_i.h:120
Pythia8_i::m_beam1
StringProperty m_beam1
Definition: Pythia8_i.h:125
Pythia8_UserHooks::UserHooksFactory::create
static UserHooks * create(const std::string &hookName)
Definition: UserHooksFactory.cxx:10
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
Atlas::setExtendedEventContext
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
Definition: ExtendedEventContext.cxx:70
GenBase::initialize
virtual StatusCode initialize() override
Definition: GenBase.cxx:17
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
Pythia8_i::m_internal_event_number
int m_internal_event_number
Definition: Pythia8_i.h:112
Pythia8_i::m_pythia
std::unique_ptr< Pythia8::Pythia > m_pythia
Definition: Pythia8_i.h:92
Pythia8_i::m_computeEfficiency
BooleanProperty m_computeEfficiency
Definition: Pythia8_i.h:133
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
Pythia8_i::m_pythiaToHepMC
HepMC::Pythia8ToHepMC m_pythiaToHepMC
Definition: Pythia8_i.h:93
HepMC::set_random_states
void set_random_states(GenEvent *e, std::vector< T > a)
Definition: GenEvent.h:647
ServiceHandle< ICondSvc >