13 const std::string& name,
14 const IInterface *parent) :
25 return StatusCode::SUCCESS;
41 return StatusCode::RECOVERABLE;
46 return StatusCode::SUCCESS;
55 while (iEvt != eSubEvents)
60 ATH_MSG_DEBUG (
"processBunchXing: SubEvt McEventCollection from StoreGate " << seStore.name() );
69 static_cast<int>(iEvt->time()),
70 static_cast<int>(iEvt->type())
74 return StatusCode::SUCCESS;
83 return StatusCode::FAILURE;
86 return StatusCode::SUCCESS;
94 ATH_CHECK(outputMcEventCollection.
record(std::make_unique<McEventCollection>()));
98 TimedTruthList truthList;
109 return StatusCode::RECOVERABLE;
114 TimedTruthList::iterator timedTruthListIter(truthList.begin()), endOfTimedTruthList(truthList.end());
116 while (timedTruthListIter != endOfTimedTruthList)
121 pBackgroundMcEvtColl,
122 outputMcEventCollection.
ptr(),
123 currentPileUpTimeEventIndex.
index(),
124 static_cast<int>(currentPileUpTimeEventIndex.
time()),
125 static_cast<int>(currentPileUpTimeEventIndex.
type())
127 ++timedTruthListIter;
131 return StatusCode::SUCCESS;
138 if (outputMcEventCollection->
at(0)->heavy_ion())
return StatusCode::SUCCESS;
139 if (pMcEvtColl->
at(0)->heavy_ion())
143 HepMC::GenHeavyIonPtr hinew=std::make_shared<HepMC::GenHeavyIon>(*(pMcEvtColl->
at(0)->heavy_ion()));
144 outputMcEventCollection->
at(0)->set_heavy_ion(std::move(hinew));
146 outputMcEventCollection->
at(0)->set_heavy_ion(*(pMcEvtColl->
at(0)->heavy_ion()));
149 return StatusCode::SUCCESS;
154 ATH_MSG_VERBOSE (
"processEvent() Event Type: " << pileupType <<
", BunchCrossingTime: " << bunchCrossingTime );
155 if (!outputMcEventCollection) {
156 ATH_MSG_ERROR( this->name()<<
"::processEvent() was passed an null output McEventCollection pointer." );
157 return StatusCode::FAILURE;
160 ATH_MSG_ERROR( this->name()<<
"::processEvent() was passed an null input McEventCollection pointer." );
161 return StatusCode::FAILURE;
166 return StatusCode::SUCCESS;
171 const HepMC::GenEvent& currentBackgroundEvent(**(pMcEvtColl->
begin()));
173 HepMC::GenEvent* copiedEvent =
new HepMC::GenEvent(currentBackgroundEvent);
175 copiedEvent->set_event_number(currentBkgEventIndex);
179 copiedEvent->add_attribute(
"BunchCrossingTime",std::make_shared<HepMC3::IntAttribute>(bunchCrossingTime));
180 copiedEvent->add_attribute(
"PileUpType",std::make_shared<HepMC3::IntAttribute>(pileupType));
182 outputMcEventCollection->
push_back(copiedEvent);
186 return StatusCode::SUCCESS;
191 if (outputMcEventCollection->
empty()) {
return; }
194 ATH_MSG_INFO (
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" );
196 while(outputEventItr!=endOfEvents)
199 const int event_number((*outputEventItr)->event_number());
200 ATH_MSG_INFO (
"GenEvent #"<<event_number<<
", signal_process_id="<<signal_process_id<<
", number of Vertices="<<(*outputEventItr)->vertices_size() );
203 std::ofstream of(fname);
208 ATH_MSG_INFO (
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" );
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
the preferred mechanism to access information from the different event stores in a pileup job.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
const T * at(size_type n) const
Access an element, as an rvalue.
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.
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*.
void line(std::ostream &os, const GenEvent &e)
int signal_process_id(const GenEvent &e)
void fillBarcodesAttribute(GenEvent *)
std::list< value_t > type
type of the collection of timed data object
a struct encapsulating the identifier of a pile-up event
index_type index() const
the index of the component event in PileUpEventInfo
PileUpType type() const
the pileup type - minbias, cavern, beam halo, signal?
time_type time() const
bunch xing time in ns