9 const std::string& name,
10 const IInterface *parent) :
20 return StatusCode::SUCCESS;
29 if (0 == nInputEvents) {
32 return StatusCode::RECOVERABLE;
34 ATH_MSG_VERBOSE( this->name()<<
"::prepareEvent: there are " << nInputEvents <<
" subevents in this event.");
46 return StatusCode::FAILURE;
49 return StatusCode::SUCCESS;
58 while (iEvt != eSubEvents){
62 ATH_MSG_VERBOSE( this->name()<<
"::processBunchXing: SubEvt McEventCollection from StoreGate " << seStore.name() <<
" of PileUpType " << iEvt->type() );
65 static_cast<int>(iEvt->type()), iEvt->time()));
69 return StatusCode::SUCCESS;
76 return StatusCode::SUCCESS;
84 ATH_CHECK(outputMcEventCollection.
record(std::make_unique<McEventCollection>()));
88 TimedTruthList truthList;
92 const unsigned int nInputMcEventColls=truthList.size();
93 if (0 == nInputMcEventColls) {
95 return StatusCode::SUCCESS;
98 ATH_MSG_DEBUG(
"execute: there are " << nInputMcEventColls <<
" subevents in this event.");
100 TimedTruthList::iterator timedTruthListIter(truthList.begin()), endOfTimedTruthList(truthList.end());
102 while (timedTruthListIter != endOfTimedTruthList) {
103 ATH_MSG_VERBOSE( this->name()<<
"::processBunchXing: SubEvt McEventCollection of PileUpType " << timedTruthListIter->first.type() );
106 ATH_CHECK(this->
processEvent(pBackgroundMcEvtColl, outputMcEventCollection.
ptr(),
static_cast<int>(timedTruthListIter->first.type()), timedTruthListIter->first.time()));
108 ++timedTruthListIter;
112 return StatusCode::SUCCESS;
117 ATH_MSG_VERBOSE( this->name()<<
"::processEvent() Event Type: " << pileupType );
118 if (!outputMcEventCollection) {
119 ATH_MSG_ERROR( this->name()<<
"::processEvent() was passed an null output McEventCollection pointer." );
120 return StatusCode::FAILURE;
123 ATH_MSG_ERROR( this->name()<<
"::processEvent() was passed an null input McEventCollection pointer." );
124 return StatusCode::FAILURE;
126 if (!pMcEvtColl->
empty()) {
127 for (
unsigned int iEv=0; iEv<pMcEvtColl->
size(); iEv++) {
131 const int bunchCrossingTime=
static_cast<int>(timeOffset);
134 for (
const auto& itVer: evt->vertices()) {
135 HepMC::FourVector newPos(itVer->position().x(),itVer->position().y(),itVer->position().z(),itVer->position().t()+timeOffset);
136 itVer->set_position(newPos);
141 return StatusCode::SUCCESS;
148 ATH_MSG_INFO (
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" );
150 ATH_MSG_INFO (
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" );
152 while(outputEventItr!=endOfEvents) {
154 const int event_number((*outputEventItr)->event_number());
155 ATH_MSG_INFO (
"GenEvent #"<<event_number<<
", signal_process_id="<<signal_process_id<<
", number of Vertices="<<(*outputEventItr)->vertices_size() );
158 std::ofstream of(fname);
160 HepMC::Print::line(of,*evt);
164 ATH_MSG_INFO (
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" );
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
The Athena Transient Store API.
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
const std::string BunchCrossingTime
const std::string PileUpType
int signal_process_id(const GenEvent &evt)
HepMC3::FourVector FourVector
void fillBarcodesAttribute(GenEvent *e)
HepMC3::GenEvent GenEvent
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::list< value_t > type
type of the collection of timed data object