|
ATLAS Offline Software
|
#include <CaloTopoTowerBuilderTool.h>
|
| 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 |
|
Definition at line 36 of file CaloTopoTowerBuilderTool.h.
◆ nav_t
◆ StoreGateSvc_t
◆ CaloTopoTowerBuilderTool()
CaloTopoTowerBuilderTool::CaloTopoTowerBuilderTool |
( |
const std::string & |
name, |
|
|
const std::string & |
type, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~CaloTopoTowerBuilderTool()
CaloTopoTowerBuilderTool::~CaloTopoTowerBuilderTool |
( |
| ) |
|
|
virtualdefault |
◆ CreateCaloCell2ClusterMap()
Definition at line 326 of file CaloTopoTowerBuilderTool.cxx.
333 cell2ClusterMap->
resize(maxRange);
335 ATH_MSG_DEBUG(
"CaloCluster container contains " << clusColl->size() <<
" clusters");
340 if ((clust->getNumberOfCells()) == 0 ) {
341 ATH_MSG_DEBUG(
" no cells for this cluster... No reverse navigation possible...");
346 for( ;cellIter!=cellIterEnd;cellIter++) {
356 (*cell2ClusterMap)[myHashId] = theNav;
366 return cell2ClusterMap;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
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.
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;
88 bool delete_cellToClusterMap=
false;
89 if(cellToClusterMap==
nullptr ){
91 delete_cellToClusterMap=
true;
97 double minimumCellEnergy = theTowers->GetMinimumCellEnergy();
98 double minimumClusterEnergy = theTowers->GetMinimumClusterEnergy();
100 bool useCellWeights = theTowers->GetUseCellWeights();
102 ATH_MSG_DEBUG(
"Energy cuts " << minimumCellEnergy <<
" " << minimumClusterEnergy <<
" " << useCellWeights);
104 float noiseSigma0 = theTowers->GetNoiseSigma();
105 float cellESignificanceThreshold = theTowers->GetCellESignificanceThreshold();
108 ATH_MSG_DEBUG(
"Noise cuts "<< noiseSigma0 <<
" " << cellESignificanceThreshold);
111 std::vector<CaloCell_ID::SUBCALO> caloIndices = theTowers->GetCaloIndices();
112 bool caloSelection = theTowers->GetCaloSelection();
114 ATH_MSG_DEBUG(
"caloSelection " << caloSelection <<
" " << caloIndices.size());
122 ATH_MSG_DEBUG(
"Starting loop over Navigable CaloCell2ClusterMap");
123 while ( clusterContainer ==
nullptr && fClusMap != lClusMap ){
131 const nav_t* pNav = (*fClusMap);
132 clusterContainer = pNav->getContainer(pNav->begin());
133 ATH_MSG_DEBUG(
"Successfully picked up CaloClusterContainer ");
139 if ( clusterContainer ==
nullptr ) {
140 if (!Cells->
empty() ) {
141 ATH_MSG_WARNING(
"No cluster found from CaloCell2ClusterMap, tool unusable" );
147 if(delete_cellToClusterMap){
149 delete cellToClusterMap;
153 return StatusCode::SUCCESS;
165 for (
const CaloTower* tower : *towerContainer)
167 int towerIndex = towerContainer->getTowerIndex(tower);
169 CaloTower* newTower = theTowers->getTower(towerIndex);
172 ATH_MSG_VERBOSE(
"In loop over tower grid: tower eta-phi" << tower->eta() <<
" " << tower->phi());
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;
185 for ( ; cellInTowerIter != lastCellInTower; cellInTowerIter++ ){
186 numberOfCellsInTower++;
190 double signedE = 0.0;
191 double weight = tower->getCellWeight(cellInTowerIter);
196 size_t globalIndex=0;
197 if (!(tower->getCellIndex(
cell,globalIndex)) ) {
204 std::vector<CaloCell_ID::SUBCALO>::const_iterator theFound =
205 find (caloIndices.begin(),caloIndices.end(),iCaloNum);
206 if (theFound==caloIndices.end()) continue ;
210 if (!useCellWeights)
weight = 1.0;
211 double cellEnergy =
weight * signedE;
216 float noiseSigma = 1.0;
217 if (cellESignificanceThreshold>=0.) {
218 noiseSigma = noiseSigma0;
219 if ( noiseSigma > 0. ) signedRatio = signedE/noiseSigma;
228 if ( (signedE > minimumCellEnergy) && ( fabs(signedRatio) > cellESignificanceThreshold) ){
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);
243 for ( ; clusterIterator != lastCluster; clusterIterator++ ){
244 const CaloCluster* clusterFromCell = (*clusterIterator);
246 double eClus = clusterFromCell->
energy();
251 if ( eClusRaw > minimumClusterEnergy ){
254 numberOfAttachedCellsInTower++;
255 totalNumberOfCellsInAttachedClusters += clusterFromCell->
getNumberOfCells();
256 totalAttachedClusterEnergy += eClusRaw;
257 energyTower += cellEnergy;
258 numberOfClustersInTower++;
263 ATH_MSG_VERBOSE(
" -- Found at least one cluster passing cuts. 'break'");
275 newTower->
setE(energyTower);
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 );
291 for ( ; cellInTowerIter != lastCellInTower; cellInTowerIter++ ) {
292 double weight = tower->getCellWeight(cellInTowerIter);
301 if(delete_cellToClusterMap){
303 delete cellToClusterMap;
308 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ handle()
void CaloTopoTowerBuilderTool::handle |
( |
const Incident & |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode CaloTopoTowerBuilderToolBase::initialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ initializeTool()
StatusCode CaloTopoTowerBuilderTool::initializeTool |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& ICaloTopoTowerBuilderToolBase::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ LoadCalibration()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ setTowerSeg()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_calo_id
◆ m_caloIndices
◆ m_detStore
◆ m_evtStore
◆ m_theTowerSeg
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
def retrieve(aClass, aKey=None)
map of CaloCluster objects each CaloCell belongs to
Const iterator class for DataVector/DataList.
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
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
void putElement(const CONT *objectContainer, const constituent_type *constituentObject, const RPAR &objectParameter=RPAR(), size_t sizeHint=0)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Storable container for CaloCluster.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
index_t neta() const
Retrieve number of bins.
virtual double getBasicEnergy() const
Access basic energy scale signal.
#define ATH_MSG_VERBOSE(x)
void addUniqueCellNoKine(const CaloCellContainer *theContainer, index_type theIndex, double weight, size_t size_hint=0)
Add a cell (very fast)
unsigned int getNumberOfCells() const
Return the number of cells in the store.
index_t nphi() const
Retrieve number of bins.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual double energy() const
Return energy.
virtual void setOwner(IDataHandleHolder *o)=0
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
Storable container class for CaloTower.
CaloEnergyCluster::cell_iterator cell_iterator
Iterator on CaloCell s.
SUBCALO
enumeration of sub calorimeters
Principal data class for CaloCell clusters.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
Data class for calorimeter cell towers.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
virtual double e() const override final
get energy data member
double etamax() const
Retrieve upper boundary value range.
void resize(size_type sz)
Resizes the collection to the specified number of elements.
NavigableIterator< CONT, RPAR, COLL > object_iter
Container class for CaloCell.
Navigable template generalization to handle navigation.
double etamin() const
Retrieve lower boundary value range.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual void setE(double theE)
set energy data member
IDENTIFIER_TYPE size_type
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
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.
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size