31#include "Gaudi/Property.h"
32#include "GaudiKernel/IService.h"
33#include "GaudiKernel/MsgStream.h"
37 ISvcLocator* pSvcLocator)
58 ATH_MSG_INFO(
"***********************************************");
59 ATH_MSG_INFO(
"* Steering options for LArCalibInject_timeSh algorithm *");
60 ATH_MSG_INFO(
"***********************************************");
72 return StatusCode::SUCCESS;
93 auto hitEMapOut = std::make_unique<LArHitEMap>(cabling,
m_calocell_id,
94 *caloMgrHandle,
false);
108 const auto* hitmapPtr = hitmap.
cptr();
109 it_end = hitmapPtr->GetNbCells();
111 for (; it != it_end; ++it) {
112 const LArHitList& hitlist = hitmapPtr->GetCell(it);
113 const std::vector<std::pair<float, float> >& timeE = hitlist.
getData();
114 if (!timeE.empty()) {
116 for (
size_t i = 0; i < timeE.size(); i++) {
117 std::pair<float, float> energy_time = timeE[i];
118 hitEMapOut->AddEnergy(idhash, energy_time.first, energy_time.second);
125 unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
126 std::default_random_engine generator(seed);
127 std::uniform_real_distribution<double> distribution(-12.5, 12.5);
129 for (; it != it_end; it += 16) {
131 float time_inject = (float)distribution(generator);
132 hitEMapOut->AddEnergy(idhash, 10500.0, time_inject);
136 return StatusCode::SUCCESS;
141 ATH_MSG_INFO(
" LArCalibInject_timeSh finalize completed successfully");
143 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
This is a "hash" representation of an Identifier.
SG::ReadCondHandleKey< ILArfSampl > m_fracSKey
Property: Fraction of Energy Sampled (conditions input).
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
seedless option
LArCalibInject_timeSh(const std::string &name, ISvcLocator *pSvcLocator)
constructor
SG::WriteHandleKey< LArHitEMap > m_hitMapOutKey
output Lar Digits Cell container
StatusCode execute(const EventContext &context) const
Create LAr object save in TES (2 containers: 1 EM, 1 hadronic)
StatusCode initialize()
Read ascii files for auxiliary data (puslse shapes, noise, etc...)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
const T * retrieve(const EventContext &context, const SG::ReadCondHandleKey< T > &handleKey) const
~LArCalibInject_timeSh()
destructor
const CaloCell_ID * m_calocell_id
SG::ReadHandleKey< LArHitEMap > m_hitMapKey
hit map
const LARLIST & getData() const
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.