ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTowerxAODFromCells Class Reference

#include <CaloTowerxAODFromCells.h>

Inheritance diagram for CaloTowerxAODFromCells:
Collaboration diagram for CaloTowerxAODFromCells:

Public Member Functions

 CaloTowerxAODFromCells (const std::string &name, ISvcLocator *pSvcLocator)
 Default algorithm constructor.
virtual ~CaloTowerxAODFromCells ()
 Baseclass destructor.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
@c AthAlgorithm interface implementation
virtual StatusCode initialize () override
 Initialize algorithm.
virtual StatusCode execute (const EventContext &ctx) const override
 Execute algorithm.
virtual StatusCode finalize () override
 Finalize algorithm.

Protected Types

Internal mapping of cells to towers
typedef std::vector< std::vector< cellToTower_t > > CellToTowerVec

Protected Member Functions

StatusCode initBase ()
 <
SG::WriteHandle< xAOD::CaloTowerContainermakeContainer (const EventContext &ctx) const
 Intialize m_cellToTower cache.
const CellToTowerVecgetIndexCache (const EventContext &ctx) const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Protected Attributes

SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
Algorithm properties
SG::WriteHandleKey< xAOD::CaloTowerContainerm_caloTowerContainerKey
 Handle to xAOD::CaloTowerContainer.
float m_minEta
 Tower-grid: lower eta boundary.
float m_maxEta
 Tower-grid: upper eta boundary.
int m_nEtaBins
 Tower-grid: number of phi bins.
int m_nPhiBins
 Tower-grid: number of phi bins.
bool m_doxCheck
 Turn on internal checks (debugging)

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode fillIndexCache (const EventContext &ctx, CellToTowerVec &cellToTower) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

bool m_filterCells
CxxUtils::CachedValue< CellToTowerVecm_cellToTower
 map of cell indices to tower indices and weights
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared
Algorithm properties
SG::ReadHandleKey< CaloCellContainerm_inputCellContainerKey
double m_cellThresholdE
 Cell energy threshold (only for FilteredCell mode)

Detailed Description

Definition at line 19 of file CaloTowerxAODFromCells.h.

Member Typedef Documentation

◆ CellToTowerVec

typedef std::vector<std::vector<cellToTower_t> > CaloTowerxAODAlgoBase::CellToTowerVec
protectedinherited

Definition at line 63 of file CaloTowerxAODAlgoBase.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CaloTowerxAODFromCells()

CaloTowerxAODFromCells::CaloTowerxAODFromCells ( const std::string & name,
ISvcLocator * pSvcLocator )

Default algorithm constructor.

Parameters
namereference to non-modifiable name of algorithm instance
pSvcLocatorpointer to generic service locator

Definition at line 18 of file CaloTowerxAODFromCells.cxx.

19 : CaloTowerxAODAlgoBase(name,pSvcLocator)
20 , m_inputCellContainerKey("AllCalo")
21 , m_cellThresholdE(std::numeric_limits<float>::min())
22 , m_filterCells(false)
23{
24 declareProperty("InputCellContainer", m_inputCellContainerKey);
25 declareProperty("CellEnergyThreshold", m_cellThresholdE);
26}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
CaloTowerxAODAlgoBase(const std::string &name, ISvcLocator *pSvcLocator)
Default algorithm constructor.
double m_cellThresholdE
Cell energy threshold (only for FilteredCell mode)
SG::ReadHandleKey< CaloCellContainer > m_inputCellContainerKey

◆ ~CaloTowerxAODFromCells()

CaloTowerxAODFromCells::~CaloTowerxAODFromCells ( )
virtualdefault

Baseclass destructor.

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode CaloTowerxAODFromCells::execute ( const EventContext & ctx) const
overridevirtual

Execute algorithm.

Definition at line 46 of file CaloTowerxAODFromCells.cxx.

47{
48 const CellToTowerVec& cellToTower = getIndexCache(ctx);
49 if(cellToTower.empty()) {
50 ATH_MSG_ERROR( "Failed to compute the index cache");
51 return StatusCode::FAILURE;
52 }
53
54 SG::ReadHandle<CaloCellContainer> inputCellContainer(m_inputCellContainerKey, ctx);
55 if (!inputCellContainer.isValid()) {
56 ATH_MSG_ERROR( "Can't retrieve CaloCellContainer with key " << inputCellContainer.name() );
57 return StatusCode::FAILURE;
58 }
59
60 SG::WriteHandle<xAOD::CaloTowerContainer> caloTowerContainer =
61 this->makeContainer(ctx);
62 if (!caloTowerContainer.isValid())
63 return StatusCode::FAILURE;
64
65 const size_t nCell2Tower=cellToTower.size();
66 if (nCell2Tower<inputCellContainer->size()) {
67 ATH_MSG_ERROR( "Number of cells larger than size of internal cell2tower cache. nCells="
68 << inputCellContainer->size() << ", cell2tower size=" << nCell2Tower );
69 return StatusCode::FAILURE;
70 }
71
72 for (const CaloCell* cell : *inputCellContainer) {
73
74 if (!m_filterCells || (cell->e()> m_cellThresholdE)) {
75
76 const IdentifierHash cellHash=cell->caloDDE()->calo_hash();
77 assert(cellHash<cellToTower.size());
78 if (!(cellHash<cellToTower.size())) {
79 ATH_MSG_ERROR( "Cell2Tower mapping too small " << cellToTower.size() << ", expected at least" << cellHash );
80 return StatusCode::FAILURE;
81 }
82 const auto& c2ts=cellToTower[cellHash];
83 //Remember: A cell can contribute to more than one tower!
84 for (const cellToTower_t& c2t : c2ts) {
85 if (c2t.m_towerIdx > caloTowerContainer->size()) {
86 ATH_MSG_ERROR( "Tower container size too small " << caloTowerContainer->size() << ", expected at least" << c2t.m_towerIdx );
87 return StatusCode::FAILURE;
88 }
89 (*caloTowerContainer)[c2t.m_towerIdx]->addEnergy(cell->e()*c2t.m_weight);
90 }//end loop over towers coverd by this cell
91 }// end if filter cells
92 }//end loop over cells
93
94
95 return StatusCode::SUCCESS;
96}
#define ATH_MSG_ERROR(x)
std::vector< std::vector< cellToTower_t > > CellToTowerVec
const CellToTowerVec & getIndexCache(const EventContext &ctx) const
SG::WriteHandle< xAOD::CaloTowerContainer > makeContainer(const EventContext &ctx) const
Intialize m_cellToTower cache.
virtual bool isValid() override final
Can the handle be successfully dereferenced?

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ fillIndexCache()

StatusCode CaloTowerxAODAlgoBase::fillIndexCache ( const EventContext & ctx,
CellToTowerVec & cellToTower ) const
privateinherited

Definition at line 73 of file CaloTowerxAODAlgoBase.cxx.

74{
75 ATH_MSG_INFO("Filling cell -> tower index map");
76
77 //Some basic sanity checks:
78 if (m_minEta>=m_maxEta) {
79 ATH_MSG_ERROR( "Configuration problem: minEta>=maxEta " << m_minEta << "," << m_maxEta );
80 return StatusCode::FAILURE;
81 }
82
83 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx};
84 ATH_CHECK(caloMgrHandle.isValid());
85 const CaloDetDescrManager* theManager = *caloMgrHandle;
86
87 //Build a dummy CaloTowerContainer
88 std::unique_ptr<xAOD::CaloTowerContainer> dummy(new xAOD::CaloTowerContainer());
89
91
92 const int nTowers=dummy->nTowers();
93
94 if (nTowers<1) {
95 ATH_MSG_ERROR( "Something went wrong with tower grid config: Got container with " << nTowers << " Towers." );
96 return StatusCode::FAILURE;
97 }
98
99 ATH_MSG_INFO("Working on tower container with dEta=" << dummy->deltaEta() << ", dPhi="
100 << dummy->deltaPhi() << ", nTowers=" << nTowers);
101
102 cellToTower.clear();
103 cellToTower.resize(theManager->element_size()); //fixme, get calo-hash-max
104
105 //FCAL cells are not pointing. We slice them in smaller chunks to see in which tower they go
106 const std::array<double,3> ndxFCal={{4.,4.,6.}};
107 const std::array<double,3> ndyFCal={{4.,6.,6.}};
108
110 ddeIt!=theManager->element_end();++ddeIt) {
111
112 const CaloDetDescrElement* dde=*ddeIt;
113
114 if (dde->is_lar_fcal()) {
115 //special handling of FCAL cells. Inspired by LArRecUtils/src/LArFCalTowerStore.cxx
116 double xCell = dde->x();
117 double yCell = dde->y();
118 double zCell = dde->z();
119 double dxCell = dde->dx();
120 double dyCell = dde->dy();
121
122 // get cell logical location
123 int thisModule = dde->getLayer()-1; //modules are counted 1..n, convert to 0..n-1
124 double theXBin = dxCell / ndxFCal[thisModule];
125 double theYBin = dyCell / ndyFCal[thisModule];
126 double theWeight = 1. / (ndxFCal[thisModule] * ndyFCal[thisModule]);
127
128 // loop the cell fragments
129 for (int iX=0;iX<ndxFCal[thisModule];++iX) {
130 double x=xCell-dxCell/2.0 + iX*theXBin;
131 for (int iY=0;iY<ndyFCal[thisModule];++iY) {
132 double y=yCell-dyCell/2.0 + iY*theYBin;
133
134 // eta,phi of fragment
135 double r = sqrt( x * x + y * y + zCell * zCell );
136 double eta = -0.5 * log((r-zCell)/(r+zCell));
137 double phi = CaloPhiRange::fix(atan2(y,x));
138 //int towerIdx=xAOD::CaloTowerGrid::index(dummy.get(),eta,phi);
139 int towerIdx=dummy->index(eta,phi);
140 if (towerIdx>=nTowers || towerIdx<0) {
141 ATH_MSG_ERROR("Found invalid tower index for FCAL cell eta/phi " << eta << "/" << phi << ", x/y=" << x << "/" << y);
142 return StatusCode::FAILURE;
143 }
144 //m_cellToTower[dde->calo_hash()].push_back(cellToTower_t(towerIdx,theWeight));
145 cellToTower[dde->calo_hash()].emplace_back(towerIdx,theWeight);
146 ATH_MSG_VERBOSE("cell hash " << dde->calo_hash() << ", goes into tower " << towerIdx << " with weight " << theWeight);
147 } //end y loop
148 } //end x loop
149 }//end FCAL
150
151 else { //Non-FCAL subcalos:
152
153 const double cellDeta = dde->deta();
154 const double cellDphi = dde->dphi();
155 const double etaRaw = dde->eta_raw();
156 const double phiRaw = CaloPhiRange::fix(dde->phi_raw());
157 //The following lines ar copied from the old CaloTowerStore.cxx
158 // calculate cell/tower size ratio (integer,[1..n])
159 size_t ke = (size_t) (cellDeta/dummy->deltaEta()+0.5);
160 ke = (ke==0) ? 1 : ke;
161 size_t kp = (size_t) (cellDphi/dummy->deltaPhi()+0.5);
162 kp = (kp==0) ? 1 : kp;
163 // signal weight
164 if ( ke>1 || kp>1 ) {
165 ATH_MSG_VERBOSE( "Found cell [0x" << std::hex << dde->identify().get_compact() << std::dec
166 << "] spanning several towers. nEta=" << ke << "nPhi="<<kp );
167 }
168
169
170 double theWeight = 1. / ( (double) ke * kp );
171 // fractional cell sizes
172 double cellDdeta = cellDeta / (double) ke;
173 double cellDdphi = cellDphi / (double) kp;
174 double etaMin = etaRaw - cellDeta / 2.;
175 double phiMin = phiRaw - cellDphi / 2.;
176
177 //Loop over cell fragments:
178
179 for ( size_t ie=1; ie<=ke; ie++ ){ // outer (eta) fragment loop
180 double cellEta = etaMin + ((double)ie - 0.5) * cellDdeta; // eta of fragment
181 for ( size_t ip=1; ip<=kp; ip++ ){ // inner (phi) fragement loop
182 double cellPhi = phiMin + ((double)ip - 0.5) * cellDdphi; // phi of fragment
183 int towerIdx=dummy->index(cellEta,cellPhi);
184 if (towerIdx>=nTowers || towerIdx<0) {
185 ATH_MSG_ERROR("Found invalid tower index " << towerIdx << " for cell eta/phi " << cellEta << "/" << cellPhi << " coming from " << dde->calo_hash() << "/" << ie << "/" << ip);
186 return StatusCode::FAILURE;
187 }
188 cellToTower[dde->calo_hash()].push_back(cellToTower_t(towerIdx,theWeight));
189 ATH_MSG_VERBOSE("cell hash " << dde->calo_hash() << ", goes into tower " << towerIdx << "with weight" << theWeight);
190 }//end loop over fragments (phi)
191 }// end loop over fragments (eta)
192 }//end else FCAL
193 }//end loop over detDescrElements
194
195
196 if (m_doxCheck) {
197 const CaloCell_ID* caloCellId;
198 ATH_CHECK(detStore()->retrieve(caloCellId));
199 for (size_t i=0;i<cellToTower.size(); ++i) {
200 const auto& towerinfo=cellToTower[i];
201 if (!towerinfo.empty()) {
202 ATH_MSG_DEBUG("Cell with index " << i << " contributes to " << towerinfo.size() << " Towers.");
203 }
204 else {
205 const Identifier id=caloCellId->cell_id(i);
206 ATH_MSG_ERROR("Cell with index " << i << ", id=0x"
207 << std::hex << id.get_identifier32().get_compact() << std::dec
208 << "does not contribute to any tower!");
209 }
210 double sumWeight=0;
211 for (const cellToTower_t& ct : towerinfo) sumWeight+=ct.m_weight;
212 if (fabs(sumWeight-1)>0.001) {
213 const Identifier id=caloCellId->cell_id(i);
214 ATH_MSG_ERROR( "Cell with index " << i << ", id=0x"
215 << std::hex << id.get_identifier32().get_compact() << std::dec
216 << ": Weights don't add up to 1.0, got " << sumWeight );
217 }
218 }//end loop over cells
219 }//end if doxCheck
220
221 ATH_MSG_DEBUG("Built CelltoTower index table. nCells=" << cellToTower.size() << ", nTowers=" << nTowers);
222
223 return StatusCode::SUCCESS;
224}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
#define y
#define x
const ServiceHandle< StoreGateSvc > & detStore() const
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
virtual int getLayer() const
cell layer
Identifier identify() const override final
cell identifier
bool is_lar_fcal() const
cell belongs to FCAL
calo_element_const_iterator element_begin() const
first element
CaloConstIteratorAdaptor< calo_element_vec::const_iterator > calo_element_const_iterator
calo_element_const_iterator element_end() const
end of element vector
calo_element_vec_size element_size() const
total number of elements
static double fix(double phi)
float m_maxEta
Tower-grid: upper eta boundary.
int m_nEtaBins
Tower-grid: number of phi bins.
bool m_doxCheck
Turn on internal checks (debugging)
int m_nPhiBins
Tower-grid: number of phi bins.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
float m_minEta
Tower-grid: lower eta boundary.
value_type get_compact() const
Get the compact id.
int r
Definition globals.cxx:22
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode CaloTowerxAODFromCells::finalize ( )
overridevirtual

Finalize algorithm.

Definition at line 98 of file CaloTowerxAODFromCells.cxx.

99{ return StatusCode::SUCCESS; }

◆ getIndexCache()

const CaloTowerxAODAlgoBase::CellToTowerVec & CaloTowerxAODAlgoBase::getIndexCache ( const EventContext & ctx) const
protectedinherited

Definition at line 63 of file CaloTowerxAODAlgoBase.cxx.

64{
65 if(!m_cellToTower.isValid()) {
66 CellToTowerVec cellToTower;
67 if(fillIndexCache(ctx,cellToTower).isFailure()) cellToTower.clear();
68 m_cellToTower.set(std::move(cellToTower));
69 }
70 return *m_cellToTower.ptr();
71}
CxxUtils::CachedValue< CellToTowerVec > m_cellToTower
map of cell indices to tower indices and weights
StatusCode fillIndexCache(const EventContext &ctx, CellToTowerVec &cellToTower) const

◆ initBase()

StatusCode CaloTowerxAODAlgoBase::initBase ( )
protectedinherited

<

Initialization of this base-class

Create xAOD::CaloTowerContainer and auxiliary store

Definition at line 30 of file CaloTowerxAODAlgoBase.cxx.

30 {
31 ATH_CHECK( m_caloTowerContainerKey.initialize() );
32 ATH_CHECK( m_caloMgrKey.initialize() );
33 return StatusCode::SUCCESS;
34}
SG::WriteHandleKey< xAOD::CaloTowerContainer > m_caloTowerContainerKey
Handle to xAOD::CaloTowerContainer.

◆ initialize()

StatusCode CaloTowerxAODFromCells::initialize ( )
overridevirtual

Initialize algorithm.

Definition at line 31 of file CaloTowerxAODFromCells.cxx.

31 {
32
33 m_filterCells=(m_cellThresholdE!=std::numeric_limits<float>::min());
35
36 // process modes
37 if ( m_filterCells ) {
38 ATH_MSG_INFO("[Configuration::Status] FilterCell mode configured with Ecell > " << m_cellThresholdE << " MeV");
39 } else {
40 ATH_MSG_INFO("[Configuration::Status] Using all cells");
41 }
42
43 return initBase();
44}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

◆ makeContainer()

SG::WriteHandle< xAOD::CaloTowerContainer > CaloTowerxAODAlgoBase::makeContainer ( const EventContext & ctx) const
protectedinherited

Intialize m_cellToTower cache.

Definition at line 38 of file CaloTowerxAODAlgoBase.cxx.

39{
40 SG::WriteHandle<xAOD::CaloTowerContainer> caloTowerContainer
42
43 if( caloTowerContainer.record (std::make_unique<xAOD::CaloTowerContainer>(),
44 std::make_unique<xAOD::CaloTowerAuxContainer>()).isSuccess())
45 {
46 // configure the container
47 caloTowerContainer->configureGrid(m_nEtaBins,m_minEta,m_maxEta,m_nPhiBins);
48
49 //Prefill the container:
50 const int nTowers=caloTowerContainer->nTowers();
51
52 for (int iTower=0;iTower<nTowers;++iTower) {
54 caloTowerContainer->push_back(tower);
55 tower->setEnergy(0.0);
56 }
57 }
58
59 return caloTowerContainer;
60}
void setEnergy(double energy)
Sets the energy.

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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.

◆ 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< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> CaloTowerxAODAlgoBase::m_caloMgrKey
protectedinherited
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 49 of file CaloTowerxAODAlgoBase.h.

49 { this
50 , "CaloDetDescrManager"
51 , "CaloDetDescrManager"
52 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_caloTowerContainerKey

SG::WriteHandleKey<xAOD::CaloTowerContainer> CaloTowerxAODAlgoBase::m_caloTowerContainerKey
protectedinherited

Handle to xAOD::CaloTowerContainer.

Definition at line 41 of file CaloTowerxAODAlgoBase.h.

◆ m_cellThresholdE

double CaloTowerxAODFromCells::m_cellThresholdE
private

Cell energy threshold (only for FilteredCell mode)

Definition at line 45 of file CaloTowerxAODFromCells.h.

◆ m_cellToTower

CxxUtils::CachedValue<CellToTowerVec> CaloTowerxAODAlgoBase::m_cellToTower
privateinherited

map of cell indices to tower indices and weights

Definition at line 77 of file CaloTowerxAODAlgoBase.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doxCheck

bool CaloTowerxAODAlgoBase::m_doxCheck
protectedinherited

Turn on internal checks (debugging)

Definition at line 46 of file CaloTowerxAODAlgoBase.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_filterCells

bool CaloTowerxAODFromCells::m_filterCells
private

Definition at line 48 of file CaloTowerxAODFromCells.h.

◆ m_inputCellContainerKey

SG::ReadHandleKey<CaloCellContainer> CaloTowerxAODFromCells::m_inputCellContainerKey
private

Definition at line 44 of file CaloTowerxAODFromCells.h.

◆ m_maxEta

float CaloTowerxAODAlgoBase::m_maxEta
protectedinherited

Tower-grid: upper eta boundary.

Definition at line 43 of file CaloTowerxAODAlgoBase.h.

◆ m_minEta

float CaloTowerxAODAlgoBase::m_minEta
protectedinherited

Tower-grid: lower eta boundary.

Definition at line 42 of file CaloTowerxAODAlgoBase.h.

◆ m_nEtaBins

int CaloTowerxAODAlgoBase::m_nEtaBins
protectedinherited

Tower-grid: number of phi bins.

Definition at line 44 of file CaloTowerxAODAlgoBase.h.

◆ m_nPhiBins

int CaloTowerxAODAlgoBase::m_nPhiBins
protectedinherited

Tower-grid: number of phi bins.

Definition at line 45 of file CaloTowerxAODAlgoBase.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: