24#include "CLHEP/Units/SystemOfUnits.h"
25#include <CLHEP/Random/Randomize.h>
29using CLHEP::RandGauss;
37 const std::string&
type,
38 const std::string& name,
39 const IInterface* parent)
48 declareInterface<CaloCellCorrection>(
this);
66 return StatusCode::SUCCESS;
78 CLHEP::HepRandomEngine* engine = wrapper->
getEngine (ctx);
102 << iregion <<
" " <<
m_spread1[iregion]);
125 for (
int i=0;i<544;i++) {
130 for (
int i=0;i<544;i++) {
132 int ieta,iphi,barrelec,ii;
137 else if (iregion<256) {
141 else if (iregion<(256+112)) {
145 else if (iregion<(256+224)) {
147 ii=iregion-(256+112);
149 else if (iregion<(256+224+32)) {
151 ii=iregion-(256+224);
155 ii=iregion-(256+224+32);
159 ATH_MSG_DEBUG(
"iregion,barrelec,ieta,iphi,spread " << iregion <<
" "
160 << barrelec <<
" " << ieta <<
" " << iphi <<
" " <<
m_spread1[i] );
172 int iphi=(int)(
phi*(16./(2*
M_PI)));
173 if (iphi>15) iphi=15;
174 if (abs(barrelec)==1) {
175 int ieta=(int)(
eta*(1./0.2));
177 iregion=16*ieta+iphi;
178 if (barrelec==1) iregion=iregion+128;
180 if (abs(barrelec)==2) {
183 else if(
eta<1.6) ieta=1;
184 else if(
eta<1.8) ieta=2;
185 else if(
eta<2.0) ieta=3;
186 else if(
eta<2.1) ieta=4;
187 else if(
eta<2.3) ieta=5;
189 iregion=16*ieta+iphi;
190 if (barrelec==-2) iregion=iregion+256;
191 if (barrelec==2) iregion=iregion+256+112;
193 if (abs(barrelec)==3) {
197 if (barrelec==-3) iregion=iregion+256+224;
198 if (barrelec==3) iregion=iregion+256+224+32;
211 const EventContext& ctx)
const
215 float energy = theCell->
energy();
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Definition of CaloDetDescrManager.
#define ATLAS_THREAD_SAFE
A wrapper class for event-slot-local random engines.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
static void setenergy(CaloCell *lar_cell, float energy)
Data object for each calorimeter readout cell.
double energy() const
get energy (data member)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
This class groups all DetDescr information related to a CaloCell.
IdentifierHash calo_hash() const
cell calo hash
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
float eta_raw() const
cell eta_raw
float phi_raw() const
cell phi_raw
This is a "hash" representation of an Identifier.
std::vector< float > m_spread1
std::once_flag m_initOnce
LArCellEmMiscalib(const std::string &type, const std::string &name, const IInterface *parent)
static int region(int barrelec, double eta, double phi)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
const CaloDetDescrManager * m_calodetdescrmgr
void initOnce(const EventContext &ctx)
virtual void MakeCorrection(CaloCell *theCell, const EventContext &ctx) const override
virtual StatusCode initialize() override
Constructor.
std::vector< float > m_calib
const LArEM_ID * m_larem_id
void smearingPerRegion(CLHEP::HepRandomEngine *engine)
ServiceHandle< IAthRNGSvc > m_rngSvc
const CaloIdManager * m_caloIdMgr