|
ATLAS Offline Software
|
#include <CaloTowerxAODAlgoBase.h>
|
| CaloTowerxAODAlgoBase (const std::string &name, ISvcLocator *pSvcLocator) |
| Default algorithm constructor. More...
|
|
| ~CaloTowerxAODAlgoBase () |
| destructor More...
|
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
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 . 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 | 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 |
|
Definition at line 23 of file CaloTowerxAODAlgoBase.h.
◆ CellToTowerVec
◆ StoreGateSvc_t
◆ CaloTowerxAODAlgoBase()
CaloTowerxAODAlgoBase::CaloTowerxAODAlgoBase |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Default algorithm constructor.
- Parameters
-
name | reference to non-modifiable name of algorithm instance |
pSvcLocator | pointer to generic service locator |
Definition at line 15 of file CaloTowerxAODAlgoBase.cxx.
◆ ~CaloTowerxAODAlgoBase()
CaloTowerxAODAlgoBase::~CaloTowerxAODAlgoBase |
( |
| ) |
|
|
default |
◆ cardinality()
unsigned int AthReentrantAlgorithm::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.
Override this to return 0 for reentrant algorithms.
Definition at line 55 of file AthReentrantAlgorithm.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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 & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ fillIndexCache()
StatusCode CaloTowerxAODAlgoBase::fillIndexCache |
( |
const EventContext & |
ctx, |
|
|
CellToTowerVec & |
cellToTower |
|
) |
| const |
|
private |
Definition at line 73 of file CaloTowerxAODAlgoBase.cxx.
80 return StatusCode::FAILURE;
92 const int nTowers=
dummy->nTowers();
95 ATH_MSG_ERROR(
"Something went wrong with tower grid config: Got container with " << nTowers <<
" Towers." );
96 return StatusCode::FAILURE;
99 ATH_MSG_INFO(
"Working on tower container with dEta=" <<
dummy->deltaEta() <<
", dPhi="
100 <<
dummy->deltaPhi() <<
", nTowers=" << nTowers);
106 const std::array<double,3> ndxFCal={{4.,4.,6.}};
107 const std::array<double,3> ndyFCal={{4.,6.,6.}};
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();
124 double theXBin = dxCell / ndxFCal[thisModule];
125 double theYBin = dyCell / ndyFCal[thisModule];
126 double theWeight = 1. / (ndxFCal[thisModule] * ndyFCal[thisModule]);
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;
135 double r = sqrt(
x *
x +
y *
y + zCell * zCell );
136 double eta = -0.5 *
log((
r-zCell)/(
r+zCell));
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;
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);
153 const double cellDeta = dde->
deta();
154 const double cellDphi = dde->
dphi();
155 const double etaRaw = dde->
eta_raw();
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;
164 if ( ke>1 || kp>1 ) {
166 <<
"] spanning several towers. nEta=" << ke <<
"nPhi="<<kp );
170 double theWeight = 1. / ( (
double) ke * kp );
172 double cellDdeta = cellDeta / (
double) ke;
173 double cellDdphi = cellDphi / (
double) kp;
174 double etaMin = etaRaw - cellDeta / 2.;
175 double phiMin = phiRaw - cellDphi / 2.;
179 for (
size_t ie=1;
ie<=ke;
ie++ ){
181 for (
size_t ip=1;
ip<=kp;
ip++ ){
182 double cellPhi = phiMin + ((
double)
ip - 0.5) * cellDdphi;
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;
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);
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.");
207 << std::hex <<
id.get_identifier32().get_compact() << std::dec
208 <<
"does not contribute to any tower!");
211 for (
const cellToTower_t&
ct : towerinfo) sumWeight+=
ct.m_weight;
212 if (fabs(sumWeight-1)>0.001) {
215 << std::hex <<
id.get_identifier32().get_compact() << std::dec
216 <<
": Weights don't add up to 1.0, got " << sumWeight );
221 ATH_MSG_DEBUG(
"Built CelltoTower index table. nCells=" << cellToTower.size() <<
", nTowers=" << nTowers);
223 return StatusCode::SUCCESS;
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ getIndexCache()
◆ initBase()
StatusCode CaloTowerxAODAlgoBase::initBase |
( |
| ) |
|
|
protected |
◆ inputHandles()
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()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, InDet::SiSPGNNTrackMaker, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ makeContainer()
Intialize m_cellToTower cache.
Definition at line 38 of file CaloTowerxAODAlgoBase.cxx.
43 if( caloTowerContainer.record (std::make_unique<xAOD::CaloTowerContainer>(),
44 std::make_unique<xAOD::CaloTowerAuxContainer>()).isSuccess())
50 const int nTowers=caloTowerContainer->nTowers();
52 for (
int iTower=0;iTower<nTowers;++iTower) {
54 caloTowerContainer->push_back(tower);
59 return caloTowerContainer;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ setFilterPassed()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ sysExecute()
StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::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 InputMakerBase, and HypoBase.
Definition at line 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_caloMgrKey
Initial value:{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }
Definition at line 49 of file CaloTowerxAODAlgoBase.h.
◆ m_caloTowerContainerKey
◆ m_cellToTower
◆ m_detStore
◆ m_doxCheck
bool CaloTowerxAODAlgoBase::m_doxCheck |
|
protected |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
◆ m_maxEta
float CaloTowerxAODAlgoBase::m_maxEta |
|
protected |
◆ m_minEta
float CaloTowerxAODAlgoBase::m_minEta |
|
protected |
◆ m_nEtaBins
int CaloTowerxAODAlgoBase::m_nEtaBins |
|
protected |
◆ m_nPhiBins
int CaloTowerxAODAlgoBase::m_nPhiBins |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
float deta() const
cell deta
def retrieve(aClass, aKey=None)
const T * ptr() const
Return a pointer to the cached value.
Basic container storing all information need for xAOD::CaloTower_v1 objects.
Scalar phi() const
phi method
calo_element_const_iterator element_end() const
end of element vector
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool isValid() const
Test to see if the value is valid.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
bool m_doxCheck
Turn on internal checks (debugging)
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)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
value_type get_compact() const
Get the compact id.
#define ATH_MSG_VERBOSE(x)
float eta_raw() const
cell eta_raw
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
Identifier identify() const override final
cell identifier
StatusCode fillIndexCache(const EventContext &ctx, CellToTowerVec &cellToTower) const
IdentifierHash calo_hash() const
cell calo hash
AthReentrantAlgorithm()
Default constructor:
std::vector< std::vector< cellToTower_t > > CellToTowerVec
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
float m_maxEta
Tower-grid: upper eta boundary.
float m_minEta
Tower-grid: lower eta boundary.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Helper class for offline cell identifiers.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
int m_nEtaBins
Tower-grid: number of phi bins.
bool is_lar_fcal() const
cell belongs to FCAL
static double fix(double phi)
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void setEnergy(double energy)
Sets the energy.
virtual StatusCode sysInitialize() override
Override sysInitialize.
CxxUtils::CachedValue< CellToTowerVec > m_cellToTower
map of cell indices to tower indices and weights
StatusCode initialize(bool used=true)
SG::WriteHandleKey< xAOD::CaloTowerContainer > m_caloTowerContainerKey
Handle to xAOD::CaloTowerContainer.
void set(const T &val) const
Set the value, assuming it is currently invalid.
calo_element_const_iterator element_begin() const
first element
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,...
float dphi() const
cell dphi
virtual int getLayer() const
cell layer
This class provides the client interface for accessing the detector description information common to...
#define ATH_MSG_WARNING(x)
calo_element_vec_size element_size() const
total number of elements
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
int m_nPhiBins
Tower-grid: number of phi bins.
Tranform iterator over pointers to iterator over const pointers.
float phi_raw() const
cell phi_raw