|
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "CLHEP/Random/RandomEngine.h"
19 #include "CLHEP/Random/RandFlat.h"
20 #include "CLHEP/Random/RandGaussQ.h"
21 #include "CLHEP/Random/RandPoissonQ.h"
25 const std::string&
name,
26 const IInterface*
parent) :
35 const ZdcID* zdcId =
nullptr;
37 ATH_MSG_ERROR(
"execute: Could not retrieve ZdcID object from the detector store");
38 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
123 CLHEP::HepRandomEngine* rngEngine = rngWrapper->
getEngine(ctx);
130 if (!hitCollection.
isValid()) {
131 ATH_MSG_ERROR(
"Could not get ZDC_SimFiberHit_Collection container " << hitCollection.
name() <<
" from store " << hitCollection.
store());
132 return StatusCode::FAILURE;
134 ATH_MSG_DEBUG(
"ZDC_SimFiberHitHitCollection found with " << hitCollection->
size() <<
" hits");
146 moduleContainer->setStore( moduleAuxContainer.get() );
158 fillContainer(thpcZDC_Fiber, rngEngine, moduleContainer.get());
166 sumsContainer->setStore( sumsAuxContainer.get() );
169 for (
int iside : {-1, 1}){
173 LucrodTriggerSideAmpAcc (*new_sum) = 42;
184 ATH_CHECK( moduleContainerH.record (std::move(moduleContainer), std::move(moduleAuxContainer)) );
187 ATH_CHECK( sumsContainerH.record (std::move(sumsContainer), std::move(sumsAuxContainer)) );
189 return StatusCode::SUCCESS;
194 ATH_MSG_DEBUG (
"ZDC_PileUpTool::prepareEvent() called for " << nInputEvents <<
" input events" );
207 return StatusCode::SUCCESS;
214 ATH_MSG_DEBUG (
"ZDC_PileUpTool::processBunchXing() " << bunchXing );
216 for (; iEvt!=eSubEvents; ++iEvt) {
219 <<
" bunch crossing : " << bunchXing
220 <<
" time offset : " << iEvt->time()
221 <<
" event number : " << iEvt->ptr()->eventNumber()
222 <<
" run number : " << iEvt->ptr()->runNumber());
227 ATH_MSG_ERROR (
"SubEvent ZDC_SimFiberHit_Collection not found in StoreGate " << seStore.name() );
228 return StatusCode::FAILURE;
230 ATH_MSG_DEBUG (
"ZDC_SimFiberHit_Collection found with " << tmpColl->
size() <<
" hits" );
238 return StatusCode::SUCCESS;
246 CLHEP::HepRandomEngine* rngEngine = rngWrapper->
getEngine(ctx);
252 return StatusCode::SUCCESS;
269 for (;
it != itend; ++
it) {
277 bool zdcFound[2][4] = {{}};
278 bool rpdFound[2][16] = {{}};
279 bool branFound[2] = {};
280 for(
auto module : *zdcModuleContainer){
281 int iside = (
module->zdcSide() == -1) ? 0 : 1;
284 zdcFound[iside][
mod] =
true;
285 ATH_MSG_DEBUG(
"ZDC_PileUpTool::addEmptyWaveforms Found ZDC side " <<
module->zdcSide() <<
" module " <<
mod);
287 rpdFound[iside][
module->zdcChannel()] =
true;
288 ATH_MSG_DEBUG(
"ZDC_PileUpTool::addEmptyWaveforms Found RPD side " <<
module->zdcSide() <<
" channel " <<
module->zdcChannel());
290 branFound[iside] =
true;
295 for(
int iside : {0,1}){
296 int side = (iside == 0) ? -1 : 1;
298 if(!zdcFound[iside][
mod]){
299 ATH_MSG_DEBUG(
"ZDC_PileUpTool::addEmptyWaveforms Creating empty waveform for ZDC side " <<
side <<
" module " <<
mod);
305 ATH_MSG_DEBUG(
"ZDC_PileUpTool::addEmptyWaveforms Creating empty waveform for RPD side " <<
side <<
" channel " <<
channel);
310 ATH_MSG_DEBUG(
"ZDC_PileUpTool::addEmptyWaveforms Creating empty waveform for BRAN side " <<
side );
329 newCollection->
Insert(hit);
348 for(
int side : {0,1}){
360 newTimedCollection.
insert(0.0, newCollection);
362 return newTimedCollection;
382 zdcModuleContainer->
back()->setZdcId(
id.get_identifier32().get_compact());
383 zdcModuleContainer->
back()->setZdcSide(
side);
384 zdcModuleContainer->
back()->setZdcModule(
module);
386 zdcModuleContainer->
back()->setZdcChannel(
channel);
394 float amplitude = 0,
t0 = 0;
395 bool doHighGain =
true;
396 std::shared_ptr<ZDCWaveformBase> waveformPtr;
397 std::shared_ptr<ZDCWaveformSampler> wfSampler;
437 std::vector<unsigned int> wf = wfSampler->
Generate(amplitude,
t0);
438 std::vector<short unsigned int> retVal;
440 retVal.push_back(wf[
sample]);
def retrieve(aClass, aKey=None)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
const_pointer_type cptr()
Dereference the pointer.
Auxiliary store for xAOD::ZdcModuleContainer_v2.
Helper class to provide type-safe access to aux data.
const std::string & name() const
Return the StoreGate ID for the referenced object.
int module(const Identifier &id) const
std::vector< ALFA_RawData_p1 > t0
Class containing ZDC Module information.
#define ATH_MSG_VERBOSE(x)
ZDC_SimFiberHit_Collection::const_iterator ZDC_SimFiberHit_ConstIterator
const_iterator begin() const
void setWaveform(const std::string &, const std::vector< uint16_t > &)
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
CONT::const_iterator const_iterator
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
Identifier channel_id(int side, int module, int type, int channel) const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
The Athena Transient Store API.
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string store() const
Return the name of the store holding the object we are proxying.
void Add(int nphot, double edep)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const T * back() const
Access the last element in the collection as an rvalue.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::unique_ptr< base_value_type > unique_type
Type of a unique_ptr that can be used to insert elements into this container.
A wrapper class for event-slot-local random engines.
Helper class to provide type-safe access to aux data.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
the preferred mechanism to access information from the different event stores in a pileup job.
const_iterator end() const
int side(const Identifier &id) const
Values of different levels (failure returns 0)
TimedVector::const_iterator const_iterator
int type(const Identifier &id) const
std::string ZdcModuleToString(const xAOD::ZdcModule &zm)
void push_back(const T &t)
int channel(const Identifier &id) const