ATLAS Offline Software
CaloTowerxAODAlgoBase.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef CALOREC_CALOTOWERXAODALGOBASE_H
8 #define CALOREC_CALOTOWERXAODALGOBASE_H
9 
12 
15 #include "StoreGate/WriteHandle.h"
18 #include "CxxUtils/CachedValue.h"
19 
20 #include <string>
21 #include <vector>
22 
24 {
25 public:
26 
32  CaloTowerxAODAlgoBase(const std::string& name, ISvcLocator* pSvcLocator);
33 
36 
37 protected:
38 
42  float m_minEta;
43  float m_maxEta;
44  int m_nEtaBins;
45  int m_nPhiBins;
46  bool m_doxCheck;
47 
50  , "CaloDetDescrManager"
51  , "CaloDetDescrManager"
52  , "SG Key for CaloDetDescrManager in the Condition Store" };
53 
54 
57  struct cellToTower_t{
58  size_t m_towerIdx;
59  float m_weight;
60  cellToTower_t(size_t idx, float w=1.0) : m_towerIdx(idx), m_weight(w) {};
62  };
63  typedef std::vector<std::vector<cellToTower_t>> CellToTowerVec;
65 
68 
71  makeContainer(const EventContext& ctx) const;
72 
74  const CellToTowerVec& getIndexCache(const EventContext& ctx) const;
75 
76 private:
78 
79  StatusCode fillIndexCache(const EventContext& ctx, CellToTowerVec& cellToTower) const;
80 };
81 
82 #endif
CaloTowerxAODAlgoBase::cellToTower_t::m_weight
float m_weight
Definition: CaloTowerxAODAlgoBase.h:59
CaloTowerxAODAlgoBase::~CaloTowerxAODAlgoBase
~CaloTowerxAODAlgoBase()
destructor
CaloTowerxAODAlgoBase::cellToTower_t
Definition: CaloTowerxAODAlgoBase.h:57
CaloTowerxAODAlgoBase::initBase
StatusCode initBase()
<
Definition: CaloTowerxAODAlgoBase.cxx:30
CaloTowerxAODAlgoBase::getIndexCache
const CellToTowerVec & getIndexCache(const EventContext &ctx) const
Definition: CaloTowerxAODAlgoBase.cxx:63
CaloTowerxAODAlgoBase::m_doxCheck
bool m_doxCheck
Turn on internal checks (debugging)
Definition: CaloTowerxAODAlgoBase.h:46
CaloTowerAuxContainer.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
WriteHandle.h
Handle class for recording to StoreGate.
CaloTowerxAODAlgoBase::fillIndexCache
StatusCode fillIndexCache(const EventContext &ctx, CellToTowerVec &cellToTower) const
Definition: CaloTowerxAODAlgoBase.cxx:73
CaloTowerContainer.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
CaloTowerxAODAlgoBase::CellToTowerVec
std::vector< std::vector< cellToTower_t > > CellToTowerVec
Definition: CaloTowerxAODAlgoBase.h:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloTowerxAODAlgoBase::m_maxEta
float m_maxEta
Tower-grid: upper eta boundary.
Definition: CaloTowerxAODAlgoBase.h:43
CxxUtils::CachedValue< CellToTowerVec >
CaloTowerxAODAlgoBase::m_minEta
float m_minEta
Tower-grid: lower eta boundary.
Definition: CaloTowerxAODAlgoBase.h:42
CaloTowerxAODAlgoBase::makeContainer
SG::WriteHandle< xAOD::CaloTowerContainer > makeContainer(const EventContext &ctx) const
Intialize m_cellToTower cache.
Definition: CaloTowerxAODAlgoBase.cxx:38
CaloTowerxAODAlgoBase::cellToTower_t::cellToTower_t
cellToTower_t()
Definition: CaloTowerxAODAlgoBase.h:61
CaloTowerxAODAlgoBase::cellToTower_t::cellToTower_t
cellToTower_t(size_t idx, float w=1.0)
Definition: CaloTowerxAODAlgoBase.h:60
CaloTowerxAODAlgoBase::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: CaloTowerxAODAlgoBase.h:49
CaloTowerxAODAlgoBase::m_nEtaBins
int m_nEtaBins
Tower-grid: number of phi bins.
Definition: CaloTowerxAODAlgoBase.h:44
ReadCondHandleKey.h
AthReentrantAlgorithm.h
CachedValue.h
Cached value with atomic update.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloTowerxAODAlgoBase::CaloTowerxAODAlgoBase
CaloTowerxAODAlgoBase(const std::string &name, ISvcLocator *pSvcLocator)
Default algorithm constructor.
Definition: CaloTowerxAODAlgoBase.cxx:15
CaloTowerxAODAlgoBase::m_cellToTower
CxxUtils::CachedValue< CellToTowerVec > m_cellToTower
map of cell indices to tower indices and weights
Definition: CaloTowerxAODAlgoBase.h:77
CaloTowerxAODAlgoBase::m_caloTowerContainerKey
SG::WriteHandleKey< xAOD::CaloTowerContainer > m_caloTowerContainerKey
Handle to xAOD::CaloTowerContainer.
Definition: CaloTowerxAODAlgoBase.h:41
SG::ReadCondHandleKey< CaloDetDescrManager >
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
IOVSvcDefs.h
defines and typedefs for IOVSvc
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
CaloTowerxAODAlgoBase
Definition: CaloTowerxAODAlgoBase.h:24
CaloTowerxAODAlgoBase::cellToTower_t::m_towerIdx
size_t m_towerIdx
<
Definition: CaloTowerxAODAlgoBase.h:58
CaloTowerxAODAlgoBase::m_nPhiBins
int m_nPhiBins
Tower-grid: number of phi bins.
Definition: CaloTowerxAODAlgoBase.h:45