 |
ATLAS Offline Software
|
#include <Pythia8_i.h>
|
| 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 |
|
|
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< customRndm > | m_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} |
|
|
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< StoreGateSvc > | StoreGateSvc_t |
|
|
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...
|
|
|
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, PDGID > | m_particleIDs |
|
std::vector< long int > | m_seeds {} |
|
StringProperty | m_userProcess {this, "UserProcess", ""} |
|
std::shared_ptr< Pythia8::Sigma2Process > | m_procPtr {} |
|
std::vector< UserHooksPtrType > | m_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< IPythia8Custom > | m_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 |
|
|
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< IAthRNGSvc > | m_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 |
|
Definition at line 62 of file Pythia8_i.h.
◆ StoreGateSvc_t
◆ PDGID
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};
◆ Pythia8_i()
Pythia8_i::Pythia8_i |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~Pythia8_i()
Pythia8_i::~Pythia8_i |
( |
| ) |
|
◆ 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.
78 ATH_MSG_ERROR(
"McEventCollection is empty during first event access");
79 return *(
events()->begin());
◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]
◆ 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 357 of file Pythia8_i.cxx.
363 const EventContext& ctx = Gaudi::Hive::currentContext();
378 ATH_MSG_ERROR(
"Exceeded the max number of consecutive event failures.");
379 returnCode = StatusCode::FAILURE;
389 if(stat != StatusCode::SUCCESS) returnCode =
stat;
398 double eventWeight =
m_pythia->info.mergingWeight()*
m_pythia->info.weight();
401 if(returnCode != StatusCode::FAILURE &&
409 ATH_MSG_WARNING(
"Found event weight " << eventWeight <<
" between the float and double precision limits. Rejecting event.");
◆ cmTomm()
void GenBase::cmTomm |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event lengths by x 10.
Definition at line 78 of file GenBase.cxx.
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);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ 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.
85 ATH_MSG_ERROR(
"Const McEventCollection is empty during first event access");
◆ events_const() [1/2]
◆ events_const() [2/2]
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ 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.
105 if (
name() ==
"ParticleDecayer") {
112 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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.
57 return Algorithm::extraOutputDeps();
◆ 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 422 of file Pythia8_i.cxx.
436 ATH_MSG_ERROR(
"Something wrong with this event - it contains fewer than 2 particles!");
438 return StatusCode::FAILURE;
446 auto evtlhe = std::make_shared<HepMC::GenEvent>();
448 auto extra = std::make_shared<HepMC::ShortEventAttribute>(evtlhe.get());
449 evt->add_attribute(
"LHERecord",
extra);
451 ATH_MSG_WARNING(
"LHE record saving requested, but not implemented with HEPMC2 functionality.");
476 ATH_MSG_DEBUG(
"No PDF information available in HepMC::GenEvent!");
484 return StatusCode::SUCCESS;
◆ fillWeights()
StatusCode Pythia8_i::fillWeights |
( |
HepMC::GenEvent * |
evt | ) |
|
|
virtual |
mismatch in weight name!
Definition at line 488 of file Pythia8_i.cxx.
494 #ifndef PYTHIA8_304SERIES
497 if (hook->canEnhanceEmission()) {
501 #endif // not PYTHIA8_304SERIES
506 std::map<std::string,double> fWeights;
510 size_t atlas_specific_weights = 1;
511 fWeights[
"Default"]=eventWeight;
535 std::vector<std::string>::const_iterator
id =
m_weightIDs.begin()+atlas_specific_weights;
538 if(
m_pythia->info.getWeightsDetailedSize() != 0){
539 for(std::map<std::string, Pythia8::LHAwgt>::const_iterator wgt =
m_pythia->info.rwgt->wgts.begin();
540 wgt !=
m_pythia->info.rwgt->wgts.end(); ++wgt){
545 if(*
id != wgt->first){
546 ATH_MSG_ERROR(
"Mismatch in LHE3 weight id. Found "<<wgt->first<<
", expected "<<*
id);
547 return StatusCode::FAILURE;
552 std::map<std::string, Pythia8::LHAweight>::const_iterator weightName =
m_pythia->info.init_weights->find(wgt->first);
553 if(weightName !=
m_pythia->info.init_weights->end()){
566 for(
int iw = 1; iw <
m_pythia->info.PYTHIA8_NWEIGHTS(); ++iw){
582 fWeights[
"EXTRA_bare_LHE_weight"]=(-10.0)*
m_pythia->info.eventWeightLHEF;
591 std::map<std::string, Pythia8::LHAweight>::const_iterator
weight =
m_pythia->info.init_weights->find(
id);
600 ATH_MSG_ERROR(
"Something wrong when building list of weight names: " <<
m_weightNames.size() <<
" vs "<< fWeights.size() <<
", exiting ...");
601 return StatusCode::FAILURE;
607 if (!
evt->run_info()) {
608 evt->set_run_info(m_runinfo);
614 evt->weights().push_back(1.0);
620 evt->weights().resize(fWeights.size(), 1.0);
621 for (
auto w: fWeights) {
622 evt->weight(
w.first)=
w.second;
625 auto beams=
evt->beams();
633 evt->weights().clear();
635 auto beams=
evt->beam_particles();
636 ATH_MSG_DEBUG(
" Energy of the beams " << beams.first->momentum().e() );
643 return StatusCode::SUCCESS;
◆ finalize()
StatusCode GenModule::finalize |
( |
| ) |
|
|
inlineinherited |
◆ 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 647 of file Pythia8_i.cxx.
653 double xs =
info.sigmaGen();
657 ATH_MSG_DEBUG(
"Multiplying cross-section by CKKWL merging acceptance of "<<
m_nMerged <<
"/" <<
info.nAccepted() <<
" = " << accfactor
658 <<
": " << xs <<
" -> " << xs*accfactor);
665 std::cout <<
"Using FxFx cross section recipe: xs = "<<
m_sigmaTotal <<
" / " << 1e9*
info.nTried() << std::endl;
670 ATH_MSG_DEBUG(
"Multiplying cross-section by Pythia Modifier tool factor " << xsmod );
676 std::cout <<
"MetaData: cross-section (nb)= " << xs <<std::endl;
677 std::cout <<
"MetaData: generator= Pythia 8." << std::string(py8version()) <<std::endl;
680 std::cout<<
"MetaData: weights = ";
682 std::cout<<std::endl;
686 if (
info.nTried()>0)
ATH_MSG_INFO(
"Pythia8 efficiency (nAccepted/nTried %) = " <<
info.nAccepted()*100./
info.nTried());
687 else ATH_MSG_INFO(
"Pythia8 efficiency cannot be computed, nTried <=0");
696 return StatusCode::SUCCESS;
◆ 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.
105 m_runinfo = std::make_shared<HepMC3::GenRunInfo>();
107 struct HepMC3::GenRunInfo::ToolInfo
generator={std::string(
"Pythia8"),py8version(),std::string(
"Used generator")};
115 s_pythia_stream =
"PYTHIA8_INIT";
123 m_pythia->readString(
"Tune:pp = 5");
127 m_pythia->readString(
"PDF:pSet= LHAPDF6:cteq6l1");
130 m_pythia->readString(
"Next:numberShowEvent = 0");
133 m_pythia->settings.addFlag(
"AthenaPythia8ToHepMC:print_inconsistency",
true);
139 bool canSetHook =
true;
140 if (hook ==
"SuppressSmallPT") {
155 for(
const std::pair<const std::string, double> ¶m : Pythia8_UserHooks::UserHooksFactory::userSettings<double>()){
156 m_pythia->settings.addParm(param.first, param.second,
false,
false, 0., 0.);
159 for(
const std::pair<const std::string, int> ¶m : Pythia8_UserHooks::UserHooksFactory::userSettings<int>()){
160 m_pythia->settings.addMode(param.first, param.second,
false,
false, 0., 0.);
163 for(
const std::pair<const std::string, bool> ¶m : Pythia8_UserHooks::UserHooksFactory::userSettings<bool>()){
164 m_pythia->settings.addFlag(param.first, param.second);
167 for(
const std::pair<const std::string, std::string> ¶m : Pythia8_UserHooks::UserHooksFactory::userSettings<std::string>()){
168 m_pythia->settings.addWord(param.first, param.second);
173 ATH_MSG_ERROR(
"Unable to retrieve Athena Tool for custom Pythia processing");
174 return StatusCode::FAILURE;
185 if(
cmd.compare(
"")==0)
continue;
186 else if (
cmd.find(
"Beams:id") != std::string::npos ) {
187 ATH_MSG_ERROR(
"With command '" <<
cmd <<
"' you are trying to set a beam different from p: please use the Beam1/Beam2 properties instead:");
190 return StatusCode::FAILURE;
192 else if (
cmd.find(
"Beams:frameType") != std::string::npos ) {
194 ATH_MSG_WARNING(
" Found an explicit 'Beams:frameType' command: this will override transform beams momenta/energy parameters, regardless of its requested value. ");
201 return StatusCode::FAILURE;
213 return StatusCode::FAILURE;
220 ATH_MSG_INFO(
" !!!!!!!!!!!! WARNING ON PYTHIA RANDOM NUMBERS !!!!!!!!!! ");
221 ATH_MSG_INFO(
" THE ATHENA SERVICE AthRNGenSvc IS USED.");
222 ATH_MSG_INFO(
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ");
227 #if PYTHIA_VERSION_INTEGER >= 8310
232 s_pythia_stream =
"PYTHIA8";
234 ATH_MSG_INFO(
" !!!!!!!!!!!! WARNING ON PYTHIA RANDOM NUMBERS !!!!!!!!!! ");
235 ATH_MSG_INFO(
" THE STANDARD PYTHIA8 RANDOM NUMBER SERVICE IS USED.");
236 ATH_MSG_INFO(
" THE ATHENA SERVICE AthRNGSvc IS ***NOT*** USED.");
237 ATH_MSG_INFO(
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ");
248 std::vector<std::string> resonanceArgs;
251 if(resonanceArgs.size() != 2){
252 ATH_MSG_ERROR(
"Cannot Understand UserResonance job option!");
253 ATH_MSG_ERROR(
"You should specify it as a 'name:id1,id2,id3...'");
254 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");
257 std::vector<std::string> resonanceIds;
258 boost::split(resonanceIds, resonanceArgs.back(), boost::is_any_of(
","));
259 if(resonanceIds.size()==0){
260 ATH_MSG_ERROR(
"You did not specifiy any PDG ids to which your user resonance width should be applied!");
261 ATH_MSG_ERROR(
"You should specify a list as 'name:id1,id2,id3...'");
262 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");
266 for(std::vector<std::string>::const_iterator sId = resonanceIds.begin();
267 sId != resonanceIds.end(); ++sId){
268 int idResIn = boost::lexical_cast<int>(*sId);
273 #if PYTHIA_VERSION_INTEGER >= 8310
274 m_pythia->setResonancePtr(resonance);
276 m_pythia->setResonancePtr(resonance.get());
292 ATH_MSG_ERROR(
"Both LHE file and user process have been specified");
293 ATH_MSG_ERROR(
"LHE input does not make sense with a user process!");
297 canInit = canInit &&
m_pythia->readString(
"Beams:frameType = 4");
305 canInit = canInit &&
m_pythia->readString(
"Beams:frameType = 1");
313 #if PYTHIA_VERSION_INTEGER >= 8310
328 m_pythia->settings.writeFile(
"Settings_before.log",
true);
335 returnCode = StatusCode::FAILURE;
340 m_pythia->settings.writeFile(
"Settings_after.log",
true);
348 m_pythiaToHepMC.set_print_inconsistency(
m_pythia->settings.flag(
"AthenaPythia8ToHepMC:print_inconsistency") );
◆ 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 |
◆ getRandomEngine() [2/2]
CLHEP::HepRandomEngine * GenModule::getRandomEngine |
( |
const std::string & |
streamName, |
|
|
unsigned long int |
randomSeedOffset, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
protectedinherited |
◆ 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.
58 ctx.setEventID (EventIDBase (conditionsRun,
59 EventIDBase::UNDEFEVT,
60 EventIDBase::UNDEFNUM,
61 EventIDBase::UNDEFNUM,
◆ 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.
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());
◆ initialize()
StatusCode GenModule::initialize |
( |
| ) |
|
|
virtualinherited |
◆ inputHandles()
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.
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);
◆ mmTocm()
void GenBase::mmTocm |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event lengths by x 1/10.
Definition at line 87 of file GenBase.cxx.
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);
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ particleTable()
const HepPDT::ParticleDataTable& GenBase::particleTable |
( |
| ) |
const |
|
inlineinherited |
Get a particle data table.
Definition at line 118 of file GenBase.h.
◆ partPropSvc()
Access the particle property service.
Definition at line 113 of file GenBase.h.
◆ pdt()
const HepPDT::ParticleDataTable& GenBase::pdt |
( |
| ) |
const |
|
inlineinherited |
Shorter alias to get a particle data table.
Definition at line 123 of file GenBase.h.
◆ pythia_stream()
const std::string & Pythia8_i::pythia_stream |
( |
| ) |
|
|
static |
◆ pythiaVersion()
double Pythia8_i::pythiaVersion |
( |
| ) |
const |
◆ renounce()
◆ renounceArray()
◆ s_allowedTunes()
static int Pythia8_i::s_allowedTunes |
( |
double |
version | ) |
|
|
staticprivate |
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ useReseed()
bool Pythia8_i::useReseed |
( |
| ) |
const |
|
inlineprotected |
◆ useRndmGenSvc()
bool Pythia8_i::useRndmGenSvc |
( |
| ) |
const |
|
inlineprotected |
◆ xmlpath()
std::string Pythia8_i::xmlpath |
( |
| ) |
|
|
static |
◆ m_athenaTool
PublicToolHandle<IPythia8Custom> Pythia8_i::m_athenaTool {this, "CustomInterface", ""} |
|
private |
◆ m_atlasRndmEngine
std::shared_ptr<customRndm> Pythia8_i::m_atlasRndmEngine {} |
|
protected |
◆ m_beam1
StringProperty Pythia8_i::m_beam1 {this, "Beam1", "PROTON"} |
|
private |
◆ m_beam2
StringProperty Pythia8_i::m_beam2 {this, "Beam2", "PROTON"} |
|
private |
◆ m_collisionEnergy
DoubleProperty Pythia8_i::m_collisionEnergy {this, "CollisionEnergy", 14000.0} |
|
private |
◆ m_commands
StringArrayProperty Pythia8_i::m_commands {this, "Commands", {} } |
|
private |
◆ m_computeEfficiency
BooleanProperty Pythia8_i::m_computeEfficiency {this, "computeEfficiency", false} |
|
private |
◆ m_conversion
double Pythia8_i::m_conversion {1.} |
|
private |
◆ m_detStore
◆ m_doCKKWLAcceptance
BooleanProperty Pythia8_i::m_doCKKWLAcceptance {this, "CKKWLAcceptance", false} |
|
private |
◆ m_doFxFxXS
BooleanProperty Pythia8_i::m_doFxFxXS {this, "FxFxXS", false} |
|
private |
◆ m_doLHE3Weights
bool Pythia8_i::m_doLHE3Weights {false} |
|
private |
◆ m_dsid
IntegerProperty Pythia8_i::m_dsid {this, "Dsid", 999999, "Dataset ID number"} |
|
protected |
◆ m_enhanceWeight
double Pythia8_i::m_enhanceWeight {1.0} |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_failureCount
unsigned int Pythia8_i::m_failureCount {0} |
|
private |
◆ 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 |
◆ 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 |
◆ m_maxFailures
UnsignedIntegerProperty Pythia8_i::m_maxFailures {this, "MaxFailures", 10} |
|
protected |
◆ 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
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 |
◆ 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 |
◆ m_nMerged
double Pythia8_i::m_nMerged {0.} |
|
private |
◆ m_numberAlphaS
DoubleProperty Pythia8_i::m_numberAlphaS {this,"numberAlphaS", 3.0} |
|
protected |
◆ m_outputParticleDataFile
StringProperty Pythia8_i::m_outputParticleDataFile {this, "OutputParticleData", "ParticleData.local.xml"} |
|
private |
◆ m_override_transform_beamenergy
bool Pythia8_i::m_override_transform_beamenergy {false} |
|
private |
◆ m_particleDataFile
StringProperty Pythia8_i::m_particleDataFile {this, "ParticleData", ""} |
|
private |
◆ m_particleIDs
std::map<std::string, PDGID> Pythia8_i::m_particleIDs |
|
private |
◆ 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 |
◆ m_pt0timesMPI
DoubleProperty Pythia8_i::m_pt0timesMPI {this,"pT0timesMPI", 1.0} |
|
protected |
◆ m_pythia
std::unique_ptr<Pythia8::Pythia> Pythia8_i::m_pythia {} |
|
protected |
◆ m_pythiaToHepMC
HepMC::Pythia8ToHepMC Pythia8_i::m_pythiaToHepMC |
|
protected |
◆ 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
◆ m_sameAlphaSAsMPI
BooleanProperty Pythia8_i::m_sameAlphaSAsMPI {this,"useSameAlphaSasMPI", false} |
|
protected |
◆ m_saveLHE
BooleanProperty Pythia8_i::m_saveLHE {this, "SaveLHERecord", false} |
|
private |
◆ m_seeds
std::vector<long int> Pythia8_i::m_seeds {} |
|
private |
◆ m_showerWeightNames
std::vector<std::string> Pythia8_i::m_showerWeightNames {"nominal"} |
|
private |
◆ m_showerWeightNamesProp
StringArrayProperty Pythia8_i::m_showerWeightNamesProp {this, "ShowerWeightNames", {} } |
|
private |
◆ m_sigmaTotal
double Pythia8_i::m_sigmaTotal {0.} |
|
private |
◆ m_SuppressSmallPT
Pythia8::SuppressSmallPT* Pythia8_i::m_SuppressSmallPT {} |
|
private |
◆ m_useLHAPDF
BooleanProperty Pythia8_i::m_useLHAPDF {this, "UseLHAPDF", true} |
|
private |
◆ m_useReseed
BooleanProperty Pythia8_i::m_useReseed {this,"useReseed", false} |
|
protected |
◆ m_userHooks
StringArrayProperty Pythia8_i::m_userHooks {this, "UserHooks", {} } |
|
protected |
◆ m_userHooksPtrs
◆ m_userModes
std::vector<std::string> Pythia8_i::m_userModes |
|
private |
◆ m_useRndmGenSvc
BooleanProperty Pythia8_i::m_useRndmGenSvc {this, "useRndmGenSvc", true, "the max number of consecutive failures"} |
|
protected |
◆ m_userParams
std::vector<std::string> Pythia8_i::m_userParams |
|
private |
◆ m_userProcess
StringProperty Pythia8_i::m_userProcess {this, "UserProcess", ""} |
|
private |
◆ m_userResonancePtrs
std::vector<std::shared_ptr<Pythia8::ResonanceWidths> > Pythia8_i::m_userResonancePtrs |
|
private |
◆ m_userResonances
StringProperty Pythia8_i::m_userResonances {this, "UserResonances", ""} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_version
double Pythia8_i::m_version {-1.} |
|
private |
◆ m_vhka
◆ m_weightCommands
std::vector<std::string> Pythia8_i::m_weightCommands {} |
|
private |
◆ m_weightIDs
std::vector<std::string> Pythia8_i::m_weightIDs {} |
|
private |
◆ m_weightNames
std::vector<std::string> Pythia8_i::m_weightNames {} |
|
private |
The documentation for this class was generated from the following files:
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
UnsignedIntegerProperty m_maxFailures
BooleanProperty m_saveLHE
virtual StatusCode fillWeights(HepMC::GenEvent *evt)
std::shared_ptr< Pythia8::Sigma2Process > m_procPtr
static std::string xmlpath()
StringProperty m_particleDataFile
const_pointer_type cptr()
Dereference the pointer.
std::vector< std::string > m_weightNames
BooleanProperty m_useReseed
virtual StatusCode fillEvt(HepMC::GenEvent *evt)=0
For filling the HepMC event object.
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
unsigned int m_failureCount
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
PublicToolHandle< IPythia8Custom > m_athenaTool
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
GenEvent * newGenEvent(const int a, const int b)
StringArrayProperty m_userHooks
const std::string & key() const
Return the StoreGate ID for the referenced object.
DoubleProperty m_pt0timesMPI
void fillBarcodesAttribute(GenEvent *)
StringArrayProperty m_showerWeightNamesProp
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
std::vector< UserHooksPtrType > m_userHooksPtrs
virtual void setOwner(IDataHandleHolder *o)=0
std::string PathResolverFindCalibDirectory(const std::string &logical_file_name)
BooleanProperty m_doFxFxXS
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....
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::vector< std::shared_ptr< Pythia8::ResonanceWidths > > m_userResonancePtrs
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< IAthRNGSvc > m_rndmSvc
Data members.
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode genInitialize()
For initializing the generator, if required.
virtual StatusCode sysInitialize() override
Override sysInitialize.
DoubleProperty m_numberAlphaS
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
std::vector< std::string > m_showerWeightNames
static std::shared_ptr< Sigma2Process > create(const std::string &procName)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::shared_ptr< customRndm > m_atlasRndmEngine
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
BooleanProperty m_isAfterburner
Flag for normal vs. afterburner generators.
#define PYTHIA8_CONVERSION
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
virtual StatusCode genFinalize()
For finalising the generator, if required.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Pythia8::SuppressSmallPT * m_SuppressSmallPT
virtual void renounce()=0
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
std::vector< std::string > m_weightIDs
A wrapper class for event-slot-local random engines.
std::string to_string(const DetectorType &type)
#define PYTHIA8_PTRWRAP(A)
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
StringProperty m_userProcess
std::vector< long int > m_seeds
std::map< std::string, PDGID > m_particleIDs
DataObjIDColl m_extendedExtraObjects
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
bool empty() const noexcept
#define ATH_MSG_WARNING(x)
IntegerProperty m_randomSeed
Seed for random number engine.
StringProperty m_outputParticleDataFile
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
bool m_override_transform_beamenergy
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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.
BooleanProperty m_sameAlphaSAsMPI
StringProperty m_userResonances
BooleanProperty m_doCKKWLAcceptance
StringArrayProperty m_commands
DoubleProperty m_collisionEnergy
BooleanProperty m_useRndmGenSvc
static UserHooks * create(const std::string &hookName)
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
virtual StatusCode initialize() override
int m_internal_event_number
std::unique_ptr< Pythia8::Pythia > m_pythia
BooleanProperty m_computeEfficiency
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
CLHEP::HepRandomEngine * getRandomEngineDuringInitialize(const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const
HepMC::Pythia8ToHepMC m_pythiaToHepMC
void set_random_states(GenEvent *e, std::vector< T > a)