ATLAS Offline Software
Loading...
Searching...
No Matches
met::METMuonAssociator Class Referencefinal

#include <METMuonAssociator.h>

Inheritance diagram for met::METMuonAssociator:
Collaboration diagram for met::METMuonAssociator:

Public Member Functions

 METMuonAssociator (const std::string &name)
 ~METMuonAssociator ()=default
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual StatusCode execute (xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap) const override
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

StatusCode executeTool (xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap) const final
StatusCode extractTopoClusters (const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &tclist, const met::METAssociator::ConstitHolder &constits) const final
StatusCode extractPFO (const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &pfolist, const met::METAssociator::ConstitHolder &constits, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &momenta) const final
StatusCode extractFE (const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &momenta) const final
StatusCode extractFEHR (const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > hardObjs, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &momenta, float &UEcorr) const final
StatusCode extractFEsFromLinks (const xAOD::Muon *mu, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits) const
StatusCode extractFEs (const xAOD::Muon *mu, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits) const
StatusCode extractTracks (const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &constlist, const met::METAssociator::ConstitHolder &constits) const final
StatusCode retrieveConstituents (met::METAssociator::ConstitHolder &constits) const
bool acceptTrack (const xAOD::TrackParticle *trk, const xAOD::Vertex *pv) const
bool isGoodEoverP (const xAOD::TrackParticle *trk) const
virtual StatusCode fillAssocMap (xAOD::MissingETAssociationMap *metMap, const xAOD::IParticleContainer *hardObjs) const
StatusCode GetUEcorr (const met::METAssociator::ConstitHolder &constits, std::vector< TLorentzVector > &v_clus, TLorentzVector &clus, TLorentzVector &HR, const float Drcone, const float MinDistCone, float &UEcorr) const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Static Protected Member Functions

static bool greaterPt (const xAOD::IParticle *part1, const xAOD::IParticle *part2)
static bool greaterPtPFO (const xAOD::PFO *part1, const xAOD::PFO *part2)
static bool greaterPtFE (const xAOD::FlowElement *part1, const xAOD::FlowElement *part2)

Protected Attributes

ToolHandle< InDet::IInDetTrackSelectionToolm_trkseltool
ToolHandle< xAOD::ITrackIsolationToolm_trkIsolationTool
ToolHandle< xAOD::ICaloTopoClusterIsolationToolm_caloIsolationTool
std::string m_neutralFELinksKey
std::string m_chargedFELinksKey
std::string m_neutralPFOLinksKey
std::string m_chargedPFOLinksKey
bool m_usePFOLinks
bool m_useFELinks
SG::ReadHandleKey< xAOD::VertexContainerm_pvcollKey {this,"PrimVxColl","PrimaryVertices","Primary Vertex Collection"}
SG::ReadHandleKey< xAOD::IParticleContainerm_clcollKey {this,"ClusColl","CaloCalTopoClusters","Topo cluster Collection"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trkcollKey {this,"TrkColl","InDetTrackParticles","Track particle Collection"}
SG::ReadHandleKey< xAOD::PFOContainerm_pfcollKey {this,"PFlowColl","","PFO Collection"}
SG::ReadHandleKey< xAOD::FlowElementContainerm_fecollKey {this,"FlowElementCollection","","FlowElement Collection (overrides PFO if not empty)"}
SG::ReadHandleKey< xAOD::IParticleContainerm_hybridContKey {this,"HybridKey","","Hybrid Collection"}
Gaudi::Property< boolm_recoil {this, "HRecoil", false, ""}
bool m_pflow
bool m_useTracks
bool m_useRapidity
bool m_useIsolationTools = false
bool m_useModifiedClus
bool m_weight_charged_pfo = false
bool m_cleanChargedPFO
bool m_skipconst
std::string m_forcoll
double m_foreta
double m_cenTrackPtThr
double m_forTrackPtThr

Private Member Functions

 METMuonAssociator ()
 Default constructor:

Private Attributes

Gaudi::Property< boolm_doMuonClusterMatch {this, "DoClusterMatch", true, ""}
SG::ReadHandleKey< xAOD::MuonContainerm_muContKey
SG::ReadDecorHandleKey< xAOD::MuonContainerm_neutralFEReadDecorKey
SG::ReadDecorHandleKey< xAOD::MuonContainerm_chargedFEReadDecorKey
SG::ReadDecorHandleKey< xAOD::CaloClusterContainerm_elementLinkName

Static Private Attributes

static constexpr float m_Drcone = 0.2
static constexpr float m_MinDistCone = 0.4

Detailed Description

Definition at line 22 of file METMuonAssociator.h.

Constructor & Destructor Documentation

◆ METMuonAssociator() [1/2]

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

Definition at line 41 of file METMuonAssociator.cxx.

41 :
44 {
45 }
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58

◆ ~METMuonAssociator()

met::METMuonAssociator::~METMuonAssociator ( )
default

◆ METMuonAssociator() [2/2]

met::METMuonAssociator::METMuonAssociator ( )
private

Default constructor:

Member Function Documentation

◆ acceptTrack()

bool met::METAssociator::acceptTrack ( const xAOD::TrackParticle * trk,
const xAOD::Vertex * pv ) const
protectedinherited

Definition at line 376 of file METAssociator.cxx.

377 {
378
379 if (!vx) return false;//in events with no pv, we will just reject all tracks, and therefore build only the calo MET
380 return static_cast<bool> (m_trkseltool->accept( *trk, vx ));
381 }
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkseltool

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

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

◆ evtStore()

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.

◆ execute()

StatusCode met::METAssociator::execute ( xAOD::MissingETContainer * metCont,
xAOD::MissingETAssociationMap * metMap ) const
overridevirtualinherited

Implements IMETAssocToolBase.

Definition at line 150 of file METAssociator.cxx.

151 {
152 ATH_MSG_DEBUG ("In execute: " << name() << "...");
153 if(!metCont) {
154 ATH_MSG_WARNING("Invalid pointer to MissingETContainer supplied! Abort.");
155 return StatusCode::FAILURE;
156 }
157
158 if(!metMap) {
159 ATH_MSG_WARNING("Invalid pointer to MissingETAssociationMap supplied! Abort.");
160 return StatusCode::FAILURE;
161 }
162 if(m_pflow && !m_useTracks ){
163 ATH_MSG_WARNING("Attempting to build PFlow MET without a track collection.");
164 return StatusCode::FAILURE;
165 }
166
167 return this->executeTool(metCont, metMap);
168 }
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
virtual StatusCode executeTool(xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap) const =0

◆ executeTool()

StatusCode met::METMuonAssociator::executeTool ( xAOD::MissingETContainer * metCont,
xAOD::MissingETAssociationMap * metMap ) const
finalprotectedvirtual

Implements met::METAssociator.

Definition at line 68 of file METMuonAssociator.cxx.

69 {
70 ATH_MSG_VERBOSE ("In execute: " << name() << "...");
71
72 SG::ReadHandle<xAOD::MuonContainer> muonCont(m_muContKey);
73 if (!muonCont.isValid()) {
74 ATH_MSG_WARNING("Unable to retrieve input muon container " << m_muContKey.key());
75 return StatusCode::FAILURE;
76 }
77
78 ATH_MSG_DEBUG("Successfully retrieved muon collection");
79 if (fillAssocMap(metMap,muonCont.cptr()).isFailure()) {
80 ATH_MSG_WARNING("Unable to fill map with muon container " << m_muContKey.key());
81 return StatusCode::FAILURE;
82 }
83 return StatusCode::SUCCESS;
84 }
#define ATH_MSG_VERBOSE(x)
virtual StatusCode fillAssocMap(xAOD::MissingETAssociationMap *metMap, const xAOD::IParticleContainer *hardObjs) const
SG::ReadHandleKey< xAOD::MuonContainer > m_muContKey

◆ extractFE()

StatusCode met::METMuonAssociator::extractFE ( const xAOD::IParticle * obj,
std::vector< const xAOD::IParticle * > & felist,
const met::METAssociator::ConstitHolder & constits,
std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > & momenta ) const
finalprotectedvirtual

Implements met::METAssociator.

Definition at line 204 of file METMuonAssociator.cxx.

208 {
209 const xAOD::Muon *mu = static_cast<const xAOD::Muon*>(obj);
210 if (m_useFELinks)
211 ATH_CHECK( extractFEsFromLinks(mu, felist,constits) );
212 else
213 ATH_CHECK( extractFEs(mu, felist, constits) );
214
215 return StatusCode::SUCCESS;
216 }
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode extractFEs(const xAOD::Muon *mu, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits) const
StatusCode extractFEsFromLinks(const xAOD::Muon *mu, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits) const
Muon_v1 Muon
Reference the current persistent version:

◆ extractFEHR()

StatusCode met::METMuonAssociator::extractFEHR ( const xAOD::IParticle * obj,
std::vector< const xAOD::IParticle * > hardObjs,
std::vector< const xAOD::IParticle * > & felist,
const met::METAssociator::ConstitHolder & constits,
std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > & momenta,
float & UEcorr ) const
finalprotectedvirtual

Reimplemented from met::METAssociator.

Definition at line 326 of file METMuonAssociator.cxx.

332 {
333 if(obj->type() != xAOD::Type::ObjectType::Muon){
334 UEcorr=0.0;
335 felist={};
336 return StatusCode::SUCCESS;
337 }
338 const xAOD::Muon* mu = static_cast<const xAOD::Muon*>(obj);
339
340 // Get PFOs associated to muons
341 for(const auto fe : *constits.feCont) {
342 if( fe->isCharged()) { // Fill list with charged PFOs (using muon tracks)
343 if( mu && P4Helpers::isInDeltaR(*fe, *mu, m_Drcone, m_useRapidity) && PVMatchedAcc(*fe) &&
344 ( !m_cleanChargedPFO || isGoodEoverP(static_cast<const xAOD::TrackParticle*>(fe->chargedObject(0))) ) ){
345 felist.push_back(fe);
346 }
347 }
348 else{ // Fill list with neutral PFOs (using muon clusters)
349 if( mu && P4Helpers::isInDeltaR(*fe, *mu, m_Drcone, m_useRapidity) ){
350 felist.push_back(fe);
351 }
352 } // neutral PFO condition
353 } // loop over all PFOs
354
355 // Calculating UE energy correction for a given lepton (using mu)
356 if(mu){
357 // Vectoral sum of all FE
358 TLorentzVector HR; // uncorrected HR (initialized with 0,0,0,0 automatically)
359 for(const auto fe_itr : *constits.feCont) {
360 if( fe_itr->pt() < 0 || fe_itr->e() < 0 ) { // sanity check
361 continue;
362 }
363
364 //remove charged FE that are not matched to the PV
365 if(fe_itr->isCharged() && !PVMatchedAcc(*fe_itr)){
366 continue;
367 }
368 HR += fe_itr->p4();
369 }
370
371 // Create vectors of muons
372 std::vector<const xAOD::Muon*> v_mu;
373 for(const auto& obj_i : hardObjs) {
374 if(obj_i->pt()<5e3 && obj_i->type() != xAOD::Type::Muon) { // sanity check
375 continue;
376 }
377 const xAOD::Muon* mu_curr = static_cast<const xAOD::Muon*>(obj_i); // current muon
378 v_mu.push_back(mu_curr);
379 }
380
381
382 // Subtracting PFOs matched to muons from HR
383 for(const auto fe_i : *constits.feCont) { // charged and neutral PFOs
384 if( fe_i->pt() < 0 || fe_i->e() < 0 ) { // sanity check
385 continue;
386 }
387 for(const auto& mu_i : v_mu) { // loop over muons
388 double dR = P4Helpers::deltaR( fe_i->eta(), fe_i->phi(), mu_i->eta(), mu_i->phi() );
389 if( dR < m_Drcone ) { // if PFO is in a cone around muon
390 HR -= fe_i->p4();
391 break;
392 } // cone requirement
393 } // over v_mu
394 } // over PFOs
395
396 // Save v_mu as a vector TLV (as commonn type for electrons and muons)
397 std::vector<TLorentzVector> v_muTLV;
398 v_muTLV.reserve(v_mu.size());
399 for(const auto& mu_i : v_mu) { // loop over v_mu
400 v_muTLV.push_back( mu_i->p4() );
401 }
402
403 // Save current mu as TLV
404 TLorentzVector muTLV = mu->p4();
405
406 // Get UE correction
407 ATH_CHECK( GetUEcorr(constits, v_muTLV, muTLV, HR, m_Drcone, m_MinDistCone, UEcorr) );
408 } // available mu requirement
409
410
411 return StatusCode::SUCCESS;
412 }
bool isGoodEoverP(const xAOD::TrackParticle *trk) const
StatusCode GetUEcorr(const met::METAssociator::ConstitHolder &constits, std::vector< TLorentzVector > &v_clus, TLorentzVector &clus, TLorentzVector &HR, const float Drcone, const float MinDistCone, float &UEcorr) const
static constexpr float m_Drcone
static constexpr float m_MinDistCone
static const SG::ConstAccessor< char > PVMatchedAcc("matchedToPV")
@ Muon
The object is a muon.
Definition ObjectType.h:48
bool isInDeltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2, double dR, bool useRapidity=true)
Check if 2 xAOD::IParticle are in a cone.
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
TrackParticle_v1 TrackParticle
Reference the current persistent version:
const xAOD::FlowElementContainer * feCont

◆ extractFEs()

StatusCode met::METMuonAssociator::extractFEs ( const xAOD::Muon * mu,
std::vector< const xAOD::IParticle * > & felist,
const met::METAssociator::ConstitHolder & constits ) const
protected

Definition at line 265 of file METMuonAssociator.cxx.

268 {
269 const TrackParticle* idtrack = mu->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
270 const CaloCluster* muclus = mu->cluster();
271 ATH_MSG_VERBOSE("Muon " << mu->index() << " with pt " << mu->pt()
272 << ", eta " << mu->eta()
273 << ", phi " << mu->phi());
274 if(muclus) {
275 ATH_MSG_VERBOSE(" has cluster with "
276 << "eta " << muclus->calEta()
277 << ", phi " << muclus->calPhi()
278 << ", E " << muclus->calE()
279 << " formed of " << muclus->size() << " cells.");
280 }
281 ATH_MSG_VERBOSE("Muon Eloss type: " << mu->energyLossType()
282 << " Eloss: " << mu->floatParameter(xAOD::Muon::EnergyLoss)
283 << " MeasuredEloss: " << mu->floatParameter(xAOD::Muon::MeasEnergyLoss)
284 << " FSR E: " << mu->floatParameter(xAOD::Muon::FSR_CandidateEnergy) );
285
286 // One loop over PFOs
287 for(const xAOD::FlowElement* fe : *constits.feCont) {
288 if(fe->isCharged()) {
289 // get charged FEs by matching the muon ID track
290 // We set a small -ve pt for cPFOs that were rejected
291 // by the ChargedHadronSubtractionTool
292 const static SG::AuxElement::ConstAccessor<char> PVMatchedAcc("matchedToPV");
293 if(idtrack && fe->chargedObject(0) == idtrack && PVMatchedAcc(*fe) &&
294 ( !m_cleanChargedPFO || isGoodEoverP(static_cast<const xAOD::TrackParticle*>(fe->chargedObject(0))) )
295 ) {
296 ATH_MSG_VERBOSE("Accept muon PFO (FE) " << fe << " px, py = " << fe->p4().Px() << ", " << fe->p4().Py());
297 ATH_MSG_VERBOSE("Muon PFO index: " << fe->index() << ", pt: " << fe->pt() << ", eta: " << fe->eta() << ", phi: " << fe->phi() );
298 ATH_MSG_VERBOSE("Muon ID Track index: " << idtrack->index() << ", pt: " << idtrack->pt() << ", eta: " << idtrack->eta() << ", phi: " << idtrack->phi() );
299 felist.push_back(fe);
300 break;
301 } // track match
302 } else {
303 // get neutral PFOs by matching the muon cluster
304 if(muclus && m_doMuonClusterMatch) {
305
306 SG::ReadDecorHandle<CaloClusterContainer, std::vector<ElementLink<CaloClusterContainer> > > tcLinkAcc(m_elementLinkName);
307 for(const auto& matchel : tcLinkAcc(*muclus)) {
308 if(!matchel.isValid()) {
309 ATH_MSG_DEBUG("Invalid muon-cluster elementLink");
310 } else {
311 if((*matchel)->e()>FLT_MIN && fe->otherObject(0) == *matchel) { // +ve E && matches cluster
312 ATH_MSG_VERBOSE("Tool found cluster " << (*matchel)->index() << " with pt " << (*matchel)->pt() );
313 felist.push_back(fe);
314 }
315 }
316 }
317 } // muon has linked cluster
318 }
319 } // end of cluster loop
320
321 return StatusCode::SUCCESS;
322 }
size_t index() const
Return the index of this element within its container.
Gaudi::Property< bool > m_doMuonClusterMatch
SG::ReadDecorHandleKey< xAOD::CaloClusterContainer > m_elementLinkName
virtual double pt() const override
virtual double phi() const override
The azimuthal angle ( ) of the particle.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
const xAOD::IParticle * chargedObject(std::size_t i) const
const xAOD::IParticle * otherObject(std::size_t i) const
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16

◆ extractFEsFromLinks()

StatusCode met::METMuonAssociator::extractFEsFromLinks ( const xAOD::Muon * mu,
std::vector< const xAOD::IParticle * > & felist,
const met::METAssociator::ConstitHolder & constits ) const
protected

Definition at line 218 of file METMuonAssociator.cxx.

221 {
222 ATH_MSG_DEBUG("Extract FEs From Links for " << mu->type() << " with pT " << mu->pt());
223
224 std::vector<FELink_t> nFELinks;
225 std::vector<FELink_t> cFELinks;
226
227 SG::ReadDecorHandle<xAOD::MuonContainer, std::vector<FELink_t> > neutralFEReadDecorHandle (m_neutralFEReadDecorKey);
228 SG::ReadDecorHandle<xAOD::MuonContainer, std::vector<FELink_t> > chargedFEReadDecorHandle (m_chargedFEReadDecorKey);
229 nFELinks=neutralFEReadDecorHandle(*mu);
230 cFELinks=chargedFEReadDecorHandle(*mu);
231
232 // Charged FEs
233 for (const FELink_t& feLink : cFELinks) {
234 if (!feLink.isValid()) continue;
235 const xAOD::FlowElement* fe_init = *feLink;
236 for (const auto *const fe : *constits.feCont){
237 if (fe->index() == fe_init->index() && fe->isCharged()){ //index-based match between JetETmiss and CHSFlowElements collections
238 const static SG::AuxElement::ConstAccessor<char> PVMatchedAcc("matchedToPV");
239 if( fe->isCharged() && PVMatchedAcc(*fe)&& ( !m_cleanChargedPFO || isGoodEoverP(static_cast<const xAOD::TrackParticle*>(fe->chargedObject(0))) ) ) {
240 ATH_MSG_DEBUG("Accept cFE with pt " << fe->pt() << ", e " << fe->e() << ", eta " << fe->eta() << ", phi " << fe->phi() );
241 felist.push_back(fe);
242 }
243 }
244 }
245 } // end cFE loop
246
247 // Neutral FEs
248 for (const FELink_t& feLink : nFELinks) {
249 if (!feLink.isValid()) continue;
250 const xAOD::FlowElement* fe_init = *feLink;
251 for (const auto *const fe : *constits.feCont){
252 if (fe->index() == fe_init->index() && !fe->isCharged()){ //index-based match between JetETmiss and CHSFlowElements collections
253 if( ( !fe->isCharged()&& fe->e() > FLT_MIN ) ){
254 ATH_MSG_DEBUG("Accept nFE with pt " << fe->pt() << ", e " << fe->e() << ", eta " << fe->eta() << ", phi " << fe->phi() << " in sum.");
255 felist.push_back(fe);
256 }
257 }
258 }
259 } // end nFE links loop
260
261
262 return StatusCode::SUCCESS;
263 }
ElementLink< xAOD::FlowElementContainer > FELink_t
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_neutralFEReadDecorKey
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_chargedFEReadDecorKey

◆ extractPFO()

StatusCode met::METMuonAssociator::extractPFO ( const xAOD::IParticle * obj,
std::vector< const xAOD::IParticle * > & pfolist,
const met::METAssociator::ConstitHolder & constits,
std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > & momenta ) const
finalprotectedvirtual

Implements met::METAssociator.

Definition at line 141 of file METMuonAssociator.cxx.

145 {
146 const xAOD::Muon *mu = static_cast<const xAOD::Muon*>(obj);
147 const TrackParticle* idtrack = mu->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
148 const CaloCluster* muclus = mu->cluster();
149
150 ATH_MSG_VERBOSE("Muon " << mu->index() << " with pt " << mu->pt()
151 << ", eta " << mu->eta()
152 << ", phi " << mu->phi());
153 if(muclus) {
154 ATH_MSG_VERBOSE(" has cluster with "
155 << "eta " << muclus->calEta()
156 << ", phi " << muclus->calPhi()
157 << ", E " << muclus->calE()
158 << " formed of " << muclus->size() << " cells.");
159 }
160 ATH_MSG_VERBOSE("Muon Eloss type: " << mu->energyLossType()
161 << " Eloss: " << mu->floatParameter(xAOD::Muon::EnergyLoss)
162 << " MeasuredEloss: " << mu->floatParameter(xAOD::Muon::MeasEnergyLoss)
163 << " FSR E: " << mu->floatParameter(xAOD::Muon::FSR_CandidateEnergy) );
164
165 // One loop over PFOs
166 for(const auto *const pfo : *constits.pfoCont) {
167 if(pfo->isCharged()) {
168 // get charged PFOs by matching the muon ID track
169 // We set a small -ve pt for cPFOs that were rejected
170 // by the ChargedHadronSubtractionTool
171 const static SG::AuxElement::ConstAccessor<char> PVMatchedAcc("matchedToPV");
172 if(idtrack && pfo->track(0) == idtrack && PVMatchedAcc(*pfo) &&
173 ( !m_cleanChargedPFO || isGoodEoverP(pfo->track(0)) )
174 ) {
175 ATH_MSG_VERBOSE("Accept muon PFO " << pfo << " px, py = " << pfo->p4().Px() << ", " << pfo->p4().Py());
176 ATH_MSG_VERBOSE("Muon PFO index: " << pfo->index() << ", pt: " << pfo->pt() << ", eta: " << pfo->eta() << ", phi: " << pfo->phi() );
177 ATH_MSG_VERBOSE("Muon ID Track index: " << idtrack->index() << ", pt: " << idtrack->pt() << ", eta: " << idtrack->eta() << ", phi: " << idtrack->phi() );
178 pfolist.push_back(pfo);
179 break;
180 } // track match
181 } else {
182 // get neutral PFOs by matching the muon cluster
183 if(muclus && m_doMuonClusterMatch) {
184
185 SG::ReadDecorHandle<CaloClusterContainer, std::vector<ElementLink<CaloClusterContainer> > > tcLinkAcc(m_elementLinkName);
186 for(const auto& matchel : tcLinkAcc(*muclus)) {
187 if(!matchel.isValid()) {
188 ATH_MSG_DEBUG("Invalid muon-cluster elementLink");
189 } else {
190 if((*matchel)->e()>FLT_MIN && pfo->cluster(0) == *matchel) { // +ve E && matches cluster
191 ATH_MSG_VERBOSE("Tool found cluster " << (*matchel)->index() << " with pt " << (*matchel)->pt() );
192 pfolist.push_back(pfo);
193 }
194 }
195 }
196 } // muon has linked cluster
197 }
198 } // end of cluster loop
199
200 return StatusCode::SUCCESS;
201 }
const xAOD::PFOContainer * pfoCont

◆ extractTopoClusters()

StatusCode met::METMuonAssociator::extractTopoClusters ( const xAOD::IParticle * obj,
std::vector< const xAOD::IParticle * > & tclist,
const met::METAssociator::ConstitHolder & constits ) const
finalprotectedvirtual

Implements met::METAssociator.

Definition at line 88 of file METMuonAssociator.cxx.

91 {
92 const xAOD::Muon *mu = static_cast<const xAOD::Muon*>(obj);
93 const CaloCluster* muclus = mu->cluster();
94 if(muclus && m_doMuonClusterMatch) {
95 ATH_MSG_VERBOSE("Muon " << mu->index() << " with pt " << mu->pt()
96 << ", eta " << mu->eta()
97 << ", phi " << mu->phi()
98 << " has cluster with "
99 << "eta " << muclus->calEta()
100 << ", phi " << muclus->calPhi()
101 << ", E " << muclus->calE()
102 << " formed of " << muclus->size() << " cells.");
103 ATH_MSG_VERBOSE("Muon Eloss type: " << mu->energyLossType()
104 << " Eloss: " << mu->floatParameter(xAOD::Muon::EnergyLoss)
105 << " MeasuredEloss: " << mu->floatParameter(xAOD::Muon::MeasEnergyLoss)
106 << " FSR E: " << mu->floatParameter(xAOD::Muon::FSR_CandidateEnergy) );
107
108 SG::ReadDecorHandle<CaloClusterContainer, std::vector<ElementLink<CaloClusterContainer> > > tcLinkAcc(m_elementLinkName);
109 for(const auto& matchel : tcLinkAcc(*muclus)) {
110 if(!matchel.isValid()) {continue;} // In case of thinned cluster collection
111 ATH_MSG_VERBOSE("Tool found cluster " << (*matchel)->index() << " with pt " << (*matchel)->pt() );
112 if((*matchel)->e()>1e-9) { // +ve E
113 tclist.push_back(*matchel);
114 }
115 }
116 } // muon has linked cluster
117
118 return StatusCode::SUCCESS;
119 }

◆ extractTracks()

StatusCode met::METMuonAssociator::extractTracks ( const xAOD::IParticle * obj,
std::vector< const xAOD::IParticle * > & constlist,
const met::METAssociator::ConstitHolder & constits ) const
finalprotectedvirtual

Implements met::METAssociator.

Definition at line 121 of file METMuonAssociator.cxx.

124 {
125 const xAOD::Muon *mu = static_cast<const xAOD::Muon*>(obj);
126 const TrackParticle* idtrack = mu->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
127 if(idtrack && acceptTrack(idtrack,constits.pv) && isGoodEoverP(idtrack)) {
128 // if(idtrack && acceptTrack(idtrack,pv)) {
129 ATH_MSG_VERBOSE("Accept muon track " << idtrack << " px, py = " << idtrack->p4().Px() << ", " << idtrack->p4().Py());
130 ATH_MSG_VERBOSE("Muon ID track ptr: " << idtrack);
131 constlist.push_back(idtrack);
132 // if(mu->pt()>10e3 && (mu->muonType()==xAOD::Muon::Combined || mu->muonType()==xAOD::Muon::SegmentTagged)) {
133 // mutracks.push_back(idtrack);
134 // }
135 }
136 return StatusCode::SUCCESS;
137 }
bool acceptTrack(const xAOD::TrackParticle *trk, const xAOD::Vertex *pv) const

◆ 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

◆ fillAssocMap()

StatusCode met::METAssociator::fillAssocMap ( xAOD::MissingETAssociationMap * metMap,
const xAOD::IParticleContainer * hardObjs ) const
protectedvirtualinherited

Reimplemented in met::METTruthAssociator.

Definition at line 304 of file METAssociator.cxx.

306 {
307 ConstitHolder constits;
308
309 if (retrieveConstituents(constits).isFailure()) {
310 ATH_MSG_DEBUG("Unable to retrieve constituent containers");
311 return StatusCode::FAILURE;
312 }
313
314 std::vector<const IParticle*> constlist;
315 constlist.reserve(20);
316 std::vector<const IParticle*> hardObjs_tmp;
317 for(const auto *const obj : *hardObjs) {
318 hardObjs_tmp.push_back(obj);
319 }
320 std::sort(hardObjs_tmp.begin(),hardObjs_tmp.end(),greaterPt);
321
322 for(const auto& obj : hardObjs_tmp) {
323 if(obj->pt()<4e3 && obj->type()!=xAOD::Type::Muon) continue;
324 constlist.clear();
325 ATH_MSG_VERBOSE( "Object type, pt, eta, phi = " << obj->type() << ", " << obj->pt() << ", " << obj->eta() << "," << obj->phi() );
326 if(m_pflow){
327 if(!m_fecollKey.key().empty()){
328 if(!m_useTracks){
329 ATH_MSG_ERROR("Attempting to build FlowElement MET without a track collection.");
330 return StatusCode::FAILURE;
331 }
332 std::map<const IParticle*, MissingETBase::Types::constvec_t> momentumOverride;
333 if(m_recoil){ // HR part:
334 float UEcorr_Pt = 0.; // Underlying event correction for HR
335 ATH_CHECK(extractFEHR(obj,hardObjs_tmp,constlist,constits,momentumOverride, UEcorr_Pt));
336 ATH_MSG_DEBUG("Energy correction is: " << UEcorr_Pt);
337 dec_UEcorr(*obj) = UEcorr_Pt;
338 }
339 else{ // MET part:
340 ATH_CHECK( this->extractFE(obj, constlist, constits, momentumOverride) );
341 }
342 MissingETComposition::insert(metMap, obj, constlist, momentumOverride);
343 }
344 else{
345 // Old PFO EDM
346 if(!m_useTracks){
347 ATH_MSG_DEBUG("Attempting to build PFlow without a track collection.");
348 return StatusCode::FAILURE;
349 }else{
350 std::map<const IParticle*,MissingETBase::Types::constvec_t> momentumOverride;
351 ATH_CHECK( this->extractPFO(obj,constlist,constits,momentumOverride) );
352 MissingETComposition::insert(metMap,obj,constlist,momentumOverride);
353 }
354 }
355 } else {
356 std::vector<const IParticle*> tclist;
357 tclist.reserve(20);
358 ATH_CHECK( this->extractTopoClusters(obj,tclist,constits) );
360 for(const auto& cl : tclist) {
361 // use index-parallelism to identify shallow copied constituents
362 constlist.push_back((*constits.tcCont)[cl->index()]);
363 }
364 } else {
365 constlist = tclist;
366 }
367 if(m_useTracks) ATH_CHECK( this->extractTracks(obj,constlist,constits) );
368 MissingETComposition::insert(metMap,obj,constlist);
369 }
370 }
371 return StatusCode::SUCCESS;
372 }
#define ATH_MSG_ERROR(x)
virtual StatusCode extractFEHR(const xAOD::IParticle *, std::vector< const xAOD::IParticle * >, std::vector< const xAOD::IParticle * > &, const met::METAssociator::ConstitHolder &, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &, float &) const
virtual StatusCode extractPFO(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &pfolist, const met::METAssociator::ConstitHolder &constits, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &momenta) const =0
virtual StatusCode extractFE(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &momenta) const =0
static bool greaterPt(const xAOD::IParticle *part1, const xAOD::IParticle *part2)
virtual StatusCode extractTopoClusters(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &tclist, const met::METAssociator::ConstitHolder &constits) const =0
virtual StatusCode extractTracks(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &constlist, const met::METAssociator::ConstitHolder &constits) const =0
Gaudi::Property< bool > m_recoil
StatusCode retrieveConstituents(met::METAssociator::ConstitHolder &constits) const
SG::ReadHandleKey< xAOD::FlowElementContainer > m_fecollKey
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
static const SG::Decorator< float > dec_UEcorr("UEcorr_Pt")
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
static bool insert(MissingETComponentMap *pMap, const MissingET *pMET, const IParticle *pPart, MissingETBase::Types::weight_t weight=MissingETBase::Types::weight_t())
Insert contributing signal or physics object by pointer, with optional kinematic weight object.

◆ 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 }
ServiceHandle< StoreGateSvc > & evtStore()

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

◆ GetUEcorr()

StatusCode met::METAssociator::GetUEcorr ( const met::METAssociator::ConstitHolder & constits,
std::vector< TLorentzVector > & v_clus,
TLorentzVector & clus,
TLorentzVector & HR,
const float Drcone,
const float MinDistCone,
float & UEcorr ) const
protectedinherited

Definition at line 446 of file METAssociator.cxx.

453 {
454 // 1. Get random phi
455 unsigned int seed = floor( clus.Pt() * Gaudi::Units::GeV );
456 TRandom3 hole;
457 hole.SetSeed(seed);
458
459 bool isNextToPart(true);
460 bool isNextToHR(true);
461 double phiRnd(0.);
462
463 int numOfRndTrials = 0; // Counter for trials to find random cone without overlaps
464 const int maxNumOfRndTrials = 100; // Max. number of trials to find random cone without overlaps
465
466 while(isNextToPart || isNextToHR ){
467 isNextToPart = false;
468 isNextToHR = true;
469
470 phiRnd = hole.Uniform( -std::numbers::pi, std::numbers::pi);
471 double dR = P4Helpers::deltaR( HR.Eta(), HR.Phi(), clus.Eta(), phiRnd );
472 if(dR > MinDistCone){
473 isNextToHR = false;
474 }
475
476 for(const auto& clus_j : v_clus) { // loop over leptons
477 dR = P4Helpers::deltaR( clus.Eta(), phiRnd, clus_j.Eta(), clus_j.Phi() );
478 if(dR < MinDistCone){
479 isNextToPart = true;
480 break;
481 }
482 } // swclus_j
483
484 numOfRndTrials++;
485 if(numOfRndTrials == maxNumOfRndTrials){ // check number of trials
486 UEcorr = 0.;
487 return StatusCode::SUCCESS;
488 }
489 } // while isNextToPart, isNextToHR
490
491 ATH_MSG_DEBUG("Found rnd phi: " << phiRnd);
492
493
494 // 2. Calculete UE correction
495 TLorentzVector tv_UEcorr; // TLV of UE correction (initialized with 0,0,0,0 automatically)
496 std::pair <double, double> eta_rndphi = std::make_pair(clus.Eta(), phiRnd); // pair of current cluser eta and random phi
497
498
499 // Calculate delta phi -> always the same angle so its sufficient to calculate it only once
500 float dphi_angle=P4Helpers::deltaPhi(clus.Phi(),eta_rndphi.second);
501
502 for(const auto fe_itr : *constits.feCont){ // loop over PFOs
503 if(fe_itr->pt() < 0 || fe_itr->e() < 0){ //sanity check
504 continue;
505 }
506
507 //remove charged FE that are not matched to the PV
508 const static SG::ConstAccessor<char> PVMatchedAcc("matchedToPV");
509 if(fe_itr->isCharged() && !PVMatchedAcc(*fe_itr)){
510 continue;
511 }
512
513 double dR = P4Helpers::deltaR( fe_itr->eta(), fe_itr->phi(), eta_rndphi.first, eta_rndphi.second );
514 if( dR < Drcone ){
515 // Rotate on dphi_angle
516 TLorentzVector tv_fe = fe_itr->p4();
517 tv_fe.RotateZ(dphi_angle);
518 tv_UEcorr += tv_fe; // summing PFOs of UE for correction
519 } // cone requirement
520 } // loop over PFOs
521
522 UEcorr = tv_UEcorr.Pt(); // Pt of UE correction
523
524 return StatusCode::SUCCESS;
525 }
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[

◆ greaterPt()

bool met::METAssociator::greaterPt ( const xAOD::IParticle * part1,
const xAOD::IParticle * part2 )
inlinestaticprotectedinherited

Definition at line 167 of file METAssociator.h.

167 {
168 return part1->pt()>part2->pt();
169 }
virtual double pt() const =0
The transverse momentum ( ) of the particle.

◆ greaterPtFE()

bool met::METAssociator::greaterPtFE ( const xAOD::FlowElement * part1,
const xAOD::FlowElement * part2 )
inlinestaticprotectedinherited

Definition at line 176 of file METAssociator.h.

176 {
177 if (!(part1->isCharged()) && part2->isCharged()) return false;
178 if (part1->isCharged() && !(part2->isCharged())) return true;
179 return part1->pt() > part2->pt();
180 }

◆ greaterPtPFO()

bool met::METAssociator::greaterPtPFO ( const xAOD::PFO * part1,
const xAOD::PFO * part2 )
inlinestaticprotectedinherited

Definition at line 170 of file METAssociator.h.

170 {
171 if (part1->charge()==0 && part2->charge()!=0) return false;
172 if (part1->charge()!=0 && part2->charge()==0) return true;
173 if (part1->charge()==0 && part2->charge()==0) return part1->ptEM()>part2->ptEM();
174 return part1->pt()>part2->pt();
175 }
virtual double ptEM() const
get EM scale pt
Definition PFO_v1.cxx:204
float charge() const
get charge of PFO
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition PFO_v1.cxx:52

◆ initialize()

StatusCode met::METMuonAssociator::initialize ( void )
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 met::METAssociator.

Definition at line 49 of file METMuonAssociator.cxx.

50 {
52 ATH_MSG_VERBOSE ("Initializing " << name() << "...");
53 ATH_CHECK( m_muContKey.initialize());
54 if (m_useFELinks) {
59 }
60
62
63 return StatusCode::SUCCESS;
64 }
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
std::string m_chargedFELinksKey
std::string m_neutralFELinksKey

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

◆ isGoodEoverP()

bool met::METAssociator::isGoodEoverP ( const xAOD::TrackParticle * trk) const
protectedinherited

Definition at line 384 of file METAssociator.cxx.

385 {
386
387 if( (fabs(trk->eta())<1.5 && trk->pt()>m_cenTrackPtThr) ||
388 (fabs(trk->eta())>=1.5 && trk->pt()>m_forTrackPtThr) ) {
389
390 // Get relative error on qoverp
391 float Rerr = Amg::error(trk->definingParametersCovMatrix(),4)/fabs(trk->qOverP());
392 ATH_MSG_VERBOSE( "Track momentum error (%): " << Rerr*100 );
393
394 // first compute track and calo isolation variables
395 float ptcone20 = 0., isolfrac = 0., etcone10 = 0., EoverP = 0.;
396 // ptcone
397 TrackIsolation trkIsoResult;
398 std::vector<Iso::IsolationType> trkIsoCones;
399 trkIsoCones.push_back(xAOD::Iso::IsolationType::ptcone20);
400 xAOD::TrackCorrection trkIsoCorr;
402 m_trkIsolationTool->trackIsolation(trkIsoResult,
403 *trk,
404 trkIsoCones,
405 trkIsoCorr);
406 ptcone20 = !trkIsoResult.ptcones.empty() ? trkIsoResult.ptcones[0] : 0;
407 isolfrac = ptcone20/trk->pt();
408 // etcone
409 CaloIsolation caloIsoResult;
410 std::vector<Iso::IsolationType> caloIsoCones;
411 // We can't actually configure the tool to give etcone10, so instead we have to compute etcone20,
412 // applying the core cone correction.
413 // Then, we retrieve the correction value, which is etcone10, rather than the isolation value
414 caloIsoCones.push_back(xAOD::Iso::IsolationType::etcone20);
415 xAOD::CaloCorrection caloIsoCorr_coreCone;
416 caloIsoCorr_coreCone.calobitset.set(xAOD::Iso::IsolationCaloCorrection::coreCone); // this is etcone10
417 m_caloIsolationTool->caloTopoClusterIsolation(caloIsoResult,
418 *trk,
419 caloIsoCones,
420 caloIsoCorr_coreCone);
421 if(!caloIsoResult.etcones.empty()) {
422 // retrieve the correction value for the core cone
424 } else {
425 ATH_MSG_WARNING("isGoodEoverP: Failed to retrieve the isolation core correction (etcone10)! Setting etcone10=0");
426 etcone10 = 0.;
427 }
428 EoverP = etcone10/trk->pt();
430 ATH_MSG_VERBOSE( "Track isolation fraction: " << isolfrac );
431 ATH_MSG_VERBOSE( "Track E/P = " << EoverP );
432
433 if(isolfrac<0.1) {
434 // isolated track cuts
435 if(Rerr>0.4) return false;
436 else if (EoverP<0.65 && ((EoverP>0.1 && Rerr>0.05) || Rerr>0.1)) return false;
437 } else {
438 // non-isolated track cuts
439 float trkptsum = ptcone20+trk->pt();
440 if(etcone10/trkptsum<0.6 && trk->pt()/trkptsum>0.6) return false;
441 }
442 }
443 return true;
444 }
ToolHandle< xAOD::ICaloTopoClusterIsolationTool > m_caloIsolationTool
ToolHandle< xAOD::ITrackIsolationTool > m_trkIsolationTool
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
float qOverP() const
Returns the parameter.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
@ TrackIsolation
tracker isolation (ptcone30)
@ etcone20
Calorimeter isolation.
@ ptcone20
Track isolation.
setRcore setEtHad setFside pt
Iso::IsolationCaloCorrectionBitset calobitset
Iso::IsolationTrackCorrectionBitset trackbitset

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

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

◆ 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();
384 }
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)

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

◆ retrieveConstituents()

StatusCode met::METAssociator::retrieveConstituents ( met::METAssociator::ConstitHolder & constits) const
protectedinherited

Definition at line 170 of file METAssociator.cxx.

171 {
172 ATH_MSG_DEBUG ("In execute: " << name() << "...");
173 if (!m_skipconst || m_forcoll.empty()) {
174
175 SG::ReadHandle<IParticleContainer> topoclusterCont(m_clcollKey);
176 if (!topoclusterCont.isValid()) {
177 ATH_MSG_WARNING("Unable to retrieve topocluster container " << m_clcollKey.key() << " for overlap removal");
178 return StatusCode::FAILURE;
179 }
180 constits.tcCont=topoclusterCont.cptr();
181 ATH_MSG_DEBUG("Successfully retrieved topocluster collection");
182 } else {
183 std::string hybridname = "Etmiss";
184 hybridname += m_clcollKey.key();
185 hybridname += m_foreta;
186 hybridname += m_forcoll;
187
188 SG::ReadHandle<IParticleContainer> hybridCont(m_hybridContKey);
189 if( hybridCont.isValid()) {
190 constits.tcCont=hybridCont.cptr();
191 } else {
192 ATH_MSG_WARNING("Trying to do something currently unsupported- lets abort");
193 return StatusCode::FAILURE;
194 // Trying to do this using write handles (need to get some input here)
195 /*std::unique_ptr<ConstDataVector<IParticleContainer>> hybridCont = std::make_unique<ConstDataVector<IParticleContainer>>();
196 SG::WriteHandle<ConstDataVector<IParticleContainer>> hybridContHandle(hybridname);
197
198 StatusCode sc = hybridContHandle.record(std::make_unique<ConstDataVector<IParticleContainer>>(*hybridCont));
199
200 if (sc.isFailure()) {
201 ATH_MSG_WARNING("Unable to record container");
202 return StatusCode::SUCCESS;
203
204 }*/
205
206 /*SG::ReadHandle<IParticleContainer> centCont(m_clcoll);
207 if (!centCont.isValid()) {
208 ATH_MSG_WARNING("Unable to retrieve central container " << m_clcoll << " for overlap removal");
209 return StatusCode::FAILURE;
210 }
211
212 SG::ReadHandle<IParticleContainer> forCont(m_forcoll);
213 if (!forCont.isValid()) {
214 ATH_MSG_WARNING("Unable to retrieve forward container " << m_forcoll << " for overlap removal");
215 return StatusCode::FAILURE;
216 }
217 ConstDataVector<IParticleContainer> *hybridCont = new ConstDataVector<IParticleContainer>(SG::VIEW_ELEMENTS);
218
219 const IParticleContainer* centCont=0;
220 if( evtStore()->retrieve(centCont, m_clcoll).isFailure() ) {
221 ATH_MSG_WARNING("Unable to retrieve central container " << m_clcoll << " for overlap removal");
222 return StatusCode::FAILURE;
223 }
224
225 const IParticleContainer* forCont=0;
226 if( evtStore()->retrieve(forCont, m_forcoll).isFailure() ) {
227 ATH_MSG_WARNING("Unable to retrieve forward container " << m_forcoll << " for overlap removal");
228 return StatusCode::FAILURE;
229 }
230
231 for(const auto clus : *centCont) if (fabs(clus->eta())<m_foreta) hybridCont->push_back(clus);
232 for(const auto clus : *forCont) if (fabs(clus->eta())>=m_foreta) hybridCont->push_back(clus);
233 ATH_CHECK( evtStore()->record(hybridCont,hybridname));
234 constits.tcCont = hybridCont->asDataVector();
235 */
236 }
237 }
238
239 if( !m_useTracks){
240 //if you want to skip tracks, set the track collection empty manually
241 ATH_MSG_DEBUG("Skipping tracks");
242 }else{
243 SG::ReadHandle<VertexContainer> vxCont(m_pvcollKey);
244 if (!vxCont.isValid()) {
245 ATH_MSG_WARNING("Unable to retrieve primary vertex container " << m_pvcollKey.key());
246 //this is actually really bad. If it's empty that's okay
247 return StatusCode::FAILURE;
248 }
249
250 ATH_MSG_DEBUG("Successfully retrieved primary vertex container");
251 ATH_MSG_DEBUG("Container holds " << vxCont->size() << " vertices");
252
253 for(const auto *const vx : *vxCont) {
254 ATH_MSG_VERBOSE( "Testing vertex " << vx->index() );
255 if(vx->vertexType()==VxType::PriVtx)
256 {constits.pv = vx; break;}
257 }
258 if(!constits.pv) {
259 ATH_MSG_DEBUG("Failed to find primary vertex! Reject all tracks.");
260 } else {
261 ATH_MSG_VERBOSE("Primary vertex has z = " << constits.pv->z());
262 }
263
264 constits.trkCont=nullptr;
265 ATH_MSG_DEBUG("Retrieving Track collection " << m_trkcollKey.key());
266 SG::ReadHandle<TrackParticleContainer> trCont(m_trkcollKey);
267 if (!trCont.isValid()) {
268 ATH_MSG_WARNING("Unable to retrieve track particle container");
269 return StatusCode::FAILURE;
270 }
271 constits.trkCont=trCont.cptr();
272
273 if(m_pflow){
274 if(!m_fecollKey.key().empty()){
275 ATH_MSG_DEBUG("Retrieving FlowElement collection " << m_fecollKey.key());
276 constits.feCont = nullptr;
277 SG::ReadHandle<xAOD::FlowElementContainer> feCont(m_fecollKey);
278 if (!feCont.isValid()) {
279 ATH_MSG_ERROR("Unable to retrieve FlowElement container "<< m_fecollKey.key());
280 return StatusCode::FAILURE;
281 }
282 constits.feCont=feCont.cptr();
283 }
284 else{
285 ATH_MSG_DEBUG("Retrieving PFlow collection " << m_pfcollKey.key());
286 constits.pfoCont = nullptr;
287 SG::ReadHandle<PFOContainer> pfCont(m_pfcollKey);
288 if (!pfCont.isValid()) {
289 ATH_MSG_WARNING("Unable to PFlow object container");
290 return StatusCode::FAILURE;
291 }
292 constits.pfoCont=pfCont.cptr();
293 }
294 }//pflow
295 }//retrieve track/pfo containers
296
297 return StatusCode::SUCCESS;
298 }
SG::ReadHandleKey< xAOD::PFOContainer > m_pfcollKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkcollKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvcollKey
std::string m_forcoll
SG::ReadHandleKey< xAOD::IParticleContainer > m_hybridContKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_clcollKey
float z() const
Returns the z position.
@ PriVtx
Primary vertex.
const xAOD::IParticleContainer * tcCont
const xAOD::TrackParticleContainer * trkCont

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_caloIsolationTool

ToolHandle<xAOD::ICaloTopoClusterIsolationTool> met::METAssociator::m_caloIsolationTool
protectedinherited

Definition at line 87 of file METAssociator.h.

◆ m_cenTrackPtThr

double met::METAssociator::m_cenTrackPtThr
protectedinherited

Definition at line 118 of file METAssociator.h.

◆ m_chargedFELinksKey

std::string met::METAssociator::m_chargedFELinksKey
protectedinherited

Definition at line 90 of file METAssociator.h.

◆ m_chargedFEReadDecorKey

SG::ReadDecorHandleKey<xAOD::MuonContainer> met::METMuonAssociator::m_chargedFEReadDecorKey
private
Initial value:
{
this,
"ChargedFEReadDecorKey",
"",
"Charged FlowElement links key"
}

Definition at line 102 of file METMuonAssociator.h.

102 {
103 this,
104 "ChargedFEReadDecorKey",
105 "",
106 "Charged FlowElement links key"
107 };

◆ m_chargedPFOLinksKey

std::string met::METAssociator::m_chargedPFOLinksKey
protectedinherited

Definition at line 92 of file METAssociator.h.

◆ m_clcollKey

SG::ReadHandleKey<xAOD::IParticleContainer> met::METAssociator::m_clcollKey {this,"ClusColl","CaloCalTopoClusters","Topo cluster Collection"}
protectedinherited

Definition at line 97 of file METAssociator.h.

97{this,"ClusColl","CaloCalTopoClusters","Topo cluster Collection"};

◆ m_cleanChargedPFO

bool met::METAssociator::m_cleanChargedPFO
protectedinherited

Definition at line 112 of file METAssociator.h.

◆ m_doMuonClusterMatch

Gaudi::Property<bool> met::METMuonAssociator::m_doMuonClusterMatch {this, "DoClusterMatch", true, ""}
private

Definition at line 85 of file METMuonAssociator.h.

85{this, "DoClusterMatch", true, ""};

◆ m_Drcone

float met::METMuonAssociator::m_Drcone = 0.2
staticconstexprprivate

Definition at line 81 of file METMuonAssociator.h.

◆ m_elementLinkName

SG::ReadDecorHandleKey<xAOD::CaloClusterContainer> met::METMuonAssociator::m_elementLinkName
private
Initial value:
{
this,
"ElementLinkName",
"MuonClusterCollection.constituentClusterLinks"
}

Definition at line 108 of file METMuonAssociator.h.

108 {
109 this,
110 "ElementLinkName",
111 "MuonClusterCollection.constituentClusterLinks"
112 };

◆ m_fecollKey

SG::ReadHandleKey<xAOD::FlowElementContainer> met::METAssociator::m_fecollKey {this,"FlowElementCollection","","FlowElement Collection (overrides PFO if not empty)"}
protectedinherited

Definition at line 100 of file METAssociator.h.

100{this,"FlowElementCollection","","FlowElement Collection (overrides PFO if not empty)"};

◆ m_forcoll

std::string met::METAssociator::m_forcoll
protectedinherited

Definition at line 115 of file METAssociator.h.

◆ m_foreta

double met::METAssociator::m_foreta
protectedinherited

Definition at line 116 of file METAssociator.h.

◆ m_forTrackPtThr

double met::METAssociator::m_forTrackPtThr
protectedinherited

Definition at line 119 of file METAssociator.h.

◆ m_hybridContKey

SG::ReadHandleKey<xAOD::IParticleContainer> met::METAssociator::m_hybridContKey {this,"HybridKey","","Hybrid Collection"}
protectedinherited

Definition at line 101 of file METAssociator.h.

101{this,"HybridKey","","Hybrid Collection"};

◆ m_MinDistCone

float met::METMuonAssociator::m_MinDistCone = 0.4
staticconstexprprivate

Definition at line 82 of file METMuonAssociator.h.

◆ m_muContKey

SG::ReadHandleKey<xAOD::MuonContainer> met::METMuonAssociator::m_muContKey
private
Initial value:
{
this,
"InputCollection",
"Muons",
"muons input key"
}

Definition at line 90 of file METMuonAssociator.h.

90 {
91 this,
92 "InputCollection",
93 "Muons",
94 "muons input key"
95 };

◆ m_neutralFELinksKey

std::string met::METAssociator::m_neutralFELinksKey
protectedinherited

Definition at line 89 of file METAssociator.h.

◆ m_neutralFEReadDecorKey

SG::ReadDecorHandleKey<xAOD::MuonContainer> met::METMuonAssociator::m_neutralFEReadDecorKey
private
Initial value:
{
this,
"NeutralFEReadDecorKey",
"",
"Neutral FlowElement links key"
}

Definition at line 96 of file METMuonAssociator.h.

96 {
97 this,
98 "NeutralFEReadDecorKey",
99 "",
100 "Neutral FlowElement links key"
101 };

◆ m_neutralPFOLinksKey

std::string met::METAssociator::m_neutralPFOLinksKey
protectedinherited

Definition at line 91 of file METAssociator.h.

◆ m_pfcollKey

SG::ReadHandleKey<xAOD::PFOContainer> met::METAssociator::m_pfcollKey {this,"PFlowColl","","PFO Collection"}
protectedinherited

Definition at line 99 of file METAssociator.h.

99{this,"PFlowColl","","PFO Collection"};

◆ m_pflow

bool met::METAssociator::m_pflow
protectedinherited

Definition at line 106 of file METAssociator.h.

◆ m_pvcollKey

SG::ReadHandleKey<xAOD::VertexContainer> met::METAssociator::m_pvcollKey {this,"PrimVxColl","PrimaryVertices","Primary Vertex Collection"}
protectedinherited

Definition at line 96 of file METAssociator.h.

96{this,"PrimVxColl","PrimaryVertices","Primary Vertex Collection"};

◆ m_recoil

Gaudi::Property<bool> met::METAssociator::m_recoil {this, "HRecoil", false, ""}
protectedinherited

Definition at line 104 of file METAssociator.h.

104{this, "HRecoil", false, ""};

◆ m_skipconst

bool met::METAssociator::m_skipconst
protectedinherited

Definition at line 114 of file METAssociator.h.

◆ m_trkcollKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> met::METAssociator::m_trkcollKey {this,"TrkColl","InDetTrackParticles","Track particle Collection"}
protectedinherited

Definition at line 98 of file METAssociator.h.

98{this,"TrkColl","InDetTrackParticles","Track particle Collection"};

◆ m_trkIsolationTool

ToolHandle<xAOD::ITrackIsolationTool> met::METAssociator::m_trkIsolationTool
protectedinherited

Definition at line 86 of file METAssociator.h.

◆ m_trkseltool

ToolHandle<InDet::IInDetTrackSelectionTool> met::METAssociator::m_trkseltool
protectedinherited

Definition at line 85 of file METAssociator.h.

◆ m_useFELinks

bool met::METAssociator::m_useFELinks
protectedinherited

Definition at line 94 of file METAssociator.h.

◆ m_useIsolationTools

bool met::METAssociator::m_useIsolationTools = false
protectedinherited

Definition at line 109 of file METAssociator.h.

◆ m_useModifiedClus

bool met::METAssociator::m_useModifiedClus
protectedinherited

Definition at line 110 of file METAssociator.h.

◆ m_usePFOLinks

bool met::METAssociator::m_usePFOLinks
protectedinherited

Definition at line 93 of file METAssociator.h.

◆ m_useRapidity

bool met::METAssociator::m_useRapidity
protectedinherited

Definition at line 108 of file METAssociator.h.

◆ m_useTracks

bool met::METAssociator::m_useTracks
protectedinherited

Definition at line 107 of file METAssociator.h.

◆ m_weight_charged_pfo

bool met::METAssociator::m_weight_charged_pfo = false
protectedinherited

Definition at line 111 of file METAssociator.h.


The documentation for this class was generated from the following files: