ATLAS Offline Software
Loading...
Searching...
No Matches
MuonMatchingTool Class Reference

Class that provides functionalities for searching for online muons close to a given offline muon and judging they are matched with the specific criteria. More...

#include <MuonMatchingTool.h>

Inheritance diagram for MuonMatchingTool:
Collaboration diagram for MuonMatchingTool:

Public Member Functions

 MuonMatchingTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
const xAOD::MuonRoImatchL1 (const xAOD::Muon *mu, const std::string &trigger, bool &pass) const
 Function that searches for a Level 1 muon candidate and judges if it is matched to a given offline muon.
const xAOD::MuonRoImatchL1 (const xAOD::TruthParticle *mu, const std::string &trigger, bool &pass) const
 Function that searches for a Level 1 truth muon candidate and judges if it is matched to a given offline muon.
const xAOD::MuonRoImatchL1 (double eta, double phi, double dR, const std::string &trigger, bool &pass) const
 Function that dR matches L1 muon candidates.
const xAOD::L2StandAloneMuonmatchL2SA (const xAOD::Muon *mu, const std::string &trigger, bool &pass) const
 Function that searches for an L2 standalone muon (L2MuonSA) candidate and judges if it is matched to a given offline muon.
const TrigCompositeUtils::LinkInfo< xAOD::L2StandAloneMuonContainersearchL2SALinkInfo (const xAOD::Muon *mu, std::string trigger) const
 Function that searches for the L2 standalone muon (L2MuonSA) candidate closest to a given offline muon.
const xAOD::L2StandAloneMuonmatchL2SAReadHandle (const EventContext &ctx, const xAOD::Muon *mu) const
 Function that searches for an L2 standalone muon (L2MuonSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.
const xAOD::L2CombinedMuonmatchL2CB (const xAOD::Muon *mu, std::string trigger, bool &pass) const
 Function that searches for an L2 combined muon (L2muComb) candidate and judges if it is matched to a given offline muon.
const TrigCompositeUtils::LinkInfo< xAOD::L2CombinedMuonContainersearchL2CBLinkInfo (const xAOD::Muon *mu, std::string trigger) const
 Function that searches for the L2 combined muon (L2muComb) candidate closest to a given offline muon.
const xAOD::L2CombinedMuonmatchL2CBReadHandle (const EventContext &ctx, const xAOD::Muon *mu) const
 Function that searches for an L2 combined muon (L2muComb) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.
const xAOD::MuonmatchEFSA (const xAOD::Muon *mu, std::string trigger, bool &pass) const
 Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given offline muon.
const xAOD::MuonmatchEFSA (const xAOD::TruthParticle *mu, std::string trigger, bool &pass) const
 Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given truth muon.
const TrigCompositeUtils::LinkInfo< xAOD::MuonContainermatchEFSALinkInfo (const xAOD::Muon *mu, std::string trig) const
 Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given track particle.
const xAOD::MuonmatchEFSAReadHandle (const EventContext &ctx, const xAOD::Muon *mu) const
 Function that searches for an EF standalone muon (EFSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.
const xAOD::MuonmatchEFCB (const xAOD::Muon *mu, std::string trigger, bool &pass) const
 Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given offline muon.
const xAOD::MuonmatchEFCB (const xAOD::TruthParticle *mu, std::string trig, bool &pass) const
 Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given truth muon.
const TrigCompositeUtils::LinkInfo< xAOD::MuonContainermatchEFCBLinkInfo (const xAOD::Muon *mu, std::string trig) const
 Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given track particle.
const xAOD::MuonmatchEFCBReadHandle (const EventContext &ctx, const xAOD::Muon *mu) const
 Function that searches for an EF combined muon (EFCB) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.
const xAOD::MuonmatchEFSAFS (const xAOD::Muon *mu, std::string trigger, bool &pass) const
 Function that searches for an EF FS standalone muon (EFSAFS) candidate and judges if it is matched to a given offline muon.
const xAOD::MuonmatchEFSAFS (const xAOD::TruthParticle *mu, std::string trigger, bool &pass) const
 Function that searches for an EF standalone muon (EFSAFS) candidate and judges if it is matched to a given truth muon.
const TrigCompositeUtils::LinkInfo< xAOD::MuonContainermatchEFSAFSLinkInfo (const xAOD::Muon *mu, std::string trig) const
 Function that searches for an EF standalone muon (EFSAFS) candidate and judges if it is matched to a given track particle.
const xAOD::MuonmatchEFSAFSReadHandle (const EventContext &ctx, const xAOD::Muon *mu) const
 Function that searches for an EF standalone muon (EFSAFS) candidate by ReadHandle and judges if it is matched to a given offlineSAFS muon.
const xAOD::MuonmatchEFCBFS (const xAOD::Muon *mu, std::string trigger, bool &pass) const
 Function that searches for an EF combined muon (EFCBFS) candidate and judges if it is matched to a given offline muon.
const xAOD::MuonmatchEFCBFS (const xAOD::TruthParticle *mu, std::string trig, bool &pass) const
 Function that searches for an EF combined muon (EFCBFS) candidate and judges if it is matched to a given truth muon.
const TrigCompositeUtils::LinkInfo< xAOD::MuonContainermatchEFCBFSLinkInfo (const xAOD::Muon *mu, std::string trig) const
 Function that searches for an EF combined muon (EFCBFS) candidate and judges if it is matched to a given track particle.
const xAOD::MuonmatchEFCBFSReadHandle (const EventContext &ctx, const xAOD::Muon *mu) const
 Function that searches for an EF combined muon (EFCBFS) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.
const xAOD::MuonmatchEFIso (const xAOD::Muon *mu, std::string trigger, bool &pass) const
 Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given offline muon.
const xAOD::MuonmatchEFIso (const xAOD::TruthParticle *mu, std::string trigger, bool &pass) const
 Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given truth muon.
const TrigCompositeUtils::LinkInfo< xAOD::MuonContainermatchEFIsoLinkInfo (const xAOD::Muon *mu, std::string trig) const
 Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given track particle.
const xAOD::TrackParticleSearchEFTrack (const EventContext &ctx, const TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > &muLinkInfo, const SG::ReadHandleKey< xAOD::TrackParticleContainer > &ReadHandleKey) const
 Function that searches for an EF muon track (e.g.
const xAOD::MuonmatchL2SAtoOff (const EventContext &ctx, const xAOD::L2StandAloneMuon *samu) const
 Function that searches for an offline muon matched to L2SA muon.
const xAOD::MuonmatchL2CBtoOff (const EventContext &ctx, const xAOD::L2CombinedMuon *cbmu) const
 Function that searches for an offline muon matched to L2CB muon.
bool isMatchedL2SA (const xAOD::L2StandAloneMuon *, const xAOD::Muon *) const
bool isMatchedL2CB (const xAOD::L2CombinedMuon *, const xAOD::Muon *) const
bool isMatchedL2InsideOut (const xAOD::L2CombinedMuon *, const xAOD::Muon *) const
const Trk::TrackParametersextTrackToPivot (const xAOD::TrackParticle *track) const
 Function to extrapolate a Inner Detector track to the pivot plane i.e.
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

Static Public Member Functions

static double reqdRL1byPt (double mupt)
 Function compute dR used for matching offline muons and level 1 RoIs at the pivot plane.
static std::tuple< bool, double, double > trigPosForMatchSATrack (const xAOD::Muon *mu)
static std::tuple< bool, double, double > trigPosForMatchCBTrack (const xAOD::Muon *mu)
static std::tuple< bool, double, double > PosForMatchSATrack (const xAOD::Muon *mu)
static std::tuple< bool, double, double > PosForMatchCBTrack (const xAOD::Muon *mu)

Protected Member Functions

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.

Private Types

enum  L1Items {
  L1B_MU3V =1 , L1B_MU5VF =2 , L1B_MU8F =3 , L1B_MU14FCH =6 ,
  L1B_MU14FCHR =6 , L1E_MU3V =1 , L1E_MU5VF =3 , L1E_MU8F =6 ,
  L1E_MU14FCH =12 , L1E_MU14FCHR =12 , ERROR
}
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

int L1ItemStringToInt (const std::string &l1item, int roiSource) const
template<class T, class OFFL>
const T * matchReadHandle (const OFFL *offl, float reqdR, SG::ReadHandleKey< DataVector< T > > ReadHandleKey, const EventContext &ctx, std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
 Function that searches for an online muon candidate of type T by ReadHandle and judges if it is matched to a given offline muon.
template<class T, class OFFL>
const TrigCompositeUtils::LinkInfo< DataVector< T > > matchLinkInfo (const OFFL *offl, std::string trigger, float reqdR, bool &pass, const std::string &containerSGKey="", std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
 Function that searches for an online muon candidate of type T closest to a given offline muon.
template<class T, class OFFL>
const T * match (const OFFL *offl, std::string trigger, float reqdR, bool &pass, const std::string &containerSGKey="", std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
 Function that searches for an online muon candidate of type T and judges if it is matched to a given offline muon.
template<class T>
const xAOD::MuonmatchOff (const EventContext &ctx, const T *trig, float reqdR, std::tuple< bool, double, double >(*offlinePosForMatchFunc)(const xAOD::Muon *), std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
 Function that searches for an offline muon candidate matched to online muon of type T.
const Amg::Vector3D offlineMuonAtPivot (const xAOD::Muon *mu) const
const Trk::TrackParametersextTrackToTGC (const xAOD::TrackParticle *track) const
const Trk::TrackParametersextTrackToRPC (const xAOD::TrackParticle *track) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static double FermiFunction (double x, double x0, double w)
template<class T>
static std::tuple< bool, double, double > trigPosForMatch (const T *trig)

Private Attributes

const float m_L2SAreqdR = 0.25
const float m_L2CBreqdR = 0.03
const float m_L2InsideOutreqdR = 0.01
const float m_EFreqdR = 0.03
SG::ReadHandleKey< xAOD::MuonRoIContainerm_MuonRoIContainerKey {this, "MuonRoIContainerName", "LVL1MuonRoIs", "Level 1 muon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_MuonContainerKey {this, "MuonContainerName", "Muons", "Offline muon container"}
SG::ReadHandleKey< xAOD::L2StandAloneMuonContainerm_L2MuonSAContainerKey {this, "L2StandAloneMuonContainerName", "HLT_MuonL2SAInfo", "L2MuonSA container"}
SG::ReadHandleKey< xAOD::L2CombinedMuonContainerm_L2muCombContainerKey {this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSAMuonContainerKey {this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFCBMuonContainerKey {this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSAFSMuonContainerKey {this, "EFSAFSMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFCBFSMuonContainerKey {this, "EFCBFSMuonContainerName", "HLT_MuonsCB_FS", "EFCBFSMuon container"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_MStrackContainerKey {this, "ExtrapolatedMStrackConntainner", "HLT_MSExtrapolatedMuons_RoITrackParticles", "ExtrapolatedMuons track container"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_CBtrackContainerKey {this, "CBtrackContainerName", "HLT_CBCombinedMuon_RoITrackParticles", "CombinedMuon track container"}
Gaudi::Property< bool > m_use_extrapolator {this, "UseExtrapolator", false, "Flag to enable the extrapolator for matching offline and trigger muons"}
ToolHandle< LVL1::ITrigThresholdDecisionToolm_thresholdTool
PublicToolHandle< Trig::TrigDecisionToolm_trigDec {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", "TrigDecisionTool"}
PublicToolHandle< Trk::IExtrapolatorm_extrapolator {"Trk::Extrapolator/AtlasExtrapolator"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Class that provides functionalities for searching for online muons close to a given offline muon and judging they are matched with the specific criteria.

Definition at line 29 of file MuonMatchingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ L1Items

Enumerator
L1B_MU3V 
L1B_MU5VF 
L1B_MU8F 
L1B_MU14FCH 
L1B_MU14FCHR 
L1E_MU3V 
L1E_MU5VF 
L1E_MU8F 
L1E_MU14FCH 
L1E_MU14FCHR 
ERROR 

Definition at line 352 of file MuonMatchingTool.h.

Constructor & Destructor Documentation

◆ MuonMatchingTool()

MuonMatchingTool::MuonMatchingTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 11 of file MuonMatchingTool.cxx.

12 : AthAlgTool(type, name, parent)
13{}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

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

◆ 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

◆ extTrackToPivot()

const Trk::TrackParameters * MuonMatchingTool::extTrackToPivot ( const xAOD::TrackParticle * track) const

Function to extrapolate a Inner Detector track to the pivot plane i.e.

the middle layers of the Muon Spectrometer where the level 1 RoI is defined. This functionality is not available yet.

Parameters
trackInner Detector track that is extrapolated.
Returns
Pointer to the extrapolated track parameters.
See also
reqdRL1byPt
Todo
Return std::unique_ptr when this is available.

Definition at line 438 of file MuonMatchingTool.cxx.

438 {
439
440 const Trk::TrackParameters *extRPC = nullptr;
441 const Trk::TrackParameters *extTGC = nullptr;
442
443 if(!track) return extTGC;
444 double trkEta = track->eta();
445 double extEta =0.;
446 bool isBarrel = true;
447
448 if( fabs(trkEta)<1.05){
449 extRPC = extTrackToRPC(track);
450 if(!extRPC){
451 isBarrel = false;
452 extTGC = extTrackToTGC(track);
453 }
454 else{
455 isBarrel = true;
456 extEta = extRPC->position().eta();
457 if(fabs(extEta)>=1.05){
458 extTGC = extTrackToTGC(track);
459 isBarrel = (extTGC) == nullptr;
460 }
461 }
462 }
463 else if( fabs(trkEta)>=1.05 ){
464 extTGC = extTrackToTGC(track);
465 if(!extTGC){
466 isBarrel = true;
467 extRPC = extTrackToRPC(track);
468 }
469 else{
470 isBarrel = false;
471 extEta = extTGC->position().eta();
472 if(fabs(extEta)<1.05){
473 extRPC = extTrackToRPC(track);
474 isBarrel = (extRPC) != nullptr;
475 }
476 }
477 }
478
479 ATH_MSG_DEBUG("extTGC=" << extTGC << " extRPC=" << extRPC << " isBarrel=" << isBarrel);
480 if( isBarrel) delete extTGC;
481 else if(!isBarrel) delete extRPC;
482 return (isBarrel) ? extRPC : extTGC;
483}
#define ATH_MSG_DEBUG(x)
const Trk::TrackParameters * extTrackToRPC(const xAOD::TrackParticle *track) const
const Trk::TrackParameters * extTrackToTGC(const xAOD::TrackParticle *track) const
const Amg::Vector3D & position() const
Access method for the position.
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ extTrackToRPC()

const Trk::TrackParameters * MuonMatchingTool::extTrackToRPC ( const xAOD::TrackParticle * track) const
private

Definition at line 511 of file MuonMatchingTool.cxx.

511 {
512 ATH_MSG_DEBUG("extTrackToRPC");
513 if(!trk) return nullptr;
514 std::unique_ptr<Trk::CylinderSurface> barrel(new Trk::CylinderSurface( 7478., 15000. ));
515 const bool boundaryCheck = true;
516
517 const Trk::TrackParameters* param = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),
518 trk->perigeeParameters(),
519 *barrel,
521 boundaryCheck,
522 Trk::muon).release();
523 return param;
524}
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
@ anyDirection

◆ extTrackToTGC()

const Trk::TrackParameters * MuonMatchingTool::extTrackToTGC ( const xAOD::TrackParticle * track) const
private

Definition at line 487 of file MuonMatchingTool.cxx.

487 {
488 ATH_MSG_DEBUG("extTrackToTGC");
489 if(!trk) return nullptr;
490 double TGC_Z = ( trk->eta()>0 )? 15153.0:-15153.0;
492 //object pointed by matrix will be deleted in destructer of DiscSurface, therefore release it
493 std::unique_ptr<Trk::DiscSurface> disc(new Trk::DiscSurface( matrix, 0., 15000.));
494 const bool boundaryCheck = true;
495
496 const Trk::TrackParameters* param = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),
497 trk->perigeeParameters(),
498 *disc,
500 boundaryCheck,
501 Trk::muon).release();
502
503 ATH_MSG_DEBUG("param=" << param
504 << " eta=" << ((param) ? param->position().eta() : 0)
505 << " phi=" << ((param) ? param->position().phi() : 0));;
506 return param;
507}
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D

◆ FermiFunction()

double MuonMatchingTool::FermiFunction ( double x,
double x0,
double w )
staticprivate

Definition at line 432 of file MuonMatchingTool.cxx.

432 {
433 return 1/(1+TMath::Exp(-10*(x-x0)/w));
434}
#define x

◆ initialize()

StatusCode MuonMatchingTool::initialize ( )
overridevirtual

Definition at line 16 of file MuonMatchingTool.cxx.

16 {
17
18 ATH_CHECK( m_trigDec.retrieve() );
19 ATH_CHECK( m_thresholdTool.retrieve() );
21 ATH_CHECK( m_extrapolator.retrieve() );
22 }
23 ATH_CHECK( m_MuonContainerKey.initialize() );
24 ATH_CHECK( m_MuonRoIContainerKey.initialize() );
25 ATH_CHECK( m_L2MuonSAContainerKey.initialize() );
26 ATH_CHECK( m_L2muCombContainerKey.initialize() );
27 ATH_CHECK( m_EFSAMuonContainerKey.initialize() );
28 ATH_CHECK( m_EFCBMuonContainerKey.initialize() );
29 ATH_CHECK( m_EFSAFSMuonContainerKey.initialize() );
30 ATH_CHECK( m_EFCBFSMuonContainerKey.initialize() );
31 ATH_CHECK( m_MStrackContainerKey.initialize() );
32 ATH_CHECK( m_CBtrackContainerKey.initialize() );
33
34 return StatusCode::SUCCESS;
35}
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandle< LVL1::ITrigThresholdDecisionTool > m_thresholdTool
SG::ReadHandleKey< xAOD::MuonRoIContainer > m_MuonRoIContainerKey
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_MStrackContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_CBtrackContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFCBMuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFCBFSMuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSAFSMuonContainerKey
SG::ReadHandleKey< xAOD::L2StandAloneMuonContainer > m_L2MuonSAContainerKey
SG::ReadHandleKey< xAOD::L2CombinedMuonContainer > m_L2muCombContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Gaudi::Property< bool > m_use_extrapolator
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSAMuonContainerKey

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

◆ isMatchedL2CB()

bool MuonMatchingTool::isMatchedL2CB ( const xAOD::L2CombinedMuon * cbmu,
const xAOD::Muon * mu ) const

Definition at line 422 of file MuonMatchingTool.cxx.

422 {
423 float dR = xAOD::P4Helpers::deltaR(cbmu, mu, false);
424 return dR < m_L2CBreqdR;
425}
const float m_L2CBreqdR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi

◆ isMatchedL2InsideOut()

bool MuonMatchingTool::isMatchedL2InsideOut ( const xAOD::L2CombinedMuon * cbiomu,
const xAOD::Muon * mu ) const

Definition at line 427 of file MuonMatchingTool.cxx.

427 {
428 float dR = xAOD::P4Helpers::deltaR(cbiomu, mu, false);
429 return dR < m_L2InsideOutreqdR;
430}
const float m_L2InsideOutreqdR

◆ isMatchedL2SA()

bool MuonMatchingTool::isMatchedL2SA ( const xAOD::L2StandAloneMuon * samu,
const xAOD::Muon * mu ) const

Definition at line 410 of file MuonMatchingTool.cxx.

410 {
411 float offlEta = mu->eta();
412 float offlPhi = mu->phi();
413 float trigEta = samu->roiEta();
414 float trigPhi = samu->roiPhi();
415
416 float deta = offlEta - trigEta;
417 float dphi = xAOD::P4Helpers::deltaPhi(offlPhi, trigPhi);
418 float dR = sqrt(deta*deta + dphi*dphi);
419 return dR < m_L2SAreqdR;
420}
const float m_L2SAreqdR
float roiEta() const
Get and set RoI eta.
float roiPhi() const
Get and set RoI phi.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[

◆ L1ItemStringToInt()

int MuonMatchingTool::L1ItemStringToInt ( const std::string & l1item,
int roiSource ) const
inlineprivate

Definition at line 353 of file MuonMatchingTool.h.

353 {
354 if( "L1_MU3V"==l1item) return roiSource==0 ? L1Items::L1B_MU3V : L1Items::L1E_MU3V;
355 if( "L1_MU5VF"==l1item) return roiSource==0 ? L1Items::L1B_MU5VF : L1Items::L1E_MU5VF;
356 if( "L1_MU8F"==l1item) return roiSource==0 ? L1Items::L1B_MU8F : L1Items::L1E_MU8F;
357 if( "L1_MU14FCH"==l1item) return roiSource==0 ? L1Items::L1B_MU14FCH : L1Items::L1E_MU14FCH;
358 if( "L1_MU14FCHR"==l1item) return roiSource==0 ? L1Items::L1B_MU14FCHR : L1Items::L1E_MU14FCHR;
359 return L1Items::ERROR;
360 }

◆ match()

template<class T, class OFFL>
const T * MuonMatchingTool::match ( const OFFL * offl,
std::string trigger,
float reqdR,
bool & pass,
const std::string & containerSGKey = "",
std::tuple< bool, double, double >(* trigPosForMatchFunc )(const T *) = &MuonMatchingTool::trigPosForMatch< T > ) const
private

Function that searches for an online muon candidate of type T and judges if it is matched to a given offline muon.

Parameters
offlPosition of the offline muon used for computing dR.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
reqdRRequirement of dR used for the matching. Note that reqdR is updated with the dR of the found candidate.
passTrue if the matched candidate passed the hypothesis step.
trigPosForMatchFuncFunction pointer that implements cuts for the online muon candidates.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.
See also
MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation.
Todo
Consider improving the argument list.

◆ matchEFCB() [1/2]

const xAOD::Muon * MuonMatchingTool::matchEFCB ( const xAOD::Muon * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which EFCB candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 125 of file MuonMatchingTool.cxx.

125 {
126 ATH_MSG_DEBUG("MuonMonitoring::matchEFCB()");
127 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
128 ATH_MSG_DEBUG("HLT_Muons_RoI CB Muon");
129 return MuonTrack ? match<xAOD::Muon>( MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsCB_RoI*.*", &MuonMatchingTool::trigPosForMatchCBTrack) : nullptr;
130}
const T * match(const OFFL *offl, std::string trigger, float reqdR, bool &pass, const std::string &containerSGKey="", std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
Function that searches for an online muon candidate of type T and judges if it is matched to a given ...
static std::tuple< bool, double, double > trigPosForMatchCBTrack(const xAOD::Muon *mu)
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ matchEFCB() [2/2]

const xAOD::Muon * MuonMatchingTool::matchEFCB ( const xAOD::TruthParticle * mu,
std::string trig,
bool & pass ) const

Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given truth muon.

Parameters
muTruth muon around which EFCB candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 120 of file MuonMatchingTool.cxx.

120 {
121 ATH_MSG_DEBUG("MuonMonitoring::matchEFCB() for TruthParticle");
122 return mu ? match<xAOD::Muon>( mu, std::move(trig), m_EFreqdR, pass, "HLT_MuonsCB_RoI*.*", &MuonMatchingTool::trigPosForMatchCBTrack) : nullptr;
123}

◆ matchEFCBFS() [1/2]

const xAOD::Muon * MuonMatchingTool::matchEFCBFS ( const xAOD::Muon * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF combined muon (EFCBFS) candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which EFCBFS candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 201 of file MuonMatchingTool.cxx.

201 {
202 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFS()");
203 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
204 ATH_MSG_DEBUG("HLT_Muons_FS CB Muon");
205 return MuonTrack ? match<xAOD::Muon>( MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsCB_FS.*", &MuonMatchingTool::trigPosForMatchCBTrack) : nullptr;
206}

◆ matchEFCBFS() [2/2]

const xAOD::Muon * MuonMatchingTool::matchEFCBFS ( const xAOD::TruthParticle * mu,
std::string trig,
bool & pass ) const

Function that searches for an EF combined muon (EFCBFS) candidate and judges if it is matched to a given truth muon.

Parameters
muTruth muon around which EFCBFS candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 196 of file MuonMatchingTool.cxx.

196 {
197 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFS() for TruthParticle");
198 return mu ? match<xAOD::Muon>( mu, std::move(trig), m_EFreqdR, pass, "HLT_MuonsCB_FS.*", &MuonMatchingTool::trigPosForMatchCBTrack) : nullptr;
199}

◆ matchEFCBFSLinkInfo()

const TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > MuonMatchingTool::matchEFCBFSLinkInfo ( const xAOD::Muon * mu,
std::string trig ) const

Function that searches for an EF combined muon (EFCBFS) candidate and judges if it is matched to a given track particle.

Parameters
muOffline muon around which EFCBFS candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
Returns
Pointer to the matched candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 208 of file MuonMatchingTool.cxx.

208 {
209 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFSLinkInfo()");
210 bool pass = false;
211 TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> muonLinkInfo;
212 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
213 return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsCB_FS.*", &MuonMatchingTool::trigPosForMatchCBTrack) : muonLinkInfo;
214}
const TrigCompositeUtils::LinkInfo< DataVector< T > > matchLinkInfo(const OFFL *offl, std::string trigger, float reqdR, bool &pass, const std::string &containerSGKey="", std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
Function that searches for an online muon candidate of type T closest to a given offline muon.

◆ matchEFCBFSReadHandle()

const xAOD::Muon * MuonMatchingTool::matchEFCBFSReadHandle ( const EventContext & ctx,
const xAOD::Muon * mu ) const

Function that searches for an EF combined muon (EFCBFS) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.

Parameters
muOffline muon around which EFCBFS candidates are searched.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 216 of file MuonMatchingTool.cxx.

216 {
217 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFSReadHandle()");
218 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
220}
const T * matchReadHandle(const OFFL *offl, float reqdR, SG::ReadHandleKey< DataVector< T > > ReadHandleKey, const EventContext &ctx, std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
Function that searches for an online muon candidate of type T by ReadHandle and judges if it is match...

◆ matchEFCBLinkInfo()

const TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > MuonMatchingTool::matchEFCBLinkInfo ( const xAOD::Muon * mu,
std::string trig ) const

Function that searches for an EF combined muon (EFCB) candidate and judges if it is matched to a given track particle.

Parameters
muOffline muon around which EFCB candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
Returns
Pointer to the matched candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 132 of file MuonMatchingTool.cxx.

132 {
133 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBLinkInfo()");
134 bool pass = false;
135 TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> muonLinkInfo;
136 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
137 return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsCB_RoI*.*", &MuonMatchingTool::trigPosForMatchCBTrack) : muonLinkInfo;
138}

◆ matchEFCBReadHandle()

const xAOD::Muon * MuonMatchingTool::matchEFCBReadHandle ( const EventContext & ctx,
const xAOD::Muon * mu ) const

Function that searches for an EF combined muon (EFCB) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.

Parameters
muOffline muon around which EFCB candidates are searched.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 140 of file MuonMatchingTool.cxx.

140 {
141 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBReadHandle()");
142 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
144}

◆ matchEFIso() [1/2]

const xAOD::Muon * MuonMatchingTool::matchEFIso ( const xAOD::Muon * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which EFIso candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 222 of file MuonMatchingTool.cxx.

222 {
223 ATH_MSG_DEBUG("MuonMonitoring::matchEFIso()");
224 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
225 return MuonTrack ? match<xAOD::Muon>( MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsIso", &MuonMatchingTool::trigPosForMatchCBTrack) : nullptr;
226}

◆ matchEFIso() [2/2]

const xAOD::Muon * MuonMatchingTool::matchEFIso ( const xAOD::TruthParticle * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given truth muon.

Parameters
muTruth muon around which EFIso candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 228 of file MuonMatchingTool.cxx.

228 {
229 ATH_MSG_DEBUG("MuonMonitoring::matchEFIso() for truth particle");
230 return mu ? match<xAOD::Muon>( mu, std::move(trig), m_EFreqdR, pass, "HLT_MuonsIso", &MuonMatchingTool::trigPosForMatchCBTrack) : nullptr;
231}

◆ matchEFIsoLinkInfo()

const TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > MuonMatchingTool::matchEFIsoLinkInfo ( const xAOD::Muon * mu,
std::string trig ) const

Function that searches for an EF isolation muon (EFIso) candidate and judges if it is matched to a given track particle.

Parameters
muOffline muon around which EFIso candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
Returns
Pointer to the matched candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 264 of file MuonMatchingTool.cxx.

264 {
265 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBLinkInfo()");
266 bool pass = false;
267 TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> muonLinkInfo;
268 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
269 return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsIso", &MuonMatchingTool::trigPosForMatchCBTrack) : muonLinkInfo;
270}

◆ matchEFSA() [1/2]

const xAOD::Muon * MuonMatchingTool::matchEFSA ( const xAOD::Muon * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which EFSA candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 70 of file MuonMatchingTool.cxx.

70 {
71 ATH_MSG_DEBUG("MuonMonitoring::matchEFSA()");
72 const xAOD::TrackParticle* MuonTrack = nullptr;
73 using Type = xAOD::Muon::TrackParticleType;
74 std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
75 Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
76 Type::MuonSpectrometerTrackParticle};
77 for (Type type : types){
78 MuonTrack = mu->trackParticle(type);
79 ATH_MSG_DEBUG("HLT_Muons_RoI SA Muon");
80 if (MuonTrack) break;
81 }
82 return MuonTrack ? match<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_Muons_RoI.*", &MuonMatchingTool::trigPosForMatchSATrack) : nullptr;
83}
static const std::vector< std::string > types
RootType Type
static std::tuple< bool, double, double > trigPosForMatchSATrack(const xAOD::Muon *mu)

◆ matchEFSA() [2/2]

const xAOD::Muon * MuonMatchingTool::matchEFSA ( const xAOD::TruthParticle * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given truth muon.

Parameters
muTruth muon around which EFSA candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 85 of file MuonMatchingTool.cxx.

85 {
86 ATH_MSG_DEBUG("MuonMonitoring::matchEFSA() for truth particle");
87 return mu ? match<xAOD::Muon>(mu, std::move(trig), m_EFreqdR, pass, "HLT_Muons_RoI.*", &MuonMatchingTool::trigPosForMatchSATrack) : nullptr;
88}

◆ matchEFSAFS() [1/2]

const xAOD::Muon * MuonMatchingTool::matchEFSAFS ( const xAOD::Muon * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF FS standalone muon (EFSAFS) candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which EFSAFS candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 146 of file MuonMatchingTool.cxx.

146 {
147 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFS()");
148 const xAOD::TrackParticle* MuonTrack = nullptr;
149 using Type = xAOD::Muon::TrackParticleType;
150 std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
151 Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
152 Type::MuonSpectrometerTrackParticle};
153 for (Type type : types){
154 MuonTrack = mu->trackParticle(type);
155 ATH_MSG_DEBUG("HLT_Muons_FS SA Muon");
156 if (MuonTrack) break;
157 }
158 return MuonTrack ? match<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_Muons_FS.*", &MuonMatchingTool::trigPosForMatchSATrack) : nullptr;
159}

◆ matchEFSAFS() [2/2]

const xAOD::Muon * MuonMatchingTool::matchEFSAFS ( const xAOD::TruthParticle * mu,
std::string trigger,
bool & pass ) const

Function that searches for an EF standalone muon (EFSAFS) candidate and judges if it is matched to a given truth muon.

Parameters
muTruth muon around which EFSAFS candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 161 of file MuonMatchingTool.cxx.

161 {
162 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFS() for truth particle");
163 return mu ? match<xAOD::Muon>(mu, std::move(trig), m_EFreqdR, pass, "HLT_Muons_FS.*", &MuonMatchingTool::trigPosForMatchSATrack) : nullptr;
164}

◆ matchEFSAFSLinkInfo()

const TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > MuonMatchingTool::matchEFSAFSLinkInfo ( const xAOD::Muon * mu,
std::string trig ) const

Function that searches for an EF standalone muon (EFSAFS) candidate and judges if it is matched to a given track particle.

Parameters
muOffline muon around which EFSAFS candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
Returns
Pointer to the matched candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 166 of file MuonMatchingTool.cxx.

166 {
167 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFSLinkInfo()");
168 bool pass = false;
169 TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> muonLinkInfo;
170 const xAOD::TrackParticle* MuonTrack = nullptr;
171 using Type = xAOD::Muon::TrackParticleType;
172 std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
173 Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
174 Type::MuonSpectrometerTrackParticle};
175 for (Type type : types){
176 MuonTrack = mu->trackParticle(type);
177 if (MuonTrack) break;
178 }
179 return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_Muons_FS.*", &MuonMatchingTool::trigPosForMatchSATrack) : muonLinkInfo;
180}

◆ matchEFSAFSReadHandle()

const xAOD::Muon * MuonMatchingTool::matchEFSAFSReadHandle ( const EventContext & ctx,
const xAOD::Muon * mu ) const

Function that searches for an EF standalone muon (EFSAFS) candidate by ReadHandle and judges if it is matched to a given offlineSAFS muon.

Parameters
muOffline muon around which EFSAFS candidates are searched.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 182 of file MuonMatchingTool.cxx.

182 {
183 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFSReadHandle()");
184 const xAOD::TrackParticle* MuonTrack = nullptr;
185 using Type = xAOD::Muon::TrackParticleType;
186 std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
187 Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
188 Type::MuonSpectrometerTrackParticle};
189 for (Type type : types){
190 MuonTrack = mu->trackParticle(type);
191 if (MuonTrack) break;
192 }
194}

◆ matchEFSALinkInfo()

const TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > MuonMatchingTool::matchEFSALinkInfo ( const xAOD::Muon * mu,
std::string trig ) const

Function that searches for an EF standalone muon (EFSA) candidate and judges if it is matched to a given track particle.

Parameters
muOffline muon around which EFSA candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
Returns
Pointer to the matched candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 90 of file MuonMatchingTool.cxx.

90 {
91 ATH_MSG_DEBUG("MuonMonitoring::matchEFSALinkInfo()");
92 bool pass = false;
93 TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> muonLinkInfo;
94 const xAOD::TrackParticle* MuonTrack = nullptr;
95 using Type = xAOD::Muon::TrackParticleType;
96 std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
97 Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
98 Type::MuonSpectrometerTrackParticle};
99 for (Type type : types){
100 MuonTrack = mu->trackParticle(type);
101 if (MuonTrack) break;
102 }
103 return MuonTrack ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_Muons_RoI.*", &MuonMatchingTool::trigPosForMatchSATrack) : muonLinkInfo;
104}

◆ matchEFSAReadHandle()

const xAOD::Muon * MuonMatchingTool::matchEFSAReadHandle ( const EventContext & ctx,
const xAOD::Muon * mu ) const

Function that searches for an EF standalone muon (EFSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.

Parameters
muOffline muon around which EFSA candidates are searched.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 106 of file MuonMatchingTool.cxx.

106 {
107 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAReadHandle()");
108 const xAOD::TrackParticle* MuonTrack = nullptr;
109 using Type = xAOD::Muon::TrackParticleType;
110 std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
111 Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
112 Type::MuonSpectrometerTrackParticle};
113 for (Type type : types){
114 MuonTrack = mu->trackParticle(type);
115 if (MuonTrack) break;
116 }
118}

◆ matchL1() [1/3]

const xAOD::MuonRoI * MuonMatchingTool::matchL1 ( const xAOD::Muon * mu,
const std::string & trigger,
bool & pass ) const

Function that searches for a Level 1 muon candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which Level 1 candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if a candidate is found.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 378 of file MuonMatchingTool.cxx.

378 {
379 double refEta = mu->eta();
380 double refPhi = mu->phi();
381 double reqdR = 0.25;
382
384 reqdR = reqdRL1byPt(mu->pt());
385 const Amg::Vector3D extPos = offlineMuonAtPivot(mu);
386 if(extPos.norm()>ZERO_LIMIT){
387 refEta = extPos.eta();
388 refPhi = extPos.phi();
389 }
390 }
391 return matchL1(refEta, refPhi, reqdR, trig, pass);
392}
const float ZERO_LIMIT
const Amg::Vector3D offlineMuonAtPivot(const xAOD::Muon *mu) const
static double reqdRL1byPt(double mupt)
Function compute dR used for matching offline muons and level 1 RoIs at the pivot plane.
const xAOD::MuonRoI * matchL1(const xAOD::Muon *mu, const std::string &trigger, bool &pass) const
Function that searches for a Level 1 muon candidate and judges if it is matched to a given offline mu...

◆ matchL1() [2/3]

const xAOD::MuonRoI * MuonMatchingTool::matchL1 ( const xAOD::TruthParticle * mu,
const std::string & trigger,
bool & pass ) const

Function that searches for a Level 1 truth muon candidate and judges if it is matched to a given offline muon.

Parameters
muTruth muon around which Level 1 candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if a candidate is found.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 394 of file MuonMatchingTool.cxx.

394 {
395 double refEta = mu->eta();
396 double refPhi = mu->phi();
397 double reqdR = 0.25;
398 return matchL1(refEta, refPhi, reqdR, trig, pass);
399}

◆ matchL1() [3/3]

const xAOD::MuonRoI * MuonMatchingTool::matchL1 ( double eta,
double phi,
double dR,
const std::string & trigger,
bool & pass ) const

Function that dR matches L1 muon candidates.

Parameters
etaEta of muon around which Level 1 candidates are searched.
phiPhi of muon around which Level 1 candidates are searched.
dRdR limit within which a match is accepted.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if a candidate is found.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Retrieve the chain configuration and the lower name corresponding to the L1 threshold

Definition at line 332 of file MuonMatchingTool.cxx.

332 {
333
335 const TrigConf::HLTChain* chainCfg = m_trigDec->ExperimentalAndExpertMethods().getChainConfigurationDetails(trig);
336 const std::string L1toMatch = chainCfg->lower_chain_name().substr(3);
337
338 SG::ReadHandle<xAOD::MuonRoIContainer> L1rois(m_MuonRoIContainerKey, Gaudi::Hive::currentContext());
339 const xAOD::MuonRoI *closest = nullptr;
340
341 for (const xAOD::MuonRoI* l1muon : *L1rois){
342
343 // get all L1 thresholds from the L1 menu along with whether the L1roi passed each of those or not
344 const std::vector<std::pair<std::shared_ptr<TrigConf::L1Threshold>, bool> > L1thr_list = m_thresholdTool-> getThresholdDecisions(
345 l1muon->roiWord(), Gaudi::Hive::currentContext());
346
347 // check the L1 threshold we are looking for
348 bool L1thr_isMatch = false;
349 for(const std::pair<std::shared_ptr<TrigConf::L1Threshold>, bool>& L1thr : L1thr_list){
350 std::shared_ptr<TrigConf::L1Threshold_MU> thr = std::static_pointer_cast<TrigConf::L1Threshold_MU>(L1thr.first);
351 if (L1toMatch == thr->name()){
352 L1thr_isMatch = L1thr.second;
353 break;
354 }
355 }
356 if (!L1thr_isMatch) continue;
357
358 double l1muonEta = l1muon->eta();
359 double l1muonPhi = l1muon->phi();
360
361 double deta = refEta - l1muonEta;
362 double dphi = xAOD::P4Helpers::deltaPhi(refPhi, l1muonPhi);
363 double dR = std::sqrt(deta*deta + dphi*dphi);
364 ATH_MSG_DEBUG("L1 muon candidate eta=" << l1muonEta << " phi=" << l1muonPhi << " dR=" << dR);
365 if( dR<reqdR ){
366 reqdR = dR;
367 pass = true;
368 closest = l1muon;
369 ATH_MSG_DEBUG("*** L1 muon eta=" << l1muonEta << " phi=" << l1muonPhi << " dR=" << dR << " isPassed=true" );
370 }
371 else{
372 ATH_MSG_DEBUG("*** L1 muon eta=" << l1muonEta << " phi=" << l1muonPhi << " dR=" << dR << " isPassed=false" );
373 }
374 }
375 return closest;
376}
const std::string & lower_chain_name() const
MuonRoI_v1 MuonRoI
Definition MuonRoI.h:15

◆ matchL2CB()

const xAOD::L2CombinedMuon * MuonMatchingTool::matchL2CB ( const xAOD::Muon * mu,
std::string trigger,
bool & pass ) const

Function that searches for an L2 combined muon (L2muComb) candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which L2muComb candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 315 of file MuonMatchingTool.cxx.

315 {
316 ATH_MSG_DEBUG("MuonMonitoring::matchL2CB()");
317 return match<xAOD::L2CombinedMuon>( mu, std::move(trig), m_L2CBreqdR, pass, "HLT_MuonL2CBInfo");
318}

◆ matchL2CBReadHandle()

const xAOD::L2CombinedMuon * MuonMatchingTool::matchL2CBReadHandle ( const EventContext & ctx,
const xAOD::Muon * mu ) const

Function that searches for an L2 combined muon (L2muComb) candidate by ReadHandle and judges if it is matched to a given offlineCB muon.

Parameters
muOffline muon around which L2muComb candidates are searched.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 326 of file MuonMatchingTool.cxx.

326 {
327 ATH_MSG_DEBUG("MuonMonitoring::matchL2CBReadHandle()");
328 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
329 return MuonTrack ? matchReadHandle<xAOD::L2CombinedMuon>( MuonTrack, m_L2CBreqdR, m_L2muCombContainerKey, ctx) : nullptr;
330}

◆ matchL2CBtoOff()

const xAOD::Muon * MuonMatchingTool::matchL2CBtoOff ( const EventContext & ctx,
const xAOD::L2CombinedMuon * cbmu ) const

Function that searches for an offline muon matched to L2CB muon.

Parameters
ctxReference to the EventContext needed for accessing the Muons container.
cbmuthe given online muon
Returns
Pointer to the matched offline muon. This is nullptr when there is no muon found.

Definition at line 405 of file MuonMatchingTool.cxx.

405 {
407}
const xAOD::Muon * matchOff(const EventContext &ctx, const T *trig, float reqdR, std::tuple< bool, double, double >(*offlinePosForMatchFunc)(const xAOD::Muon *), std::tuple< bool, double, double >(*trigPosForMatchFunc)(const T *)=&MuonMatchingTool::trigPosForMatch< T >) const
Function that searches for an offline muon candidate matched to online muon of type T.
static std::tuple< bool, double, double > PosForMatchCBTrack(const xAOD::Muon *mu)

◆ matchL2SA()

const xAOD::L2StandAloneMuon * MuonMatchingTool::matchL2SA ( const xAOD::Muon * mu,
const std::string & trigger,
bool & pass ) const

Function that searches for an L2 standalone muon (L2MuonSA) candidate and judges if it is matched to a given offline muon.

Parameters
muOffline muon around which L2MuonSA candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
passTrue if the matched candidate passed the hypothesis step.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.

Definition at line 273 of file MuonMatchingTool.cxx.

273 {
274 ATH_MSG_DEBUG("MuonMonitoring::matchL2SA()");
275 float reqdR = m_L2SAreqdR;
277 reqdR = reqdRL1byPt(mu->pt());
278 const Amg::Vector3D extPos = offlineMuonAtPivot(mu);
279 if(extPos.norm()>ZERO_LIMIT){
280 return match<xAOD::L2StandAloneMuon>( &extPos, trig, reqdR, pass);
281 }
282 }
283 return match<xAOD::L2StandAloneMuon>( mu, trig, reqdR, pass, "HLT_MuonL2SAInfo");
284}

◆ matchL2SAReadHandle()

const xAOD::L2StandAloneMuon * MuonMatchingTool::matchL2SAReadHandle ( const EventContext & ctx,
const xAOD::Muon * mu ) const

Function that searches for an L2 standalone muon (L2MuonSA) candidate by ReadHandle and judges if it is matched to a given offlineSA muon.

Parameters
muOffline muon around which L2MuonSA candidates are searched.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.

Definition at line 292 of file MuonMatchingTool.cxx.

292 {
293 ATH_MSG_DEBUG("MuonMonitoring::matchL2SAReadHandle()");
294 float reqdR = m_L2SAreqdR;
296 reqdR = reqdRL1byPt(mu->pt());
297 const Amg::Vector3D extPos = offlineMuonAtPivot(mu);
298 if(extPos.norm()>ZERO_LIMIT){
300 }
301 }
302 const xAOD::TrackParticle* MuonTrack = nullptr;
303 using Type = xAOD::Muon::TrackParticleType;
304 std::vector<Type> types { Type::ExtrapolatedMuonSpectrometerTrackParticle,
305 Type::MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
306 Type::MuonSpectrometerTrackParticle};
307 for (Type type : types){
308 MuonTrack = mu->trackParticle(type);
309 if (MuonTrack) break;
310 }
311 return MuonTrack ? matchReadHandle<xAOD::L2StandAloneMuon>( MuonTrack, reqdR, m_L2MuonSAContainerKey, ctx) : nullptr;
312}

◆ matchL2SAtoOff()

const xAOD::Muon * MuonMatchingTool::matchL2SAtoOff ( const EventContext & ctx,
const xAOD::L2StandAloneMuon * samu ) const

Function that searches for an offline muon matched to L2SA muon.

Parameters
ctxReference to the EventContext needed for accessing the Muons container.
samuthe given online muon
Returns
Pointer to the matched offline muon. This is nullptr when there is no muon found.

Definition at line 401 of file MuonMatchingTool.cxx.

401 {
403}
static std::tuple< bool, double, double > PosForMatchSATrack(const xAOD::Muon *mu)

◆ matchLinkInfo()

template<class T, class OFFL>
const TrigCompositeUtils::LinkInfo< DataVector< T > > MuonMatchingTool::matchLinkInfo ( const OFFL * offl,
std::string trigger,
float reqdR,
bool & pass,
const std::string & containerSGKey = "",
std::tuple< bool, double, double >(* trigPosForMatchFunc )(const T *) = &MuonMatchingTool::trigPosForMatch< T > ) const
private

Function that searches for an online muon candidate of type T closest to a given offline muon.

Parameters
offlPosition of the offline muon used for computing dR.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
trigPosForMatchFuncFunction pointer that implements cuts for the online muon candidates.
Returns
LinkInfo to the matched candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.
See also
MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation.
Todo
Consider improving the argument list.

◆ matchOff()

template<class T>
const xAOD::Muon * MuonMatchingTool::matchOff ( const EventContext & ctx,
const T * trig,
float reqdR,
std::tuple< bool, double, double >(* offlinePosForMatchFunc )(const xAOD::Muon *),
std::tuple< bool, double, double >(* trigPosForMatchFunc )(const T *) = &MuonMatchingTool::trigPosForMatch< T > ) const
private

Function that searches for an offline muon candidate matched to online muon of type T.

Parameters
trigPosition of the online muon used for computing dR.
reqdRRequirement of dR used for the matching. Note that reqdR is updated with the dR of the found candidate.
offlinePosForMatchFuncFunction pointer that implements cuts for the offline muon candidates.
trigPosForMatchFuncFunction pointer that implements cuts for the online muon candidates.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis, users should check pass for the decision.
See also
MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation.
Todo
Consider improving the argument list.

◆ matchReadHandle()

template<class T, class OFFL>
const T * MuonMatchingTool::matchReadHandle ( const OFFL * offl,
float reqdR,
SG::ReadHandleKey< DataVector< T > > ReadHandleKey,
const EventContext & ctx,
std::tuple< bool, double, double >(* trigPosForMatchFunc )(const T *) = &MuonMatchingTool::trigPosForMatch< T > ) const
private

Function that searches for an online muon candidate of type T by ReadHandle and judges if it is matched to a given offline muon.

Parameters
offlPosition of the offline muon used for computing dR.
reqdRRequirement of dR used for the matching. Note that reqdR is updated with the dR of the found candidate.
ReadHandleKeySG::ReadHandleKey of online muon.
ctxEventContext.
trigPosForMatchFuncFunction pointer that implements cuts for the online muon candidates.
Returns
Pointer to the matched candidate. This is nullptr when there is no candidate found.
See also
MuonMatchingTool.icc for the implementation and MuonMatchingTool.cxx for the instantiation.
Todo
Consider improving the argument list.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

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

◆ offlineMuonAtPivot()

const Amg::Vector3D MuonMatchingTool::offlineMuonAtPivot ( const xAOD::Muon * mu) const
private

Definition at line 38 of file MuonMatchingTool.cxx.

38 {
39 const xAOD::TrackParticle* track = mu->primaryTrackParticle();
40 std::unique_ptr<const Trk::TrackParameters> extPars(extTrackToPivot(track));
41 return extPars ? extPars->position() : Amg::Vector3D(0.,0.,0.);
42}
const Trk::TrackParameters * extTrackToPivot(const xAOD::TrackParticle *track) const
Function to extrapolate a Inner Detector track to the pivot plane i.e.

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

◆ PosForMatchCBTrack()

std::tuple< bool, double, double > MuonMatchingTool::PosForMatchCBTrack ( const xAOD::Muon * mu)
static

Definition at line 64 of file MuonMatchingTool.cxx.

64 {
65 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle);
66 return MuonTrack ? std::forward_as_tuple(true, MuonTrack->eta(), MuonTrack->phi()) : std::forward_as_tuple(false, 0., 0.);
67}
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.

◆ PosForMatchSATrack()

std::tuple< bool, double, double > MuonMatchingTool::PosForMatchSATrack ( const xAOD::Muon * mu)
static

Definition at line 59 of file MuonMatchingTool.cxx.

59 {
60 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
61 return MuonTrack ? std::forward_as_tuple(true, MuonTrack->eta(), MuonTrack->phi()) : std::forward_as_tuple(false, 0., 0.);
62}

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

◆ reqdRL1byPt()

double MuonMatchingTool::reqdRL1byPt ( double mupt)
static

Function compute dR used for matching offline muons and level 1 RoIs at the pivot plane.

This is needed that the accuracy of the extrapolation by extTrackToPivot is dependent on the pt of the offline muon.

Parameters
muptOffline muon pt
Returns
Required dR between the offline muon and Level 1 muons

Definition at line 528 of file MuonMatchingTool.cxx.

528 {
529 double dR = 0.08;
530 if( mupt < 10000. ) {
531 dR = -0.00001*mupt + 0.18;
532 }
533 return dR;
534}

◆ SearchEFTrack()

const xAOD::TrackParticle * MuonMatchingTool::SearchEFTrack ( const EventContext & ctx,
const TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > & muLinkInfo,
const SG::ReadHandleKey< xAOD::TrackParticleContainer > & ReadHandleKey ) const

Function that searches for an EF muon track (e.g.

ExtrapolatedMuonSpectrometerTrackParticle, CombinedTrackParticle) matched to a EF muon.

Parameters
ctxReference to the EventContext needed for accessing the TrackParticle container.
muLinkInfoLinkInfo of EF muon.
ReadHandleKeyof TrackParticle container.
Returns
Pointer to the matched TrackParticle. This is nullpt rwhen there is no TrackParticle found.

Definition at line 234 of file MuonMatchingTool.cxx.

234 {
235 const xAOD::TrackParticle* MatchedTrack = nullptr;
236 const ElementLink<xAOD::MuonContainer> muEL = muLinkInfo.link;
237 float EFEta = (*muEL)->eta();
238 float EFPhi = (*muEL)->phi();
239 float mindR = 999.;
240
241 SG::ReadHandle<xAOD::TrackParticleContainer> trackHandle(ReadHandleKey, ctx);
242 if ( !trackHandle.isValid() ) return MatchedTrack;
243
244 const auto track = m_trigDec->associateToEventView<xAOD::TrackParticleContainer>(trackHandle, muLinkInfo);
247
248 for (xAOD::TrackParticleContainer::const_iterator it = begin; it != end; ++it) {
249
250 float deta = EFEta - (*it)->eta();
251 float dphi = xAOD::P4Helpers::deltaPhi(EFPhi, (*it)->phi() );
252 float dR = std::sqrt(deta*deta + dphi*dphi);
253
254 if( dR< mindR ){
255 mindR = dR;
256 MatchedTrack = (*it);
257 }
258 }
259
260 return MatchedTrack;
261
262}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
ElementLink< T > link
Link to the feature.
Definition LinkInfo.h:55

◆ searchL2CBLinkInfo()

const TrigCompositeUtils::LinkInfo< xAOD::L2CombinedMuonContainer > MuonMatchingTool::searchL2CBLinkInfo ( const xAOD::Muon * mu,
std::string trigger ) const

Function that searches for the L2 combined muon (L2muComb) candidate closest to a given offline muon.

Parameters
muOffline muon around which L2MuonSA candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
Returns
LinkInfo to the found candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis and matched, users should check pass for the decision and pass for knowing if it is really matched.
Todo
Consider improving the argument list.

Definition at line 320 of file MuonMatchingTool.cxx.

320 {
321 ATH_MSG_DEBUG("MuonMonitoring::searchL2CBLinkInfo()");
322 bool pass = false;
323 return matchLinkInfo<xAOD::L2CombinedMuon>( mu, std::move(trig), 1000., pass, "HLT_MuonL2CBInfo");
324}

◆ searchL2SALinkInfo()

const TrigCompositeUtils::LinkInfo< xAOD::L2StandAloneMuonContainer > MuonMatchingTool::searchL2SALinkInfo ( const xAOD::Muon * mu,
std::string trigger ) const

Function that searches for the L2 standalone muon (L2MuonSA) candidate closest to a given offline muon.

Parameters
muOffline muon around which L2MuonSA candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_ivarmedium_L1MU20, etc.
Returns
LinkInfo to the found candidate. This is inValid link when there is no candidate found. Important: a valid pointer doesn't mean that it passed the hypothesis and matched, users should check pass for the decision and pass for knowing if it is really matched.
Todo
Consider improving the argument list.

Definition at line 286 of file MuonMatchingTool.cxx.

286 {
287 ATH_MSG_DEBUG("MuonMonitoring::searchL2SALinkInfo()");
288 bool pass = false;
289 return matchLinkInfo<xAOD::L2StandAloneMuon>( mu, std::move(trig), 1000., pass, "HLT_MuonL2SAInfo");
290}

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

◆ trigPosForMatch()

template<class T>
std::tuple< bool, double, double > MuonMatchingTool::trigPosForMatch ( const T * trig)
inlinestaticprivate

◆ trigPosForMatchCBTrack()

std::tuple< bool, double, double > MuonMatchingTool::trigPosForMatchCBTrack ( const xAOD::Muon * mu)
static

Definition at line 55 of file MuonMatchingTool.cxx.

55 {
56 return mu->muonType() == xAOD::Muon::MuonType::Combined ? std::forward_as_tuple(true, mu->eta(), mu->phi()) : std::forward_as_tuple(false, 0., 0.);
57}

◆ trigPosForMatchSATrack()

std::tuple< bool, double, double > MuonMatchingTool::trigPosForMatchSATrack ( const xAOD::Muon * mu)
static

Definition at line 51 of file MuonMatchingTool.cxx.

51 {
52 return mu->muonType() == xAOD::Muon::MuonType::MuonStandAlone ? std::forward_as_tuple(true, mu->eta(), mu->phi()) : std::forward_as_tuple(false, 0., 0.);
53}

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

SG::ReadHandleKey<xAOD::TrackParticleContainer> MuonMatchingTool::m_CBtrackContainerKey {this, "CBtrackContainerName", "HLT_CBCombinedMuon_RoITrackParticles", "CombinedMuon track container"}
private

Definition at line 449 of file MuonMatchingTool.h.

449{this, "CBtrackContainerName", "HLT_CBCombinedMuon_RoITrackParticles", "CombinedMuon track container"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_EFCBFSMuonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> MuonMatchingTool::m_EFCBFSMuonContainerKey {this, "EFCBFSMuonContainerName", "HLT_MuonsCB_FS", "EFCBFSMuon container"}
private

Definition at line 447 of file MuonMatchingTool.h.

447{this, "EFCBFSMuonContainerName", "HLT_MuonsCB_FS", "EFCBFSMuon container"};

◆ m_EFCBMuonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> MuonMatchingTool::m_EFCBMuonContainerKey {this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"}
private

Definition at line 445 of file MuonMatchingTool.h.

445{this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"};

◆ m_EFreqdR

const float MuonMatchingTool::m_EFreqdR = 0.03
private

Definition at line 365 of file MuonMatchingTool.h.

◆ m_EFSAFSMuonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> MuonMatchingTool::m_EFSAFSMuonContainerKey {this, "EFSAFSMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"}
private

Definition at line 446 of file MuonMatchingTool.h.

446{this, "EFSAFSMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"};

◆ m_EFSAMuonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> MuonMatchingTool::m_EFSAMuonContainerKey {this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"}
private

Definition at line 444 of file MuonMatchingTool.h.

444{this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extrapolator

PublicToolHandle<Trk::IExtrapolator> MuonMatchingTool::m_extrapolator {"Trk::Extrapolator/AtlasExtrapolator"}
private

Definition at line 459 of file MuonMatchingTool.h.

459{"Trk::Extrapolator/AtlasExtrapolator"};

◆ m_L2CBreqdR

const float MuonMatchingTool::m_L2CBreqdR = 0.03
private

Definition at line 363 of file MuonMatchingTool.h.

◆ m_L2InsideOutreqdR

const float MuonMatchingTool::m_L2InsideOutreqdR = 0.01
private

Definition at line 364 of file MuonMatchingTool.h.

◆ m_L2muCombContainerKey

SG::ReadHandleKey<xAOD::L2CombinedMuonContainer> MuonMatchingTool::m_L2muCombContainerKey {this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"}
private

Definition at line 443 of file MuonMatchingTool.h.

443{this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"};

◆ m_L2MuonSAContainerKey

SG::ReadHandleKey<xAOD::L2StandAloneMuonContainer> MuonMatchingTool::m_L2MuonSAContainerKey {this, "L2StandAloneMuonContainerName", "HLT_MuonL2SAInfo", "L2MuonSA container"}
private

Definition at line 442 of file MuonMatchingTool.h.

442{this, "L2StandAloneMuonContainerName", "HLT_MuonL2SAInfo", "L2MuonSA container"};

◆ m_L2SAreqdR

const float MuonMatchingTool::m_L2SAreqdR = 0.25
private

Definition at line 362 of file MuonMatchingTool.h.

◆ m_MStrackContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> MuonMatchingTool::m_MStrackContainerKey {this, "ExtrapolatedMStrackConntainner", "HLT_MSExtrapolatedMuons_RoITrackParticles", "ExtrapolatedMuons track container"}
private

Definition at line 448 of file MuonMatchingTool.h.

448{this, "ExtrapolatedMStrackConntainner", "HLT_MSExtrapolatedMuons_RoITrackParticles", "ExtrapolatedMuons track container"};

◆ m_MuonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> MuonMatchingTool::m_MuonContainerKey {this, "MuonContainerName", "Muons", "Offline muon container"}
private

Definition at line 441 of file MuonMatchingTool.h.

441{this, "MuonContainerName", "Muons", "Offline muon container"};

◆ m_MuonRoIContainerKey

SG::ReadHandleKey<xAOD::MuonRoIContainer> MuonMatchingTool::m_MuonRoIContainerKey {this, "MuonRoIContainerName", "LVL1MuonRoIs", "Level 1 muon container"}
private

Definition at line 440 of file MuonMatchingTool.h.

440{this, "MuonRoIContainerName", "LVL1MuonRoIs", "Level 1 muon container"};

◆ m_thresholdTool

ToolHandle<LVL1::ITrigThresholdDecisionTool> MuonMatchingTool::m_thresholdTool
private
Initial value:
{
this, "TrigThresholdDecisionTool", "LVL1::TrigThresholdDecisionTool/LVL1__TrigThresholdDecisionTool",
"Tool to get pass/fail of each trigger threshold"}

Definition at line 455 of file MuonMatchingTool.h.

455 {
456 this, "TrigThresholdDecisionTool", "LVL1::TrigThresholdDecisionTool/LVL1__TrigThresholdDecisionTool",
457 "Tool to get pass/fail of each trigger threshold"};

◆ m_trigDec

PublicToolHandle<Trig::TrigDecisionTool> MuonMatchingTool::m_trigDec {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", "TrigDecisionTool"}
private

Definition at line 458 of file MuonMatchingTool.h.

458{this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", "TrigDecisionTool"};

◆ m_use_extrapolator

Gaudi::Property<bool> MuonMatchingTool::m_use_extrapolator {this, "UseExtrapolator", false, "Flag to enable the extrapolator for matching offline and trigger muons"}
private

Definition at line 452 of file MuonMatchingTool.h.

452{this, "UseExtrapolator", false, "Flag to enable the extrapolator for matching offline and trigger muons"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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