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

#include <METCaloRegionsTool.h>

Inheritance diagram for met::METCaloRegionsTool:
Collaboration diagram for met::METCaloRegionsTool:

Public Member Functions

 METCaloRegionsTool (const std::string &name)
 
 ~METCaloRegionsTool ()=default
 
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function. More...
 
virtual StatusCode execute (xAOD::MissingET *metTerm, xAOD::MissingETComponentMap *metMap) const override
 
virtual void print () const
 Print the state of the tool. More...
 
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
 

Protected Types

enum  CaloRegions {
  EMB = 0, EME, FCAL, HEC,
  PEMB, PEME, TILE, REGIONS_TOTAL
}
 

Protected Member Functions

bool accept (const xAOD::IParticle *object) const
 
bool resolveOverlap (const xAOD::IParticle *object, xAOD::MissingETComponentMap *metMap, std::vector< const xAOD::IParticle * > &acceptedSignals, MissingETBase::Types::weight_t &objWeight) const
 
StatusCode fillCellMet (xAOD::MissingETContainer *metContainer, const CaloCellContainer *caloCellContainer) const
 
StatusCode fillClusterMet (xAOD::MissingETContainer *metContainer, const xAOD::CaloClusterContainer *caloClusContainer) const
 
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...
 

Static Protected Member Functions

static xAOD::MissingETfindMetTerm (xAOD::MissingETContainer *metContainer, CaloSampling::CaloSample sample)
 

Protected Attributes

std::string m_input_data_key
 
std::string m_output_met_key
 
Gaudi::Property< bool > m_calo_useCells {this, "UseCells", true, ""}
 
Gaudi::Property< bool > m_calo_doTriggerMet {this, "DoTriggerMET", true, ""}
 

Static Protected Attributes

static const std::string s_CaloRegionNames []
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

SG::ReadCondHandleKey< CaloNoisem_noiseCDOKey {this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"}
 
SG::ReadHandleKey< xAOD::CaloClusterContainerm_caloClusterKey {this,"CaloClusterKey","","SG Key of Calo Cluster Collection"}
 
SG::ReadHandleKey< CaloCellContainerm_caloCellKey {this,"CaloCellKey","","SG Key of Calo Cell Container"}
 
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 51 of file METCaloRegionsTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ CaloRegions

Enumerator
EMB 
EME 
FCAL 
HEC 
PEMB 
PEME 
TILE 
REGIONS_TOTAL 

Definition at line 100 of file METCaloRegionsTool.h.

100  {
101  EMB = 0,
102  EME,
103  FCAL,
104  HEC,
105  PEMB,
106  PEME,
107  TILE,
109  };

Constructor & Destructor Documentation

◆ METCaloRegionsTool() [1/2]

met::METCaloRegionsTool::METCaloRegionsTool ( const std::string &  name)

Definition at line 55 of file METCaloRegionsTool.cxx.

55  :
56  AsgTool(name)
57  {
58  }

◆ ~METCaloRegionsTool()

met::METCaloRegionsTool::~METCaloRegionsTool ( )
default

◆ METCaloRegionsTool() [2/2]

met::METCaloRegionsTool::METCaloRegionsTool ( )
private

Member Function Documentation

◆ accept()

bool met::METCaloRegionsTool::accept ( const xAOD::IParticle object) const
protected

◆ 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 met::METCaloRegionsTool::execute ( xAOD::MissingET metTerm,
xAOD::MissingETComponentMap metMap 
) const
overridevirtual

Implements IMETToolBase.

Definition at line 80 of file METCaloRegionsTool.cxx.

81  {
82 
83  ATH_MSG_DEBUG ("In execute: " << name() << "...");
84 
85  // Create the container and push back the new MET terms
87  MissingETContainer* metCont = static_cast<MissingETContainer*>( metTerm_EMB->container() );
88 
89  // Push region terms to the container
90  for( int i=0; i < REGIONS_TOTAL; ++i) {
91  // Create the new terms
92  if( i > 0 ) {
93  metCont->push_back( new MissingET(0.,0.,0.) );
94  }
95  // Set Name and Source
96  metCont->at(i)->setName( s_CaloRegionNames[i] );
97  metCont->at(i)->setSource( source );
98  }
99  // The last term is Trigger MET if asked for by the user
101  std::string termName = "";
102  for( int i=0; i<3; ++i) {
103  switch(i) {
104  case 0: termName = "AllCells"; break;
105  case 1: termName = "Cells_Abs2S"; break;
106  case 2: termName = "Cells_Abs2S_m5S"; break;
107  }
108  metCont->push_back( new MissingET(0.,0.,0.) );
109  metCont->at(REGIONS_TOTAL+i)->setName( termName );
111  }
112  }
113 
114  StatusCode sc = StatusCode::SUCCESS;
115 
116  // Either Cells or Clusters
117  if(m_calo_useCells) {
118  // Retrieve the cell container
120 
121  #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
122  #else
123  if (!caloCellCont.isValid()) {
124  ATH_MSG_WARNING("Couldn't set up ReadHandle for Calo Cell Container "<<m_caloCellKey.key());
125  ATH_MSG_WARNING("Unable to retrieve input cell cluster container");
126  return StatusCode::SUCCESS;
127 
128  }
129  #endif
130  // Fill MET
131  sc = fillCellMet(metCont,caloCellCont.cptr());
132  } else {
133  // Retrieve the calo container
135  if (!caloClusCont.isValid()) {
136  ATH_MSG_WARNING("Unable to retrieve input calo cluster container"<<m_caloClusterKey.key());
137  return StatusCode::SUCCESS;
138 
139  }
140  // Fill MET
141  sc=fillClusterMet(metCont,caloClusCont.cptr());
142  } // end if use clusters if/else
143 
144  // Debug information
145  for( int i=0; i < REGIONS_TOTAL; ++i) {
146  MissingET* currentTerm = (MissingET*) metCont->at(i);
147  if(!currentTerm) continue;
148  ATH_MSG_DEBUG ( "MET Calo term name " << currentTerm->name() <<
149  ", source " << currentTerm->source() <<
150  ", mpx " << currentTerm->mpx() <<
151  ", mpy " << currentTerm->mpy() <<
152  ", met " << currentTerm->met() <<
153  ", sumet " << currentTerm->sumet()
154  );
155  } // end debug information
156 
157  if(sc.isFailure()) {
158  ATH_MSG_WARNING("Unable to fill cell/cluster MET");
159  }
160 
161  return StatusCode::SUCCESS;
162  }

◆ 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

◆ fillCellMet()

StatusCode met::METCaloRegionsTool::fillCellMet ( xAOD::MissingETContainer metContainer,
const CaloCellContainer caloCellContainer 
) const
protected

Definition at line 211 of file METCaloRegionsTool.cxx.

213  {
214  #if defined (XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
215  ATH_MSG_WARNING("Cell information is only available in athena framework");
216  #else
218  const CaloNoise* noiseCDO=*noiseHdl;
219  // Loop over all cells
220  for (const CaloCell* cell : *caloCellContainer) {
221 
222  // Retrieve the sampling
223  CaloSampling::CaloSample sample = (CaloSampling::CaloSample) cell->caloDDE()->getSampling();
224 
225  // Calculate Et/phi
226  double e_cell = cell->energy();
227  double et_cell = e_cell/cosh(cell->eta());
228  double phi_cell = cell->phi();
229 
230  // Find the associated MET
231  MissingET* metTerm = findMetTerm(metContainer, sample);
232  if(!metTerm) {
233  ATH_MSG_WARNING("Invalid calo sample MET pointer");
234  continue;
235  }
236 
237  // Add to MET for the Calo regions
238  metTerm->add(et_cell*cos(phi_cell),
239  et_cell*sin(phi_cell),
240  et_cell);
241 
242  // Trigger MET
243  if(m_calo_doTriggerMet) {
244  #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
245  double noise_cell = 0;
246  #else
247  double noise_cell = noiseCDO->getNoise(cell->ID(),cell->gain());
248  #endif
249  // All cells
250  metContainer->at(REGIONS_TOTAL)->add(et_cell*cos(phi_cell),
251  et_cell*sin(phi_cell),
252  et_cell);
253  // |E| > 2*sigma
254  if( fabs(e_cell) < 2.0*noise_cell ) continue;
255  metContainer->at(REGIONS_TOTAL+1)->add(et_cell*cos(phi_cell),
256  et_cell*sin(phi_cell),
257  et_cell);
258  // E > -5*sigma
259  if( e_cell < -5.0*noise_cell ) continue;
260  metContainer->at(REGIONS_TOTAL+2)->add(et_cell*cos(phi_cell),
261  et_cell*sin(phi_cell),
262  et_cell);
263  }
264  } // end of loop overall cells
265  #endif
266  return StatusCode::SUCCESS;
267  } // end of fillCellMet

◆ fillClusterMet()

StatusCode met::METCaloRegionsTool::fillClusterMet ( xAOD::MissingETContainer metContainer,
const xAOD::CaloClusterContainer caloClusContainer 
) const
protected

Definition at line 270 of file METCaloRegionsTool.cxx.

272  {
273 
274  // Loop over all clusters
275  for(const auto *iClus : *caloClusContainer) {
276  // Loop over all samplings
277  for(int iSample=CaloSampling::PreSamplerB;
278  iSample<=CaloSampling::FCAL2; ++iSample) {
279 
281 
282  // Eta is only defined if Energy != 0
283  if(fabs(iClus->eSample(sample))>0) {
284 
285  // Calculate Et/phi
286  double et_sample = iClus->eSample(sample)/cosh(iClus->etaSample(sample));
287  double phi_sample = iClus->phiSample(sample);
288 
289  // Find the associated MET
290  MissingET* metTerm = findMetTerm(metContainer, sample);
291  if(!metTerm) {
292  ATH_MSG_WARNING("Invalid calo sample MET pointer");
293  continue;
294  }
295 
296  // Add to MET
297  metTerm->add(et_sample*cos(phi_sample),
298  et_sample*sin(phi_sample),
299  et_sample);
300  } // end of energy>0 if
301  } // end of loop over samplings
302  } // end of loop over clusters
303  return StatusCode::SUCCESS;
304  } // end of fillClusterMet

◆ findMetTerm()

MissingET * met::METCaloRegionsTool::findMetTerm ( xAOD::MissingETContainer metContainer,
CaloSampling::CaloSample  sample 
)
staticprotected

Definition at line 165 of file METCaloRegionsTool.cxx.

166  {
167  switch(sample) {
168  case CaloSampling::EMB1:
169  case CaloSampling::EMB2:
170  case CaloSampling::EMB3:
171  return metContainer->at(EMB);
172  //
173  case CaloSampling::EME1:
174  case CaloSampling::EME2:
175  case CaloSampling::EME3:
176  return metContainer->at(EME);
177  //
178  case CaloSampling::FCAL0:
179  case CaloSampling::FCAL1:
180  case CaloSampling::FCAL2:
181  return metContainer->at(FCAL);
182  //
183  case CaloSampling::HEC0:
184  case CaloSampling::HEC1:
185  case CaloSampling::HEC2:
186  case CaloSampling::HEC3:
187  return metContainer->at(HEC);
188  //
190  return metContainer->at(PEMB);
191  //
193  return metContainer->at(PEME);
194  //
204  return metContainer->at(TILE);
205  //
206  default: return nullptr;
207  }
208  }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode met::METCaloRegionsTool::initialize ( )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 62 of file METCaloRegionsTool.cxx.

63  {
64  ATH_MSG_DEBUG("Initializing " << name() << "...");
65 
66  #if !defined(XAOD_STANDALONE) && !defined(XAOD_ANALYSIS)
68  #endif
69  // Either Cells or Clusters
72 
73  return StatusCode::SUCCESS;
74  }

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

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

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

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

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

◆ resolveOverlap()

bool met::METCaloRegionsTool::resolveOverlap ( const xAOD::IParticle object,
xAOD::MissingETComponentMap metMap,
std::vector< const xAOD::IParticle * > &  acceptedSignals,
MissingETBase::Types::weight_t objWeight 
) const
protected

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

Gaudi::Property<bool> met::METCaloRegionsTool::m_calo_doTriggerMet {this, "DoTriggerMET", true, ""}
protected

Definition at line 82 of file METCaloRegionsTool.h.

◆ m_calo_useCells

Gaudi::Property<bool> met::METCaloRegionsTool::m_calo_useCells {this, "UseCells", true, ""}
protected

Definition at line 81 of file METCaloRegionsTool.h.

◆ m_caloCellKey

SG::ReadHandleKey<CaloCellContainer> met::METCaloRegionsTool::m_caloCellKey {this,"CaloCellKey","","SG Key of Calo Cell Container"}
private

Definition at line 122 of file METCaloRegionsTool.h.

◆ m_caloClusterKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> met::METCaloRegionsTool::m_caloClusterKey {this,"CaloClusterKey","","SG Key of Calo Cluster Collection"}
private

Definition at line 121 of file METCaloRegionsTool.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_input_data_key

std::string met::METCaloRegionsTool::m_input_data_key
protected

Definition at line 79 of file METCaloRegionsTool.h.

◆ m_noiseCDOKey

SG::ReadCondHandleKey<CaloNoise> met::METCaloRegionsTool::m_noiseCDOKey {this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"}
private

Definition at line 119 of file METCaloRegionsTool.h.

◆ m_output_met_key

std::string met::METCaloRegionsTool::m_output_met_key
protected

Definition at line 80 of file METCaloRegionsTool.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.

◆ s_CaloRegionNames

const std::string met::METCaloRegionsTool::s_CaloRegionNames
staticprotected
Initial value:
=
{
"EMB",
"EME",
"FCAL",
"HEC",
"PEMB",
"PEME",
"TILE"
}

Definition at line 111 of file METCaloRegionsTool.h.


The documentation for this class was generated from the following files:
MissingETContainer
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingETContainer.h:22
met::METCaloRegionsTool::findMetTerm
static xAOD::MissingET * findMetTerm(xAOD::MissingETContainer *metContainer, CaloSampling::CaloSample sample)
Definition: METCaloRegionsTool.cxx:165
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
met::METCaloRegionsTool::REGIONS_TOTAL
@ REGIONS_TOTAL
Definition: METCaloRegionsTool.h:108
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
met::METCaloRegionsTool::EME
@ EME
Definition: METCaloRegionsTool.h:102
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
met::METCaloRegionsTool::m_calo_doTriggerMet
Gaudi::Property< bool > m_calo_doTriggerMet
Definition: METCaloRegionsTool.h:82
met::METCaloRegionsTool::PEME
@ PEME
Definition: METCaloRegionsTool.h:106
met::METCaloRegionsTool::HEC
@ HEC
Definition: METCaloRegionsTool.h:104
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
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
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
CaloNoise::getNoise
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition: CaloNoise.h:34
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
met::METCaloRegionsTool::s_CaloRegionNames
static const std::string s_CaloRegionNames[]
Definition: METCaloRegionsTool.h:111
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
met::METCaloRegionsTool::EMB
@ EMB
Definition: METCaloRegionsTool.h:101
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition: AsgTool.cxx:58
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
lumiFormat.i
int i
Definition: lumiFormat.py:85
met::METCaloRegionsTool::m_caloClusterKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterKey
Definition: METCaloRegionsTool.h:121
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
met::METCaloRegionsTool::m_calo_useCells
Gaudi::Property< bool > m_calo_useCells
Definition: METCaloRegionsTool.h:81
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
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
MissingETBase::Source::Category::Calo
@ Calo
Indicator for MET terms reconstructed from calorimeter signals alone.
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::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
MissingET
Athena::TPCnvVers::Old Athena::TPCnvVers::Old MissingET
Definition: RecTPCnv.cxx:64
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
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
CaloNoise
Definition: CaloNoise.h:16
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MissingET::add
virtual void add(double theEx, double theEy, double theEt, double theEta, double weight)
Definition: MissingET.cxx:127
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
met::METCaloRegionsTool::fillCellMet
StatusCode fillCellMet(xAOD::MissingETContainer *metContainer, const CaloCellContainer *caloCellContainer) const
Definition: METCaloRegionsTool.cxx:211
met::METCaloRegionsTool::m_noiseCDOKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Definition: METCaloRegionsTool.h:119
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
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
MissingET
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:23
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MissingETBase::Source::clusterEM
static Types::bitmask_t clusterEM(Region reg=Region::FullAcceptance)
Bit mask for MET term from EMTopo signal objects.
Definition: MissingETBase.h:305
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
copySelective.source
string source
Definition: copySelective.py:32
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
MissingET::sumet
virtual double sumet() const
Definition: MissingET.cxx:149
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
SG::DataProxy
Definition: DataProxy.h:45
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
met::METCaloRegionsTool::m_caloCellKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellKey
Definition: METCaloRegionsTool.h:122
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
met::METCaloRegionsTool::TILE
@ TILE
Definition: METCaloRegionsTool.h:107
fitman.k
k
Definition: fitman.py:528
met::METCaloRegionsTool::PEMB
@ PEMB
Definition: METCaloRegionsTool.h:105
met::METCaloRegionsTool::fillClusterMet
StatusCode fillClusterMet(xAOD::MissingETContainer *metContainer, const xAOD::CaloClusterContainer *caloClusContainer) const
Definition: METCaloRegionsTool.cxx:270
met::METCaloRegionsTool::FCAL
@ FCAL
Definition: METCaloRegionsTool.h:103