16 #include "CLHEP/Vector/LorentzVector.h"
38 return StatusCode::SUCCESS;
45 return StatusCode::SUCCESS;
54 ATH_MSG_ERROR(
"Expected GenEvent::signal_process_vertex() to already have been set at this point!");
55 return StatusCode::FAILURE;
62 CLHEP::HepLorentzVector *curShift = vertexShifter->generate(ctx);
64 ATH_MSG_ERROR(
"Vertex Shifter AthenaTool returned zero-pointer! Ignore.");
68 ATH_MSG_VERBOSE(
"Retrieved Vertex shift of: " << *curShift <<
" from " << vertexShifter->name());
75 bool modifySigVtx(
true);
80 for(
auto& curVtx: ge.vertices()) {
84 const HepMC::FourVector &curPos = (curVtx->has_set_position()) ? curVtx->position() : HepMC::FourVector::ZERO_VECTOR();
86 auto vtxIt = ge.vertices_begin();
87 auto vtxItEnd = ge.vertices_end();
88 for( ; vtxIt != vtxItEnd; ++vtxIt) {
90 auto curVtx = (*vtxIt);
91 const HepMC::FourVector &curPos = curVtx->position();
95 CLHEP::HepLorentzVector newPos( curPos.x(), curPos.y(), curPos.z(), curPos.t() );
97 newPos += (*curShift);
99 ATH_MSG_VERBOSE(
"Original vtx position = " << curPos.x() <<
", " << curPos.y() <<
", " << curPos.z() );
103 curVtx->set_position( HepMC::FourVector(newPos.x(),newPos.y(),newPos.z(),newPos.t()));
104 if(modifySigVtx && signalProcVtx==curVtx) {
112 CLHEP::HepLorentzVector newPos( curPos.x(), curPos.y(), curPos.z(), curPos.t() );
113 newPos += (*curShift);
121 return StatusCode::SUCCESS;