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

#include <CaloTowerxAODFromClusters.h>

Inheritance diagram for CaloTowerxAODFromClusters:
Collaboration diagram for CaloTowerxAODFromClusters:

Public Member Functions

 CaloTowerxAODFromClusters (const std::string &name, ISvcLocator *pSvcLocator)
 Default algorithm constructor.
virtual ~CaloTowerxAODFromClusters ()
 Baseclass destructor.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
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
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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 &) 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::CaloTowerContainer > makeContainer (const EventContext &ctx) const
 Intialize m_cellToTower cache.
const CellToTowerVec & getIndexCache (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< CaloDetDescrManager > m_caloMgrKey
Algorithm properties
SG::WriteHandleKey< xAOD::CaloTowerContainer > m_caloTowerContainerKey {this, "CaloTowerContainer", "CmbTowers", "Output xAOD::CaloTowerContainer"}
 Handle to xAOD::CaloTowerContainer.
Gaudi::Property< float > m_minEta {this, "minEta", -5, "Tower-grid: lower eta boundary"}
 Tower-grid: lower eta boundary.
Gaudi::Property< float > m_maxEta {this, "maxEta", 5, "Tower-grid: upper eta boundary"}
 Tower-grid: upper eta boundary.
Gaudi::Property< int > m_nEtaBins {this, "nEta", 100, "Tower-grid: number of phi bins"}
 Tower-grid: number of phi bins.
Gaudi::Property< int > m_nPhiBins {this, "nPhi", 64, "Tower-grid: number of phi bins"}
 Tower-grid: number of phi bins.
Gaudi::Property< bool > m_doxCheck {this, "doCrossChecks", false, "Turn on internal checks (debugging)"}
 Turn on internal checks (debugging).

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_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

CxxUtils::CachedValue< CellToTowerVec > m_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< xAOD::CaloClusterContainer > m_inputClusterContainerKey {this, "InputClusterContainer", "CaloCalTopoClusters"}

Detailed Description

Definition at line 14 of file CaloTowerxAODFromClusters.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 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CaloTowerxAODFromClusters()

CaloTowerxAODFromClusters::CaloTowerxAODFromClusters ( 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 CaloTowerxAODFromClusters.cxx.

19 : CaloTowerxAODAlgoBase(name,pSvcLocator)
20{
21}
CaloTowerxAODAlgoBase(const std::string &name, ISvcLocator *pSvcLocator)
Default algorithm constructor.

◆ ~CaloTowerxAODFromClusters()

CaloTowerxAODFromClusters::~CaloTowerxAODFromClusters ( )
virtualdefault

Baseclass destructor.

Member Function Documentation

◆ 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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ 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 CaloTowerxAODFromClusters::execute ( const EventContext & ctx) const
overridevirtual

Execute algorithm.

Definition at line 32 of file CaloTowerxAODFromClusters.cxx.

33{
34 const CellToTowerVec& cellToTower = getIndexCache(ctx);
35 if(cellToTower.empty()) {
36 ATH_MSG_ERROR( "Failed to compute the index cache");
37 return StatusCode::FAILURE;
38 }
39
40 SG::ReadHandle<xAOD::CaloClusterContainer> inputClusterContainer(m_inputClusterContainerKey, ctx);
41
42 SG::WriteHandle<xAOD::CaloTowerContainer> caloTowerContainer =
43 this->makeContainer(ctx);
44 if (!caloTowerContainer.isValid())
45 return StatusCode::FAILURE;
46
47 auto addedCellsMap = std::make_unique<std::bitset< CALOTOWER_MAX_CELL_COUNT> >();
48
49 for (const xAOD::CaloCluster* it_cluster : *inputClusterContainer) {
50 const CaloClusterCellLink* cellLinks=it_cluster->getCellLinks();
51 if (!cellLinks) {
52 ATH_MSG_ERROR("Cluster without cell links found in collection: " << inputClusterContainer.name());
53 return StatusCode::FAILURE;
54 }
55
56 for (const CaloCell* cell : *cellLinks) {
57 //Ask cell for it's hash
58 const IdentifierHash cellHash = cell->caloDDE()->calo_hash();
59 //Check it this cell is already part of reducedCellContainer
60 if (!addedCellsMap->test(cellHash)) {
61 addedCellsMap->set(cellHash);
62 assert(cellHash<cellToTower.size());
63 const auto& c2ts=cellToTower[cellHash];
64 //Remember: A cell can contribute to more than one tower!
65 for (const cellToTower_t& c2t : c2ts) {
66 (*caloTowerContainer)[c2t.m_towerIdx]->addEnergy(cell->e()*c2t.m_weight);
67 }//end loop over towers coverd by this cell
68 }//end cell has not been added yet
69 }//end loop over cells in this cluster
70 }//end loop over clusters
71 return StatusCode::SUCCESS;
72}
#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.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inputClusterContainerKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ 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 & AthCommonAlgorithm< 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 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ fillIndexCache()

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

Definition at line 66 of file CaloTowerxAODAlgoBase.cxx.

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

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode CaloTowerxAODFromClusters::finalize ( )
overridevirtual

Finalize algorithm.

Definition at line 74 of file CaloTowerxAODFromClusters.cxx.

75{ return StatusCode::SUCCESS; }

◆ getIndexCache()

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

Definition at line 56 of file CaloTowerxAODAlgoBase.cxx.

57{
58 if(!m_cellToTower.isValid()) {
59 CellToTowerVec cellToTower;
60 if(fillIndexCache(ctx,cellToTower).isFailure()) cellToTower.clear();
61 m_cellToTower.set(std::move(cellToTower));
62 }
63 return *m_cellToTower.ptr();
64}
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 23 of file CaloTowerxAODAlgoBase.cxx.

23 {
24 ATH_CHECK( m_caloTowerContainerKey.initialize() );
25 ATH_CHECK( m_caloMgrKey.initialize() );
26 return StatusCode::SUCCESS;
27}
SG::WriteHandleKey< xAOD::CaloTowerContainer > m_caloTowerContainerKey
Handle to xAOD::CaloTowerContainer.

◆ initialize()

StatusCode CaloTowerxAODFromClusters::initialize ( )
overridevirtual

Initialize algorithm.

Definition at line 26 of file CaloTowerxAODFromClusters.cxx.

26 {
29 return StatusCode::SUCCESS;
30}

◆ 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()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ makeContainer()

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

Intialize m_cellToTower cache.

Definition at line 31 of file CaloTowerxAODAlgoBase.cxx.

32{
33 SG::WriteHandle<xAOD::CaloTowerContainer> caloTowerContainer
35
36 if( caloTowerContainer.record (std::make_unique<xAOD::CaloTowerContainer>(),
37 std::make_unique<xAOD::CaloTowerAuxContainer>()).isSuccess())
38 {
39 // configure the container
40 caloTowerContainer->configureGrid(m_nEtaBins,m_minEta,m_maxEta,m_nPhiBins);
41
42 //Prefill the container:
43 const int nTowers=caloTowerContainer->nTowers();
44
45 for (int iTower=0;iTower<nTowers;++iTower) {
47 caloTowerContainer->push_back(tower);
48 tower->setEnergy(0.0);
49 }
50 }
51
52 return caloTowerContainer;
53}
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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

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

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< 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.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< 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 AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

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 {this, "CaloTowerContainer", "CmbTowers", "Output xAOD::CaloTowerContainer"}
protectedinherited

Handle to xAOD::CaloTowerContainer.

Definition at line 41 of file CaloTowerxAODAlgoBase.h.

41{this, "CaloTowerContainer", "CmbTowers", "Output xAOD::CaloTowerContainer"};

◆ 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 381 of file AthCommonDataStore.h.

◆ m_doxCheck

Gaudi::Property<bool> CaloTowerxAODAlgoBase::m_doxCheck {this, "doCrossChecks", false, "Turn on internal checks (debugging)"}
protectedinherited

Turn on internal checks (debugging).

Definition at line 46 of file CaloTowerxAODAlgoBase.h.

46{this, "doCrossChecks", false, "Turn on internal checks (debugging)"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_inputClusterContainerKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> CaloTowerxAODFromClusters::m_inputClusterContainerKey {this, "InputClusterContainer", "CaloCalTopoClusters"}
private

Definition at line 39 of file CaloTowerxAODFromClusters.h.

39{this, "InputClusterContainer", "CaloCalTopoClusters"};

◆ m_maxEta

Gaudi::Property<float> CaloTowerxAODAlgoBase::m_maxEta {this, "maxEta", 5, "Tower-grid: upper eta boundary"}
protectedinherited

Tower-grid: upper eta boundary.

Definition at line 43 of file CaloTowerxAODAlgoBase.h.

43{this, "maxEta", 5, "Tower-grid: upper eta boundary"};

◆ m_minEta

Gaudi::Property<float> CaloTowerxAODAlgoBase::m_minEta {this, "minEta", -5, "Tower-grid: lower eta boundary"}
protectedinherited

Tower-grid: lower eta boundary.

Definition at line 42 of file CaloTowerxAODAlgoBase.h.

42{this, "minEta", -5, "Tower-grid: lower eta boundary"};

◆ m_nEtaBins

Gaudi::Property<int> CaloTowerxAODAlgoBase::m_nEtaBins {this, "nEta", 100, "Tower-grid: number of phi bins"}
protectedinherited

Tower-grid: number of phi bins.

Definition at line 44 of file CaloTowerxAODAlgoBase.h.

44{this, "nEta", 100, "Tower-grid: number of phi bins"};

◆ m_nPhiBins

Gaudi::Property<int> CaloTowerxAODAlgoBase::m_nPhiBins {this, "nPhi", 64, "Tower-grid: number of phi bins"}
protectedinherited

Tower-grid: number of phi bins.

Definition at line 45 of file CaloTowerxAODAlgoBase.h.

45{this, "nPhi", 64, "Tower-grid: number of phi bins"};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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