DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
User run context for DDG4. More...
#include <Geant4Context.h>
Public Member Functions | |
Geant4Run (const G4Run *run) | |
Intializing constructor. More... | |
virtual | ~Geant4Run () |
Default destructor. More... | |
operator const G4Run & () const | |
Access the G4Run directly: Automatic type conversion. More... | |
const G4Run & | run () const |
Access the G4Event directly: Explicit G4Run accessor. More... | |
void * | addExtension (unsigned long long int k, ExtensionEntry *e) |
Add an extension object to the detector element. More... | |
template<typename T > | |
T * | addExtension (T *ptr, bool take_ownership=true) |
Add user extension object. Ownership is transferred! More... | |
template<typename T > | |
T * | extension (bool alert=true) |
Access to type safe extension object. Exception is thrown if the object is invalid. More... | |
Public Member Functions inherited from dd4hep::ObjectExtensions | |
ObjectExtensions (const std::type_info &parent_type) | |
Default constructor. More... | |
ObjectExtensions (const ObjectExtensions ©)=delete | |
Copy constructor. More... | |
virtual | ~ObjectExtensions () |
Default destructor. More... | |
ObjectExtensions & | operator= (const ObjectExtensions ©)=delete |
Assignment operator. More... | |
void | initialize () |
Initialize non-persistent object containers (e.g. after loading from ROOT file) More... | |
void | move (ObjectExtensions ©) |
Move extensions to target object. More... | |
void | clear (bool destroy=true) |
Clear all extensions. More... | |
void | copyFrom (const std::map< unsigned long long int, ExtensionEntry * > &ext, void *arg) |
Copy object extensions from another object. Hosting type must be identical! More... | |
void * | addExtension (unsigned long long int key, ExtensionEntry *entry) |
Add an extension object to the detector element. More... | |
void * | removeExtension (unsigned long long int key, bool destroy) |
Remove an existing extension object from the instance. More... | |
void * | extension (unsigned long long int key, bool alert) const |
Access an existing extension object from the detector element. More... | |
void * | extension (unsigned long long int key) const |
Access an existing extension object from the detector element. More... | |
Private Attributes | |
const G4Run * | m_run { nullptr } |
Reference to the original Geant4 run object. More... | |
Additional Inherited Members | |
Public Attributes inherited from dd4hep::ObjectExtensions | |
std::map< unsigned long long int, ExtensionEntry * > | extensions |
The extensions object. More... | |
User run context for DDG4.
The context is accessible from the Geant4Context pointer, which is present in every Geant4Action. The run context is only valid however, if there is actually an run being procesed ie. only during the lifetime of the corresponding G4Run objects.
Please note: Extensions are only valid within the hosting run and are INVALID across different runs. Hence: They are only useful to extend data of an run.
Definition at line 69 of file Geant4Context.h.
Geant4Run::Geant4Run | ( | const G4Run * | run | ) |
Intializing constructor.
Definition at line 26 of file Geant4Context.cpp.
|
virtual |
Default destructor.
Definition at line 33 of file Geant4Context.cpp.
|
inline |
Add user extension object. Ownership is transferred!
Definition at line 88 of file Geant4Context.h.
|
inline |
Add an extension object to the detector element.
Definition at line 84 of file Geant4Context.h.
|
inline |
Access to type safe extension object. Exception is thrown if the object is invalid.
Definition at line 95 of file Geant4Context.h.
|
inline |
Access the G4Run directly: Automatic type conversion.
Definition at line 80 of file Geant4Context.h.
|
inline |
Access the G4Event directly: Explicit G4Run accessor.
Definition at line 82 of file Geant4Context.h.
|
private |
Reference to the original Geant4 run object.
Definition at line 71 of file Geant4Context.h.