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

#include <METMakerAlg.h>

Inheritance diagram for met::METMakerAlg:
Collaboration diagram for met::METMakerAlg:

Public Member Functions

 METMakerAlg (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
virtual ~METMakerAlg ()
 Destructor: More...
 
virtual StatusCode initialize () override
 Athena algorithm's Hooks. More...
 
virtual StatusCode execute () override
 
virtual StatusCode finalize () override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. 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 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

 METMakerAlg ()
 Default constructor: More...
 
virtual bool accept (const xAOD::Electron *el)
 
virtual bool accept (const xAOD::Photon *ph)
 
virtual bool accept (const xAOD::TauJet *tau)
 
virtual bool accept (const xAOD::Muon *muon)
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

std::string m_softclname
 
std::string m_softtrkname
 
SG::ReadHandleKey< xAOD::ElectronContainerm_ElectronContainerKey
 
SG::ReadHandleKey< xAOD::PhotonContainerm_PhotonContainerKey
 
SG::ReadHandleKey< xAOD::TauJetContainerm_TauJetContainerKey
 
SG::ReadHandleKey< xAOD::MuonContainerm_MuonContainerKey
 
SG::ReadHandleKey< xAOD::JetContainerm_JetContainerKey
 
SG::ReadHandleKey< xAOD::MissingETContainerm_CoreMetKey
 
SG::WriteHandleKey< xAOD::MissingETContainerm_metKey
 
SG::ReadHandleKey< xAOD::MissingETAssociationMapm_metMapKey
 
bool m_doTruthLep
 
ToolHandle< IMETMakerm_metmaker
 Athena configured tools. More...
 
ToolHandle< CP::IMuonSelectionToolm_muonSelTool
 
ToolHandle< IAsgElectronLikelihoodToolm_elecSelLHTool
 
ToolHandle< IAsgPhotonIsEMSelectorm_photonSelIsEMTool
 
ToolHandle< TauAnalysisTools::ITauSelectionToolm_tauSelTool
 

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
 
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 42 of file METMakerAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ METMakerAlg() [1/2]

met::METMakerAlg::METMakerAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Constructor with parameters:

Definition at line 30 of file METMakerAlg.cxx.

32  : ::AthAlgorithm( name, pSvcLocator ),
33  m_metKey(""),
34  m_metmaker(this),
35  m_muonSelTool(this,""),
36  m_elecSelLHTool(this,""),
37  m_photonSelIsEMTool(this,""),
38  m_tauSelTool(this,"")
39 
40  {
41  declareProperty( "Maker", m_metmaker );
42  declareProperty( "METCoreName", m_CoreMetKey = "MET_Core" );
43  declareProperty("METName", m_metKey = std::string("MET_Reference"),"MET container");
44  declareProperty("METMapName", m_metMapKey = "METAssoc" );
45 
46  declareProperty( "METSoftClName", m_softclname = "SoftClus" );
47  declareProperty( "METSoftTrkName", m_softtrkname = "PVSoftTrk" );
48 
49  declareProperty( "InputJets", m_JetContainerKey = "AntiKt4LCTopoJets" );
50  declareProperty( "InputElectrons", m_ElectronContainerKey = "Electrons" );
51  declareProperty( "InputPhotons", m_PhotonContainerKey = "Photons" );
52  declareProperty( "InputTaus", m_TauJetContainerKey = "TauJets" );
53  declareProperty( "InputMuons", m_MuonContainerKey = "Muons" );
54 
55  declareProperty( "MuonSelectionTool", m_muonSelTool );
56  declareProperty( "ElectronLHSelectionTool", m_elecSelLHTool );
57  declareProperty( "PhotonIsEMSelectionTool" , m_photonSelIsEMTool );
58  declareProperty( "TauSelectionTool", m_tauSelTool );
59 
60  declareProperty( "DoTruthLeptons", m_doTruthLep = false );
61 
62  }

◆ ~METMakerAlg()

met::METMakerAlg::~METMakerAlg ( )
virtualdefault

Destructor:

◆ METMakerAlg() [2/2]

met::METMakerAlg::METMakerAlg ( )
protected

Default constructor:

Member Function Documentation

◆ accept() [1/4]

bool met::METMakerAlg::accept ( const xAOD::Electron el)
protectedvirtual

Definition at line 286 of file METMakerAlg.cxx.

287  {
288  if( fabs(el->eta())>2.47 || el->pt()<10e3 ) return false;
289  return static_cast<bool> (m_elecSelLHTool->accept(el));
290  }

◆ accept() [2/4]

bool met::METMakerAlg::accept ( const xAOD::Muon muon)
protectedvirtual

Definition at line 280 of file METMakerAlg.cxx.

281  {
282  if( mu->pt()<2.5e3 || mu->pt()/cosh(mu->eta())<4e3 ) return false;
283  return static_cast<bool>(m_muonSelTool->accept(*mu));
284  }

◆ accept() [3/4]

bool met::METMakerAlg::accept ( const xAOD::Photon ph)
protectedvirtual

Definition at line 292 of file METMakerAlg.cxx.

293  {
294  if( !(ph->author()&20) || fabs(ph->eta())>2.47 || ph->pt()<10e3 ) return false;
295  return static_cast<bool> (m_photonSelIsEMTool->accept(ph));
296  }

◆ accept() [4/4]

bool met::METMakerAlg::accept ( const xAOD::TauJet tau)
protectedvirtual

Definition at line 298 of file METMakerAlg.cxx.

299  {
300  // std::cout<<"Just checking this works -> tau pt is "<<tau->pt()<<std::endl;
301 
302  return static_cast<bool>(m_tauSelTool->accept( *tau ));
303  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< 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< 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< 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< 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< 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< 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< 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< 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< 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< 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< 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< 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< 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 met::METMakerAlg::execute ( )
overridevirtual

MET

Jets

Electrons

Photons

Taus

Muons

Definition at line 120 of file METMakerAlg.cxx.

120  {
121  ATH_MSG_VERBOSE("Executing " << name() << "...");
122 
123  // Create a MissingETContainer with its aux store
124  auto ctx = getContext();
125  auto metHandle= SG::makeHandle (m_metKey,ctx);
126  ATH_CHECK( metHandle.record (std::make_unique<xAOD::MissingETContainer>(), std::make_unique<xAOD::MissingETAuxContainer>()) );
127  xAOD::MissingETContainer* newMet=metHandle.ptr();
128 
130  if (!metMap.isValid()) {
131  ATH_MSG_WARNING("Unable to retrieve MissingETAssociationMap: " << m_metMapKey.key());
132  return StatusCode::FAILURE;
133  }
134 
135  MissingETAssociationHelper metHelper(&(*metMap));
136  // Retrieve containers ***********************************************
137 
140  if (!coreMet.isValid()) {
141  ATH_MSG_WARNING("Unable to retrieve MissingETContainer: " << m_CoreMetKey.key());
142  return StatusCode::FAILURE;
143  }
144 
145 
148  if (!Jets.isValid()) {
149  ATH_MSG_WARNING("Unable to retrieve JetContainer: " << Jets.key());
150  return StatusCode::FAILURE;
151  }
152 
155  if (!Electrons.isValid()) {
156  ATH_MSG_WARNING("Unable to retrieve ElectronContainer: " << Electrons.key());
157  return StatusCode::FAILURE;
158  }
159 
162  if (!Gamma.isValid()) {
163  ATH_MSG_WARNING("Unable to retrieve GammaContainer: " << Gamma.key());
164  return StatusCode::FAILURE;
165  }
166 
169  if (!TauJets.isValid()) {
170  ATH_MSG_WARNING("Unable to retrieve TauJetContainer: " << TauJets.key());
171  return StatusCode::FAILURE;
172  }
173 
176  if (!Muons.isValid()) {
177  ATH_MSG_WARNING("Unable to retrieve MuonContainer: " << Muons.key());
178  return StatusCode::FAILURE;
179  }
180 
181  // Select and flag objects for final MET building ***************************
182 
185  // Electrons
188  for(const auto *const el : *Electrons) {
189  if(accept(el)) {
190  metElectrons.push_back(el);
191 
192  }
193  }
194  if( m_metmaker->rebuildMET("RefEle", xAOD::Type::Electron, newMet,
195  metElectrons.asDataVector(),
196  metHelper, objScale).isFailure() ) {
197  ATH_MSG_WARNING("Failed to build electron term.");
198  }
199  ATH_MSG_DEBUG("Selected " << metElectrons.size() << " MET electrons. "
200  << acc_constitObjLinks(*(*newMet)["RefEle"]).size() << " are non-overlapping.");
201  }
202 
203  // Photons
204  if(!m_PhotonContainerKey.empty()) {
206  for(const auto *const ph : *Gamma) {
207  if(accept(ph)) {
208  metPhotons.push_back(ph);
209  }
210  }
211  if( m_metmaker->rebuildMET("RefGamma", xAOD::Type::Photon, newMet,
212  metPhotons.asDataVector(),
213  metHelper, objScale).isFailure() ) {
214  ATH_MSG_WARNING("Failed to build photon term.");
215  }
216  ATH_MSG_DEBUG("Selected " << metPhotons.size() << " MET photons. "
217  << acc_constitObjLinks(*(*newMet)["RefGamma"]).size() << " are non-overlapping.");
218  }
219 
220  // Taus
221  if(!m_TauJetContainerKey.empty()) {
223  for(const auto *const tau : *TauJets) {
224  if(accept(tau)) {
225  metTaus.push_back(tau);
226  }
227  }
228  if( m_metmaker->rebuildMET("RefTau", xAOD::Type::Tau, newMet,
229  metTaus.asDataVector(),
230  metHelper, objScale).isFailure() ){
231  ATH_MSG_WARNING("Failed to build tau term.");
232  }
233  ATH_MSG_DEBUG("Selected " << metTaus.size() << " MET taus. "
234  << acc_constitObjLinks(*(*newMet)["RefTau"]).size() << " are non-overlapping.");
235  }
236 
237  // Muons
238  if(!m_MuonContainerKey.empty()) {
240  for(const auto *const mu : *Muons) {
241  if(accept(mu)) {
242  metMuons.push_back(mu);
243  }
244  }
245 
247  if( m_metmaker->rebuildMET("Muons", xAOD::Type::Muon, newMet,
248  metMuons.asDataVector(),
249  metHelper, objScale).isFailure() ) {
250  ATH_MSG_WARNING("Failed to build muon term.");
251  }
252  ATH_MSG_DEBUG("Selected " << metMuons.size() << " MET muons. "
253  << acc_constitObjLinks(*(*newMet)["Muons"]).size() << " are non-overlapping.");
254  }
255 
256  if( m_metmaker->rebuildJetMET("RefJet", m_softclname, m_softtrkname, newMet,
257  Jets.cptr(), coreMet.cptr(), metHelper, false ).isFailure() ) {
258  ATH_MSG_WARNING("Failed to build jet and soft terms.");
259  }
260  ATH_MSG_DEBUG("Of " << Jets.cptr()->size() << " jets, "
261  << acc_constitObjLinks(*(*newMet)["RefJet"]).size() << " are non-overlapping, "
262  << acc_constitObjLinks(*(*newMet)[m_softtrkname]).size() << " are soft");
263 
265  if((*newMet)[m_softtrkname]) trksource = (*newMet)[m_softtrkname]->source();
266  if( buildMETSum("FinalTrk", newMet, trksource).isFailure() ){
267  ATH_MSG_WARNING("Building MET FinalTrk sum failed.");
268  }
270  if((*newMet)[m_softclname]) clsource = (*newMet)[m_softclname]->source();
271  if( buildMETSum("FinalClus", newMet, clsource).isFailure() ) {
272  ATH_MSG_WARNING("Building MET FinalClus sum failed.");
273  }
274 
275  return StatusCode::SUCCESS;
276  }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode met::METMakerAlg::finalize ( )
overridevirtual

Definition at line 113 of file METMakerAlg.cxx.

113  {
114  ATH_MSG_INFO ("Finalizing " << name() << "...");
115  return StatusCode::SUCCESS;
116  }

◆ initialize()

StatusCode met::METMakerAlg::initialize ( )
overridevirtual

Athena algorithm's Hooks.

Definition at line 70 of file METMakerAlg.cxx.

70  {
71  ATH_MSG_INFO("Initializing " << name() << "...");
72  ATH_MSG_INFO("Retrieving tools...");
73 
74  // retrieve tools
75  if( m_metmaker.retrieve().isFailure() ) {
76  ATH_MSG_ERROR("Failed to retrieve tool: " << m_metmaker->name());
77  return StatusCode::FAILURE;
78  };
79 
80  if( m_muonSelTool.retrieve().isFailure() ) {
81  ATH_MSG_ERROR("Failed to retrieve tool: " << m_muonSelTool->name());
82  return StatusCode::FAILURE;
83  };
84 
85  if( m_elecSelLHTool.retrieve().isFailure() ) {
86  ATH_MSG_ERROR("Failed to retrieve tool: " << m_elecSelLHTool->name());
87  return StatusCode::FAILURE;
88  };
89 
90  if( m_photonSelIsEMTool.retrieve().isFailure() ) {
91  ATH_MSG_ERROR("Failed to retrieve tool: " << m_photonSelIsEMTool->name());
92  return StatusCode::FAILURE;
93  };
94 
95  if( m_tauSelTool.retrieve().isFailure() ) {
96  ATH_MSG_ERROR("Failed to retrieve tool: " << m_tauSelTool->name());
97  return StatusCode::FAILURE;
98  };
100  ATH_CHECK( m_PhotonContainerKey.initialize() );
101  ATH_CHECK( m_TauJetContainerKey.initialize() );
102  ATH_CHECK( m_MuonContainerKey.initialize() );
103  ATH_CHECK( m_JetContainerKey.initialize() );
104  ATH_CHECK( m_CoreMetKey.initialize() );
105  ATH_CHECK( m_metKey.initialize() );
106  ATH_CHECK( m_metMapKey.initialize() );
107 
108  return StatusCode::SUCCESS;
109  }

◆ inputHandles()

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< 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_CoreMetKey

SG::ReadHandleKey<xAOD::MissingETContainer> met::METMakerAlg::m_CoreMetKey
protected

Definition at line 77 of file METMakerAlg.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doTruthLep

bool met::METMakerAlg::m_doTruthLep
protected

Definition at line 83 of file METMakerAlg.h.

◆ m_elecSelLHTool

ToolHandle<IAsgElectronLikelihoodTool> met::METMakerAlg::m_elecSelLHTool
protected

Definition at line 89 of file METMakerAlg.h.

◆ m_ElectronContainerKey

SG::ReadHandleKey<xAOD::ElectronContainer> met::METMakerAlg::m_ElectronContainerKey
protected

Definition at line 71 of file METMakerAlg.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_JetContainerKey

SG::ReadHandleKey<xAOD::JetContainer> met::METMakerAlg::m_JetContainerKey
protected

Definition at line 75 of file METMakerAlg.h.

◆ m_metKey

SG::WriteHandleKey<xAOD::MissingETContainer> met::METMakerAlg::m_metKey
protected

Definition at line 79 of file METMakerAlg.h.

◆ m_metmaker

ToolHandle<IMETMaker> met::METMakerAlg::m_metmaker
protected

Athena configured tools.

Definition at line 86 of file METMakerAlg.h.

◆ m_metMapKey

SG::ReadHandleKey<xAOD::MissingETAssociationMap> met::METMakerAlg::m_metMapKey
protected

Definition at line 80 of file METMakerAlg.h.

◆ m_MuonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> met::METMakerAlg::m_MuonContainerKey
protected

Definition at line 74 of file METMakerAlg.h.

◆ m_muonSelTool

ToolHandle<CP::IMuonSelectionTool> met::METMakerAlg::m_muonSelTool
protected

Definition at line 88 of file METMakerAlg.h.

◆ m_PhotonContainerKey

SG::ReadHandleKey<xAOD::PhotonContainer> met::METMakerAlg::m_PhotonContainerKey
protected

Definition at line 72 of file METMakerAlg.h.

◆ m_photonSelIsEMTool

ToolHandle<IAsgPhotonIsEMSelector> met::METMakerAlg::m_photonSelIsEMTool
protected

Definition at line 90 of file METMakerAlg.h.

◆ m_softclname

std::string met::METMakerAlg::m_softclname
protected

Definition at line 67 of file METMakerAlg.h.

◆ m_softtrkname

std::string met::METMakerAlg::m_softtrkname
protected

Definition at line 68 of file METMakerAlg.h.

◆ m_TauJetContainerKey

SG::ReadHandleKey<xAOD::TauJetContainer> met::METMakerAlg::m_TauJetContainerKey
protected

Definition at line 73 of file METMakerAlg.h.

◆ m_tauSelTool

ToolHandle<TauAnalysisTools::ITauSelectionTool> met::METMakerAlg::m_tauSelTool
protected

Definition at line 91 of file METMakerAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
met::METMakerAlg::m_softclname
std::string m_softclname
Definition: METMakerAlg.h:67
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
met::METMakerAlg::m_photonSelIsEMTool
ToolHandle< IAsgPhotonIsEMSelector > m_photonSelIsEMTool
Definition: METMakerAlg.h:90
MissingETBase::UsageHandler::PhysicsObject
@ PhysicsObject
Physics object based.
Definition: MissingETCompositionBase.h:187
MissingETBase::UsageHandler::TruthParticle
@ TruthParticle
Truth particle based.
Definition: MissingETCompositionBase.h:189
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Jets
Definition: Jets.py:1
xAOD::Egamma_v1::author
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
Definition: Egamma_v1.cxx:166
met::METMakerAlg::m_PhotonContainerKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_PhotonContainerKey
Definition: METMakerAlg.h:72
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
MissingETBase::Source::Signal::LCTopo
@ LCTopo
Indicator for MET contribution from TopoClusters with LCW calibration applied.
VP1PartSpect::Gamma
@ Gamma
Definition: VP1PartSpectFlags.h:22
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
met::METMakerAlg::m_tauSelTool
ToolHandle< TauAnalysisTools::ITauSelectionTool > m_tauSelTool
Definition: METMakerAlg.h:91
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
met::buildMETSum
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
Definition: METHelpers.cxx:64
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
met::METMakerAlg::m_elecSelLHTool
ToolHandle< IAsgElectronLikelihoodTool > m_elecSelLHTool
Definition: METMakerAlg.h:89
met::METMakerAlg::m_softtrkname
std::string m_softtrkname
Definition: METMakerAlg.h:68
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
met::METMakerAlg::m_metKey
SG::WriteHandleKey< xAOD::MissingETContainer > m_metKey
Definition: METMakerAlg.h:79
met::METMakerAlg::accept
virtual bool accept(const xAOD::Electron *el)
Definition: METMakerAlg.cxx:286
met::METMakerAlg::m_TauJetContainerKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_TauJetContainerKey
Definition: METMakerAlg.h:73
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
met::METMakerAlg::m_metMapKey
SG::ReadHandleKey< xAOD::MissingETAssociationMap > m_metMapKey
Definition: METMakerAlg.h:80
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< 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
met::METMakerAlg::m_MuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Definition: METMakerAlg.h:74
met::METMakerAlg::m_CoreMetKey
SG::ReadHandleKey< xAOD::MissingETContainer > m_CoreMetKey
Definition: METMakerAlg.h:77
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
MissingETBase::UsageHandler::Policy
Policy
Policies on usage checks.
Definition: MissingETCompositionBase.h:182
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
met::METMakerAlg::m_muonSelTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelTool
Definition: METMakerAlg.h:88
MissingETBase::UsageHandler::OnlyTrack
@ OnlyTrack
Track based only.
Definition: MissingETCompositionBase.h:185
xAOD::MissingETAssociationHelper
Definition: MissingETAssociationHelper.h:26
met::METMakerAlg::m_doTruthLep
bool m_doTruthLep
Definition: METMakerAlg.h:83
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
Muon
struct TBPatternUnitContext Muon
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
MissingETBase::Source::Signal::Track
@ Track
Indicator for MET contribution from reconstructed charged particle tracks.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Muons
Definition: Muons.py:1
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
met::METMakerAlg::m_JetContainerKey
SG::ReadHandleKey< xAOD::JetContainer > m_JetContainerKey
Definition: METMakerAlg.h:75
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
xAODType::Tau
@ Tau
The object is a tau (jet)
Definition: ObjectType.h:49
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: Egamma_v1.cxx:70
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
met::METMakerAlg::m_ElectronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronContainerKey
Definition: METMakerAlg.h:71
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
met::METMakerAlg::m_metmaker
ToolHandle< IMETMaker > m_metmaker
Athena configured tools.
Definition: METMakerAlg.h:86
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >