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

#include <CaloTopoTowerAlgorithm.h>

Inheritance diagram for CaloTopoTowerAlgorithm:
Collaboration diagram for CaloTopoTowerAlgorithm:

Public Types

typedef CaloTopoTowerBuilderToolBase tool_type
 
typedef std::vector< tool_type * > tool_store
 
typedef tool_store::const_iterator tool_iterator
 

Public Member Functions

 CaloTopoTowerAlgorithm (const std::string &name, ISvcLocator *pService)
 Algorithm constructor. More...
 
virtual ~CaloTopoTowerAlgorithm ()
 
virtual StatusCode initialize () override
 inherited from Algorithm More...
 
virtual StatusCode execute (const EventContext &ctx) const override
 
virtual StatusCode finalize () override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

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

bool m_genericLink
 
std::vector< std::string > m_toolNames
 
ToolHandleArray< ICaloTopoTowerBuilderToolBasem_ptools
 
tool_store m_tools
 
SG::ReadHandleKey< CaloCellContainerm_cellContainerKey
 
SG::ReadHandleKey< CaloClusterContainerm_clusterKey
 
SG::ReadHandleKey< CaloCell2ClusterMapm_cellToClusterMapKey
 
SG::ReadHandleKey< CaloTowerContainerm_towerContainerKey
 
SG::WriteHandleKey< CaloTopoTowerContainerm_newTowerContainerKey
 
double m_minimumCellEnergy
 
double m_minimumClusterEnergy
 
bool m_useCellWeights
 
float m_noiseSigma
 
float m_cellESignificanceThreshold
 
std::vector< std::string > m_includedCalos
 
std::vector< CaloCell_ID::SUBCALOm_caloIndices
 
bool m_caloSelection
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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 CaloTopoTowerAlgorithm.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ tool_iterator

typedef tool_store::const_iterator CaloTopoTowerAlgorithm::tool_iterator

Definition at line 42 of file CaloTopoTowerAlgorithm.h.

◆ tool_store

Definition at line 41 of file CaloTopoTowerAlgorithm.h.

◆ tool_type

Definition at line 40 of file CaloTopoTowerAlgorithm.h.

Constructor & Destructor Documentation

◆ CaloTopoTowerAlgorithm()

CaloTopoTowerAlgorithm::CaloTopoTowerAlgorithm ( const std::string &  name,
ISvcLocator *  pService 
)

Algorithm constructor.

Definition at line 17 of file CaloTopoTowerAlgorithm.cxx.

19  : AthReentrantAlgorithm(name,pSvcLocator)
20  , m_genericLink(true)
21  , m_ptools( this )
22  , m_cellContainerKey("AllCalo")
23  , m_clusterKey("CaloTopoClusters")
24  , m_cellToClusterMapKey("CaloCell2TopoCluster")
25  , m_towerContainerKey("CmbTower")
26  , m_newTowerContainerKey("TopoTower")
27  , m_caloSelection(false)
28 {
29  // tool names
30  //declareProperty("TowerBuilderTools",m_toolNames);
31  declareProperty("TowerBuilderTools",m_ptools);
32  // output data
33  //declareProperty("TowerContainerName",m_towerContainerName);
34  // linkable
35  declareProperty("GenericLinked",m_genericLink);
36 
38  //Item From CaloTopoTowerAlg
39  declareProperty("Cell2ClusterMapName", m_cellToClusterMapKey);
40  declareProperty("CellContainerName" , m_cellContainerKey);
41  declareProperty("ClusterContainerName", m_clusterKey);
42  declareProperty("InputTowerContainerName" , m_towerContainerKey);
43  declareProperty("OutputTowerContainerName", m_newTowerContainerKey);
44 
45  // Declare configurable properties of the algorithm
46  declareProperty("MinimumCellEnergy", m_minimumCellEnergy = -1000000000.0);
47  declareProperty("MinimumClusterEnergy", m_minimumClusterEnergy = -1000000000.0);
48 
49  // Noise Tool stuff
50  declareProperty("DefaultNoiseSigma", m_noiseSigma = 10.0);
51  declareProperty("CellEnergySignificance", m_cellESignificanceThreshold = -1);
52 
53  // Calo from which to use cells
54  declareProperty("IncludedCalos", m_includedCalos);
55  declareProperty("useCellWeight", m_useCellWeights=true);
56 
57  //END Item From CaloTopoTowerAlg
59 
60 }

◆ ~CaloTopoTowerAlgorithm()

CaloTopoTowerAlgorithm::~CaloTopoTowerAlgorithm ( )
virtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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 CaloTopoTowerAlgorithm::execute ( const EventContext &  ctx) const
overridevirtual

retrieve existing Tower container

get CaloCell container from StoreGate

+++ pick up TopoCluster from StoreGate

+++ pick up CaloCell2ClusterMap from StoreGate

Definition at line 173 of file CaloTopoTowerAlgorithm.cxx.

174 {
175 
177  // Re-allocate Services //
179 
180  //timing
181  IChronoStatSvc* theTicker = chronoSvc();
182 
184  // Tool Processing //
188  if ( !towerContainer.isValid() ) {
189  ATH_MSG_WARNING( " cannot retrieve tower container with key " << towerContainer.name() );
190  return StatusCode::SUCCESS;
191  }
192 
195  if ( !theCells.isValid()) {
196  ATH_MSG_WARNING( " cannot retrieve cell container with key " << theCells.name() );
197  return StatusCode::SUCCESS;
198  }
199  ATH_MSG_DEBUG( "CaloTopoTowerAlgorithm::execute " << theCells.name() << " size= " << theCells->size() );
200 
203 
204  if ( !clusters.isValid() )
205  {
206  ATH_MSG_WARNING( "cannot retrieve CaloClusterContainer with key <"
207  << clusters.name() << ">" );
208  return StatusCode::SUCCESS;
209  }
210 
213  if ( !cellToClusterMap.isValid() ){
214  ATH_MSG_WARNING( "cannot retrieve CaloCell2ClusterMap with key <"
215  << cellToClusterMap.name() << ">" );
216  return StatusCode::SUCCESS;
217  }
218 
219  ATH_MSG_DEBUG( "Successfully retrieved CaloCell2ClusterMap <"<< cellToClusterMap.name() << ">" );
220 
222  ATH_CHECK( theTowers.record (std::make_unique<CaloTopoTowerContainer>(towerContainer->towerseg())) );
223 
225  //Starting to save variable to CaloTopoTowerContainer
226  //
227 
228  theTowers->SetTowers(towerContainer.cptr());
229  theTowers->SetClusters(clusters.ptr());
230  theTowers->SetCells(theCells.cptr());
231  theTowers->SetCellToClusterMap(cellToClusterMap.cptr());
232 
233  theTowers->SetMinimumCellEnergy(m_minimumCellEnergy);
234  theTowers->SetMinimumClusterEnergy(m_minimumClusterEnergy);
235  theTowers->SetUseCellWeights(m_useCellWeights);
236 
237  // Noise tool stuff
238  theTowers->SetNoiseSigma(m_noiseSigma);
239  theTowers->SetCellESignificanceThreshold(m_cellESignificanceThreshold);
240 
241  // List of calorimeters from which to use cells
242  theTowers->SetCaloIndices(m_caloIndices);
243  theTowers->SetCaloSelection(m_caloSelection);
244 
245  //
246  //Finished saving variable to CaloTopoTowerContainer
248 
249  ToolHandleArray<ICaloTopoTowerBuilderToolBase>::const_iterator firstITool = m_ptools.begin();
250  ToolHandleArray<ICaloTopoTowerBuilderToolBase>::const_iterator lastITool = m_ptools.end();
251  StatusCode processStatus = StatusCode::SUCCESS;
252  //
253  // loop stops only when Failure indicated by one of the tools
254  //
255 
256  ATH_MSG_DEBUG( "In execute() " );
257 
258  while ( ! processStatus.isFailure() && firstITool != lastITool )
259  {
260  // CaloTopoTowerBuilderToolBase* pTool = *firstTool;
261  //sc = (*firstITool).retrieve();
262  //if ( sc.isFailure() ) { log << MSG::INFO << "error retrieving tool " << endmsg; }
263 
264  //if ( (*firstITool).empty() ) { log << MSG::INFO << "tool is empty " << endmsg; }
265 
266  //ATH_MSG_INFO( "tool retrieved, going to start " );
267  if ( theTicker != nullptr )
268  {
269  // ATH_MSG_INFO( "Chrono start " );
270  theTicker->chronoStart((*firstITool)->name());
271  }
272  /* ATH_MSG_INFO( "executing tool: " << (*firstITool)->name() );
273  ATH_MSG_INFO( "this is &(firstITool): " << &(firstITool) );
274  ATH_MSG_INFO( "this is (*firstITool): " << (*firstITool) );
275  ATH_MSG_INFO( "this is &(*firstITool): " << &(*firstITool) );
276  ATH_MSG_INFO( "this is &(*(*firstITool)): " << &(*(*firstITool)) );
277  ATH_MSG_INFO( "this is theTowers: " << theTowers );
278  */
279 
280  processStatus = (*firstITool)->execute(ctx, theTowers.ptr());
281 
282  // ATH_MSG_INFO( "processStatus is: " << processStatus );
283 
284 
285  if ( theTicker != nullptr )
286  {
287  // ATH_MSG_INFO( "Chrono stop " );
288  theTicker->chronoStop((*firstITool)->name());
289  }
290  if ( ! processStatus.isFailure() )
291  {
292  ATH_MSG_DEBUG( (*firstITool)->name()
293  << ": CaloTopoTowerContainer::size() = "
294  << theTowers->size() );
295  ++firstITool;
296  }
297  else
298  {
299  // some problem - but do not skip event loop!
300  ATH_MSG_ERROR( "problems while or after processing tool \042"
301  << (*firstITool)->name()
302  << "\042 - cross-check CaloTopoTowerContainer::size() = "
303  << theTowers->size() );
304  ++firstITool;
305  }
306  }
307 
308  return StatusCode::SUCCESS;
309 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ finalize()

StatusCode CaloTopoTowerAlgorithm::finalize ( )
overridevirtual

Definition at line 315 of file CaloTopoTowerAlgorithm.cxx.

316 {
317  return StatusCode::SUCCESS;
318 }

◆ initialize()

StatusCode CaloTopoTowerAlgorithm::initialize ( )
overridevirtual

inherited from Algorithm

Definition at line 69 of file CaloTopoTowerAlgorithm.cxx.

70 {
76 
77  m_caloIndices.clear();
78  for ( unsigned int iCalos=0; iCalos< m_includedCalos.size(); iCalos++ )
79  {
80  if ( m_includedCalos[iCalos] == "LAREM" )
81  {
83  }
84  else if ( m_includedCalos[iCalos] == "LARHEC")
85  {
87  }
88  else if ( m_includedCalos[iCalos] == "LARFCAL" )
89  {
91  }
92  else if ( m_includedCalos[iCalos] == "TILE" )
93  {
95  }
96  }
97 
98  m_caloSelection=false;
99  unsigned int nSubCalo=static_cast<int>(CaloCell_ID::NSUBCALO) ;
100  if (!m_caloIndices.empty() && m_caloIndices.size()<nSubCalo) m_caloSelection=true;
101 
102  ATH_MSG_INFO( " Calo selection applied ? " << m_caloSelection );
103  if (m_caloSelection) {
104  msg() << MSG::INFO << " subcalo selected ";
105  for (unsigned int iCalos=0;iCalos< m_includedCalos.size(); iCalos++ )
106  msg() << MSG::INFO << " " << m_includedCalos[iCalos];
107  msg() << MSG::INFO << " " << endmsg;
108  }
109 
110 
112  // Allocate Tools //
114 
115  // check tool names
116  if ( m_ptools.empty() )
117  {
118  ATH_MSG_ERROR( "no tools given for this algorithm." );
119  return StatusCode::FAILURE;
120  }
121 
122  // find tools
123 
124  unsigned int toolCtr = 0;
125  ATH_MSG_INFO( " " );
126  ATH_MSG_INFO( "List of tools in execution sequence:" );
127  ATH_MSG_INFO( "------------------------------------" );
128 
129  StatusCode checkOut = m_ptools.retrieve();
130  if ( checkOut.isFailure() )
131  {
132  ATH_MSG_WARNING( "Cannot retrieve tool array " << m_ptools );
133  return StatusCode::FAILURE;
134  }
135 
136  for (ToolHandle<ICaloTopoTowerBuilderToolBase>& tool : m_ptools)
137  {
138  toolCtr++;
139  /* ATH_MSG_INFO( "retrieving tool" );
140 
141  if ( checkOut.isFailure() ) {
142  ATH_MSG_WARNING( "Cannot retrieve tool at ToolArray[" << toolCtr-1 << "]" );
143  ATH_MSG_WARNING( "This tool won't be used" );
144  }
145  else {
146  ATH_MSG_INFO( "retrieved tool" );
147  // print the list of tools
148  */
149 
150 
151  ATH_MSG_INFO( std::setw(2) << toolCtr << ".) "
152  << tool->type()
153  << "::name() = \042"
154  << tool->name()
155  << "\042" );
156 
157  ATH_MSG_INFO( "------------------------------------" );
158  ATH_MSG_INFO( " " );
159 
160  /*if ( tool->initializeTool().isFailure() ) {
161 
162  ATH_MSG_WARNING( " Tool failed to initialize" );
163  }*/
164 
165  } //close iteration over tools
166  return StatusCode::SUCCESS;
167 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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_caloIndices

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

Definition at line 97 of file CaloTopoTowerAlgorithm.h.

◆ m_caloSelection

bool CaloTopoTowerAlgorithm::m_caloSelection
protected

Definition at line 98 of file CaloTopoTowerAlgorithm.h.

◆ m_cellContainerKey

SG::ReadHandleKey<CaloCellContainer> CaloTopoTowerAlgorithm::m_cellContainerKey
protected

Definition at line 77 of file CaloTopoTowerAlgorithm.h.

◆ m_cellESignificanceThreshold

float CaloTopoTowerAlgorithm::m_cellESignificanceThreshold
protected

Definition at line 90 of file CaloTopoTowerAlgorithm.h.

◆ m_cellToClusterMapKey

SG::ReadHandleKey<CaloCell2ClusterMap> CaloTopoTowerAlgorithm::m_cellToClusterMapKey
protected

Definition at line 79 of file CaloTopoTowerAlgorithm.h.

◆ m_clusterKey

SG::ReadHandleKey<CaloClusterContainer> CaloTopoTowerAlgorithm::m_clusterKey
protected

Definition at line 78 of file CaloTopoTowerAlgorithm.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_genericLink

bool CaloTopoTowerAlgorithm::m_genericLink
protected

Definition at line 61 of file CaloTopoTowerAlgorithm.h.

◆ m_includedCalos

std::vector<std::string> CaloTopoTowerAlgorithm::m_includedCalos
protected

Definition at line 96 of file CaloTopoTowerAlgorithm.h.

◆ m_minimumCellEnergy

double CaloTopoTowerAlgorithm::m_minimumCellEnergy
protected

Definition at line 84 of file CaloTopoTowerAlgorithm.h.

◆ m_minimumClusterEnergy

double CaloTopoTowerAlgorithm::m_minimumClusterEnergy
protected

Definition at line 85 of file CaloTopoTowerAlgorithm.h.

◆ m_newTowerContainerKey

SG::WriteHandleKey<CaloTopoTowerContainer> CaloTopoTowerAlgorithm::m_newTowerContainerKey
protected

Definition at line 81 of file CaloTopoTowerAlgorithm.h.

◆ m_noiseSigma

float CaloTopoTowerAlgorithm::m_noiseSigma
protected

Definition at line 89 of file CaloTopoTowerAlgorithm.h.

◆ m_ptools

ToolHandleArray<ICaloTopoTowerBuilderToolBase> CaloTopoTowerAlgorithm::m_ptools
protected

Definition at line 65 of file CaloTopoTowerAlgorithm.h.

◆ m_toolNames

std::vector<std::string> CaloTopoTowerAlgorithm::m_toolNames
protected

Definition at line 64 of file CaloTopoTowerAlgorithm.h.

◆ m_tools

tool_store CaloTopoTowerAlgorithm::m_tools
protected

Definition at line 72 of file CaloTopoTowerAlgorithm.h.

◆ m_towerContainerKey

SG::ReadHandleKey<CaloTowerContainer> CaloTopoTowerAlgorithm::m_towerContainerKey
protected

Definition at line 80 of file CaloTopoTowerAlgorithm.h.

◆ m_useCellWeights

bool CaloTopoTowerAlgorithm::m_useCellWeights
protected

Definition at line 86 of file CaloTopoTowerAlgorithm.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
CaloTopoTowerAlgorithm::m_cellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_cellContainerKey
Definition: CaloTopoTowerAlgorithm.h:77
CaloTopoTowerAlgorithm::m_caloSelection
bool m_caloSelection
Definition: CaloTopoTowerAlgorithm.h:98
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloTopoTowerAlgorithm::m_clusterKey
SG::ReadHandleKey< CaloClusterContainer > m_clusterKey
Definition: CaloTopoTowerAlgorithm.h:78
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloTopoTowerAlgorithm::m_caloIndices
std::vector< CaloCell_ID::SUBCALO > m_caloIndices
Definition: CaloTopoTowerAlgorithm.h:97
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CaloTopoTowerAlgorithm::m_genericLink
bool m_genericLink
Definition: CaloTopoTowerAlgorithm.h:61
CaloTopoTowerAlgorithm::m_includedCalos
std::vector< std::string > m_includedCalos
Definition: CaloTopoTowerAlgorithm.h:96
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
CaloTopoTowerAlgorithm::m_minimumCellEnergy
double m_minimumCellEnergy
Definition: CaloTopoTowerAlgorithm.h:84
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
CaloTopoTowerAlgorithm::m_towerContainerKey
SG::ReadHandleKey< CaloTowerContainer > m_towerContainerKey
Definition: CaloTopoTowerAlgorithm.h:80
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
CaloTopoTowerAlgorithm::m_cellESignificanceThreshold
float m_cellESignificanceThreshold
Definition: CaloTopoTowerAlgorithm.h:90
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
CaloTopoTowerAlgorithm::m_cellToClusterMapKey
SG::ReadHandleKey< CaloCell2ClusterMap > m_cellToClusterMapKey
Definition: CaloTopoTowerAlgorithm.h:79
CaloTopoTowerAlgorithm::m_newTowerContainerKey
SG::WriteHandleKey< CaloTopoTowerContainer > m_newTowerContainerKey
Definition: CaloTopoTowerAlgorithm.h:81
CaloTopoTowerAlgorithm::m_minimumClusterEnergy
double m_minimumClusterEnergy
Definition: CaloTopoTowerAlgorithm.h:85
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
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:623
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
CaloTopoTowerAlgorithm::m_ptools
ToolHandleArray< ICaloTopoTowerBuilderToolBase > m_ptools
Definition: CaloTopoTowerAlgorithm.h:65
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
CaloTopoTowerAlgorithm::m_noiseSigma
float m_noiseSigma
Definition: CaloTopoTowerAlgorithm.h:89
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
CaloTopoTowerAlgorithm::m_useCellWeights
bool m_useCellWeights
Definition: CaloTopoTowerAlgorithm.h:86
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >