ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
LArCellEmMiscalib Class Reference

Apply miscalibration in EM calorimeter at cell level. More...

#include <LArCellEmMiscalib.h>

Inheritance diagram for LArCellEmMiscalib:
Collaboration diagram for LArCellEmMiscalib:

Public Member Functions

 LArCellEmMiscalib (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~LArCellEmMiscalib ()=default
 
virtual StatusCode initialize () override
 Constructor. More...
 
virtual void MakeCorrection (CaloCell *theCell, const EventContext &ctx) const override
 
virtual StatusCode execute (CaloCellContainer *cellCollection, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Static Protected Member Functions

static void setenergy (CaloCell *lar_cell, float energy)
 
static void addenergy (CaloCell *lar_cell, float energy)
 
static void scaleenergy (CaloCell *lar_cell, float scale)
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void smearingPerRegion (CLHEP::HepRandomEngine *engine)
 
void initOnce (const EventContext &ctx)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static int region (int barrelec, double eta, double phi)
 

Private Attributes

const LArEM_IDm_larem_id
 
const CaloIdManagerm_caloIdMgr = nullptr
 
const CaloDetDescrManagerm_calodetdescrmgr = nullptr
 
ServiceHandle< IAthRNGSvcm_rngSvc { this, "RndmSvc", "AthRNGSvc", "" }
 
int m_seed
 
double m_sigmaPerRegion
 
double m_sigmaPerCell
 
bool m_undo
 
unsigned int m_ncellem
 
std::vector< float > m_spread1
 
std::vector< float > m_calib
 
std::once_flag m_initOnce
 
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Apply miscalibration in EM calorimeter at cell level.

\ G.Unal (based on other similar tools from K.Voss)

Date
October 25, 2006

Definition at line 35 of file LArCellEmMiscalib.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArCellEmMiscalib()

LArCellEmMiscalib::LArCellEmMiscalib ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 36 of file LArCellEmMiscalib.cxx.

41  m_larem_id(nullptr),
42  m_seed(1234),
43  m_sigmaPerRegion(0.005),
44  m_sigmaPerCell(0.007),
45  m_undo(false),
46  m_ncellem(0)
47 {
48  declareInterface<CaloCellCorrection>(this);
49  declareProperty("Seed", m_seed, "seed : should always be the same");
50  declareProperty("SigmaPerRegion", m_sigmaPerRegion,"smearing per region");
51  declareProperty("SigmaPerCell", m_sigmaPerCell, "smearing per cell ");
52  declareProperty("UndoMisCalib",m_undo,"Apply opposite sign to undo miscalibration");
53 }

◆ ~LArCellEmMiscalib()

virtual LArCellEmMiscalib::~LArCellEmMiscalib ( )
virtualdefault

Member Function Documentation

◆ addenergy()

void CaloCellCorrection::addenergy ( CaloCell lar_cell,
float  energy 
)
staticprotectedinherited

Definition at line 94 of file CaloCellCorrection.cxx.

95 {
96  theCell->addEnergy( energy );
97 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode CaloCellCorrection::execute ( CaloCellContainer cellCollection,
const EventContext &  ctx 
) const
virtualinherited

Definition at line 58 of file CaloCellCorrection.cxx.

60 {
61 
62  ATH_MSG_DEBUG("Executing CaloCellCorrection");
63 
64  if (!cellCollection) {
65  ATH_MSG_ERROR( "Cell Correction tool receives invalid cell Collection" );
66  return StatusCode::FAILURE;
67  }
68 
69  // Loop over all the CaloCell Objects and call Make Correction.
70  // Note that this is the base class of all the concrete correction
71  // classes which implement a Make Correction method.
72 
73  for (CaloCell* cell : *cellCollection) {
74  MakeCorrection ( cell, ctx );
75  }
76 
77  // Done, Return success
78 
79  return StatusCode::SUCCESS;
80 
81 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode LArCellEmMiscalib::initialize ( )
overridevirtual

Constructor.

Definition at line 61 of file LArCellEmMiscalib.cxx.

62 {
63  ATH_MSG_INFO( " in LArCellEmMiscalib::initialize()" );
65  ATH_CHECK(m_rngSvc.retrieve());
66  return StatusCode::SUCCESS;
67 }

◆ initOnce()

void LArCellEmMiscalib::initOnce ( const EventContext &  ctx)
private

Definition at line 69 of file LArCellEmMiscalib.cxx.

69  {
70  StatusCode sc;
71  sc=detStore()->retrieve( m_caloIdMgr );
72  sc.ignore();
74  m_calodetdescrmgr = *caloMgrHandle;
75 
76  ATHRNG::RNGWrapper* wrapper = m_rngSvc->getEngine (this);
77  wrapper->setSeed (ctx.slot(), m_seed);
78  CLHEP::HepRandomEngine* engine = wrapper->getEngine (ctx);
79 
80 
81  // computes the smearing per region
82  this->smearingPerRegion (engine);
83 
84 
86 
88  m_calib.resize(m_ncellem,1.);
89 
90  ATH_MSG_DEBUG(" Number of EM cells " << m_ncellem);
91 
92  for (unsigned int i=0;i<m_ncellem;i++){
93  IdentifierHash idHash = i;
94  Identifier id = m_larem_id->channel_id(idHash);
95  int barrel_ec = m_larem_id->barrel_ec(id);
97  double eta = fabs(calodde->eta_raw());
98  double phi = calodde->phi_raw();
99  int iregion= LArCellEmMiscalib::region(barrel_ec,eta,phi);
100  if (iregion>=0) {
101  ATH_MSG_VERBOSE("barrel_ec,eta,phi,region " << barrel_ec << " " << eta << " " << phi << " "
102  << iregion << " " << m_spread1[iregion]);
103  double spread2=m_sigmaPerCell*RandGauss::shoot(engine,0.,1.);
104  m_calib[idHash] = m_spread1[iregion] + spread2;
105  if (m_undo ) {
106  if (m_calib[idHash] >0.) m_calib[idHash]=1./m_calib[idHash];
107  else m_calib[idHash]=1.;
108  }
109  ATH_MSG_VERBOSE(" m_calib " << m_calib[idHash]);
110  }
111  else {
112  ATH_MSG_WARNING( " Cannot find region for cell " << eta << " " << phi );
113  m_calib[idHash]=1.;
114  }
115  }
116 
117 
118 
119 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& CaloCellCorrection::interfaceID ( )
inlinestaticinherited

Definition at line 54 of file CaloCellCorrection.h.

54 { return IID_CaloCellCorrection;}

◆ MakeCorrection()

void LArCellEmMiscalib::MakeCorrection ( CaloCell theCell,
const EventContext &  ctx 
) const
overridevirtual

Implements CaloCellCorrection.

Definition at line 210 of file LArCellEmMiscalib.cxx.

212 {
213  LArCellEmMiscalib* thisNC ATLAS_THREAD_SAFE = const_cast<LArCellEmMiscalib*>(this);
214  std::call_once(m_initOnce, &LArCellEmMiscalib::initOnce,thisNC, ctx);
215  float energy = theCell->energy();
216 
217  float weight=1;
218 
219 
220  const CaloDetDescrElement * theDDE = theCell->caloDDE();
221  // Identifier id = theCell->ID();
222 
223  //if (m_larem_id->is_lar_em(id)) {
224 
225  if (theDDE->getSubCalo()==CaloCell_ID::LAREM) {
226  // IdentifierHash idHash = m_larem_id->channel_hash(id);
227  IdentifierHash idHash = theDDE->calo_hash();
228  if (idHash < m_ncellem) {
229  weight = m_calib[idHash];
230  }
231  else
232  {
233  ATH_MSG_WARNING( "Inconsistent hash value found " << idHash
234  << " >= " << m_ncellem );
235  }
236 // if (m_larem_id->phi(id)==0)
237 // std::cout << "Barrel_ec,sampl.region,eta,wt " << m_larem_id->barrel_ec(id) <<
238 // " " << m_larem_id->sampling(id) << " " << m_larem_id->region(id) << " " <<
239 // m_larem_id->eta(id) << " " << weight << std::endl;
240 
241  setenergy(theCell,energy*weight);
242 
243 
244  }
245 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ region()

int LArCellEmMiscalib::region ( int  barrelec,
double  eta,
double  phi 
)
staticprivate

Definition at line 168 of file LArCellEmMiscalib.cxx.

169 {
170  int iregion=-1;
171  if (phi<0.) phi=phi+2*M_PI;
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));
176  if (ieta>7) ieta=7;
177  iregion=16*ieta+iphi;
178  if (barrelec==1) iregion=iregion+128;
179  }
180  if (abs(barrelec)==2) {
181  int ieta;
182  if (eta<1.5) ieta=0;
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;
188  else ieta=6;
189  iregion=16*ieta+iphi;
190  if (barrelec==-2) iregion=iregion+256;
191  if (barrelec==2) iregion=iregion+256+112;
192  }
193  if (abs(barrelec)==3) {
194  //int ieta;
195  //if (eta<2.8) ieta=0;
196  //else ieta=1;
197  if (barrelec==-3) iregion=iregion+256+224;
198  if (barrelec==3) iregion=iregion+256+224+32;
199  }
200  return iregion;
201 
202 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ scaleenergy()

void CaloCellCorrection::scaleenergy ( CaloCell lar_cell,
float  scale 
)
staticprotectedinherited

Definition at line 99 of file CaloCellCorrection.cxx.

100 {
101  theCell->scaleEnergy( scale );
102 }

◆ setenergy()

void CaloCellCorrection::setenergy ( CaloCell lar_cell,
float  energy 
)
staticprotectedinherited

Definition at line 89 of file CaloCellCorrection.cxx.

90 {
91  theCell->setEnergy( energy );
92 }

◆ smearingPerRegion()

void LArCellEmMiscalib::smearingPerRegion ( CLHEP::HepRandomEngine *  engine)
private

Definition at line 122 of file LArCellEmMiscalib.cxx.

123 {
124  m_spread1.resize(544,1);
125  for (int i=0;i<544;i++) {
126  m_spread1[i]=1.+m_sigmaPerRegion*RandGauss::shoot(engine,0.,1.);
127  }
128 
129  if (msgLvl(MSG::DEBUG)) {
130  for (int i=0;i<544;i++) {
131  int iregion=i;
132  int ieta,iphi,barrelec,ii;
133  if (iregion<128) {
134  barrelec=-1;
135  ii=iregion;
136  }
137  else if (iregion<256) {
138  barrelec=1;
139  ii=iregion-128;
140  }
141  else if (iregion<(256+112)) {
142  barrelec=-2;
143  ii=iregion-256;
144  }
145  else if (iregion<(256+224)) {
146  barrelec=2;
147  ii=iregion-(256+112);
148  }
149  else if (iregion<(256+224+32)) {
150  barrelec=-3;
151  ii=iregion-(256+224);
152  }
153  else {
154  barrelec=3;
155  ii=iregion-(256+224+32);
156  }
157  iphi=ii%16;
158  ieta=ii/16;
159  ATH_MSG_DEBUG( "iregion,barrelec,ieta,iphi,spread " << iregion << " "
160  << barrelec << " " << ieta << " " << iphi << " " << m_spread1[i] );
161  }
162  }//end if msg_lvl(DEBUG)
163 
164 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_calib

std::vector<float> LArCellEmMiscalib::m_calib
private

Definition at line 72 of file LArCellEmMiscalib.h.

◆ m_calodetdescrmgr

const CaloDetDescrManager* LArCellEmMiscalib::m_calodetdescrmgr = nullptr
private

Definition at line 60 of file LArCellEmMiscalib.h.

◆ m_caloIdMgr

const CaloIdManager* LArCellEmMiscalib::m_caloIdMgr = nullptr
private

Definition at line 59 of file LArCellEmMiscalib.h.

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> LArCellEmMiscalib::m_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}
private

Definition at line 76 of file LArCellEmMiscalib.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_initOnce

std::once_flag LArCellEmMiscalib::m_initOnce
mutableprivate

Definition at line 74 of file LArCellEmMiscalib.h.

◆ m_larem_id

const LArEM_ID* LArCellEmMiscalib::m_larem_id
private

Definition at line 58 of file LArCellEmMiscalib.h.

◆ m_ncellem

unsigned int LArCellEmMiscalib::m_ncellem
private

Definition at line 70 of file LArCellEmMiscalib.h.

◆ m_rngSvc

ServiceHandle<IAthRNGSvc> LArCellEmMiscalib::m_rngSvc { this, "RndmSvc", "AthRNGSvc", "" }
private

Definition at line 62 of file LArCellEmMiscalib.h.

◆ m_seed

int LArCellEmMiscalib::m_seed
private

Definition at line 65 of file LArCellEmMiscalib.h.

◆ m_sigmaPerCell

double LArCellEmMiscalib::m_sigmaPerCell
private

Definition at line 67 of file LArCellEmMiscalib.h.

◆ m_sigmaPerRegion

double LArCellEmMiscalib::m_sigmaPerRegion
private

Definition at line 66 of file LArCellEmMiscalib.h.

◆ m_spread1

std::vector<float> LArCellEmMiscalib::m_spread1
private

Definition at line 71 of file LArCellEmMiscalib.h.

◆ m_undo

bool LArCellEmMiscalib::m_undo
private

Definition at line 68 of file LArCellEmMiscalib.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
LArCellEmMiscalib::m_calodetdescrmgr
const CaloDetDescrManager * m_calodetdescrmgr
Definition: LArCellEmMiscalib.h:60
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloIDHelper::channel_hash_max
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArCellEmMiscalib::m_rngSvc
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition: LArCellEmMiscalib.h:63
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloIdManager::getEM_ID
const LArEM_ID * getEM_ID(void) const
Definition: CaloIdManager.cxx:80
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
LArCellEmMiscalib::m_sigmaPerRegion
double m_sigmaPerRegion
Definition: LArCellEmMiscalib.h:66
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
LArCellEmMiscalib::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: LArCellEmMiscalib.h:76
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
LArEM_Base_ID::channel_id
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
LArCellEmMiscalib::initOnce
void initOnce(const EventContext &ctx)
Definition: LArCellEmMiscalib.cxx:69
LArCellEmMiscalib::m_larem_id
const LArEM_ID * m_larem_id
Definition: LArCellEmMiscalib.h:58
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
CaloDetDescrElement::getSubCalo
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:433
CaloCellCorrection::MakeCorrection
virtual void MakeCorrection(CaloCell *cellCollection, const EventContext &ctx) const =0
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArCellEmMiscalib::m_calib
std::vector< float > m_calib
Definition: LArCellEmMiscalib.h:72
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
LArCellEmMiscalib::m_ncellem
unsigned int m_ncellem
Definition: LArCellEmMiscalib.h:70
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArCellEmMiscalib::m_caloIdMgr
const CaloIdManager * m_caloIdMgr
Definition: LArCellEmMiscalib.h:59
CaloCellCorrection::CaloCellCorrection
CaloCellCorrection(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloCellCorrection.cxx:43
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LArCellEmMiscalib::smearingPerRegion
void smearingPerRegion(CLHEP::HepRandomEngine *engine)
Definition: LArCellEmMiscalib.cxx:122
LArCellEmMiscalib::region
static int region(int barrelec, double eta, double phi)
Definition: LArCellEmMiscalib.cxx:168
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
LArEM_Base_ID::barrel_ec
int barrel_ec(const Identifier id) const
return barrel_ec according to :
LArCellEmMiscalib::m_undo
bool m_undo
Definition: LArCellEmMiscalib.h:68
LArCellEmMiscalib::m_spread1
std::vector< float > m_spread1
Definition: LArCellEmMiscalib.h:71
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
LArCellEmMiscalib::m_sigmaPerCell
double m_sigmaPerCell
Definition: LArCellEmMiscalib.h:67
LArCellEmMiscalib::m_initOnce
std::once_flag m_initOnce
Definition: LArCellEmMiscalib.h:74
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCellCorrection::setenergy
static void setenergy(CaloCell *lar_cell, float energy)
Definition: CaloCellCorrection.cxx:89
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LArCellEmMiscalib
Apply miscalibration in EM calorimeter at cell level.
Definition: LArCellEmMiscalib.h:37
LArCellEmMiscalib::m_seed
int m_seed
Definition: LArCellEmMiscalib.h:65
fitman.k
k
Definition: fitman.py:528
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352
Identifier
Definition: IdentifierFieldParser.cxx:14