|
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "CLHEP/Vector/LorentzVector.h"
40 return StatusCode::SUCCESS;
48 if(!h_inputMcEventCollection.
isValid()) {
49 ATH_MSG_FATAL(
"No input McEventCollection called " << h_inputMcEventCollection.
name() <<
" in " << h_inputMcEventCollection.
store());
50 return StatusCode::FAILURE;
52 auto outputMcEventCollection = std::make_unique<McEventCollection>(*h_inputMcEventCollection);
53 ATH_CHECK( h_outputMcEventCollection.
record ( std::move (outputMcEventCollection)) );
55 for (HepMC::GenEvent* currentGenEvent : *h_outputMcEventCollection) {
57 if ( !currentGenEvent )
continue;
62 ATH_CHECK(manipulator->manipulate(*currentGenEvent, ctx));
66 return StatusCode::SUCCESS;
75 ATH_MSG_DEBUG(
"No signal_process_vertex found - creating a dummy GenVertex.");
76 HepMC::FourVector signalPos( 0.0, 0.0, 0.0, 0.0);
82 if (!ge.vertices().empty()) {
83 ATH_MSG_DEBUG(
"No signal_process_vertex found - using the first GenVertex in the event.");
89 if (!ge.vertices().empty()) {
90 ATH_MSG_ERROR(
"Failed to set signal_process_vertex for GenEvent!!");
91 return StatusCode::FAILURE;
100 if( !ge.signal_process_vertex() ) {
102 ATH_MSG_DEBUG(
"No signal_process_vertex found - creating a dummy GenVertex.");
103 HepMC::FourVector signalPos( 0.0, 0.0, 0.0, 0.0);
106 ge.set_signal_process_vertex( signalVertex );
109 if (!ge.vertices_empty()) {
110 ATH_MSG_DEBUG(
"No signal_process_vertex found - using the first GenVertex in the event.");
112 ge.set_signal_process_vertex( signalVertex );
116 if (!ge.vertices_empty()) {
117 ATH_MSG_ERROR(
"Failed to set signal_process_vertex for GenEvent!!");
118 return StatusCode::FAILURE;
127 return StatusCode::SUCCESS;
HepMC::GenVertex * GenVertexPtr
BeamEffectsAlg(const std::string &name, ISvcLocator *pSvcLocator)
const std::string & name() const
Return the StoreGate ID for the referenced object.
virtual StatusCode execute(const EventContext &ctx) const override final
Athena algorithm's interface method execute()
An algorithm that can be simultaneously executed in multiple threads.
Handle class for recording to StoreGate.
void set_signal_process_vertex(GenEvent *e, T v)
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
StatusCode patchSignalProcessVertex(HepMC::GenEvent &ge) const
Ensure that the GenEvent::signal_process_vertex has been set.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string store() const
Return the name of the store holding the object we are proxying.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollection
ToolHandleArray< IGenEventManipulator > m_genEventManipulators
Event manipulator tools (executed in given order)
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual StatusCode initialize() override final
Athena algorithm's interface method initialize()
#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.
Handle class for reading from StoreGate.
SG::WriteHandleKey< McEventCollection > m_outputMcEventCollection
GenVertex * signal_process_vertex(const GenEvent *e)