This AthReentrantAlgorithm reads in the McEventCollection produced by the generator and writes out an updated McEventCollection for use by simulation.
More...
#include <BeamEffectsAlg.h>
|
| SG::ReadHandleKey< McEventCollection > | m_inputMcEventCollection {this, "InputMcEventCollection", "GEN_EVENT", "The name of the input McEventCollection"} |
| SG::WriteHandleKey< McEventCollection > | m_outputMcEventCollection {this, "OutputMcEventCollection", "BeamTruthEvent", "The name of the output McEventCollection"} |
| SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfoKey {this, "EventInfo", "EventInfo", "The name of the input xAOD::EventInfo"} |
| ToolHandleArray< IGenEventManipulator > | m_genEventManipulators {this, "GenEventManipulators", {}, "BeamEffectsAlg will send the read-in GenEvent to each individual IGenEventManipulator."} |
| | Event manipulator tools (executed in given order).
|
| Gaudi::Property< bool > | m_ISFRun {this, "ISFRun", false, "Temporary property so that we don't change the output in the initial switch to this code"} |
| | Temporary property so that we don't change the output in the initial switch to this code.
|
| DataObjIDColl | m_extendedExtraObjects |
| | Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
|
| StoreGateSvc_t | m_evtStore |
| | Pointer to StoreGate (event store by default).
|
| StoreGateSvc_t | m_detStore |
| | Pointer to StoreGate (detector store by default).
|
| std::vector< SG::VarHandleKeyArray * > | m_vhka |
| bool | m_varHandleArraysDeclared |
This AthReentrantAlgorithm reads in the McEventCollection produced by the generator and writes out an updated McEventCollection for use by simulation.
The IGenEventManipulators are used to apply the effects of beam properties to the GenEvents.
Definition at line 39 of file BeamEffectsAlg.h.
◆ StoreGateSvc_t
◆ BeamEffectsAlg()
| Simulation::BeamEffectsAlg::BeamEffectsAlg |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
Definition at line 23 of file BeamEffectsAlg.cxx.
24 : AthReentrantAlgorithm( name, pSvcLocator )
25 {
26 }
◆ ~BeamEffectsAlg()
| virtual Simulation::BeamEffectsAlg::~BeamEffectsAlg |
( |
| ) |
|
|
virtualdefault |
◆ declareGaudiProperty()
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
158 {
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
◆ declareProperty()
Definition at line 145 of file AthCommonDataStore.h.
145 {
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
◆ detStore()
◆ evtStore()
◆ execute()
| StatusCode Simulation::BeamEffectsAlg::execute |
( |
const EventContext & | ctx | ) |
const |
|
finaloverridevirtual |
Athena algorithm's interface method execute().
Definition at line 43 of file BeamEffectsAlg.cxx.
44 {
45
48 if(!h_inputMcEventCollection.isValid()) {
49 ATH_MSG_FATAL(
"No input McEventCollection called " << h_inputMcEventCollection.name() <<
" in " << h_inputMcEventCollection.store());
50 return StatusCode::FAILURE;
51 }
52 auto outputMcEventCollection = std::make_unique<McEventCollection>(*h_inputMcEventCollection);
53 ATH_CHECK( h_outputMcEventCollection.record ( std::move (outputMcEventCollection)) );
54
56
57 if ( !currentGenEvent ) continue;
59
61
62 ATH_CHECK(manipulator->manipulate(*currentGenEvent, ctx));
63 }
64 }
65
66 return StatusCode::SUCCESS;
67 }
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandleArray< IGenEventManipulator > m_genEventManipulators
Event manipulator tools (executed in given order).
StatusCode patchSignalProcessVertex(HepMC::GenEvent &ge) const
Ensure that the GenEvent::signal_process_vertex has been set.
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollection
SG::WriteHandleKey< McEventCollection > m_outputMcEventCollection
HepMC3::GenEvent GenEvent
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 89 of file AthCommonAlgorithm.cxx.
54{
55
56
59 }
61}
Common base class for algorithms.
DataObjIDColl m_extendedExtraObjects
◆ filterPassed()
Get filter decision:
Definition at line 93 of file AthCommonAlgorithm.h.
93 {
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:
◆ initialize()
| StatusCode Simulation::BeamEffectsAlg::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Athena algorithm's interface method initialize().
Definition at line 29 of file BeamEffectsAlg.cxx.
30 {
31
34 }
35
36
40 return StatusCode::SUCCESS;
41 }
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isClonable()
| virtual bool Simulation::BeamEffectsAlg::isClonable |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
◆ msg()
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ patchSignalProcessVertex()
| StatusCode Simulation::BeamEffectsAlg::patchSignalProcessVertex |
( |
HepMC::GenEvent & | ge | ) |
const |
|
private |
Ensure that the GenEvent::signal_process_vertex has been set.
Definition at line 69 of file BeamEffectsAlg.cxx.
70 {
71
74 ATH_MSG_DEBUG(
"No signal_process_vertex found - creating a dummy GenVertex.");
77
79 }
80 else {
81 if (!ge.vertices().empty()) {
82 ATH_MSG_DEBUG(
"No signal_process_vertex found - using the first GenVertex in the event.");
85 }
86 }
88 if (!ge.vertices().empty()) {
89 ATH_MSG_ERROR(
"Failed to set signal_process_vertex for GenEvent!!");
90 return StatusCode::FAILURE;
91 }
93 }
94 }
95 else {
97 }
98 return StatusCode::SUCCESS;
99 }
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_ISFRun
Temporary property so that we don't change the output in the initial switch to this code.
HepMC3::FourVector FourVector
void set_signal_process_vertex(GenEvent *e, T &v)
ConstGenVertexPtr signal_process_vertex(const GenEvent *e)
GenVertexPtr newGenVertexPtr(const HepMC3::FourVector &pos=HepMC3::FourVector::ZERO_VECTOR(), const int i=0)
HepMC3::GenVertexPtr GenVertexPtr
◆ renounce()
Definition at line 380 of file AthCommonDataStore.h.
381 {
384 }
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)
◆ renounceArray()
◆ setFilterPassed()
| virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed |
( |
bool | state, |
|
|
const EventContext & | ctx ) const |
|
inlinevirtualinherited |
◆ sysExecute()
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Reimplemented in AthAnalysisAlgorithm.
Definition at line 80 of file AthCommonAlgorithm.cxx.
◆ sysInitialize()
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< Gaudi::Algorithm > >.
Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.
Definition at line 60 of file AthCommonAlgorithm.cxx.
71 {
73
76 }
77
81
82 if (
cs.retrieve().isFailure() ) {
85 }
86 if (
cs->regHandle(
this,*
h).isFailure()) {
88 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
Definition at line 308 of file AthCommonDataStore.h.
308 {
309
310
313 for (
auto k :
keys) {
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka
◆ SimTesting::BeamEffectsAlg_test
| friend class SimTesting::BeamEffectsAlg_test |
|
friend |
◆ m_detStore
◆ m_eventInfoKey
Definition at line 69 of file BeamEffectsAlg.h.
69{this, "EventInfo", "EventInfo", "The name of the input xAOD::EventInfo"};
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 108 of file AthCommonAlgorithm.h.
◆ m_genEventManipulators
| ToolHandleArray<IGenEventManipulator> Simulation::BeamEffectsAlg::m_genEventManipulators {this, "GenEventManipulators", {}, "BeamEffectsAlg will send the read-in GenEvent to each individual IGenEventManipulator."} |
|
private |
Event manipulator tools (executed in given order).
Definition at line 72 of file BeamEffectsAlg.h.
72{this, "GenEventManipulators", {}, "BeamEffectsAlg will send the read-in GenEvent to each individual IGenEventManipulator."};
◆ m_inputMcEventCollection
| SG::ReadHandleKey<McEventCollection> Simulation::BeamEffectsAlg::m_inputMcEventCollection {this, "InputMcEventCollection", "GEN_EVENT", "The name of the input McEventCollection"} |
|
private |
Definition at line 65 of file BeamEffectsAlg.h.
65{this, "InputMcEventCollection", "GEN_EVENT", "The name of the input McEventCollection"};
◆ m_ISFRun
| Gaudi::Property<bool> Simulation::BeamEffectsAlg::m_ISFRun {this, "ISFRun", false, "Temporary property so that we don't change the output in the initial switch to this code"} |
|
private |
Temporary property so that we don't change the output in the initial switch to this code.
Definition at line 75 of file BeamEffectsAlg.h.
75{this, "ISFRun", false, "Temporary property so that we don't change the output in the initial switch to this code"};
◆ m_outputMcEventCollection
| SG::WriteHandleKey<McEventCollection> Simulation::BeamEffectsAlg::m_outputMcEventCollection {this, "OutputMcEventCollection", "BeamTruthEvent", "The name of the output McEventCollection"} |
|
private |
Definition at line 66 of file BeamEffectsAlg.h.
66{this, "OutputMcEventCollection", "BeamTruthEvent", "The name of the output McEventCollection"};
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files: