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

Track Record Generator. The class takes input simulation track records and uses them as generator records. More...

#include <TrackRecordGenerator.h>

Inheritance diagram for TrackRecordGenerator:
Collaboration diagram for TrackRecordGenerator:

Public Member Functions

 TrackRecordGenerator (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~TrackRecordGenerator ()
 
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 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
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
Gen-specific event loop methods: to be overloaded
virtual StatusCode genInitialize ()
 For initializing the generator, if required. More...
 
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize. More...
 
virtual StatusCode genFinalize ()
 For finalising the generator, if required. More...
 

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

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

int m_events
 
std::vector< int > m_pdgCode
 
std::vector< CLHEP::HepLorentzVector > m_fourPos
 
std::vector< CLHEP::HepLorentzVector > m_fourMom
 
CLHEP::Hep3Vector m_center
 
std::vector< HepMC::Polarization > m_polarization
 
double m_smearTR
 Amount by which to smear TR position. More...
 
double m_smearTRp
 Amount by which to smear TR momentum. More...
 
std::string m_recordName
 TrackRecord collection name. More...
 
bool m_stopParticles
 Stop particles before simulation. More...
 
float m_stopped_tminus
 
float m_stopped_tplus
 Bounds for random time. More...
 
bool m_add_cL
 For stopped particles, add c*L to the time. More...
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Utility event-mangling functions

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

Features for derived classes to use internally

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

Detailed Description

Track Record Generator. The class takes input simulation track records and uses them as generator records.

Author
Zach Marshall ZLMar.nosp@m.shal.nosp@m.l@lbl.nosp@m..gov

Definition at line 27 of file TrackRecordGenerator.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

◆ TrackRecordGenerator()

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

Definition at line 25 of file TrackRecordGenerator.cxx.

26  : GenModule(name,pSvcLocator)
27  , m_events(0)
28 {
29  // Input collection name
30  declareProperty("TRCollection" , m_recordName = "CosmicRecord" );
31 
32  // Smearing of the initial position for tracks
33  declareProperty("TRSmearing", m_smearTR=-1, "Smear the initial position of the track by up to this amount");
34  declareProperty("TRPSmearing", m_smearTRp=-1, "Smear the momentum of the track by up to this amount");
35  declareProperty("StopParticles", m_stopParticles=false, "Stop the particles and make them decay within 25 ns");
36  declareProperty("stopped_tminus", m_stopped_tminus =-25. );
37  declareProperty("stopped_tplus", m_stopped_tplus =25. );
38  declareProperty("Add_cL", m_add_cL=true, "For stopped particles, shift the time by c times the decay rho");
39 }

◆ ~TrackRecordGenerator()

TrackRecordGenerator::~TrackRecordGenerator ( )
virtual

Definition at line 42 of file TrackRecordGenerator.cxx.

43 {}

Member Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/2]

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

Access the current signal event (first in the McEventCollection)

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

Definition at line 76 of file GenBase.h.

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

◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]

McEventCollection* events GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inherited

Access the current event's McEventCollection.

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

◆ callGenerator()

StatusCode TrackRecordGenerator::callGenerator ( )
virtual

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

Reimplemented from GenModule.

Definition at line 46 of file TrackRecordGenerator.cxx.

46  {
47 
48  ++m_events;
49  ATH_MSG_DEBUG( "Event #" << m_events);
50 
51  // clear up the vectors
52  m_fourPos.clear();
53  m_fourMom.clear();
54  m_polarization.clear();
55  m_pdgCode.clear();
56 
57  const EventContext& ctx = Gaudi::Hive::currentContext();
58  CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine(name(), ctx);
59 
60  const TrackRecordCollection* coll = nullptr;
61  CHECK( evtStore()->retrieve(coll,m_recordName) );
62 
63  ATH_MSG_INFO("retrieved "<<coll->size()<<" TTR hits; will smear position by "<< (m_smearTR>0?m_smearTR:0.) <<" mm and momentum by "<< (m_smearTRp>0?m_smearTRp:0.) <<" radians");
64 
65  for (auto iterTTR : *coll) {
66 
67  const HepPDT::ParticleData* particle = particleData(std::abs(iterTTR.GetPDGCode()));
68  double mass = particle->mass().value();
69  double en = std::sqrt(mass*mass+iterTTR.GetMomentum().mag2());
70 
71  ATH_MSG_VERBOSE("Reading back TTR:\n pos is "<<iterTTR.GetPosition()
72  <<"\n mom is "<<iterTTR.GetMomentum()
73  <<"\n pdg is "<<iterTTR.GetPDGCode() );
74 
75  CLHEP::HepLorentzVector particle4Position( iterTTR.GetPosition(), iterTTR.GetTime());
76 
77  ATH_MSG_DEBUG( "Smearing position by up to " << m_smearTR << " mm and momentum by up to " << m_smearTRp << " radians" );
78  if (m_smearTR>0){
79  ATH_MSG_DEBUG( "Track record started at " << particle4Position );
80 
81  // if Z is maximal, move in X and Y; otherwise move in Z and "phi"
82  if ( particle4Position.z() == 22031 || particle4Position.z() == -22031 ){ //FIXME Hardcoded limits!
83  particle4Position.setX( particle4Position.x() + CLHEP::RandFlat::shoot(rndmEngine, -m_smearTR, m_smearTR) );
84  particle4Position.setY( particle4Position.y() + CLHEP::RandFlat::shoot(rndmEngine, -m_smearTR, m_smearTR) );
85  } else {
86  particle4Position.setZ( particle4Position.z() + CLHEP::RandFlat::shoot(rndmEngine, -m_smearTR, m_smearTR) );
87  double R = std::sqrt( std::pow( particle4Position.x(),2 ) + std::pow(particle4Position.y(),2 ) );
88  double dPhi = std::atan2( m_smearTR, R );
89  dPhi = CLHEP::RandFlat::shoot( rndmEngine, -dPhi, dPhi );
90  double theta = std::atan2( particle4Position.x() , particle4Position.y() );
91  particle4Position.setX( R*std::sin( theta + dPhi ) );
92  particle4Position.setY( R*std::cos( theta + dPhi ) );
93  }
94  ATH_MSG_DEBUG( "Shifted track record to " << particle4Position );
95  }
96  CLHEP::HepLorentzVector particle4Momentum( iterTTR.GetMomentum(), en );
97  if (m_smearTRp>0){
98  ATH_MSG_DEBUG( "Track record momentum was " << particle4Momentum );
99 
100  // Keep p - smear an angle, and then randomly spin that change in (0,2PI)
101  double dTheta = CLHEP::RandFlat::shoot(rndmEngine, 0, m_smearTRp);
102  double dPhi = CLHEP::RandFlat::shoot(rndmEngine, 0, 2*M_PI);
103 
104  // Need a perpendicular vector...
105  CLHEP::HepLorentzVector perpendicularMomentum( 1 , 0 , 0 , 0);
106  if ( particle4Momentum.x() != 0 ){
107  if (particle4Momentum.y() == 0){
108  perpendicularMomentum.setX( 0 );
109  perpendicularMomentum.setY( 1 );
110  } else {
111  perpendicularMomentum.setX( particle4Momentum.y() );
112  perpendicularMomentum.setY( particle4Momentum.x() );
113  }
114  }
115 
116  // Now scale it based on dTheta
117  double tempP = std::pow(particle4Momentum.x(),2)+std::pow(particle4Momentum.y(),2)+std::pow(particle4Momentum.z(),2);
118  if ( tempP==0 ) {
119  ATH_MSG_DEBUG("Our initial momentum had zero magnitude!!");
120  perpendicularMomentum.setX(0);
121  perpendicularMomentum.setY(0);
122  } else if ( std::tan(dTheta) == 0 ){
123  ATH_MSG_DEBUG("Randomly deciding to keep the vector's direction...");
124  perpendicularMomentum.setX(0);
125  perpendicularMomentum.setY(0);
126  } else {
127  double scale = ( tempP ) * std::sin(dTheta) / ( std::pow(perpendicularMomentum.x(),2)+std::pow(perpendicularMomentum.y(),2) );
128  perpendicularMomentum.setX( perpendicularMomentum.x() * scale );
129  perpendicularMomentum.setY( perpendicularMomentum.y() * scale );
130 
131  // Rotate perpendicularMomentum by dPhi around particle4Momentum
132  perpendicularMomentum.rotate( dPhi , particle4Momentum.vect() );
133  }
134  particle4Momentum.setX( particle4Momentum.x() + perpendicularMomentum.x() );
135  particle4Momentum.setY( particle4Momentum.y() + perpendicularMomentum.y() );
136  particle4Momentum.setZ( particle4Momentum.z() + perpendicularMomentum.z() );
137 
138  // Rescale (very small effect, but want to include it)
139  double scale2 = tempP==0? 1 : (pow(particle4Momentum.x(),2)+pow(particle4Momentum.y(),2)+pow(particle4Momentum.z(),2)) / tempP;
140  particle4Momentum.setX( particle4Momentum.x() * scale2 );
141  particle4Momentum.setY( particle4Momentum.y() * scale2 );
142  particle4Momentum.setZ( particle4Momentum.z() * scale2 );
143  ATH_MSG_DEBUG( "Rotated the vector by " << perpendicularMomentum );
144  ATH_MSG_DEBUG( "And resulting momentum is " << particle4Momentum );
145  }
146  if (m_stopParticles){
147  ATH_MSG_DEBUG( "Will stop the track record where it is and give it mass " << mass );
148  particle4Momentum.setX(0);
149  particle4Momentum.setY(0);
150  particle4Momentum.setZ(0);
151  particle4Momentum.setT(mass);
152 
153  double settime=CLHEP::RandFlat::shoot(rndmEngine,m_stopped_tminus, m_stopped_tplus);
154  ATH_MSG_DEBUG( "Setting particle time to something uniform between "<<m_stopped_tminus<<" and "<<m_stopped_tplus<<" ns : " << settime );
155  if (m_add_cL){
156  settime += particle4Position.rho()/CLHEP::c_light;
157  }
158  particle4Position.setT(settime*CLHEP::c_light); // ct in mm
159  }
160 
161  m_fourPos.push_back( particle4Position );
162  m_fourMom.push_back( particle4Momentum );
163 
164  m_pdgCode.push_back(iterTTR.GetPDGCode());
165  HepMC::Polarization thePolarization(0.0,0.0);
166  m_polarization.push_back(thePolarization);
167 
168  if (m_stopParticles){
169  ATH_MSG_DEBUG( "Only one per event!!" );
170  break;
171  }
172  } // Loop through the track record collection
173 
174  return StatusCode::SUCCESS;
175 }

◆ cmTomm()

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

Scale event lengths by x 10.

Definition at line 78 of file GenBase.cxx.

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

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ event_const()

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

Access the current signal event (const)

Definition at line 83 of file GenBase.h.

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

◆ events_const() [1/2]

const McEventCollection* GenBase::events_const ( ) const
inlineinherited

Access the current event's McEventCollection (const)

Definition at line 96 of file GenBase.h.

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

◆ events_const() [2/2]

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

Definition at line 99 of file GenBase.h.

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

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

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

Reimplemented from GenBase.

Definition at line 70 of file GenModule.cxx.

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

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

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

◆ fillEvt()

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

For filling the HepMC event object.

Implements GenModule.

Definition at line 178 of file TrackRecordGenerator.cxx.

178  {
179 
180  if ( m_fourMom.size() != m_fourPos.size() || m_fourMom.size() != m_polarization.size()) {
181  ATH_MSG_ERROR("Wrong different number of vertexes/momenta/polaritazions!");
182  return StatusCode::FAILURE;
183  }
184  for(std::size_t v = 0; v < m_fourMom.size(); ++v){
185  // Note: The vertex and particle are owned by the event, so the
186  // event is responsible for those pointers.
187 
188  // Create the particle, and specify its polarization.
190 
191  // Create the vertex, and add the particle to the vertex.
193  vertex->add_particle_out( particle );
194 
195  // Add the vertex to the event.
196  event->add_vertex( vertex );
197 
198  // Add attributes
200  } // Loop over the particles
201 
202  event->set_event_number(m_events); // Set the event number
203  if (event->weights().empty()){
204  event->weights().push_back(1.0);
205  }
206  return StatusCode::SUCCESS;
207 }

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

virtual StatusCode GenModule::genInitialize ( )
inlinevirtualinherited

For initializing the generator, if required.

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

Definition at line 62 of file GenModule.h.

62 { return StatusCode::SUCCESS; }

◆ genuserInitialize()

virtual StatusCode GenModule::genuserInitialize ( )
inlinevirtualinherited

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

Reimplemented in Pythia8B_i.

Definition at line 64 of file GenModule.h.

64 { return StatusCode::SUCCESS; }

◆ getRandomEngine() [1/2]

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

Definition at line 34 of file GenModule.cxx.

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

◆ getRandomEngine() [2/2]

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

Definition at line 44 of file GenModule.cxx.

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

◆ getRandomEngineDuringInitialize()

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

Definition at line 53 of file GenModule.cxx.

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

◆ GeVToMeV()

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

Scale event energies/momenta by x 1000.

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

Definition at line 58 of file GenBase.cxx.

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

◆ initialize()

StatusCode GenModule::initialize ( )
virtualinherited

Reimplemented from GenBase.

Definition at line 21 of file GenModule.cxx.

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

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ MeVToGeV()

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

Scale event energies/momenta by x 1/1000.

Definition at line 68 of file GenBase.cxx.

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

◆ mmTocm()

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

Scale event lengths by x 1/10.

Definition at line 87 of file GenBase.cxx.

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ particleData()

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

Access an element in the particle data table.

Definition at line 126 of file GenBase.h.

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

◆ particleTable()

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

Get a particle data table.

Definition at line 118 of file GenBase.h.

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

◆ partPropSvc()

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

Access the particle property service.

Definition at line 113 of file GenBase.h.

113  {
114  return m_ppSvc;
115  }

◆ pdt()

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

Shorter alias to get a particle data table.

Definition at line 123 of file GenBase.h.

123 { return particleTable(); }

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

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

Definition at line 66 of file AthAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_add_cL

bool TrackRecordGenerator::m_add_cL
private

For stopped particles, add c*L to the time.

Definition at line 50 of file TrackRecordGenerator.h.

◆ m_center

CLHEP::Hep3Vector TrackRecordGenerator::m_center
private

Definition at line 41 of file TrackRecordGenerator.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_events

int TrackRecordGenerator::m_events
private

Definition at line 37 of file TrackRecordGenerator.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fourMom

std::vector<CLHEP::HepLorentzVector> TrackRecordGenerator::m_fourMom
private

Definition at line 40 of file TrackRecordGenerator.h.

◆ m_fourPos

std::vector<CLHEP::HepLorentzVector> TrackRecordGenerator::m_fourPos
private

Definition at line 39 of file TrackRecordGenerator.h.

◆ m_incidentSvc

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

Handle on the incident service.

Definition at line 101 of file GenModule.h.

◆ m_isAfterburner

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

Flag for normal vs. afterburner generators.

Definition at line 87 of file GenModule.h.

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

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

Definition at line 137 of file GenBase.h.

◆ m_mcevents_const

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

Const handle to the MC event collection.

Definition at line 163 of file GenBase.h.

◆ m_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_pdgCode

std::vector<int> TrackRecordGenerator::m_pdgCode
private

Definition at line 38 of file TrackRecordGenerator.h.

◆ m_polarization

std::vector<HepMC::Polarization> TrackRecordGenerator::m_polarization
private

Definition at line 42 of file TrackRecordGenerator.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_recordName

std::string TrackRecordGenerator::m_recordName
private

TrackRecord collection name.

Definition at line 47 of file TrackRecordGenerator.h.

◆ m_rndmSvc

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

Data members.

Definition at line 99 of file GenModule.h.

◆ m_smearTR

double TrackRecordGenerator::m_smearTR
private

Amount by which to smear TR position.

Definition at line 45 of file TrackRecordGenerator.h.

◆ m_smearTRp

double TrackRecordGenerator::m_smearTRp
private

Amount by which to smear TR momentum.

Definition at line 46 of file TrackRecordGenerator.h.

◆ m_stopParticles

bool TrackRecordGenerator::m_stopParticles
private

Stop particles before simulation.

Definition at line 48 of file TrackRecordGenerator.h.

◆ m_stopped_tminus

float TrackRecordGenerator::m_stopped_tminus
private

Definition at line 49 of file TrackRecordGenerator.h.

◆ m_stopped_tplus

float TrackRecordGenerator::m_stopped_tplus
private

Bounds for random time.

Definition at line 49 of file TrackRecordGenerator.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
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
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
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
scale2
#define scale2
Definition: JetAttributeHisto.cxx:42
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
GenModule::fillEvt
virtual StatusCode fillEvt(HepMC::GenEvent *evt)=0
For filling the HepMC event object.
GenModule::callGenerator
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
Definition: GenModule.h:66
GenBase::events_const
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Definition: GenBase.h:96
SG::ReadHandle< McEventCollection >
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrackRecordGenerator::m_smearTR
double m_smearTR
Amount by which to smear TR position.
Definition: TrackRecordGenerator.h:45
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
AtlasHitsVector
Definition: AtlasHitsVector.h:33
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
HepMC::set_polarization
void set_polarization(T &a, const Polarization &b)
Definition: Polarization.h:44
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
TrackRecordGenerator::m_pdgCode
std::vector< int > m_pdgCode
Definition: TrackRecordGenerator.h:38
HepMC::newGenEvent
GenEvent * newGenEvent(const int a, const int b)
Definition: GenEvent.h:624
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TrackRecordGenerator::m_recordName
std::string m_recordName
TrackRecord collection name.
Definition: TrackRecordGenerator.h:47
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
x
#define x
HepMC::fillBarcodesAttribute
void fillBarcodesAttribute(GenEvent *)
Definition: GenEvent.h:626
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
python.DataFormatRates.events
events
Definition: DataFormatRates.py:105
GenModule::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: GenModule.cxx:34
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TrackRecordGenerator::m_fourPos
std::vector< CLHEP::HepLorentzVector > m_fourPos
Definition: TrackRecordGenerator.h:39
TrackRecordGenerator::m_stopParticles
bool m_stopParticles
Stop particles before simulation.
Definition: TrackRecordGenerator.h:48
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TrackRecordGenerator::m_polarization
std::vector< HepMC::Polarization > m_polarization
Definition: TrackRecordGenerator.h:42
GenModule::genuserInitialize
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
Definition: GenModule.h:64
GenModule::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Data members.
Definition: GenModule.h:99
GenBase::m_ppSvc
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
Definition: GenBase.h:160
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
GenModule::genInitialize
virtual StatusCode genInitialize()
For initializing the generator, if required.
Definition: GenModule.h:62
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
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
z
#define z
Atlas::ExtendedEventContext
Definition: ExtendedEventContext.h:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
GenBase::m_mcevents_const
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition: GenBase.h:163
GenModule::m_isAfterburner
BooleanProperty m_isAfterburner
Flag for normal vs. afterburner generators.
Definition: GenModule.h:87
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
jobOptions.ParticleID
ParticleID
Definition: jobOptions.decayer.py:85
GenModule::genFinalize
virtual StatusCode genFinalize()
For finalising the generator, if required.
Definition: GenModule.h:70
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TrackRecordGenerator::m_events
int m_events
Definition: TrackRecordGenerator.h:37
TrackRecordGenerator::m_fourMom
std::vector< CLHEP::HepLorentzVector > m_fourMom
Definition: TrackRecordGenerator.h:40
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TrackRecordGenerator::m_stopped_tminus
float m_stopped_tminus
Definition: TrackRecordGenerator.h:49
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
GenBase::particleTable
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
Definition: GenBase.h:118
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
GenModule::GenModule
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: GenModule.cxx:14
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
PlotCalibFromCool.en
en
Definition: PlotCalibFromCool.py:399
TrackRecordGenerator::m_stopped_tplus
float m_stopped_tplus
Bounds for random time.
Definition: TrackRecordGenerator.h:49
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
python.PyAthena.v
v
Definition: PyAthena.py:154
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
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
y
#define y
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::nsw::STGTPSegments::MergedSegmentProperty::dTheta
@ dTheta
GenBase::pdt
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition: GenBase.h:123
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
AtlasHitsVector::size
size_type size() const
Definition: AtlasHitsVector.h:143
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
GenBase::particleData
const HepPDT::ParticleData * particleData(int pid) const
Access an element in the particle data table.
Definition: GenBase.h:126
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
TrackRecordGenerator::m_smearTRp
double m_smearTRp
Amount by which to smear TR momentum.
Definition: TrackRecordGenerator.h:46
TrackRecordGenerator::m_add_cL
bool m_add_cL
For stopped particles, add c*L to the time.
Definition: TrackRecordGenerator.h:50
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >