14 #include "CaloDetDescr/CaloDetDescrElement.h"
17 #include "GaudiKernel/ThreadLocalContext.h"
18 #include "CLHEP/Random/Randomize.h"
20 using CLHEP::RandGauss;
27 const std::string&
type,
28 const std::string&
name,
31 m_corrSampleMin(0),m_corrSampleMax(0),m_fractionSigma(1),m_GaussRand(false),m_GaussRandGroupedSamples(false),m_GaussRandShifted(false),m_GaussRandShifted_Custom(false), m_shift_EMB(1),m_shift_EMEC(1),m_shift_HEC(1),m_shift_TileBar(1),m_shift_TileGap(1),m_shift_TileExt(1),m_shift_FCAL(1),
32 m_athRNGSvc (
"AthRNGSvc",
name),
33 m_randomEngine (nullptr)
35 declareInterface<CaloCellCorrection>(
this);
68 ATH_MSG_ERROR(
"Could not get random number engine from AthRNGSvc. Abort.");
69 return StatusCode::FAILURE;
71 return StatusCode::SUCCESS;
78 const EventContext& ctx)
const
84 float GaussShifted = 0;
91 double SigmaNoise = caloNoise->
getNoise(theCell->
ID(), theCell->
gain());
94 Gauss = RandGauss::shoot(engine, 0.,1.);
106 setenergy(theCell,(GaussShifted*SigmaNoise));
112 GaussShifted = RandGauss::shoot(engine,
m_shift_EMB*SigmaNoise,SigmaNoise);
115 if (sampl>3 && sampl<8){
116 GaussShifted = RandGauss::shoot(engine,
m_shift_EMEC*SigmaNoise,SigmaNoise);
119 if (sampl>7 && sampl<12){
120 GaussShifted = RandGauss::shoot(engine,
m_shift_HEC*SigmaNoise,SigmaNoise);
123 if (sampl>11 && sampl<15){
124 GaussShifted = RandGauss::shoot(engine,
m_shift_TileBar*SigmaNoise,SigmaNoise);
127 if (sampl>14 && sampl<18){
128 GaussShifted = RandGauss::shoot(engine,
m_shift_TileGap*SigmaNoise,SigmaNoise);
131 if (sampl>17 && sampl<21){
132 GaussShifted = RandGauss::shoot(engine,
m_shift_TileExt*SigmaNoise,SigmaNoise);
135 if (sampl>20 && sampl<24){
136 GaussShifted = RandGauss::shoot(engine,
m_shift_FCAL*SigmaNoise,SigmaNoise);
153 if ( (sampl>11 && sampl<21) && SigmaNoise>999){