|
ATLAS Offline Software
|
Go to the documentation of this file.
23 #include "CaloEvent/CaloTowerContainer.h"
34 m_cellToClusterMapKey(
"CaloCell2TopoCluster"),
35 m_cellContainerKey(
"AllCalo"),
36 m_towerContainerKey(
"CmbTower"),
37 m_newTowerContainerKey(
"TopoTower"),
38 m_caloSelection(false)
71 return StatusCode::SUCCESS;
116 msg(MSG::INFO) <<
" subcalo selected ";
122 return StatusCode::SUCCESS;
136 if ( !towerContainer.
isValid()) {
138 return StatusCode::SUCCESS;
144 if (newTowerContainer.
record( std::make_unique<CaloTowerContainer> (towerContainer->
towerseg()) ).isFailure()){
145 ATH_MSG_WARNING(
" cannot record new tower container with key " << towerContainer.
name() );
146 return StatusCode::SUCCESS;
148 newTowerContainer->
init();
154 return StatusCode::SUCCESS;
165 if ( !cellToClusterMap.
isValid() )
168 << cellToClusterMap.
name() <<
">" );
169 return StatusCode::SUCCESS;
171 ATH_MSG_DEBUG(
"Successfully retrieved CaloCell2ClusterMap <"<< cellToClusterMap.
name() <<
">" );
181 ATH_MSG_DEBUG(
"Starting loop over Navigable CaloCell2ClusterMap" );
182 while ( clusterContainer ==
nullptr && fClusMap != lClusMap )
192 const nav_t* pNav = (*fClusMap);
194 ATH_MSG_DEBUG(
"Successfully picked up CaloClusterContainer " );
200 if ( clusterContainer ==
nullptr )
202 if (!theCells->
empty() ) {
203 ATH_MSG_WARNING(
"No cluster found from CaloCell2ClusterMap, tool unusable" );
204 return StatusCode::SUCCESS;
208 return StatusCode::SUCCESS;
211 else ATH_MSG_DEBUG(
"Size of CaloClusterContainer = " << clusterContainer->
size() );
219 for (
const CaloTower* theTower : *towerContainer) {
220 int towerIndex = towerContainer->getTowerIndex(theTower);
225 ATH_MSG_VERBOSE(
"In loop over tower grid: tower eta-phi" << theTower->eta() <<
" " << theTower->phi() );
230 double energyTower = 0.0;
231 double totalAttachedClusterEnergy = 0.0;
232 int numberOfCellsInTower = 0;
233 int numberOfAttachedCellsInTower = 0;
234 int numberOfClustersInTower = 0;
235 int totalNumberOfCellsInAttachedClusters = 0;
239 for ( ; cellInTowerIter != lastCellInTower; cellInTowerIter++ )
241 numberOfCellsInTower++;
245 double signedE = 0.0;
246 double weight = theTower->getCellWeight(cellInTowerIter);
251 size_t globalIndex=0;
252 if (!(theTower->getCellIndex(
cell,globalIndex)) ) {
259 std::vector<CaloCell_ID::SUBCALO>::const_iterator theFound =
266 double cellEnergy =
weight * signedE;
271 float noiseSigma = 1.0;
275 if ( noiseSigma > 0. ) signedRatio = signedE/noiseSigma;
288 size_t cellIndex(
cell->caloDDE()->calo_hash());
289 ATH_MSG_VERBOSE(
"Cell index from CaloCell2ClusterMap = " << cellIndex );
290 const nav_t* nav = (cellToClusterMap->operator[])(cellIndex);
301 double eClusRaw = clusterFromCell->getBasicEnergy();
302 double eClus = clusterFromCell->energy();
311 numberOfAttachedCellsInTower++;
312 totalNumberOfCellsInAttachedClusters += clusterFromCell->getNumberOfCells();
313 totalAttachedClusterEnergy += eClusRaw;
314 energyTower += cellEnergy;
315 numberOfClustersInTower++;
320 ATH_MSG_VERBOSE(
" -- Found at least one cluster passing cuts. 'break'" );
332 newTower->
setE(energyTower);
337 ATH_MSG_VERBOSE(
"Old/ new TopoTower energy from all cells = " << theTower->e() <<
" " << newTower->
e() );
338 ATH_MSG_VERBOSE(
"TopoTower energy adding all cells in clusters = " << energyTower );
339 ATH_MSG_VERBOSE(
"Total attached cluster energy = " << totalAttachedClusterEnergy );
340 ATH_MSG_VERBOSE(
"Total number of attached clusters = " << numberOfClustersInTower );
341 ATH_MSG_VERBOSE(
"Number of cells in attached clusters = " << totalNumberOfCellsInAttachedClusters );
342 ATH_MSG_VERBOSE(
"Total number of cells originally in tower = " << numberOfCellsInTower );
343 ATH_MSG_VERBOSE(
"Total number of cells from clusters = " << numberOfAttachedCellsInTower );
347 for ( ; cellInTowerIter != lastCellInTower; cellInTowerIter++ ) {
348 double weight = theTower->getCellWeight(cellInTowerIter);
360 return StatusCode::SUCCESS;
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
CaloTower * getTower(index_t eta, index_t phi)
Returns a pointer to a tower with given indices.
Const iterator class for DataVector/DataList.
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
std::string find(const std::string &s)
return a remapped string
std::vector< std::string > m_includedCalos
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::string & name() const
Return the StoreGate ID for the referenced object.
Storable container for CaloCluster.
virtual object_iter begin() const
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
std::vector< CaloCell_ID::SUBCALO > m_caloIndices
void init()
Initializes the CaloTowerContainer.
void addUniqueCellNoKine(const CaloCellContainer *theContainer, index_type theIndex, double weight, size_t size_hint=0)
Add a cell (very fast)
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Key of the CaloNoise Conditions data object.
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< CaloTowerContainer > m_towerContainerKey
CaloEnergyCluster::cell_iterator cell_iterator
Iterator on CaloCell s.
::StatusCode StatusCode
StatusCode definition for legacy code.
SUBCALO
enumeration of sub calorimeters
SG::ReadHandleKey< CaloCell2ClusterMap > m_cellToClusterMapKey
Principal data class for CaloCell clusters.
SG::WriteHandleKey< CaloTowerContainer > m_newTowerContainerKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Data class for calorimeter cell towers.
virtual double e() const override final
get energy data member
const CaloTowerSeg & towerseg() const
Return a copy of the attached CaloTowerSeg.
const CONT * getContainer(const constituent_type *aConstituent) const
float m_cellESignificanceThreshold
StatusCode initialize(bool used=true)
Navigable template generalization to handle navigation.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
virtual unsigned int size() const
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
virtual void setE(double theE)
set energy data member
CaloTopoTowerAlg(const std::string &name, ISvcLocator *pSvcLocator)
AlgTool constructor.
double m_minimumClusterEnergy
virtual ~CaloTopoTowerAlg()
Destructor
double m_minimumCellEnergy
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
virtual StatusCode initialize() override
initialize
virtual StatusCode finalize() override
finalize
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.