ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
CaloTopoTowerBuilderTool Class Reference

#include <CaloTopoTowerBuilderTool.h>

Inheritance diagram for CaloTopoTowerBuilderTool:
Collaboration diagram for CaloTopoTowerBuilderTool:

Public Member Functions

 CaloTopoTowerBuilderTool (const std::string &name, const std::string &type, const IInterface *parent)
 AlgTool constructor. More...
 
virtual ~CaloTopoTowerBuilderTool ()
 
virtual StatusCode execute (const EventContext &ctx, CaloTopoTowerContainer *theContainer, const CaloCellContainer *theCell=0) const override
 execute More...
 
virtual StatusCode initializeTool () override
 
virtual void handle (const Incident &) override
 
virtual StatusCode LoadCalibration (IOVSVC_CALLBACK_ARGS) override
 
virtual StatusCode initialize () override
 common initialization More...
 
virtual void setTowerSeg (const CaloTowerSeg &theTowerSeg) override
 
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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Protected Attributes

std::vector< CaloCell_ID::SUBCALOm_caloIndices
 
CaloTowerSeg m_theTowerSeg
 

Private Types

typedef Navigable< CaloClusterContainernav_t
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

const CaloCell2ClusterMapCreateCaloCell2ClusterMap (const CaloClusterContainer *c) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const CaloCell_IDm_calo_id
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 36 of file CaloTopoTowerBuilderTool.h.

Member Typedef Documentation

◆ nav_t

Definition at line 70 of file CaloTopoTowerBuilderTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CaloTopoTowerBuilderTool()

CaloTopoTowerBuilderTool::CaloTopoTowerBuilderTool ( const std::string &  name,
const std::string &  type,
const IInterface *  parent 
)

AlgTool constructor.

Definition at line 35 of file CaloTopoTowerBuilderTool.cxx.

39  m_calo_id(nullptr)
40 {
41  declareInterface<ICaloTopoTowerBuilderToolBase>(this);
42 }

◆ ~CaloTopoTowerBuilderTool()

CaloTopoTowerBuilderTool::~CaloTopoTowerBuilderTool ( )
virtualdefault

Member Function Documentation

◆ CreateCaloCell2ClusterMap()

const CaloCell2ClusterMap * CaloTopoTowerBuilderTool::CreateCaloCell2ClusterMap ( const CaloClusterContainer c) const
private

Definition at line 326 of file CaloTopoTowerBuilderTool.cxx.

327 {
328  ATH_MSG_DEBUG("CreateCaloCell2ClusterMap() Starting");
329  CaloCell2ClusterMap *cell2ClusterMap;
330  cell2ClusterMap = new CaloCell2ClusterMap();
331  // resize it to total range of IdentifierHash for all calos
333  cell2ClusterMap->resize(maxRange);
334 
335  ATH_MSG_DEBUG("CaloCluster container contains " << clusColl->size() << " clusters");
336  // loop over cluster collection and add each cluster to the map for
337  // each member cell
338  for (const CaloCluster* clust : *clusColl) {
339  // loop over its cell members
340  if ((clust->getNumberOfCells()) == 0 ) {
341  ATH_MSG_DEBUG(" no cells for this cluster... No reverse navigation possible...");
342  }
343  else {
344  CaloCluster::cell_iterator cellIter = clust->cell_begin();
345  CaloCluster::cell_iterator cellIterEnd = clust->cell_end();
346  for( ;cellIter!=cellIterEnd;cellIter++) {
347  // look up the IdentifierHash for the current cell
348  if (*cellIter) {
349  IdentifierHash myHashId = m_calo_id->calo_cell_hash((*cellIter)->ID());
350  // get the existing? Navigable for this cell
351  Navigable<CaloClusterContainer> *theNav = (*cell2ClusterMap)[myHashId];
352  if ( !theNav ) {
353  // create a new Navigable if it doesn't exist
354  theNav = new Navigable<CaloClusterContainer>();
355  // and store it in the vector
356  (*cell2ClusterMap)[myHashId] = theNav;
357  }
358  // add the current cluster to the list of clusters for this cell
359  theNav->putElement(clusColl,clust);
360  // add the energy*weight for this cell to the weightedESum
361  }
362  }
363  }
364  }
365  ATH_MSG_DEBUG("CreateCaloCell2ClusterMap() Finished");
366  return cell2ClusterMap;
367 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode CaloTopoTowerBuilderTool::execute ( const EventContext &  ctx,
CaloTopoTowerContainer theContainer,
const CaloCellContainer theCell = 0 
) const
overridevirtual

execute

+++ consistency: pick up CaloClusterContainer pointer from map

+++ loop on towers

+++ loop cells in old tower

Various counters for keeping track of energy added to this tower

+++ Look at all cells in this tower

Require that the cell have a minimum energy and energy significance

Require that the cell be used in at least one cluster

+++ Loop over all clusters associated to this cell

filter clusters according to cluster energy

Set tower energy according to the energy from cells in clusters passing selections

Implements ICaloTopoTowerBuilderToolBase.

Definition at line 65 of file CaloTopoTowerBuilderTool.cxx.

67 {
69  //Starting loading variables from CaloTopoTowerContainer
70 
71  ATH_MSG_DEBUG("Loading variables from theTowers");
72  const CaloTowerContainer* towerContainer=theTowers->GetTowers();
73  const CaloClusterContainer* clusters=theTowers->GetClusters();
74  const CaloCellContainer* Cells=theTowers->GetCells();
75 
76  if (!towerContainer || !clusters || !Cells) {
77  msg(MSG::WARNING) << " Missing input container : ";
78  if (!towerContainer) msg(MSG::WARNING) << " no tower ";
79  if (!clusters) msg(MSG::WARNING) << " no TopoClusters ";
80  if (!Cells) msg(MSG::WARNING) << " no Cells ";
81  msg(MSG::WARNING) << " .. no CaloTopoTowers are made " << endmsg;
82  return StatusCode::SUCCESS;
83  }
84 
85  const ElementLink<CaloCellContainer> CellsEL (*Cells, 0, ctx);
86 
87  const CaloCell2ClusterMap* cellToClusterMap=theTowers->GetCellToClusterMap();
88  bool delete_cellToClusterMap=false;
89  if(cellToClusterMap==nullptr ){
90  cellToClusterMap=CreateCaloCell2ClusterMap(clusters);
91  delete_cellToClusterMap=true;
92  }
93  ATH_MSG_DEBUG( "Tower size " << towerContainer->size() );
94  ATH_MSG_DEBUG( "Cluster size " << clusters->size() );
95  ATH_MSG_DEBUG( "Cell size " << Cells->size() );
96 
97  double minimumCellEnergy = theTowers->GetMinimumCellEnergy();
98  double minimumClusterEnergy = theTowers->GetMinimumClusterEnergy();
99 
100  bool useCellWeights = theTowers->GetUseCellWeights();
101 
102  ATH_MSG_DEBUG("Energy cuts " << minimumCellEnergy << " " << minimumClusterEnergy << " " << useCellWeights);
103 
104  float noiseSigma0 = theTowers->GetNoiseSigma();
105  float cellESignificanceThreshold = theTowers->GetCellESignificanceThreshold();
106 
107 
108  ATH_MSG_DEBUG("Noise cuts "<< noiseSigma0 << " " << cellESignificanceThreshold);
109 
110  // List of calorimeters from which to use cells
111  std::vector<CaloCell_ID::SUBCALO> caloIndices = theTowers->GetCaloIndices();
112  bool caloSelection = theTowers->GetCaloSelection();
113 
114  ATH_MSG_DEBUG("caloSelection " << caloSelection << " " << caloIndices.size());
115 
116  //Finished loading variables from CaloTopoTowerContainer
119  const CaloClusterContainer* clusterContainer = nullptr;
120  CaloCell2ClusterMap::const_iterator fClusMap(cellToClusterMap->begin());
121  CaloCell2ClusterMap::const_iterator lClusMap(cellToClusterMap->end());
122  ATH_MSG_DEBUG("Starting loop over Navigable CaloCell2ClusterMap");
123  while ( clusterContainer == nullptr && fClusMap != lClusMap ){
124  ATH_MSG_VERBOSE("In loop over Navigable CaloCell2ClusterMap");
125  if (*fClusMap) {
126  // Pick first Navigable and then ask first entry in this
127  // Navigable for the pointer to the CaloClusterContainer.
128  // This should be sufficient because all entries should
129  // have the same pointer. (TBC)
130  ATH_MSG_DEBUG("CaloCell2ClusterMap has entry");
131  const nav_t* pNav = (*fClusMap);
132  clusterContainer = pNav->getContainer(pNav->begin());
133  ATH_MSG_DEBUG("Successfully picked up CaloClusterContainer ");
134  }
135  else ++fClusMap;
136  }
137 
138  // Make sure the cluster container is not NULL
139  if ( clusterContainer == nullptr ) {
140  if (!Cells->empty() ) {
141  ATH_MSG_WARNING( "No cluster found from CaloCell2ClusterMap, tool unusable" );
142  }
143  else {
144  ATH_MSG_DEBUG(" empty calorimeter event .. return ");
145  }
146 
147  if(delete_cellToClusterMap){
148  ATH_MSG_DEBUG( "Deleting cellToClusterMap Pointer");
149  delete cellToClusterMap;
150  ATH_MSG_DEBUG("Deleting cellToClusterMap Pointer Finished");
151  }
152 
153  return StatusCode::SUCCESS;
154  }
155  else
156  ATH_MSG_DEBUG("Size of CaloClusterContainer = " << clusterContainer->size());
157 
160  // (*towerIter) is the ITERATOR over TOWERS
161  // (*cellInTowerIter) is the ITERATOR over CELLS for this TOWER
162 
163  ATH_MSG_DEBUG("Beginning loop over tower grid");
164 
165  for (const CaloTower* tower : *towerContainer)
166  {
167  int towerIndex = towerContainer->getTowerIndex(tower);
168 
169  CaloTower* newTower = theTowers->getTower(towerIndex);
170 
172  ATH_MSG_VERBOSE("In loop over tower grid: tower eta-phi" << tower->eta() << " " << tower->phi());
173  CaloTower::cell_iterator cellInTowerIter(tower->cell_begin());
174  CaloTower::cell_iterator lastCellInTower(tower->cell_end());
175 
177  double energyTower = 0.0;
178  double totalAttachedClusterEnergy = 0.0;
179  int numberOfCellsInTower = 0;
180  int numberOfAttachedCellsInTower = 0;
181  int numberOfClustersInTower = 0;
182  int totalNumberOfCellsInAttachedClusters = 0;
184  ATH_MSG_VERBOSE("Now looking at all cells in this tower");
185  for ( ; cellInTowerIter != lastCellInTower; cellInTowerIter++ ){
186  numberOfCellsInTower++;
187  // geometrical cell weight in towers
188  // **** Note that in the header it says that this gets the kinematic weight
189  // **** is this somehow different from the geometrical weight?
190  double signedE = 0.0; // zero-out the energy for this cell in case we can't get it from the map
191  double weight = tower->getCellWeight(cellInTowerIter); // get the weight of this cell in the tower
192 
193  const CaloCell* cell = (*cellInTowerIter);
194  if (!cell) continue;
195 
196  size_t globalIndex=0;
197  if (!(tower->getCellIndex(cell,globalIndex)) ) {
198  ATH_MSG_WARNING( " cannot find back cell index " );
199  continue;
200  }
201 
202  if (caloSelection) {
203  CaloCell_ID::SUBCALO iCaloNum = (cell->caloDDE()->getSubCalo()); // keep only cells from desired calorimeter
204  std::vector<CaloCell_ID::SUBCALO>::const_iterator theFound =
205  find (caloIndices.begin(),caloIndices.end(),iCaloNum);
206  if (theFound==caloIndices.end()) continue ;
207  }
208 
209  signedE = cell->e(); // get the cell energy if we got a good pointer
210  if (!useCellWeights) weight = 1.0; // if we chose not to use the cell weights, reset to 1.0
211  double cellEnergy = weight * signedE; // calculate the energy of this cell in this tower using the weight
212 
213 
214  float signedRatio=0;
215 
216  float noiseSigma = 1.0;
217  if (cellESignificanceThreshold>=0.) {
218  noiseSigma = noiseSigma0;
219  if ( noiseSigma > 0. ) signedRatio = signedE/noiseSigma;
220  }
221 
222  // WARNINGGING
223  ATH_MSG_VERBOSE( " Cell has E = " << signedE << " eta,phi " << cell->eta() << " " << cell->phi() );
224  ATH_MSG_VERBOSE( "Cell has E in tower = " << cellEnergy );
225  ATH_MSG_VERBOSE( " Cell noise sigma = " << noiseSigma );
226  ATH_MSG_VERBOSE( " Cell noise signif = " << signedRatio );
228  if ( (signedE > minimumCellEnergy) && ( fabs(signedRatio) > cellESignificanceThreshold) ){
229  // find clusters associated to this cell using the hash ID
230  size_t cellIndex(cell->caloDDE()->calo_hash());
231  ATH_MSG_VERBOSE("Cell index from CaloCell2ClusterMap = " << cellIndex);
232  const nav_t* nav = (cellToClusterMap->operator[])(cellIndex);
233 
235  if (!nav) {
236  ATH_MSG_VERBOSE("No Cluster container from this cell!");
237  }
238  else{
240  ATH_MSG_VERBOSE("Cell associated to N clusters = " << nav->size());
241  nav_t::object_iter clusterIterator(nav->begin());
242  nav_t::object_iter lastCluster(nav->end());
243  for ( ; clusterIterator != lastCluster; clusterIterator++ ){
244  const CaloCluster* clusterFromCell = (*clusterIterator);
245  double eClusRaw = clusterFromCell->getBasicEnergy();
246  double eClus = clusterFromCell->energy();
247  ATH_MSG_VERBOSE( " Cluster Basic Energy = " << eClusRaw);
248  ATH_MSG_VERBOSE( " Cluster Normal Energy = " << eClus);
249 
251  if ( eClusRaw > minimumClusterEnergy ){
252  ATH_MSG_VERBOSE("Cluster has at least E > " << minimumClusterEnergy);
253 
254  numberOfAttachedCellsInTower++;
255  totalNumberOfCellsInAttachedClusters += clusterFromCell->getNumberOfCells();
256  totalAttachedClusterEnergy += eClusRaw;
257  energyTower += cellEnergy;
258  numberOfClustersInTower++;
259 
260  newTower->addUniqueCellNoKine(CellsEL,globalIndex,weight, 10);
261 
262  // now that we found the cell in at least one cluster above threshold, stop looking at associated clusters
263  ATH_MSG_VERBOSE(" -- Found at least one cluster passing cuts. 'break'");
264  break;
265 
266  } // cluster filter
267  } // clusters from cell loop
268  ATH_MSG_VERBOSE("Finished cluster loop");
269  } // cluster associated to cell
270  } // cell filter
271  } // cell loop
272  ATH_MSG_VERBOSE("Finished cell loop");
273 
275  newTower->setE(energyTower);
276 
277  // Report some information about this Topo-Tower
278  if (msgLvl(MSG::VERBOSE)) {
279  msg() << endmsg;
280  ATH_MSG_VERBOSE( "Old/ new TopoTower energy from all cells = " << tower->e() << " " << newTower->e() );
281  ATH_MSG_VERBOSE( "TopoTower energy adding all cells in clusters = " << energyTower );
282  ATH_MSG_VERBOSE( "Total attached cluster energy = " << totalAttachedClusterEnergy );
283  ATH_MSG_VERBOSE( "Total number of attached clusters = " << numberOfClustersInTower );
284  ATH_MSG_VERBOSE( "Number of cells in attached clusters = " << totalNumberOfCellsInAttachedClusters );
285  ATH_MSG_VERBOSE( "Total number of cells originally in tower = " << numberOfCellsInTower );
286  ATH_MSG_VERBOSE( "Total number of cells from clusters = " << numberOfAttachedCellsInTower );
287 
288  CaloTower::cell_iterator cellInTowerIter(newTower->cell_begin());
289  CaloTower::cell_iterator lastCellInTower(newTower->cell_end());
290  msg(MSG::VERBOSE) << " E*weight, eta, phi of cells in new tower ";
291  for ( ; cellInTowerIter != lastCellInTower; cellInTowerIter++ ) {
292  double weight = tower->getCellWeight(cellInTowerIter); // get the weight of this cell in the tower
293  const CaloCell* cell = (*cellInTowerIter);
294  if (!cell) continue;
295  msg(MSG::VERBOSE) << cell->e()*weight << " " << cell->eta() << " " << cell->phi() << " / ";
296  }
297  msg(MSG::VERBOSE) << endmsg;
298  }
299 
300  } // tower loop
301  if(delete_cellToClusterMap){
302  ATH_MSG_DEBUG("Deleting cellToClusterMap Pointer");
303  delete cellToClusterMap;
304  ATH_MSG_DEBUG("Deleting cellToClusterMap Pointer Finished");
305  }
306  ATH_MSG_DEBUG("Finished creating TopoTowers");
307 
308  return StatusCode::SUCCESS;
309 }

◆ 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

◆ handle()

void CaloTopoTowerBuilderTool::handle ( const Incident &  )
overridevirtual

Definition at line 314 of file CaloTopoTowerBuilderTool.cxx.

314  {
315 
316 }

◆ initialize()

StatusCode CaloTopoTowerBuilderToolBase::initialize ( )
overridevirtualinherited

common initialization

Implements ICaloTopoTowerBuilderToolBase.

Definition at line 18 of file CaloTopoTowerBuilderToolBase.cxx.

19 {
20  return this->initializeTool();
21 }

◆ initializeTool()

StatusCode CaloTopoTowerBuilderTool::initializeTool ( )
overridevirtual

Implements ICaloTopoTowerBuilderToolBase.

Definition at line 52 of file CaloTopoTowerBuilderTool.cxx.

53 {
54  ATH_MSG_INFO( "Initializing CaloTopoTowerAlg" );
55 
56  ATH_CHECK(detStore()->retrieve(m_calo_id, "CaloCell_ID"));
57 
58  return StatusCode::SUCCESS;
59 }

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

static const InterfaceID& ICaloTopoTowerBuilderToolBase::interfaceID ( )
inlinestaticinherited

Definition at line 55 of file ICaloTopoTowerBuilderToolBase.h.

55  {
56  static const InterfaceID IID("ICaloTopoTowerBuilderToolBase", 1 , 0);
57  return IID;
58  }

◆ LoadCalibration()

StatusCode CaloTopoTowerBuilderTool::LoadCalibration ( IOVSVC_CALLBACK_ARGS  )
overridevirtual

Implements ICaloTopoTowerBuilderToolBase.

Definition at line 318 of file CaloTopoTowerBuilderTool.cxx.

319 {
320  return StatusCode::SUCCESS;
321 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

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

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setTowerSeg()

void CaloTopoTowerBuilderToolBase::setTowerSeg ( const CaloTowerSeg theTowerSeg)
overridevirtualinherited

Implements ICaloTopoTowerBuilderToolBase.

Definition at line 23 of file CaloTopoTowerBuilderToolBase.cxx.

24 {
25  ATH_MSG_DEBUG(" in CaloTopoTowerBuilderToolBase::setTowerSeg ");
26  m_theTowerSeg = theTowerSeg;
27  ATH_MSG_DEBUG(" neta,nphi,etamin,etamax " << theTowerSeg.neta() << " " << theTowerSeg.nphi()
28  << " " << theTowerSeg.etamin() << " " << theTowerSeg.etamax());
29 }

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

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

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_calo_id

const CaloCell_ID* CaloTopoTowerBuilderTool::m_calo_id
private

Definition at line 68 of file CaloTopoTowerBuilderTool.h.

◆ m_caloIndices

std::vector<CaloCell_ID::SUBCALO> CaloTopoTowerBuilderTool::m_caloIndices
protected

Definition at line 62 of file CaloTopoTowerBuilderTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_theTowerSeg

CaloTowerSeg CaloTopoTowerBuilderToolBase::m_theTowerSeg
protectedinherited

Definition at line 37 of file CaloTopoTowerBuilderToolBase.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
CaloEnergyCluster::cell_begin
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
Definition: CaloEnergyCluster.cxx:270
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CaloCell2ClusterMap
map of CaloCluster objects each CaloCell belongs to
Definition: CaloCell2ClusterMap.h:27
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
CaloEnergyCluster::cell_end
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
Definition: CaloEnergyCluster.cxx:275
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Navigable::putElement
void putElement(const CONT *objectContainer, const constituent_type *constituentObject, const RPAR &objectParameter=RPAR(), size_t sizeHint=0)
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloClusterContainer
Storable container for CaloCluster.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloClusterContainer.h:37
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
CaloTowerSeg::neta
index_t neta() const
Retrieve number of bins.
Definition: CaloTowerSeg.h:423
CaloCluster::getBasicEnergy
virtual double getBasicEnergy() const
Access basic energy scale signal.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:876
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CaloTopoTowerBuilderToolBase::CaloTopoTowerBuilderToolBase
CaloTopoTowerBuilderToolBase(const std::string &name, const std::string &type, const IInterface *parent)
AlgTool constructor.
Definition: CaloTopoTowerBuilderToolBase.cxx:7
CaloEnergyCluster::addUniqueCellNoKine
void addUniqueCellNoKine(const CaloCellContainer *theContainer, index_type theIndex, double weight, size_t size_hint=0)
Add a cell (very fast)
Definition: CaloEnergyCluster.cxx:125
CaloTopoTowerBuilderToolBase::m_theTowerSeg
CaloTowerSeg m_theTowerSeg
Definition: CaloTopoTowerBuilderToolBase.h:37
CaloCompositeCellBase::getNumberOfCells
unsigned int getNumberOfCells() const
Return the number of cells in the store.
CaloTowerSeg::nphi
index_t nphi() const
Retrieve number of bins.
Definition: CaloTowerSeg.h:428
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
CaloCompositeKineBase::energy
virtual double energy() const
Return energy.
Definition: CaloCompositeKineBase.h:70
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
CaloCluster::cell_iterator
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:115
CaloTowerContainer
Storable container class for CaloTower.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloTowerContainer.h:77
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloTower::cell_iterator
CaloEnergyCluster::cell_iterator cell_iterator
Iterator on CaloCell s.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloTower.h:94
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
CaloTower
Data class for calorimeter cell towers.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloTower.h:55
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
CaloTower::e
virtual double e() const override final
get energy data member
Definition: Calorimeter/CaloEvent/CaloEvent/CaloTower.h:135
CaloTowerSeg::etamax
double etamax() const
Retrieve upper boundary value range.
Definition: CaloTowerSeg.h:448
DataVector::resize
void resize(size_type sz)
Resizes the collection to the specified number of elements.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Navigable::object_iter
NavigableIterator< CONT, RPAR, COLL > object_iter
Definition: Navigable.h:159
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
Navigable
Navigable template generalization to handle navigation.
Definition: Navigable.h:93
CaloTopoTowerBuilderTool::m_calo_id
const CaloCell_ID * m_calo_id
Definition: CaloTopoTowerBuilderTool.h:68
CaloTowerSeg::etamin
double etamin() const
Retrieve lower boundary value range.
Definition: CaloTowerSeg.h:443
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloTopoTowerBuilderTool::CreateCaloCell2ClusterMap
const CaloCell2ClusterMap * CreateCaloCell2ClusterMap(const CaloClusterContainer *c) const
Definition: CaloTopoTowerBuilderTool.cxx:326
CaloTopoTowerBuilderTool::nav_t
Navigable< CaloClusterContainer > nav_t
Definition: CaloTopoTowerBuilderTool.h:70
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
ICaloTopoTowerBuilderToolBase::initializeTool
virtual StatusCode initializeTool()=0
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
P4EEtaPhiM::setE
virtual void setE(double theE)
set energy data member
Definition: P4EEtaPhiM.h:114
Identifier::size_type
IDENTIFIER_TYPE size_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:41
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
IdentifierHash
Definition: IdentifierHash.h:38
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size