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

#include <ParticleDecayer.h>

Inheritance diagram for ParticleDecayer:
Collaboration diagram for ParticleDecayer:

Public Member Functions

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

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

double getParticleMass (int pdgID)
 
void addParticle (HepMC::GenVertexPtr, int pdg, HepMC::FourVector, int statusCode)
 
double rnd_ExpLifetime (CLHEP::HepRandomEngine *engine, double ct)
 
double rnd_DoubleRange (CLHEP::HepRandomEngine *engine, double a, double b)
 
double cosgen (CLHEP::HepRandomEngine *engine, int itype)
 
StatusCode DFTwoBodyDecay (CLHEP::HepRandomEngine *engine, HepMC::GenParticlePtr, int)
 
StatusCode setDecayPosition (CLHEP::HepRandomEngine *engine, HepMC::GenParticlePtr, HepMC::GenEvent *, bool doScalarDecay=false)
 
StatusCode changeMass (HepMC::GenParticlePtr, double)
 
StatusCode getDecayProducts (CLHEP::HepRandomEngine *engine, CLHEP::HepLorentzVector, double, std::vector< CLHEP::HepLorentzVector > &, int decayType=0)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::string m_truthParticleContainerName
 
int m_LJType {}
 
int m_scalarPDGID {}
 
double m_scalarMass {}
 
double m_particleMass {}
 
int m_particleID {}
 
double m_particleLifeTime {}
 
int m_particlePDGID {}
 
int m_particlePolarization {}
 
bool m_oppositePolarization {}
 
double m_BRElectron {}
 
double m_BRMuon {}
 
double m_BRPion {}
 
bool m_doUniformDecay {}
 
bool m_doExponentialDecay {}
 
bool m_expDecayDoVariableLifetime {}
 
double m_expDecayFractionToKeep {}
 
bool m_expDecayDoTruncateLongDecays {}
 
double m_barrelRadius
 
double m_endCapDistance
 
double m_thetaEndCapBarrel
 
HepPDT::ParticleDataTable * m_particleTable {}
 
CLHEP::HepLorentzVector m_boostLV
 
CLHEP::HepLorentzVector m_posLV
 
CLHEP::HepLorentzVector m_posLV1
 
CLHEP::HepLorentzVector m_posLV2
 
int m_eventCounter
 
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...
 

Gen-specific event loop methods: to be overloaded

virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
virtual StatusCode callGenerator ()
 For calling the generator on each iteration of the event loop. More...
 
virtual StatusCode genFinalize ()
 For finalising the generator, if required. More...
 

Features for derived classes to use internally

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

Detailed Description

Definition at line 26 of file ParticleDecayer.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ParticleDecayer()

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

Definition at line 223 of file ParticleDecayer.cxx.

223  :
224  GenModule(name, pSvcLocator),
225  m_truthParticleContainerName("GEN_EVENT"),
226  m_eventCounter(0)
227 {
228  declareProperty("McEventCollection", m_truthParticleContainerName);
229  declareProperty("LJType", m_LJType = 1); //1 = one dark photon per LeptonJet, 2 = two dark photons per LeptonJet
230  declareProperty("ScalarPDGID", m_scalarPDGID); //new PDG ID of the scalar
231  declareProperty("ScalarMass", m_scalarMass); //new mass of the scalar in MeV
232  declareProperty("ParticleID", m_particleID = 999); //PDG ID of the geantino
233  declareProperty("ParticleMass", m_particleMass = 400); //new mass of the dark photon in MeV (default 400 MeV)
234  declareProperty("ParticleLifeTime", m_particleLifeTime = 0); //ctau of the dark photon in mm (default prompt)
235  declareProperty("ParticlePolarization", m_particlePolarization = 0); //polarization of the dark photon (default 0 : isotropic decay, -1 : transverse, 1 : longitudinal)
236  declareProperty("OppositePolarization", m_oppositePolarization = false);//In case of LJType == 2 and opposite polarization for the two dark photons in the event
237  declareProperty("ParticlePDGID", m_particlePDGID = 700022); //new PDG ID of the dark photon (default 700022)
238  declareProperty("DecayBRElectrons", m_BRElectron = 1.); //BR of dark photon decay to electrons
239  declareProperty("DecayBRMuons", m_BRMuon = 0.); //BR of dark photon decay to muons
240  declareProperty("DecayBRPions", m_BRPion = 0.); //BR of dark photon decay to pions
241 
242  //Choose between the different types of displaced decays
243  declareProperty("DoUniformDecay", m_doUniformDecay = false);
244  declareProperty("DoExponentialDecay", m_doExponentialDecay = true );
245  declareProperty("ExpDecayDoVariableLifetime", m_expDecayDoVariableLifetime = false );
246  declareProperty("ExpDecayPercentageToKeep", m_expDecayFractionToKeep = 0.8 );
247  declareProperty("ExpDecayDoTruncateLongDecays", m_expDecayDoTruncateLongDecays = false );
248 
249  //Dimensions within which to decay in case of non-prompt events
250  declareProperty("BarrelRadius", m_barrelRadius = 10.e3 ); // outer limit for decay radius
251  declareProperty("EndCapDistance", m_endCapDistance = 15.e3 ); // outer limit along z for decays in endcap
252  declareProperty("ThetaEndCapBarrel", m_thetaEndCapBarrel = 0.439067982); // theta if where to switch between barrel and endcap (default: eta = 1.5)
253 }

◆ ~ParticleDecayer()

ParticleDecayer::~ParticleDecayer ( )
default

Member Function Documentation

◆ addParticle()

void ParticleDecayer::addParticle ( HepMC::GenVertexPtr  prod_vtx,
int  pdg,
HepMC::FourVector  momentum,
int  statusCode 
)
private

Definition at line 440 of file ParticleDecayer.cxx.

440  {
441 
442  double mass = 0.;
443  if( pdg == m_particlePDGID)
444  {
446  }else
447  {
448  mass = getParticleMass(pdg);
449  }
450  double energy=std::sqrt(std::pow(momentum.x(),2)+std::pow(momentum.y(),2)+std::pow(momentum.z(),2)+mass*mass);
451 HepMC::GenParticlePtr aParticle = HepMC::newGenParticlePtr (HepMC::FourVector(momentum.x(), momentum.y(), momentum.z(), energy),
452  pdg, statusCode);
453 
454  prod_vtx->add_particle_out(aParticle);
455 }

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

virtual StatusCode GenModule::callGenerator ( )
inlinevirtualinherited

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

Reimplemented in Hijing, Herwig7, CosmicGenerator, Pythia8_i, Hydjet, BeamHaloGeneratorAlg, Starlight_i, Epos, MultiParticleGunPileup, MultiPy8Pileup, TrackRecordGenerator, Pythia8B_i, and Sherpa_i.

Definition at line 66 of file GenModule.h.

66 { return StatusCode::SUCCESS; }

◆ changeMass()

StatusCode ParticleDecayer::changeMass ( HepMC::GenParticlePtr  genpart,
double  newMass 
)
private

Definition at line 94 of file ParticleDecayer.cxx.

95 {
96  double e = genpart->momentum().e();
97  double theta = genpart->momentum().theta();
98  double phi = genpart->momentum().phi();
99  //Sanity check
100  double p2 = e*e - newMass*newMass;
101  if ( p2 < 0 ) {
102  ATH_MSG_FATAL("ParticleDecayer::fillEvt: -- you have generated a tachyon!");
103  return StatusCode::FAILURE;
104  }
105  //At this point, we have e, theta, and phi. Put them together to get the four-momentum.
106  double p = std::sqrt(p2);
107  double px = p*std::sin(theta)*std::cos(phi);
108  double py = p*std::sin(theta)*std::sin(phi);
109  double pz = p*std::cos(theta);
110  //Fill the four-momentum
111  const CLHEP::HepLorentzVector updatedLV(px,py,pz,e);
112  genpart->set_momentum(HepMC::FourVector(updatedLV.x(),updatedLV.y(),updatedLV.z(),updatedLV.e()));
113  genpart->set_generated_mass(newMass);
114  return StatusCode::SUCCESS;
115 }

◆ cmTomm()

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

Scale event lengths by x 10.

Definition at line 81 of file GenBase.cxx.

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

◆ cosgen()

double ParticleDecayer::cosgen ( CLHEP::HepRandomEngine *  engine,
int  itype 
)
private

Definition at line 47 of file ParticleDecayer.cxx.

47  {
48  double x,fx,hit;
49  x=0;
50 
51  if(itype==0){ // flat
52  x=rnd_DoubleRange(engine,-1.,1.);
53  return x;
54  }
55 
56  if(itype==1){ // f(cost)=1.5*cost^2
57  hit=1.5;
58  fx=0;
59  while(hit>fx){
60  x=rnd_DoubleRange(engine,-1.,1.);
61  hit=rnd_DoubleRange(engine,0.,1.5);
62  fx=1.5*x*x;
63  }
64  return x;
65  }
66 
67  if(itype==2){ // f(cost)=0.375(1+cost^2)
68  hit=0.75;
69  fx=0;
70  while(hit>fx){
71  x=rnd_DoubleRange(engine,-1.,1.);
72  hit=rnd_DoubleRange(engine,0.,0.75);
73  fx=0.375*(1+x*x);
74  }
75  return x;
76  }
77 
78  if(itype==3){ // f(cost)=0.75(1-cost^2)
79  hit=1.5;
80  fx=0;
81  while(hit>fx){
82  x=rnd_DoubleRange(engine,-1.,1.);
83  hit=rnd_DoubleRange(engine,0.,1.5);
84  fx=0.75*(1-x*x);
85  }
86  return x;
87  }
88 
89  return x;
90 
91 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ DFTwoBodyDecay()

StatusCode ParticleDecayer::DFTwoBodyDecay ( CLHEP::HepRandomEngine *  engine,
HepMC::GenParticlePtr  genpart,
int  Polarization 
)
private

Definition at line 471 of file ParticleDecayer.cxx.

471  {
472 
473 
474  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- allow the two-body decay of the dark photon...");
475 
476  //create heplorentzvector from genpart's fourMomentum, as it is more useful
477  CLHEP::HepLorentzVector boostDF( genpart->momentum().px(), genpart->momentum().py(), genpart->momentum().pz(), genpart->momentum().e() );
478 
479  //Given branching fractions, pick decay mode
480  int ModeOfDecay;
481  double unif = rnd_DoubleRange(engine, 0.,1.);
482  if (unif<=m_BRElectron) {
483  ModeOfDecay = 11;
484  } else if (unif<=(m_BRElectron+m_BRMuon) && unif>m_BRElectron) {
485  ModeOfDecay = 13;
486  } else {
487  ModeOfDecay = 211;
488  }
489  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- decayMode = " << ModeOfDecay);
490 
491  //Now that we have a decay mode. get the associated particle mass
492  double decayPartMass = getParticleMass(ModeOfDecay);
493 
494  //Choose how to decay
495  //angular distribution handling, see pag.6 of http://arxiv.org/pdf/hep-ph/0605296v2.pdf
496  int type = 0; //isotropic by default
497  if(Polarization==0) {
498  type = 0; //isotropic
499  } else if(Polarization==-1 && (ModeOfDecay==11 || ModeOfDecay==13)) {
500  type = 2; //transverse polarization of the dark photon + fermions
501  } else if(Polarization==1 && (ModeOfDecay==11 || ModeOfDecay==13)) {
502  type = 3; //longitudinal polarization of the dark photon + fermions
503  } else if(Polarization==-1 && ModeOfDecay==211) {
504  type = 3; //transverse polarization of the dark photon + scalars
505  } else if(Polarization==1 && ModeOfDecay==211) {
506  type = 1; //longitudinal polarization of the dark photon + scalars
507  } else {
508  ATH_MSG_FATAL("ParticleDecayer::fillEvt: -- wrong polarization value... please check!");
509  return StatusCode::FAILURE;
510  }
511 
512  //Now we are ready to decay the dark photon
513  std::vector<CLHEP::HepLorentzVector> daughterLVs;
514  CHECK( getDecayProducts( engine, boostDF, decayPartMass, daughterLVs, type) );
515 
516  //Add the daughters to the pool file
517  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- Add the daughters to the pool file");
518  auto end_vtx = genpart->end_vertex();
519  auto v0=daughterLVs.at(0).vect();
520  addParticle(end_vtx, ModeOfDecay, HepMC::FourVector(v0.x(),v0.y(),v0.z(),0.0), 1);
521  auto v1=daughterLVs.at(1).vect();
522  addParticle(end_vtx, -ModeOfDecay, HepMC::FourVector(v1.x(),v1.y(),v1.z(),0.0), 1);
523 
524  return StatusCode::SUCCESS;
525 }

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

For filling the HepMC event object.

‍*** Now allow the two-body decay of the particle

‍*** Now allow the two-body decay of the scalar

Implements GenModule.

Definition at line 290 of file ParticleDecayer.cxx.

290  {
291 
292  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- EventCounter: " << m_eventCounter);
293 
294  const EventContext& ctx = Gaudi::Hive::currentContext();
295  CLHEP::HepRandomEngine* engine = this->getRandomEngine("ParticleDecayer", ctx);
296 
297  StatusCode status = StatusCode::SUCCESS;
298 
299  // Extract the event from the TES
300  McEventCollection* mcEvtColl = nullptr;
301  if (evtStore()->contains<McEventCollection>(m_truthParticleContainerName) && evtStore()->retrieve(mcEvtColl, m_truthParticleContainerName).isSuccess() ) {
302  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- Found an McEventCollection for ParticleDecayer");
303  } else {
304  ATH_MSG_FATAL("TES is empty!!!!");
305  status = StatusCode::FAILURE;
306  return status;
307  }
308 
309  event = mcEvtColl->back();
310 
311  if (event == NULL) {
312  ATH_MSG_FATAL("ParticleDecayer::fillEvt: -- McEvent was not successfully created");
313  status = StatusCode::FAILURE;
314  return status;
315  }
316 
317  for ( auto genpart : *event) {
318 
320  // only one dark photon per LeptonJet //
322  if (m_LJType == 1) {
323  if (genpart->pdg_id()==m_particleID) { //if geantino assign the new mass and cross-check
324  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- only one dark photon per LeptonJet");
325  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- found MC particle with PDG ID = " << genpart->pdg_id());
326  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- assign the new mass of the dark photon, m = " << m_particleMass);
327 
328  //Change the mass of the parent particle ( set by user input + command )
329  //Changes the magnitude of the spatial part of the 4-momentum such that the new 4-momentum has the desired inv mass
331 
332  //Add decay position to the event
333  CHECK( setDecayPosition( engine, genpart, event ) );
334 
335  //assign the new PDG_ID of the particle
336  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- set the new PDG ID = " << m_particlePDGID);
337  genpart->set_pdg_id(m_particlePDGID);
338 
339  //set the new status (decayed) of the particle
340  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- set the new status = 2");
341  genpart->set_status(2);
342 
343  //set the new momentum of the particle
344  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- set the new momentum");
345 
348 
349  }
350  }else if (m_LJType == 2) {
352  // two dark photons per LeptonJet //
354  if (genpart->pdg_id()==m_particleID) {
355 
356  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- two dark photons per LeptonJet");
357  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- found MC particle with PDG ID = " << genpart->pdg_id());
358  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- assign the new mass of the dark scalar, m = " << m_scalarMass);
359 
360  //Get the mass of the parent particle ( set by user input + command )
361  //Change the mass of the parent particle ( set by user input + command )
362  //Changes the magnitude of the spatial part of the 4-momentum such that the new 4-momentum has the desired inv mass
364 
365  //set the new PDG_ID of the scalar
366  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- set the new PDG ID = " << m_scalarPDGID);
367  genpart->set_pdg_id(m_scalarPDGID);
368 
369  //set the new status (decayed) of the scalar
370  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- set the new status = 2");
371  genpart->set_status(2);
372 
373  //set the decay vertex position of the scalar
374  //Create a HepMC vertex at the decay position of the scalar
375  CHECK( setDecayPosition( engine, genpart, event, true ) );
376 
378  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- allow the two-body decay of the dark scalar to dark photons...");
379  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- dark photon has PDG ID = " << m_particlePDGID);
380 
381  std::vector<CLHEP::HepLorentzVector> darkPhotonLVs;
382  CHECK( getDecayProducts( engine, CLHEP::HepLorentzVector( genpart->momentum().px(), genpart->momentum().py(), genpart->momentum().pz(), genpart->momentum().e() ),
384  darkPhotonLVs) );
385 
386  //add dark photon 1
387  auto v0=darkPhotonLVs.at(0).vect();
388  addParticle( genpart->end_vertex(), m_particlePDGID, HepMC::FourVector(v0.x(),v0.y(),v0.z(),0.0) , 2);
389  //add dark photon 2
390  auto v1=darkPhotonLVs.at(1).vect();
391  addParticle( genpart->end_vertex(), m_particlePDGID, HepMC::FourVector(v1.x(),v1.y(),v1.z(),0.0), 2);
392 
393  //lifetime handling of the dark photons
394  int polarizationSwitch = 1;
395 #ifdef HEPMC3
396  auto pItBegin = genpart->end_vertex()->particles_out().end();
397  auto pItEnd = genpart->end_vertex()->particles_out().end();
398 #else
399  HepMC::GenVertex::particles_out_const_iterator pItBegin = genpart->end_vertex()->particles_out_const_begin();
400  HepMC::GenVertex::particles_out_const_iterator pItEnd = genpart->end_vertex()->particles_out_const_end();
401 #endif
402  for ( auto pIt=pItBegin ; pIt != pItEnd; ++pIt )
403  {
404  //Add decay position to the event
405  CHECK( setDecayPosition( engine, *pIt, event ) );
406  //And perform two-body decay
407  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- Now allow the two-body decay of the dark photons");
408  CHECK( DFTwoBodyDecay( engine, *pIt, polarizationSwitch*m_particlePolarization ) );
410  {
411  polarizationSwitch = -polarizationSwitch;
412  }
413  }
414 
415  }
416  }else
417  {
418  ATH_MSG_FATAL("LJType set to " << m_LJType );
419  ATH_MSG_FATAL("LJType must be 1 or 2" );
420  return StatusCode::FAILURE;
421  }
422  }
423 
424  //set the event number
425  event->set_event_number(m_eventCounter);
426 
427  //Add a unit entry to the event weight vector if it's currently empty
428  if (event->weights().empty()) {
429  event->weights().push_back(1.);
430  }
431 
432  //increment the event counter
433  m_eventCounter++;
434 
435  return status;
436 }

◆ finalize()

StatusCode GenModule::finalize ( )
inlineinherited

Definition at line 55 of file GenModule.h.

55 { return genFinalize(); }

◆ genFinalize()

virtual StatusCode GenModule::genFinalize ( )
inlinevirtualinherited

For finalising the generator, if required.

Reimplemented in Hijing, Herwig7, CosmicGenerator, Pythia8_i, Hydjet, Starlight_i, Epos, BeamHaloGeneratorAlg, MultiParticleGunPileup, MultiPy8Pileup, Pythia8B_i, and Sherpa_i.

Definition at line 70 of file GenModule.h.

70 { return StatusCode::SUCCESS; }

◆ genInitialize()

StatusCode ParticleDecayer::genInitialize ( )
virtual

For initializing the generator, if required.

Reimplemented from GenModule.

Definition at line 257 of file ParticleDecayer.cxx.

258 {
259  // Check here if the tool has been configured correctly
261  {
262  ATH_MSG_FATAL("Cannot configure exponential and uniform decay at the same time.");
263  return StatusCode::FAILURE;
264  }
265 
266  double TOTBR = m_BRElectron + m_BRMuon + m_BRPion;
267  if (TOTBR>1.0000001) {
268  ATH_MSG_FATAL("ParticleDecayer::genInitialize: -- Branching Ratio sum is larger than 1!! Please check the values in your jobOption.");
269  ATH_MSG_FATAL("ParticleDecayer::genInitialize: -- Branching Ratio Electrons " << m_BRElectron);
270  ATH_MSG_FATAL("ParticleDecayer::genInitialize: -- Branching Ratio Muons " << m_BRMuon);
271  ATH_MSG_FATAL("ParticleDecayer::genInitialize: -- Branching Ratio Pions " << m_BRPion);
272  ATH_MSG_FATAL("ParticleDecayer::genInitialize: -- Total Branching Ratio " << TOTBR);
273  return StatusCode::FAILURE;
274  }
275 
276  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- daughters randomly produced: " << m_BRElectron << "% e, " << m_BRMuon << "% mu, " << m_BRPion << "% pi");
277 
278  if( m_LJType != 1 && m_LJType != 2 )
279  {
280  ATH_MSG_FATAL("LJType is set to " << m_LJType);
281  ATH_MSG_FATAL("LJType has to be set to either 1 or 2");
282  return StatusCode::FAILURE;
283  }
284 
285 
286  return StatusCode::SUCCESS;
287 }

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

◆ getDecayProducts()

StatusCode ParticleDecayer::getDecayProducts ( CLHEP::HepRandomEngine *  engine,
CLHEP::HepLorentzVector  parentLV,
double  decayPartMass,
std::vector< CLHEP::HepLorentzVector > &  daughterLVs,
int  decayType = 0 
)
private

Definition at line 528 of file ParticleDecayer.cxx.

532 {
533  double parentMass = parentLV.m();
534  CLHEP::Hep3Vector boostVec = parentLV.boostVector();
535 
536  if( decayPartMass > parentMass/2.)
537  {
538  ATH_MSG_FATAL("Decay particle has more than half the mass of parent.");
539  return StatusCode::FAILURE;
540  }
541  //Get the angles in the rest frame
542  double phi_rf = rnd_DoubleRange(engine, -M_PI, M_PI);
543  double ct_rf = cosgen(engine, decayType);
544  double theta_rf = std::acos(ct_rf);
545 
546  //construct p1 particle momentum in rest-frame (_rf)
547  double p1_rf = std::sqrt(parentMass*parentMass/4. - decayPartMass*decayPartMass);
548  double px_rf = p1_rf*std::cos(phi_rf)*std::sin(theta_rf);
549  double py_rf = p1_rf*std::sin(phi_rf)*std::sin(theta_rf);
550  double pz_rf = p1_rf*ct_rf;
551  CLHEP::HepLorentzVector hlv1( px_rf, py_rf, pz_rf, parentMass/2.);
552  CLHEP::HepLorentzVector hlv2( -px_rf, -py_rf, -pz_rf, parentMass/2.);
553 
554  //Transform from the rotated frame to the (x,y,z) frame.
555  hlv1.rotateUz((parentLV.vect()).unit());
556  hlv2.rotateUz((parentLV.vect()).unit());
557 
558  //Now boost back to the lab-frame
559  hlv1.boost(boostVec);
560  hlv2.boost(boostVec);
561 
562  daughterLVs.push_back(hlv1);
563  daughterLVs.push_back(hlv2);
564 
565  return StatusCode::SUCCESS;
566 }

◆ getParticleMass()

double ParticleDecayer::getParticleMass ( int  pdgID)
private

Definition at line 459 of file ParticleDecayer.cxx.

459  {
460  IPartPropSvc* partPropSvc = 0;
461  StatusCode PartPropStatus = Gaudi::svcLocator()->service("PartPropSvc", partPropSvc);
462  if (!PartPropStatus.isSuccess() || 0 == partPropSvc) throw GaudiException("PartPropSvc error", "I_ParticleDecayer", StatusCode::FAILURE);
463  m_particleTable = partPropSvc->PDT();
464 
465  const HepPDT::ParticleData* particle = m_particleTable->particle(HepPDT::ParticleID(std::abs(pid)));
466  return particle->mass().value();
467 }

◆ 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 61 of file GenBase.cxx.

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

◆ 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 71 of file GenBase.cxx.

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

◆ mmTocm()

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

Scale event lengths by x 1/10.

Definition at line 90 of file GenBase.cxx.

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ particleData()

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

Access an element in the particle data table.

Definition at line 126 of file GenBase.h.

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

◆ particleTable()

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

Get a particle data table.

Definition at line 118 of file GenBase.h.

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

◆ partPropSvc()

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

Access the particle property service.

Definition at line 113 of file GenBase.h.

113  {
114  return m_ppSvc;
115  }

◆ pdt()

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

Shorter alias to get a particle data table.

Definition at line 123 of file GenBase.h.

123 { return particleTable(); }

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ rnd_DoubleRange()

double ParticleDecayer::rnd_DoubleRange ( CLHEP::HepRandomEngine *  engine,
double  a,
double  b 
)
private

Definition at line 39 of file ParticleDecayer.cxx.

39  {
40  double r = engine->flat(); //< Return random num in [0,1]
41  return a + r*(b-a);
42 }

◆ rnd_ExpLifetime()

double ParticleDecayer::rnd_ExpLifetime ( CLHEP::HepRandomEngine *  engine,
double  ct 
)
private

Definition at line 32 of file ParticleDecayer.cxx.

32  {
33  double r = engine->flat(); //< Return random num in [0,1]
34  return ((-ct)*std::log(1.-r));
35 }

◆ setDecayPosition()

StatusCode ParticleDecayer::setDecayPosition ( CLHEP::HepRandomEngine *  engine,
HepMC::GenParticlePtr  genpart,
HepMC::GenEvent *  event,
bool  doScalarDecay = false 
)
private

Definition at line 118 of file ParticleDecayer.cxx.

119 {
120  HepMC::GenVertexPtr vtxp = genpart->production_vertex();
121  if(!vtxp) {
122  ATH_MSG_FATAL("ParticleDecayer::fillEvt: -- no production vertex position found!");
123  return StatusCode::FAILURE;
124  }
125  if ( doScalarDecay ) // scalar decay is prompt. decay vtx == scalar production vertex
126  {
128  end_vtx->set_position(vtxp->position());
129  end_vtx->add_particle_in(genpart);
130  event->add_vertex(end_vtx);
131  return StatusCode::SUCCESS;
132  }
133 
134  //lifetime handling
135  double gamma = genpart->momentum().e()/genpart->momentum().m();
136  double ctau = 0.;
137  double theta = genpart->momentum().theta();
138 
139  // Make sure theta is between 0 and pi
140  while( theta > M_PI )
141  {
142  theta -= M_PI;
143  }
144  while( theta < 0 )
145  {
146  theta += M_PI;
147  }
148 
150  {
151  if(m_expDecayDoVariableLifetime) // Variable proper lifetime distribution, such that fixed fraction of events decays within detector, independent of boost
152  {
153  double distanceToEdge = -999.;
154  if ( theta < m_thetaEndCapBarrel || theta > ( M_PI - m_thetaEndCapBarrel) ) // Particle escapes through endcap
155  {
156  distanceToEdge = std::abs(m_endCapDistance/std::cos(theta));
157  }
158  else // Particle escapes through barrel
159  {
160  distanceToEdge = m_barrelRadius/std::sin(theta);
161  }
162  if ( gamma < 1. )
163  {
164  ATH_MSG_FATAL("Gamma factor cannot be smaller than 1" );
165  return StatusCode::FAILURE;
166  }
167  double Limit = distanceToEdge / gamma; // ctau is enhanced by factor gamma in lab frame
168  double lambda = -1.*Limit/std::log(1. - m_expDecayFractionToKeep);
169  ctau = rnd_ExpLifetime(engine,lambda);
171  {
172  while ( ctau > Limit ) // If decay is outside detector, let's sample again (Produces a truncated exponential)
173  {
174  ctau = rnd_ExpLifetime(engine, lambda);
175  }
176  }
177  }
178  else if( m_particleLifeTime > 0 ) // Fixed proper lifetime distribution. Note that if m_particleLifeTime <= 0. ctau remains 0
179  {
180  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- set lifetime of the dark photon according to ctau = " << m_particleLifeTime);
182  }
183  }else if (m_doUniformDecay)
184  {
185  double decayRadius = -999.;
186  if ( theta < m_thetaEndCapBarrel || theta > ( M_PI - m_thetaEndCapBarrel) ) // Particle escapes through endcap
187  {
188  double outerLength = std::abs(m_endCapDistance/std::cos(theta));
189  double outerRadius = outerLength*std::sin(theta);
190  decayRadius = rnd_DoubleRange(engine,0., std::min(outerRadius, std::abs(m_barrelRadius)) );
191  }else // Particle escapes through barrel
192  {
193  decayRadius = rnd_DoubleRange(engine,0., std::abs(m_barrelRadius));
194  }
195 
196  double decayLength = decayRadius/std::sin(theta);
197  ctau = decayLength/gamma;
198  }else
199  {
200  ATH_MSG_FATAL("have to pick uniform or exponential decay distance");
201  return StatusCode::FAILURE;
202  }
203 
204  double ctg = gamma * ctau;
205  double px = genpart->momentum().px();
206  double py = genpart->momentum().py();
207  double pz = genpart->momentum().pz();
208  double p = std::sqrt(px*px + py*py + pz*pz);
209 
210  const CLHEP::HepLorentzVector posLV(((ctg*px/p)+(vtxp->position().x())), ((ctg*py/p)+(vtxp->position().y())), ((ctg*pz/p)+(vtxp->position().z())), ((ctg)+(vtxp->position().t())));
211 
212  //set the decay vertex position of the particle
213  //Create a HepMC vertex at the decay position of the particle
214  ATH_MSG_DEBUG("ParticleDecayer::fillEvt: -- set the decay vertex");
216  end_vtx->set_position(HepMC::FourVector(posLV.x(),posLV.y(),posLV.z(),posLV.t()));
217  end_vtx->add_particle_in(genpart);
218  event->add_vertex(end_vtx);
219  return StatusCode::SUCCESS;
220 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

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

Definition at line 66 of file AthAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_barrelRadius

double ParticleDecayer::m_barrelRadius
private

Definition at line 73 of file ParticleDecayer.h.

◆ m_boostLV

CLHEP::HepLorentzVector ParticleDecayer::m_boostLV
private

Definition at line 92 of file ParticleDecayer.h.

◆ m_BRElectron

double ParticleDecayer::m_BRElectron {}
private

Definition at line 61 of file ParticleDecayer.h.

◆ m_BRMuon

double ParticleDecayer::m_BRMuon {}
private

Definition at line 63 of file ParticleDecayer.h.

◆ m_BRPion

double ParticleDecayer::m_BRPion {}
private

Definition at line 65 of file ParticleDecayer.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_doExponentialDecay

bool ParticleDecayer::m_doExponentialDecay {}
private

Definition at line 68 of file ParticleDecayer.h.

◆ m_doUniformDecay

bool ParticleDecayer::m_doUniformDecay {}
private

Definition at line 67 of file ParticleDecayer.h.

◆ m_endCapDistance

double ParticleDecayer::m_endCapDistance
private

Definition at line 74 of file ParticleDecayer.h.

◆ m_eventCounter

int ParticleDecayer::m_eventCounter
private

Definition at line 100 of file ParticleDecayer.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_expDecayDoTruncateLongDecays

bool ParticleDecayer::m_expDecayDoTruncateLongDecays {}
private

Definition at line 71 of file ParticleDecayer.h.

◆ m_expDecayDoVariableLifetime

bool ParticleDecayer::m_expDecayDoVariableLifetime {}
private

Definition at line 69 of file ParticleDecayer.h.

◆ m_expDecayFractionToKeep

double ParticleDecayer::m_expDecayFractionToKeep {}
private

Definition at line 70 of file ParticleDecayer.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_incidentSvc

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

Handle on the incident service.

Definition at line 101 of file GenModule.h.

◆ m_isAfterburner

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

Flag for normal vs. afterburner generators.

Definition at line 87 of file GenModule.h.

◆ m_LJType

int ParticleDecayer::m_LJType {}
private

Definition at line 42 of file ParticleDecayer.h.

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

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

Definition at line 137 of file GenBase.h.

◆ m_mcevents_const

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

Const handle to the MC event collection.

Definition at line 163 of file GenBase.h.

◆ m_mkMcEvent

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

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

Definition at line 139 of file GenBase.h.

◆ m_oppositePolarization

bool ParticleDecayer::m_oppositePolarization {}
private

Definition at line 58 of file ParticleDecayer.h.

◆ m_particleID

int ParticleDecayer::m_particleID {}
private

Definition at line 50 of file ParticleDecayer.h.

◆ m_particleLifeTime

double ParticleDecayer::m_particleLifeTime {}
private

Definition at line 52 of file ParticleDecayer.h.

◆ m_particleMass

double ParticleDecayer::m_particleMass {}
private

Definition at line 48 of file ParticleDecayer.h.

◆ m_particlePDGID

int ParticleDecayer::m_particlePDGID {}
private

Definition at line 54 of file ParticleDecayer.h.

◆ m_particlePolarization

int ParticleDecayer::m_particlePolarization {}
private

Definition at line 56 of file ParticleDecayer.h.

◆ m_particleTable

HepPDT::ParticleDataTable* ParticleDecayer::m_particleTable {}
private

Definition at line 77 of file ParticleDecayer.h.

◆ m_posLV

CLHEP::HepLorentzVector ParticleDecayer::m_posLV
private

Definition at line 94 of file ParticleDecayer.h.

◆ m_posLV1

CLHEP::HepLorentzVector ParticleDecayer::m_posLV1
private

Definition at line 96 of file ParticleDecayer.h.

◆ m_posLV2

CLHEP::HepLorentzVector ParticleDecayer::m_posLV2
private

Definition at line 98 of file ParticleDecayer.h.

◆ m_ppSvc

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

Handle on the particle property service.

Definition at line 160 of file GenBase.h.

◆ m_randomSeed

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

Seed for random number engine.

Definition at line 84 of file GenModule.h.

◆ m_rndmSvc

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

Data members.

Definition at line 99 of file GenModule.h.

◆ m_scalarMass

double ParticleDecayer::m_scalarMass {}
private

Definition at line 46 of file ParticleDecayer.h.

◆ m_scalarPDGID

int ParticleDecayer::m_scalarPDGID {}
private

Definition at line 44 of file ParticleDecayer.h.

◆ m_thetaEndCapBarrel

double ParticleDecayer::m_thetaEndCapBarrel
private

Definition at line 75 of file ParticleDecayer.h.

◆ m_truthParticleContainerName

std::string ParticleDecayer::m_truthParticleContainerName
private

Definition at line 40 of file ParticleDecayer.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
ParticleDecayer::m_particlePDGID
int m_particlePDGID
Definition: ParticleDecayer.h:54
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ParticleDecayer::m_particlePolarization
int m_particlePolarization
Definition: ParticleDecayer.h:56
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
beamspotman.r
def r
Definition: beamspotman.py:676
ParticleDecayer::DFTwoBodyDecay
StatusCode DFTwoBodyDecay(CLHEP::HepRandomEngine *engine, HepMC::GenParticlePtr, int)
Definition: ParticleDecayer.cxx:471
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
ParticleDecayer::m_particleTable
HepPDT::ParticleDataTable * m_particleTable
Definition: ParticleDecayer.h:77
test_pyathena.px
px
Definition: test_pyathena.py:18
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
GenModule::fillEvt
virtual StatusCode fillEvt(HepMC::GenEvent *evt)=0
For filling the HepMC event object.
ParticleDecayer::m_truthParticleContainerName
std::string m_truthParticleContainerName
Definition: ParticleDecayer.h:40
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 >
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ParticleDecayer::getDecayProducts
StatusCode getDecayProducts(CLHEP::HepRandomEngine *engine, CLHEP::HepLorentzVector, double, std::vector< CLHEP::HepLorentzVector > &, int decayType=0)
Definition: ParticleDecayer.cxx:528
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
ParticleDecayer::m_doUniformDecay
bool m_doUniformDecay
Definition: ParticleDecayer.h:67
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
ParticleDecayer::m_LJType
int m_LJType
Definition: ParticleDecayer.h:42
GenModule::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
Definition: GenModule.h:101
M_PI
#define M_PI
Definition: ActiveFraction.h:11
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
HepMC::newGenEvent
GenEvent * newGenEvent(const int a, const int b)
Definition: GenEvent.h:502
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
dumpTruth.statusCode
statusCode
Definition: dumpTruth.py:89
ParticleDecayer::addParticle
void addParticle(HepMC::GenVertexPtr, int pdg, HepMC::FourVector, int statusCode)
Definition: ParticleDecayer.cxx:440
x
#define x
HepMC::fillBarcodesAttribute
void fillBarcodesAttribute(GenEvent *)
Definition: GenEvent.h:504
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
ParticleDecayer::m_expDecayDoTruncateLongDecays
bool m_expDecayDoTruncateLongDecays
Definition: ParticleDecayer.h:71
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
ParticleDecayer::m_oppositePolarization
bool m_oppositePolarization
Definition: ParticleDecayer.h:58
GenModule::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: GenModule.cxx:34
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ParticleDecayer::m_BRElectron
double m_BRElectron
Definition: ParticleDecayer.h:61
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
ParticleDecayer::m_BRPion
double m_BRPion
Definition: ParticleDecayer.h:65
ParticleDecayer::m_thetaEndCapBarrel
double m_thetaEndCapBarrel
Definition: ParticleDecayer.h:75
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
ParticleDecayer::setDecayPosition
StatusCode setDecayPosition(CLHEP::HepRandomEngine *engine, HepMC::GenParticlePtr, HepMC::GenEvent *, bool doScalarDecay=false)
Definition: ParticleDecayer.cxx:118
GenModule::genuserInitialize
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
Definition: GenModule.h:64
ParticleDecayer::m_expDecayDoVariableLifetime
bool m_expDecayDoVariableLifetime
Definition: ParticleDecayer.h:69
ParticleDecayer::m_particleLifeTime
double m_particleLifeTime
Definition: ParticleDecayer.h:52
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
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
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
TrigVtx::gamma
@ gamma
Definition: TrigParticleTable.h:26
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
HepMC::newGenVertexPtr
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
Definition: GenVertex.h:64
parseMapping.v0
def v0
Definition: parseMapping.py:149
ret
T ret(T t)
Definition: rootspy.cxx:260
Atlas::ExtendedEventContext
Definition: ExtendedEventContext.h:23
ParticleDecayer::m_scalarMass
double m_scalarMass
Definition: ParticleDecayer.h:46
ParticleDecayer::rnd_ExpLifetime
double rnd_ExpLifetime(CLHEP::HepRandomEngine *engine, double ct)
Definition: ParticleDecayer.cxx:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
GenBase::m_mcevents_const
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition: GenBase.h:163
GenModule::m_isAfterburner
BooleanProperty m_isAfterburner
Flag for normal vs. afterburner generators.
Definition: GenModule.h:87
ParticleDecayer::m_particleMass
double m_particleMass
Definition: ParticleDecayer.h:48
ParticleDecayer::m_BRMuon
double m_BRMuon
Definition: ParticleDecayer.h:63
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
ParticleDecayer::m_particleID
int m_particleID
Definition: ParticleDecayer.h:50
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
ParticleDecayer::m_expDecayFractionToKeep
double m_expDecayFractionToKeep
Definition: ParticleDecayer.h:70
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
PowhegPythia8EvtGen_H2a4X_ctauY.ctau
int ctau
Definition: PowhegPythia8EvtGen_H2a4X_ctauY.py:28
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
ParticleDecayer::m_endCapDistance
double m_endCapDistance
Definition: ParticleDecayer.h:74
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
calibdata.ct
ct
Definition: calibdata.py:418
ParticleDecayer::m_barrelRadius
double m_barrelRadius
Definition: ParticleDecayer.h:73
min
#define min(a, b)
Definition: cfImp.cxx:40
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
ParticleDecayer::cosgen
double cosgen(CLHEP::HepRandomEngine *engine, int itype)
Definition: ParticleDecayer.cxx:47
GenModule::GenModule
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: GenModule.cxx:14
Amg::py
@ py
Definition: GeoPrimitives.h:39
ParticleDecayer::m_eventCounter
int m_eventCounter
Definition: ParticleDecayer.h:100
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
GenBase::partPropSvc
const ServiceHandle< IPartPropSvc > partPropSvc() const
Access the particle property service.
Definition: GenBase.h:113
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
ParticleDecayer::m_doExponentialDecay
bool m_doExponentialDecay
Definition: ParticleDecayer.h:68
ParticleDecayer::m_scalarPDGID
int m_scalarPDGID
Definition: ParticleDecayer.h:44
skel.genpart
tuple genpart
Check that the actual generators, tune, and main PDF are consistent with the JO name.
Definition: skel.ABtoEVGEN.py:262
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
HepMC::newGenParticlePtr
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition: GenParticle.h:39
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GenBase::pdt
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition: GenBase.h:123
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
merge.status
status
Definition: merge.py:17
ParticleDecayer::getParticleMass
double getParticleMass(int pdgID)
Definition: ParticleDecayer.cxx:459
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
ParticleDecayer::changeMass
StatusCode changeMass(HepMC::GenParticlePtr, double)
Definition: ParticleDecayer.cxx:94
PixelByteStreamErrors::Limit
@ Limit
Definition: PixelByteStreamErrors.h:14
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Atlas::setExtendedEventContext
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
Definition: ExtendedEventContext.cxx:50
GenBase::initialize
virtual StatusCode initialize() override
Definition: GenBase.cxx:17
ParticleDecayer::rnd_DoubleRange
double rnd_DoubleRange(CLHEP::HepRandomEngine *engine, double a, double b)
Definition: ParticleDecayer.cxx:39
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
LB_AnalMapSplitter.lbn
lbn
Definition: LB_AnalMapSplitter.py:28
ServiceHandle< ICondSvc >