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

A cluster builder tool forming topo-clusters representing calorimeter tower signals on a regular grid in \( (\eta,\phi) \) space. More...

#include <CaloTopoTowerFromClusterMaker.h>

Inheritance diagram for CaloTopoTowerFromClusterMaker:
Collaboration diagram for CaloTopoTowerFromClusterMaker:

Public Member Functions

 CaloTopoTowerFromClusterMaker (const std::string &type, const std::string &name, const IInterface *pParent)
 Tool constructor.
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 sysInitialize () override
 Perform system initialization for an algorithm.
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 AthAlgTool and @c CaloClusterCellProcessor interface implementations
virtual StatusCode initialize () override
 Setting up the operational mode and corresponding parameters.
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *pClusCont, CaloCellClusterWeights *cellWeights) const override
 Execute the tool and fill the xAOD::CaloClusterContainer pointed to by pClusCont.
virtual StatusCode finalize () override
 Finalize the tool (no action).

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Standard Gaudi interface ID method.

Protected Member Functions

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.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t
Internally used types
typedef std::vector< CaloProtoCluster > protocont_t
 Container for CaloProtoCluster objects.
typedef std::size_t uint_t
 Unsigned integral type.

Private Member Functions

bool addCellToProtoCluster (const CaloTowerGeometry *towerGeo, const CaloCell *cptr, protocont_t &pProtoCont, double weight=1.) const
 Adding cells to proto-clusters.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>
Tower builders
uint_t buildInclTowers (const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
 Inclusive towers.
uint_t buildExclTowers (const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
 Exclusive towers.
uint_t buildEMTopoTowers (const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont) const
 EM topo-towers.
uint_t buildLCWTopoTowers (const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont, CaloCellClusterWeights *cellWeights) const
 LCW topo-towers.

Private Attributes

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
Tool properties
SG::ReadCondHandleKey< CaloTowerGeometry > m_towerGeoKey {this,"TowerGeometry","CaloTowerGeometry"}
 the name of the key of the CaloTowerGeometry object in the ConditonsStore
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerKey {this, "CaloTopoClusterContainerKey", "CaloTopoClusters", "SG Key for CaloClusterContainer (input)"}
 Topo-cluster container key.
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey {this, "CaloCellContainerKey", "AllCalo", "SG Key for CaloCellContainer (input)"}
 Calorimeter cell container.
Gaudi::Property< bool > m_orderByPt {this, "OrderClusterByPt", false, "Turn on/off pT-ordering of CaloClusterContainer (output)"}
 Orders cluster container by \( p_{\text{T}} \), default true.
Gaudi::Property< bool > m_prepareLCW {this, "PrepareLCW", false, "Prepare data structure to apply LCW"}
 Prepare LCW calibration, default is false.
Gaudi::Property< bool > m_useCellsFromClusters {this, "BuildTopoTowers", true, "Turn on/off topo-tower formation"}
 Use cells from topo-clusters if true, else use all cells, default is true.
Gaudi::Property< bool > m_applyCellEnergyThreshold {this, "ApplyCellEnergyThreshold", false, "Turn on/off cell energy thresholds"}
 Apply cell energy threshold, default is false.
Gaudi::Property< bool > m_doCellIndexCheck {this, "DoCellIndexCheck", false, "Check cell hash indices for consistency"}
 Check cell hash index consistency if true (default false).
Gaudi::Property< bool > m_buildCombinedSignal {this, "BuildCombinedTopoSignal", false, "Build topo-clusters and topo-towers"}
 Build topo-clusters within given \( y \) range, else topo-towers.
Gaudi::Property< double > m_energyThreshold {this, "CellEnergyThreshold", m_energyThresholdDef-1., "Energy threshold for cells filled in clusters"}
 Cell energy threshold, default is set in m_energyThresholdDef.
Gaudi::Property< double > m_clusterRange {this, "TopoClusterRange", m_clusterRangeDef, "Rapidity range for using topo-clusters in combined signal mode"}
 Range where topo-clusters are used when m_buildCombinedSignal = true.
Gaudi::Property< bool > m_removeSamplingData {this, "RemoveSamplingData", true, "Remove the associated sampling data"}
 Remove sampling data for towers.
Excluded samplings
std::vector< CaloSampling::CaloSample > m_excludedSamplings
 List of excluded samplings (CaloSampling::CaloSample enumerators).
Gaudi::Property< std::vector< std::string > > m_excludedSamplingsName {this, "ExcludedSamplings", {}, "Excluded samplings by name"}
 List of excluded samplings (human-readable names).
std::bitset< _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE > m_excludedSamplingsPattern
 Bit pattern indicates if sampling is excluded.

Constants and parameters

uint_t m_numberOfSamplings {static_cast<uint_t>(CaloSampling::Unknown)}
 Number of samplings.
static const double m_energyThresholdDef = -100000000.
 Default energy threshold.
static const double m_clusterRangeDef = 5.
 Default cluster \( y \) range.
static const uint_t m_errorValueUINT = uint_t(-1)
 Error value for uint_t type values.

Internally used helpers

static xAOD::CaloCluster::ClusterSize getClusterSize (uint_t etaBins, uint_t phiBins)
 Returns a cluster size tag from number of eta and phi bins in tower grid.
static xAOD::CaloCluster::ClusterSize getClusterSize (uint_t towerBins)
 Returns a cluster size tag from number of towers (bins) in tower grid.
int cleanupCells (const CaloTowerGeometry *towerGeo, CaloClusterCellLink *clk, uint_t nclus) const
 Checks CaloClusterCellLink for consistency.

Helpers

static bool filterProtoCluster (const CaloClusterCellLink &clnk)
 Checks for and removes invalid cell links.
bool checkCellIndices (const CaloTowerGeometry *towerGeo, const CaloDetDescrManager *caloDDM, const CaloCellContainer *pCellCont) const
 Checks consistency between cell indices and hash identifiers.
bool isValidIndex (uint_t idx) const
 Checks if argument is a valid index value.
uint_t badIndexValue () const
 Returns value indicating a bad index.

Detailed Description

A cluster builder tool forming topo-clusters representing calorimeter tower signals on a regular grid in \( (\eta,\phi) \) space.

By default, EM-scale topo-towers are created from cells in topo-clusters.

This tool fills EM-scale towers and stores them as xAOD::CaloCluster. It supports several operational modes, which are controlled by tool properties. It fills a container of type xAOD::CaloClusterContainer. The properties controlling its specific behavior are:

Properties defining tool behavior
Property nameProperty typeDefault valueComment
OrderClusterByPtboolfalseif true, the xAOD::CaloClusterContainer is ordered by \( p_{\rm T}^{\rm clus} \). See further comments below.
PrepareLCWboolfalseif true, the tool fills a CaloCellClusterWeights object and records it into the event store to be used by CaloTopoClusterFromTowerCalibrator
UseCellsFromClustersbooltrueif true, only cells from topo-clusters are used to fill the towers (topo-towers); else, inclusive towers are filled with all cells.
Properties setting variables for operational modes
Property nameProperty typeDefault valueComment
CellEnergyThresholddoublem_energyThresholdDefcell energy threshold used in exclusive mode only. See further comments below.
CellContainerKeySG::ReadHandleKey<CaloCellContainer>"AllCalo"cell container key is needed to pick up CaloCellContainer for all operational modes.
ClusterContainerKeySG::ReadHandleKey<xAOD::CaloClusterContainer>"CaloTopoClusters"cluster container key is needed to pick up xAOD::CaloClusterContainer for filtered mode (UseCellsFromCluster = true)
CellClusterWeightKeySG::WriteHandleKey<CaloCellClusterWeights>−N/A−key for CaloCellClusterWeights object is needed if PrepareLCW = true. Default is empty key.
BuildCombinedTopoSignalboolfalseturns on combined topo-cluster/topo-tower output, with topo-clusters used within the rapidity range defined by TopoClusterRange and topo-towers elsewhere.

TopoClusterRange

double

5.

sets the range \( y_{\rm topo-cluster}^{\rm max} \) for using topo-clusters when BuildCombinedTopoSignal = true; topo-clusters with \( \left|y_{\rm topo-cluster}\right| < y_{\rm topo-cluster}^{\rm max} \) are used.

The towers can be classified as:

  1. inclusive cell towers All cells are collected into inclusive towers, independent of their signal. Requires properties UseCellsFromClusters = false and UseCellEnergyThreshold = false. Only EM towers are possible, as cells not collected into topo-clustersdo not have a calibration applied.
  2. exclusive cell towers Cells with \( E > E_{\rm min} \) are collected into exclusive towers. This behaviour is turned on by UseCellsFromClusters = false and UseCellEnergyThreshold = true. A meaningful CellEnergyThreshold value needs to be provided in addition.
  3. filtered mode Cells contributing to standard topo-clusters are collected into topo-towers. This behaviour is triggered by UseCellsFromClusters = true. Optionally, LCW calibration can be applied to these towers by setting PrepareLCW = true and scheduling a CaloTopoClusterFromTowerCalibrator tool after the cluster moment calculators. The values of the UseEnergyThreshold and CellEnergyThreshold properties are ignored in this mode. A valid event store key needs to be provided in the to pick up the topo-cluster container. Note that building EM topo-towers requires topo-clusters on EM scale (no LCW applied) to get the correct geometrical cell weights only. LCW topo-towers require LCW scale topo-clusters to get the correct full geometrical and calibration weights.
  4. mixed mode Cells contributing to standard topo-clusters are collected into towers if these topo-clusters are outside of a give rapidity range. The rapidity range is defined by the TopoClusterRange property. This mode is turned on by setting the property BuildCombinedTopoSignal = true. It is turned off by default (BuildCombinedTopoSignal = false). EM scale and LCW scale is possible, as in the filtered mode.

    Configuration 2 and 3 are exclusive, with 3 overwriting 2. The output topo-clusters represent calorimeter towers on the EM scale. The can be handed to cluster moment tools (needs EM scale) and, if desired, to a dedicated cluster calibration tool of type xAOD::CaloTowerClusterFromTowerCalibrator .

    To avoid multiple retrievals of the same weights by searching for cells in (many) topo-clusters, the overall weight of the cell signal is stored in a random access look-up table stored in a CaloCellClusterWeights object in the detector store. This object is created by this tool, if needed. If the tool property CellWeightLookupKey is set, this object will be generated, filled, and recorded. This is essential for calibrated topo-towers!

Definition at line 37 of file CaloTopoTowerFromClusterMaker.h.

Member Typedef Documentation

◆ protocont_t

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

◆ uint_t

typedef std::size_t CaloTopoTowerFromClusterMaker::uint_t
private

Unsigned integral type.

Definition at line 58 of file CaloTopoTowerFromClusterMaker.h.

Constructor & Destructor Documentation

◆ CaloTopoTowerFromClusterMaker()

CaloTopoTowerFromClusterMaker::CaloTopoTowerFromClusterMaker ( const std::string & type,
const std::string & name,
const IInterface * pParent )

Tool constructor.

Definition at line 50 of file CaloTopoTowerFromClusterMaker.cxx.

53 : AthAlgTool(type,name,pParent)
54{
55 declareInterface<CaloTowerCollectionProcessor>(this);
56}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ addCellToProtoCluster()

bool CaloTopoTowerFromClusterMaker::addCellToProtoCluster ( const CaloTowerGeometry * towerGeo,
const CaloCell * cptr,
protocont_t & pProtoCont,
double weight = 1. ) const
private

Adding cells to proto-clusters.

Returns
true if cell successfully added to one (or more) proto-clusters
Parameters
cptrpointer ton non-modifiable CaloCell object
pProtoContreference to proto-cluster container
weightadditional (global) weight of cell (e.g. for geometrical weight for combined EM-scale signals)

Definition at line 417 of file CaloTopoTowerFromClusterMaker.cxx.

420{
421 // invalid input
422 if ( cptr == nullptr ) { return false; }
423
424 // get towers for cell from geometry service
425 uint_t nctr(0);
426 for ( auto elm : towerGeo->getTowers(cptr->caloDDE()->calo_hash()) ) {
427 auto towerIdx(towerGeo->towerIndex(elm));
428 if ( !towerGeo->isInvalidIndex(towerIdx) ) {
429 if ( !m_excludedSamplingsPattern[(size_t)cptr->caloDDE()->getSampling()] ) {
430 uint_t cellIdx(pProtoCont.at(towerIdx).getCellLinks()->getCellContainer()->findIndex(cptr->caloDDE()->calo_hash()));
431 pProtoCont[towerIdx].addCell(cellIdx,towerGeo->cellWeight(elm)*weight); ++nctr;
432 }
433 }
434 }
435 return nctr > 0;
436}
std::bitset< _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE > m_excludedSamplingsPattern
Bit pattern indicates if sampling is excluded.
std::size_t uint_t
Unsigned integral type.
index_t towerIndex(IdentifierHash cellHash) const
Get global tower index for a calorimeter cell referenced by its hash identifier.
double cellWeight(const element_t &elm) const
Retrieve cell signal weight from lookup table entry.
bool isInvalidIndex(index_t idx) const
Returns true if argument is equal to the value provided by invalidIndex().
elementvector_t getTowers(IdentifierHash cellHash) const
Retrieve the list of towers associated with a calorimeter cell referenced its hash identifier.

◆ badIndexValue()

CaloTopoTowerFromClusterMaker::uint_t CaloTopoTowerFromClusterMaker::badIndexValue ( ) const
inlineprivate

Returns value indicating a bad index.

Definition at line 145 of file CaloTopoTowerFromClusterMaker.h.

145{ return m_errorValueUINT; }
static const uint_t m_errorValueUINT
Error value for uint_t type values.

◆ buildEMTopoTowers()

CaloTopoTowerFromClusterMaker::uint_t CaloTopoTowerFromClusterMaker::buildEMTopoTowers ( const CaloTowerGeometry * towerGeo,
const xAOD::CaloClusterContainer & clusCont,
protocont_t & protoCont ) const
private

EM topo-towers.

Definition at line 284 of file CaloTopoTowerFromClusterMaker.cxx.

285{
286 // presets
287 uint_t cCtr(0);
288 std::vector<bool> cellTags(towerGeo->totalNumberCells(),false);
289
290 // -- EM scale clusters
291 if ( !m_buildCombinedSignal ) {
292 // topo-towers
293 for ( const auto *pClus : pClusCont ) {
294 for ( auto fCell(pClus->cell_begin()); fCell != pClus->cell_end(); ++fCell ) {
295 uint_t cidx(static_cast<uint_t>((*fCell)->caloDDE()->calo_hash()));
296 if ( cidx < cellTags.size() ) {
297 if ( !cellTags.at(cidx) ) { cellTags[cidx] = this->addCellToProtoCluster(towerGeo,*fCell,pProtoCont); }
298 } else {
299 ATH_MSG_ERROR( CaloRec::Helpers::fmtMsg("Invalid cell hash index %6zu >= maximum index %6zu for cell in %s at (eta,phi) = (%6.3f,%6.3f)",
300 cidx,cellTags.size(),CaloSampling::getSamplingName((*fCell)->caloDDE()->getSampling()).c_str(),(*fCell)->eta(),(*fCell)->phi()) );
301 return m_errorValueUINT;
302 }
303 } // end cells-in-cluster loop
304 } // end cluster loop
305 } else {
306 // selected topo-towers for combined signal
307 std::vector<std::tuple<const CaloCell*,double> > cellList(towerGeo->totalNumberCells(),std::tuple<const CaloCell*,double>(nullptr,0.));
308 for ( const auto *pClus : pClusCont ) {
309 if ( std::abs(pClus->eta()) > m_clusterRange ) {
310 for ( auto fCell(pClus->cell_begin()); fCell != pClus->cell_end(); ++fCell ) {
311 uint_t cidx(static_cast<uint_t>((*fCell)->caloDDE()->calo_hash()));
312 if ( cellTags.at(cidx) ) {
313 std::get<1>(cellList[cidx]) += fCell.weight();
314 } else {
315 cellList[cidx] = std::tuple<const CaloCell*,double>(*fCell,fCell.weight());
316 cellTags[cidx] = true;
317 }
318 } // cell in cluster loop
319 } else {
320 ++cCtr;
321 } // cluster range check
322 } // cluster loop
323 // fill proto-cluster
324 for ( auto tpl : cellList ) { this->addCellToProtoCluster(towerGeo,std::get<0>(tpl),pProtoCont,std::get<1>(tpl)); }
325 } // end of fill mode
326
327 //
328 return cCtr+pProtoCont.size();
329}
#define ATH_MSG_ERROR(x,...)
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
Gaudi::Property< double > m_clusterRange
Range where topo-clusters are used when m_buildCombinedSignal = true.
bool addCellToProtoCluster(const CaloTowerGeometry *towerGeo, const CaloCell *cptr, protocont_t &pProtoCont, double weight=1.) const
Adding cells to proto-clusters.
Gaudi::Property< bool > m_buildCombinedSignal
Build topo-clusters within given range, else topo-towers.
uint_t totalNumberCells() const
Total number of cells.
std::string fmtMsg(const char *fmt,...)

◆ buildExclTowers()

CaloTopoTowerFromClusterMaker::uint_t CaloTopoTowerFromClusterMaker::buildExclTowers ( const CaloTowerGeometry * towerGeo,
const CaloCellContainer & pCellCont,
protocont_t & pProtoCont ) const
private

Exclusive towers.

Definition at line 399 of file CaloTopoTowerFromClusterMaker.cxx.

400{
401 // loop cell container
402 uint_t icl(0);
403 for ( const auto *cptr : pCellCont ) {
404 if ( cptr == nullptr ) {
405 ATH_MSG_ERROR( CaloRec::Helpers::fmtMsg("CaloCellContainer[%6zu] contains invalid cell object pointer %p",icl,(void*)cptr) );
406 return m_errorValueUINT;
407 } else {
408 // existing cell with energy above threshold
409 if ( cptr->e() > m_energyThreshold ) { this->addCellToProtoCluster(towerGeo,cptr,pProtoCont); }
410 } // end pointer check
411 ++icl;
412 } // end cell loop
413 //return StatusCode::SUCCESS;
414 return pProtoCont.size();
415}
Gaudi::Property< double > m_energyThreshold
Cell energy threshold, default is set in m_energyThresholdDef.

◆ buildInclTowers()

CaloTopoTowerFromClusterMaker::uint_t CaloTopoTowerFromClusterMaker::buildInclTowers ( const CaloTowerGeometry * towerGeo,
const CaloCellContainer & pCellCont,
protocont_t & pProtoCont ) const
private

Inclusive towers.

Returns
false in case of problems with data access or inconsistent data structures
Parameters
pCellContreference to non-modifiable CaloCellContainer@param pProtoCont reference to CaloProtoCluster container filled on output.
clusContreference to non-modifiable xAOD::CaloClusterContainer@param protoCont reference to modifiable proto-cluster container
Returns

Definition at line 381 of file CaloTopoTowerFromClusterMaker.cxx.

382{
383 // loop cell container - counter icl replaces cell hash index for NULL pointers in cell container
384 uint_t icl(0);
385 for ( const auto *cptr : pCellCont ) {
386 if ( cptr == nullptr ) {
387 ATH_MSG_ERROR( CaloRec::Helpers::fmtMsg("CaloCellContainer[%6zu] contains invalid cell object pointer %p",icl,(void*)cptr) );
388 return m_errorValueUINT;
389 } else {
390 // existing cell with non-zero energy (negative or positive)
391 if ( std::fabs(cptr->e()) > 0. ) { this->addCellToProtoCluster(towerGeo,cptr,pProtoCont); }
392 } // end pointer check
393 ++icl;
394 } // end cell loop
395 return pProtoCont.size();
396}

◆ buildLCWTopoTowers()

CaloTopoTowerFromClusterMaker::uint_t CaloTopoTowerFromClusterMaker::buildLCWTopoTowers ( const CaloTowerGeometry * towerGeo,
const xAOD::CaloClusterContainer & clusCont,
protocont_t & protoCont,
CaloCellClusterWeights * cellWeights ) const
private

LCW topo-towers.

Definition at line 332 of file CaloTopoTowerFromClusterMaker.cxx.

333{
334 // Need to keep track of LCW weights (up to two per cell) available from the topo-cluster(s) the cell is assigned to.
335 // Each cell in a topo-cluster is, at first occurance, added to the CaloProtoCluster(s) representing the tower(s) and its
336 // LCW calibration weight is stored in a lookup table indexed by the calorimeter hash id of the cell. The second
337 // time the same cell is found in another topo-cluster, only its LCW weight is added to the lookup table (stored in
338 // CaloCellClusterWeights for use in the downstream tower calibration tool) - the assignment to tower(s) has already
339 // happened.
340
341 uint_t cCtr(0);
342 // project cells on tower grid
343 if ( !m_buildCombinedSignal ) {
344 // loop original topo-cluster container
345 for ( const auto *pClus : pClusCont ) {
346 // loop over cells in the original topo-cluster
347 for ( auto fCell(pClus->cell_begin()); fCell != pClus->cell_end(); ++fCell ) {
348 // map to towers only once
349 if ( !cellWeights->check(*fCell) ) { this->addCellToProtoCluster(towerGeo,*fCell,pProtoCont); }
350 // store all associated LCW weights
351 cellWeights->set(*fCell,fCell.weight());
352 } // end cells-in-cluster loop
353 } // end cluster loop
354 } else {
355 // loop topo-cluster
356 for ( const auto *pClus : pClusCont ) {
357 // keep top-clusters in configured eta range
358 if ( std::abs(pClus->eta()) > m_clusterRange ) {
359 // loop over cells of topo-clusters for the forward towards
360 for ( auto fCell(pClus->cell_begin()); fCell != pClus->cell_end(); ++fCell ) {
361 // map to towers only once
362 if ( !cellWeights->check(*fCell) ) { this->addCellToProtoCluster(towerGeo,*fCell,pProtoCont); }
363 // store all associated LCW weights
364 cellWeights->set(*fCell,fCell.weight());
365 } // end cells-in-cluster loop
366 } else {
367 ++cCtr;
368 } // end range check
369 } // end cluster loop
370 } // end combined signal check
371
372 //
373 return cCtr+pProtoCont.size();
374}
bool check(size_t hash) const
Safe checking if cell is used by any cluster.
void set(size_t hash, double value)

◆ checkCellIndices()

bool CaloTopoTowerFromClusterMaker::checkCellIndices ( const CaloTowerGeometry * towerGeo,
const CaloDetDescrManager * caloDDM,
const CaloCellContainer * pCellCont ) const
private

Checks consistency between cell indices and hash identifiers.

Definition at line 501 of file CaloTopoTowerFromClusterMaker.cxx.

503{
505 // input and setup checks //
507
508 // check argument
509 if ( pCellCont == nullptr ) {
510 ATH_MSG_WARNING( CaloRec::Helpers::fmtMsg("Invalid pointer to CaloCellContainer (%p)",(void*)pCellCont) ); return false;
511 } else if ( pCellCont->empty() ) {
512 ATH_MSG_WARNING( CaloRec::Helpers::fmtMsg("CaloCellContainer at %p is empty (size %zu)",(void*)pCellCont,pCellCont->size()) ); return false;
513 }
514 // check the atomic state
516 // set the atomic flag
517 ATH_MSG_INFO( "Cell hash index check requested" );
519 // assign output file
520 std::string algname(this->name());
521 if ( algname.find_last_of('.') != std::string::npos ) { algname = algname.substr(algname.find_last_of('.')+1); }
522 std::string logname(CaloRec::Helpers::fmtMsg("%s.cellhash_index_check.dat",this->name().c_str()));
523 std::ofstream logstream; logstream.open(logname);
524 if ( !logstream.is_open() ) {
525 ATH_MSG_WARNING( CaloRec::Helpers::fmtMsg("Cannot open log file \042%s\042 - no hash index checking",logname.c_str()) );
526 return false;
527 }
528 logstream << "##########################################################################\n";
529 logstream << "### This file contains a list of CaloCell indices in CaloCellContainer ###\n";
530 logstream << "### for which this index is not the same as the calorimeter cell hash ###\n";
531 logstream << "### identifier. An empty list indicates full consistency between this ###\n";
532 logstream << "### index and the hash identifier for all cells. ###\n";
533 logstream << "##########################################################################\n";
534 logstream << "<begin list>--------------------------------------------------------------\n";
535
537 // loop cell container //
539
540 // prepare tag store
541 size_t ifc(0);
542 auto chkflg = std::make_unique<std::bitset<200000> >();
543 chkflg->reset();
544 for ( size_t i(0); i<pCellCont->size(); ++i ) {
545 if ( pCellCont->at(i) != nullptr ) {
546 size_t chash((size_t)pCellCont->at(i)->caloDDE()->calo_hash());
547 if ( chash != i ) {
548 std::string cni("UKNOWN");
549 double etai(0.); double phii(0.);
550 const CaloDetDescrElement* iel = i < caloDDMgr->element_size() ? caloDDMgr->get_element(i) : nullptr;
551 if ( iel != nullptr ) {
553 etai = iel->eta_raw();
554 phii = iel->phi_raw();
555 }
556 std::string cnc("UNKNOWN");
557 double etac(0.); double phic(0.);
558 const CaloDetDescrElement* cel = chash < caloDDMgr->element_size() ? caloDDMgr->get_element(chash) : nullptr;
559 if ( cel != nullptr ) {
561 etac = cel->eta_raw();
562 phic = cel->phi_raw();
563 }
564 size_t cidx(pCellCont->findIndex(chash));
565 logstream << CaloRec::Helpers::fmtMsg("[%06zu] Cell %6zu [%12.12s %5.3f %5.3f] non-matching id %6zu [%12.12s %5.3f %5.3f] findCell() index %6zu",
566 ++ifc,i,cni.c_str(),etai,phii,chash,cnc.c_str(),etac,phic,cidx) << '\n';
567 }
568 chkflg->set(chash);
569 }
570 }
571 logstream << "<end list>----------------------------------------------------------------\n";
572 logstream.close();
573
575 // check missed hashes //
577
578 // number of non-matched hashes
579 if ( ifc > 0 ) {
580 ATH_MSG_DEBUG( CaloRec::Helpers::fmtMsg("Found %zu non-matching cell hashes",ifc) );
581 }
582 // list of non-matched hashes
583 std::vector<size_t> chl; chl.reserve(towerGeo->totalNumberCells());
584 for ( size_t i(0); i<chl.size(); ++i ) { if ( !chkflg->test(i) ) { chl.push_back(i); } }
585 if ( !chl.empty() ) {
586 for ( auto h : chl ) { ATH_MSG_DEBUG( CaloRec::Helpers::fmtMsg("Cell hash %6zu not in CaloCellContainer",h) ); }
587 }
588
589 return true;
590}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
std::atomic< bool > CaloTopoTowerFromClusterMaker_checkCellIndices(false)
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
CaloCell_ID::CaloSample getSampling() const
cell sampling
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
static const std::string & getSamplingName(CaloSampling::CaloSample sid)
Lookup sampling name by identifier (function).

◆ cleanupCells()

int CaloTopoTowerFromClusterMaker::cleanupCells ( const CaloTowerGeometry * towerGeo,
CaloClusterCellLink * clk,
uint_t nclus ) const
private

Checks CaloClusterCellLink for consistency.

Definition at line 455 of file CaloTopoTowerFromClusterMaker.cxx.

456{
457 // Any pathology here probably indicates a configuration problem with the conditions (geometry)
458 // database (wrong tag for data?)
459
460 // check on null pointers in cell links
461 int nrc(0); int hid(0);
462 auto fcell(clk->begin());
463 while ( fcell != clk->end() ) {
464 const CaloCell* pCell = *fcell;
465 auto nc(clk->getCellContainer()->size());
466 const CaloCell* aCell = fcell.index() < nc ? clk->getCellContainer()->at(fcell.index()) : (const CaloCell*)nullptr;
467 if ( pCell == nullptr ) {
468 ATH_MSG_WARNING( CaloRec::Helpers::fmtMsg("CaloCellContainer[%6u/%6zu] - tower %5zu at (%6.3f,%6.3f) - cell pointer invalid (%p/%p) [removed %3i of %3zu cells]",
469 fcell.index(),nc-1,nclus,towerGeo->towerEta(nclus),towerGeo->towerPhi(nclus),
470 (void*)pCell,(void*)aCell,++nrc,clk->size()) );
471 fcell = clk->removeCell(fcell);
472 } else {
473 uint_t chash(static_cast<uint_t>(pCell->caloDDE()->calo_hash()));
474 uint_t csamp(static_cast<uint_t>(pCell->caloDDE()->getSampling()));
475 if (chash > towerGeo->maxCellHash() ) {
476 // check cell hash
477 ATH_MSG_WARNING( CaloRec::Helpers::fmtMsg("Tower %5zu at (%6.3f,%6.3f) linked cell %3i - cell hash index (%6zu/%6zu) invalid",
478 nclus,towerGeo->towerEta(nclus),towerGeo->towerPhi(nclus),hid,chash,towerGeo->maxCellHash()) );
479 fcell = clk->removeCell(fcell); ++nrc;
480 } else if ( csamp >= m_numberOfSamplings ) {
481 // check sampling id
482 ATH_MSG_WARNING( CaloRec::Helpers::fmtMsg("Tower %5zu at (%6.3f,%6.3f) linked cell %3i -cell sampling id (%3zu/%3zu) invalid",
483 nclus,towerGeo->towerEta(nclus),towerGeo->towerPhi(nclus),hid,csamp,m_numberOfSamplings) );
484 fcell = clk->removeCell(fcell); ++nrc;
485 } else if ( fcell.weight() <= 0.0000001 ) {
486 // remove cells with 0 weight
487 fcell = clk->removeCell(fcell); ++nrc;
488 } else {
489 // next cell
490 ++fcell;
491 }
492 } // end remove cell due to pointer invalid
493 ++hid;
494 } // end loop on cells in cell link object
495 return nrc;
496}
uint_t m_numberOfSamplings
Number of samplings.
double towerEta(index_t towerIndex) const
Return pseudorapidity from global tower index (bin center).
double towerPhi(index_t towerIndex) const
Return azimuth from global tower index (bin center).
uint_t maxCellHash() const
Maximum cell hash value.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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 CaloTopoTowerFromClusterMaker::execute ( const EventContext & ctx,
xAOD::CaloClusterContainer * pClusCont,
CaloCellClusterWeights * cellWeights ) const
overridevirtual

Execute the tool and fill the xAOD::CaloClusterContainer pointed to by pClusCont.

Implements CaloTowerCollectionProcessor.

Definition at line 163 of file CaloTopoTowerFromClusterMaker.cxx.

166{
168 // Check input //
170
171 // CaloCellContainer is needed to construct CaloProtoCluster
172 SG::ReadHandle<CaloCellContainer> pCellCont(m_cellContainerKey,ctx);
173 if ( !pCellCont.isValid() ) {
174 ATH_MSG_ERROR("Cannot allocate CaloCellContainer with key <" << m_cellContainerKey << ">");
175 return StatusCode::FAILURE;
176 }
177
178 SG::ReadCondHandle<CaloTowerGeometry> towerGeoHandle{m_towerGeoKey,ctx};
179 const CaloTowerGeometry* towerGeo=*towerGeoHandle;
180
181 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx};
182 const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
183
184
185 if ( msgLvl(MSG::DEBUG) && towerGeo->totalNumberCells() != pCellCont->size() ) {
186 ATH_MSG_DEBUG( CaloRec::Helpers::fmtMsg("[mismatch] number of cells in CaloCellContainer %6zu, total number of cell descriptors %6zu",
187 pCellCont->size(),towerGeo->totalNumberCells()) );
188 }
189
190 if ( m_doCellIndexCheck ) { this->checkCellIndices(towerGeo,caloDDMgr, pCellCont.cptr()); }
191
193 // Set up ProtoCluster //
195
196 // index of CaloProtoCluster in container relates to tower position! DO NOT sort, shuffle, or remove elements!
197 size_t numberOfTowers=towerGeo->towerBins();
198 protocont_t pProtoCont; pProtoCont.reserve(numberOfTowers);
199 for ( uint_t i(0); i<numberOfTowers; ++i ) { pProtoCont.push_back(CaloProtoCluster(pCellCont.cptr())); }
200
202 // Apply overall cell filter and fill protoclusters //
204
205 // The weights extracted for cells from clusters are LCW weights (typically). The total
206 // contribution of a LCW-weighted cell to towers is Ecell*Weight_LCW*Weight_tower.
207
208 // If EM clusters are used, the weights of a clustered cell are completely defined
209 // by the tower grid. As cells can shared between clusters, each cell can only be
210 // projected onto the towergrid once, with Ecell*Weight_tower
211
212 // The CaloCellClusterWeights object is used to store the combined LCW weight.
213 // for each clustered cell. In case of EM, the LCW weights are ignored and this
214 // object is not used - a simple vector<bool> tags cells already put into towers.
215
216 uint_t cCtr(0);
218 // retrieve topo-cluster container for topo-towers
219 SG::ReadHandle<xAOD::CaloClusterContainer> pTopoClusCont(m_clusterContainerKey,ctx);
220 if ( !pTopoClusCont.isValid() ) {
221 ATH_MSG_ERROR("Cannot allocate xAOD::CaloClusterContainer with key <" << m_clusterContainerKey << ">");
222 return StatusCode::FAILURE;
223 } // check on ReadHandle validity
224 cCtr = m_prepareLCW && cellWeights != nullptr ? this->buildLCWTopoTowers(towerGeo,*pTopoClusCont,pProtoCont,cellWeights) : this->buildEMTopoTowers(towerGeo,*pTopoClusCont,pProtoCont);
225 if ( !isValidIndex(cCtr) ) { ATH_MSG_WARNING("problems building EM or LCW topo-towers"); return StatusCode::SUCCESS; }
226 } else {
227 // fill inclusive/exclusive towers
228 cCtr = m_applyCellEnergyThreshold ? this->buildExclTowers(towerGeo,*pCellCont,pProtoCont) : this->buildInclTowers(towerGeo,*pCellCont,pProtoCont);
229 if ( !isValidIndex(cCtr) ) { ATH_MSG_WARNING("problems building EM inclusive or exclusive towers"); return StatusCode::SUCCESS; }
230 } // end topo-towers/inclusive-exclusive towers
231
232
233
234 // allocate sufficient space in vector
235 pClusCont->reserve(cCtr);
236 // pick up cluster size tag and set up counter
238 // loop proto-clusters
239 for ( uint_t ipc(0); ipc<pProtoCont.size(); ++ipc ) {
240 CaloProtoCluster& pProto = pProtoCont.at(ipc); // pick up proto-cluster
241 std::unique_ptr<CaloClusterCellLink> lptr(pProto.releaseCellLinks()); // take over CaloClusterCellLink object
242 this->cleanupCells(towerGeo,lptr.get(),ipc); // clean up cell links
243 if ( CaloTopoTowerFromClusterMaker::filterProtoCluster(*lptr.get()) ) { // ignore empty proto-clusters (no cells assigned)
244 xAOD::CaloCluster* clptr = pClusCont->push_back(new xAOD::CaloCluster()); // new empty cluster
245 clptr->addCellLink(std::move(lptr)); // transfer cell links to CaloCluster
246 clptr->setClusterSize(csize); // set the cluster size spec
247 CaloRec::Helpers::calculateKine(clptr,false); // calculate kinematics and other signals from cells
248 if ( m_removeSamplingData ) { // remove sampling data and invalidate tower center
249 clptr->clearSamplingData(); clptr->setEta0(0.); clptr->setPhi0(0.);
250 } else { // keep sampling data and valid tower center
251 clptr->setEta0(towerGeo->towerEta(ipc)); clptr->setPhi0(towerGeo->towerPhi(ipc));
252 }
253 }
254 } // proto-cluster loop
255
256 // clean up proto-cluster container
257 pProtoCont.clear();
258
260 // Sorting //
262
263 // All towers/clusters at this point are on EM scale. Sorting LCW towers by pT should be done in the
264 // CaloTopoClusterFromTowerCalibrator tool to assure desired ordering on the final scale.
265 // The link between tower location and index of tower representation (CaloCluster) in its
266 // container is definitively broken after sorting (was never ok in mixed cluster/tower mode).
267 if ( m_orderByPt ) {
268 std::sort(pClusCont->begin(),pClusCont->end(),[](xAOD::CaloCluster* pc1,xAOD::CaloCluster* pc2) {
269 volatile double pt1(pc1->pt()); // FIXME needed? (this was just copied)
270 volatile double pt2(pc2->pt()); // FIXME needed? (this was just copied)
271 return ( pt1 > pt2 );
272 }
273 );
274 } // end ordered by pT
275
276 return StatusCode::SUCCESS;
277} // end execute
bool msgLvl(const MSG::Level lvl) const
CaloClusterCellLink * releaseCellLinks()
Hand over ownership of CaloClusterCellLink to client.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
Calorimeter cell container.
bool checkCellIndices(const CaloTowerGeometry *towerGeo, const CaloDetDescrManager *caloDDM, const CaloCellContainer *pCellCont) const
Checks consistency between cell indices and hash identifiers.
Gaudi::Property< bool > m_useCellsFromClusters
Use cells from topo-clusters if true, else use all cells, default is true.
std::vector< CaloProtoCluster > protocont_t
Container for CaloProtoCluster objects.
static xAOD::CaloCluster::ClusterSize getClusterSize(uint_t etaBins, uint_t phiBins)
Returns a cluster size tag from number of eta and phi bins in tower grid.
uint_t buildInclTowers(const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
Inclusive towers.
bool isValidIndex(uint_t idx) const
Checks if argument is a valid index value.
uint_t buildExclTowers(const CaloTowerGeometry *towerGeo, const CaloCellContainer &pCellCont, protocont_t &pProtoCont) const
Exclusive towers.
uint_t buildLCWTopoTowers(const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont, CaloCellClusterWeights *cellWeights) const
LCW topo-towers.
Gaudi::Property< bool > m_applyCellEnergyThreshold
Apply cell energy threshold, default is false.
Gaudi::Property< bool > m_removeSamplingData
Remove sampling data for towers.
SG::ReadCondHandleKey< CaloTowerGeometry > m_towerGeoKey
the name of the key of the CaloTowerGeometry object in the ConditonsStore
Gaudi::Property< bool > m_doCellIndexCheck
Check cell hash index consistency if true (default false).
static bool filterProtoCluster(const CaloClusterCellLink &clnk)
Checks for and removes invalid cell links.
uint_t buildEMTopoTowers(const CaloTowerGeometry *towerGeo, const xAOD::CaloClusterContainer &clusCont, protocont_t &protoCont) const
EM topo-towers.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerKey
Topo-cluster container key.
Gaudi::Property< bool > m_orderByPt
Orders cluster container by , default true.
Gaudi::Property< bool > m_prepareLCW
Prepare LCW calibration, default is false.
int cleanupCells(const CaloTowerGeometry *towerGeo, CaloClusterCellLink *clk, uint_t nclus) const
Checks CaloClusterCellLink for consistency.
uint_t towerBins() const
Total number of towers.
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
void addCellLink(CaloClusterCellLink *CCCL)
void setClusterSize(const ClusterSize)
Get cluster size.
ClusterSize
Enumeration to identify different cluster sizes.
void setPhi0(flt_t)
Set raw of cluster seed.
void clearSamplingData()
Clear the sampling data.
bool calculateKine(xAOD::CaloCluster *pClus, bool onlyKine=false)
Kinematic updates.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ 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

◆ filterProtoCluster()

bool CaloTopoTowerFromClusterMaker::filterProtoCluster ( const CaloClusterCellLink & clnk)
staticprivate

Checks for and removes invalid cell links.

Definition at line 498 of file CaloTopoTowerFromClusterMaker.cxx.

499{ return clnk.size() > 0; }

◆ finalize()

StatusCode CaloTopoTowerFromClusterMaker::finalize ( )
overridevirtual

Finalize the tool (no action).

Definition at line 160 of file CaloTopoTowerFromClusterMaker.cxx.

161{ return StatusCode::SUCCESS; }

◆ getClusterSize() [1/2]

xAOD::CaloCluster::ClusterSize CaloTopoTowerFromClusterMaker::getClusterSize ( uint_t etaBins,
uint_t phiBins )
staticprivate

Returns a cluster size tag from number of eta and phi bins in tower grid.

Definition at line 442 of file CaloTopoTowerFromClusterMaker.cxx.

443{ return CaloTopoTowerFromClusterMaker::getClusterSize(etaBins*phiBins); }

◆ getClusterSize() [2/2]

xAOD::CaloCluster::ClusterSize CaloTopoTowerFromClusterMaker::getClusterSize ( uint_t towerBins)
staticprivate

Returns a cluster size tag from number of towers (bins) in tower grid.

Definition at line 445 of file CaloTopoTowerFromClusterMaker.cxx.

446{
447 // check for tower sizes
448 return nTowers == 6400 // known "standard" towers 0,1 x 0.1
450 : nTowers == 25600 // known "fine" towers 0.05 x 0.05
452 : xAOD::CaloCluster::Tower_fixed_area; // unspecified towers
453}

◆ initialize()

StatusCode CaloTopoTowerFromClusterMaker::initialize ( )
overridevirtual

Setting up the operational mode and corresponding parameters.

Definition at line 58 of file CaloTopoTowerFromClusterMaker.cxx.

59{
60 //--------------------//
61 // Set up handle keys //
62 //--------------------//
63
64 ATH_CHECK(m_cellContainerKey.initialize());
65
66 //---------------------//
67 // Check configuration //
68 //---------------------//
69
70 ATH_CHECK(m_towerGeoKey.initialize());
71 ATH_CHECK(m_caloMgrKey.initialize());
72
73 // tower builder configurations
75 // topo-tower
76 ATH_MSG_INFO("Configure for building topo-towers (filtered mode):");
77 // energy threshold not (yet) implemented for topo-towers
79 ATH_MSG_WARNING("[ignore] cannot apply energy thresholds to topo-towers!");
81 }
82 ATH_CHECK(m_clusterContainerKey.initialize());
83 // // check on request for LCW
84 // if ( m_prepareLCW ) {
85 // ATH_CHECK(m_cellClusterWeightKey.initialize());
86 // ATH_MSG_INFO("[accept] prepare for LCW calibration - initialize CaloCellClusterWeights key object <" << m_cellClusterWeightKey << ">");
87 // } else {
88 // ATH_MSG_INFO("[accept] use EM scale");
89 // }
90 } else {
91 // inclusive/exclusive towers
92 ATH_MSG_INFO("Configure for building cell towers:");
94 ATH_MSG_INFO("[accept] configure exclusive towers: use cell energy threshold");
96 ATH_MSG_ERROR("######## [reject] invalid cell energy threshold " << m_energyThreshold/Athena::Units::GeV
97 << " GeV is smaller than default (no-op) " << m_energyThresholdDef/Athena::Units::GeV << " GeV - fatal");
98 return StatusCode::FAILURE;
99 }
100 ATH_MSG_INFO("######## [accept] energy threshold for cells to contribute to towers is " << m_energyThreshold/Athena::Units::GeV << " GeV");
101 } else {
102 ATH_MSG_INFO("[accept] configure inclusive towers");
103 } // end inclusive/exclusive tower configuration
104 } // end tower builder configuration
105
106 // local data (constant parameters)
107 //m_numberOfCells = m_towerGeometrySvc->totalNumberCells();
108 //m_maxCellHash = m_towerGeometrySvc->maxCellHash();
109 //m_numberOfTowers = m_towerGeometrySvc->towerBins();
110 // ATH_MSG_INFO("Additional tool parameters:");
111 // if ( m_numberOfCells > 0 ) {
112 // ATH_MSG_INFO("[accept] maximum cell hash index is " << m_maxCellHash);
113 // ATH_MSG_INFO("[accept] maximum number of cells is " << m_numberOfCells);
114 // } else {
115 // ATH_MSG_ERROR("[reject] invalid maximum cell hash index/total number of cells " << m_maxCellHash << "/" << m_numberOfCells << " - fatal");
116 // return StatusCode::FAILURE;
117 // }
118 // if ( m_numberOfTowers > 0 ) {
119 // ATH_MSG_INFO("[accept] maximum number of towers is " << m_numberOfTowers);
120 // } else {
121 // ATH_MSG_ERROR("[reject] invalid maximum number of towers " << m_numberOfTowers << " - fatal");
122 // return StatusCode::FAILURE;
123 // }
124
125 if ( m_excludedSamplingsName.empty() ) {
126 m_excludedSamplings.clear();
128 ATH_MSG_INFO("Cells from all samplings used for topo-cluster included");
129 } else {
130 size_t nex(std::min(m_excludedSamplingsName.size(), m_excludedSamplingsPattern.size()));
132 ATH_MSG_WARNING( CaloRec::Helpers::fmtMsg("Configuration problem: number of excluded sampling names %zu exceeds expected maximum %zu - ignore last %zu name(s)",
134 }
135 m_excludedSamplings.resize(nex);
137 for ( size_t i(0); i<nex; ++i ) {
140 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("CaloSampling \042%10.10s\042 has id %2zu (name in lookup table \042%10.10s\042)",
141 m_excludedSamplingsName.value().at(i).c_str(),(size_t)m_excludedSamplings.at(i),CaloRec::Lookup::getSamplingName(m_excludedSamplings.at(i)).c_str()) );
142 }
143 }
144
145 ATH_MSG_INFO("Other properties:");
146 std::map<bool,std::string> blu { { true, "true" }, { false, "false" } };
147 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("PrepareLCW ................. %s", blu[m_prepareLCW.value()].c_str()) );
148 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("BuildTopoTowers ............ %s", blu[m_useCellsFromClusters.value()].c_str()) );
149 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("ApplyCellEnergyThreshold ... %s", blu[m_applyCellEnergyThreshold.value()].c_str()) );
150 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("OrderClusterByPt ........... %s", blu[m_orderByPt.value()].c_str()) );
151 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("DoCellIndexCheck ........... %s", blu[m_doCellIndexCheck.value()].c_str()) );
152 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("BuildCombinedTopoSignal .... %s", blu[m_buildCombinedSignal.value()].c_str()) );
153 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("TopoClusterRange ........... %.2f", m_clusterRange.value()) );
154 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("ExcludedSamplings .......... %zu (number of)",m_excludedSamplingsName.size()) );
155 ATH_MSG_INFO( CaloRec::Helpers::fmtMsg("RemoveSamplingData ......... %s", blu[m_removeSamplingData.value()].c_str()) );
156
157 return StatusCode::SUCCESS;
158}
#define ATH_CHECK
Evaluate an expression and check for errors.
static const double m_energyThresholdDef
Default energy threshold.
std::vector< CaloSampling::CaloSample > m_excludedSamplings
List of excluded samplings (CaloSampling::CaloSample enumerators).
Gaudi::Property< std::vector< std::string > > m_excludedSamplingsName
List of excluded samplings (human-readable names).
static CaloSampling::CaloSample getSamplingId(const std::string &sname)
Lookup sampling identifier by name (function).

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

const InterfaceID & CaloTowerCollectionProcessor::interfaceID ( )
inlinestaticinherited

Standard Gaudi interface ID method.

Definition at line 44 of file CaloTowerCollectionProcessor.h.

static const InterfaceID IID_CaloTowerCollectionProcessor("CaloTowerCollectionProcessor", 1, 0)

◆ isValidIndex()

bool CaloTopoTowerFromClusterMaker::isValidIndex ( uint_t idx) const
inlineprivate

Checks if argument is a valid index value.

Definition at line 146 of file CaloTopoTowerFromClusterMaker.h.

146{ return idx != badIndexValue(); }
uint_t badIndexValue() const
Returns value indicating a bad index.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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.

◆ 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 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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

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

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

Member Data Documentation

◆ m_applyCellEnergyThreshold

Gaudi::Property<bool> CaloTopoTowerFromClusterMaker::m_applyCellEnergyThreshold {this, "ApplyCellEnergyThreshold", false, "Turn on/off cell energy thresholds"}
private

Apply cell energy threshold, default is false.

Definition at line 73 of file CaloTopoTowerFromClusterMaker.h.

73{this, "ApplyCellEnergyThreshold", false, "Turn on/off cell energy thresholds"};

◆ m_buildCombinedSignal

Gaudi::Property<bool> CaloTopoTowerFromClusterMaker::m_buildCombinedSignal {this, "BuildCombinedTopoSignal", false, "Build topo-clusters and topo-towers"}
private

Build topo-clusters within given \( y \) range, else topo-towers.

Definition at line 75 of file CaloTopoTowerFromClusterMaker.h.

75{this, "BuildCombinedTopoSignal", false, "Build topo-clusters and topo-towers"};

◆ m_caloMgrKey

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

Definition at line 66 of file CaloTopoTowerFromClusterMaker.h.

66{this,"CaloDetDescrManager", "CaloDetDescrManager"};

◆ m_cellContainerKey

SG::ReadHandleKey<CaloCellContainer> CaloTopoTowerFromClusterMaker::m_cellContainerKey {this, "CaloCellContainerKey", "AllCalo", "SG Key for CaloCellContainer (input)"}
private

Calorimeter cell container.

Definition at line 69 of file CaloTopoTowerFromClusterMaker.h.

69{this, "CaloCellContainerKey", "AllCalo", "SG Key for CaloCellContainer (input)"};

◆ m_clusterContainerKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> CaloTopoTowerFromClusterMaker::m_clusterContainerKey {this, "CaloTopoClusterContainerKey", "CaloTopoClusters", "SG Key for CaloClusterContainer (input)"}
private

Topo-cluster container key.

Definition at line 68 of file CaloTopoTowerFromClusterMaker.h.

68{this, "CaloTopoClusterContainerKey", "CaloTopoClusters", "SG Key for CaloClusterContainer (input)"};

◆ m_clusterRange

Gaudi::Property<double> CaloTopoTowerFromClusterMaker::m_clusterRange {this, "TopoClusterRange", m_clusterRangeDef, "Rapidity range for using topo-clusters in combined signal mode"}
private

Range where topo-clusters are used when m_buildCombinedSignal = true.

Definition at line 77 of file CaloTopoTowerFromClusterMaker.h.

77{this, "TopoClusterRange", m_clusterRangeDef, "Rapidity range for using topo-clusters in combined signal mode"};
static const double m_clusterRangeDef
Default cluster range.

◆ m_clusterRangeDef

const double CaloTopoTowerFromClusterMaker::m_clusterRangeDef = 5.
staticprivate

Default cluster \( y \) range.

Definition at line 88 of file CaloTopoTowerFromClusterMaker.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_doCellIndexCheck

Gaudi::Property<bool> CaloTopoTowerFromClusterMaker::m_doCellIndexCheck {this, "DoCellIndexCheck", false, "Check cell hash indices for consistency"}
private

Check cell hash index consistency if true (default false).

Definition at line 74 of file CaloTopoTowerFromClusterMaker.h.

74{this, "DoCellIndexCheck", false, "Check cell hash indices for consistency"};

◆ m_energyThreshold

Gaudi::Property<double> CaloTopoTowerFromClusterMaker::m_energyThreshold {this, "CellEnergyThreshold", m_energyThresholdDef-1., "Energy threshold for cells filled in clusters"}
private

Cell energy threshold, default is set in m_energyThresholdDef.

Definition at line 76 of file CaloTopoTowerFromClusterMaker.h.

76{this, "CellEnergyThreshold", m_energyThresholdDef-1., "Energy threshold for cells filled in clusters"};

◆ m_energyThresholdDef

const double CaloTopoTowerFromClusterMaker::m_energyThresholdDef = -100000000.
staticprivate

Default energy threshold.

Definition at line 87 of file CaloTopoTowerFromClusterMaker.h.

◆ m_errorValueUINT

const CaloTopoTowerFromClusterMaker::uint_t CaloTopoTowerFromClusterMaker::m_errorValueUINT = uint_t(-1)
staticprivate

Error value for uint_t type values.

Definition at line 89 of file CaloTopoTowerFromClusterMaker.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_excludedSamplings

std::vector<CaloSampling::CaloSample> CaloTopoTowerFromClusterMaker::m_excludedSamplings
private

List of excluded samplings (CaloSampling::CaloSample enumerators).

Definition at line 135 of file CaloTopoTowerFromClusterMaker.h.

◆ m_excludedSamplingsName

Gaudi::Property<std::vector<std::string> > CaloTopoTowerFromClusterMaker::m_excludedSamplingsName {this, "ExcludedSamplings", {}, "Excluded samplings by name"}
private

List of excluded samplings (human-readable names).

Definition at line 136 of file CaloTopoTowerFromClusterMaker.h.

136{this, "ExcludedSamplings", {}, "Excluded samplings by name"};

◆ m_excludedSamplingsPattern

std::bitset< _CALOTOPOTOWERFROMCLUSTERMAKER_BITSET_SIZE > CaloTopoTowerFromClusterMaker::m_excludedSamplingsPattern
private

Bit pattern indicates if sampling is excluded.

Definition at line 137 of file CaloTopoTowerFromClusterMaker.h.

◆ m_numberOfSamplings

uint_t CaloTopoTowerFromClusterMaker::m_numberOfSamplings {static_cast<uint_t>(CaloSampling::Unknown)}
private

Number of samplings.

Definition at line 85 of file CaloTopoTowerFromClusterMaker.h.

85{static_cast<uint_t>(CaloSampling::Unknown)};

◆ m_orderByPt

Gaudi::Property<bool> CaloTopoTowerFromClusterMaker::m_orderByPt {this, "OrderClusterByPt", false, "Turn on/off pT-ordering of CaloClusterContainer (output)"}
private

Orders cluster container by \( p_{\text{T}} \), default true.

Definition at line 70 of file CaloTopoTowerFromClusterMaker.h.

70{this, "OrderClusterByPt", false, "Turn on/off pT-ordering of CaloClusterContainer (output)"};

◆ m_prepareLCW

Gaudi::Property<bool> CaloTopoTowerFromClusterMaker::m_prepareLCW {this, "PrepareLCW", false, "Prepare data structure to apply LCW"}
private

Prepare LCW calibration, default is false.

Definition at line 71 of file CaloTopoTowerFromClusterMaker.h.

71{this, "PrepareLCW", false, "Prepare data structure to apply LCW"};

◆ m_removeSamplingData

Gaudi::Property<bool> CaloTopoTowerFromClusterMaker::m_removeSamplingData {this, "RemoveSamplingData", true, "Remove the associated sampling data"}
private

Remove sampling data for towers.

Definition at line 78 of file CaloTopoTowerFromClusterMaker.h.

78{this, "RemoveSamplingData", true, "Remove the associated sampling data"};

◆ m_towerGeoKey

SG::ReadCondHandleKey<CaloTowerGeometry> CaloTopoTowerFromClusterMaker::m_towerGeoKey {this,"TowerGeometry","CaloTowerGeometry"}
private

the name of the key of the CaloTowerGeometry object in the ConditonsStore

Definition at line 65 of file CaloTopoTowerFromClusterMaker.h.

65{this,"TowerGeometry","CaloTowerGeometry"};

◆ m_useCellsFromClusters

Gaudi::Property<bool> CaloTopoTowerFromClusterMaker::m_useCellsFromClusters {this, "BuildTopoTowers", true, "Turn on/off topo-tower formation"}
private

Use cells from topo-clusters if true, else use all cells, default is true.

Definition at line 72 of file CaloTopoTowerFromClusterMaker.h.

72{this, "BuildTopoTowers", true, "Turn on/off topo-tower formation"};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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