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 EventContext &ctx, 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 EventContext &ctx, 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 (const EventContext &ctx, double eta, double phi, double dR, const std::string &trigger, bool &pass) const
 Function that dR matches L1 muon candidates.
const xAOD::L2StandAloneMuonmatchL2SA (const EventContext &ctx, 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 xAOD::MuonmatchFastRecoSA (const EventContext &ctx, const xAOD::Muon *mu, const std::string &trigger, bool &pass) const
 Function that searches for a EF fast reco muon (PhaseII) candidate and judges if it is matched to a given offline muon.
const xAOD::L2StandAloneMuonmatchL2SA (const xAOD::TruthParticle *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 truth particle.
const xAOD::MuonmatchFastRecoSA (const xAOD::TruthParticle *mu, const std::string &trigger, bool &pass) const
 Function that searches for a EF fast reco standalone muon (PhaseII) candidate and judges if it is matched to a given truth particle.
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 TrigCompositeUtils::LinkInfo< xAOD::MuonContainersearchFastRecoSALinkInfo (const xAOD::Muon *mu, std::string trigger) const
 Function that searches for the EF fast reco standalone 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::MuonmatchFastRecoSAReadHandle (const EventContext &ctx, const xAOD::Muon *mu) const
 Function that searches for a EF fast reco standalone muon (PhaseII) 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 xAOD::L2CombinedMuonmatchL2CB (const xAOD::TruthParticle *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 truth 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::MuonmatchFastRecoSAtoOff (const EventContext &ctx, const xAOD::Muon *samu) const
 Function that searches for an offline muon matched to EF Fast Reco SA 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 isMatchedFastRecoSA (const xAOD::Muon *, const xAOD::Muon *) const
bool isMatchedL2CB (const xAOD::L2CombinedMuon *, const xAOD::Muon *) const
bool isMatchedL2InsideOut (const xAOD::L2CombinedMuon *, const xAOD::Muon *) const
std::unique_ptr< Trk::TrackParametersextTrackToPivot (const EventContext &ctx, 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, const bool isPhaseII=false)
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, const 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::function< std::tuple< bool, double, double >(const xAOD::Muon *)> offlinePosForMatchFunc, std::function< std::tuple< bool, double, double >(const T *)> trigPosForMatchFunc=&MuonMatchingTool::trigPosForMatch< T >) const
 Function that searches for an offline muon candidate matched to online muon of type T.
Amg::Vector3D offlineMuonAtPivot (const EventContext &ctx, const xAOD::Muon &mu) const
std::unique_ptr< Trk::TrackParametersextTrackToTGC (const EventContext &ctx, const xAOD::TrackParticle &track) const
std::unique_ptr< Trk::TrackParametersextTrackToRPC (const EventContext &ctx, 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

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_MuonRoIKey {this, "MuonRoIContainerName", "LVL1MuonRoIs", "Level 1 muon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_MuonKey {this, "MuonContainerName", "Muons", "Offline muon container"}
SG::ReadHandleKey< xAOD::L2StandAloneMuonContainerm_L2SAMuonKey {this, "L2StandAloneMuonContainerName", "HLT_FastMuons_RoI", "L2MuonSA container"}
SG::ReadHandleKey< xAOD::MuonContainerm_FastRecoSAMuonKey {this, "FastRecoSAContainerName", "HLT_FastMuonsInfo", "EFFastRecoSA container (Phase2)"}
SG::ReadHandleKey< xAOD::L2CombinedMuonContainerm_L2CBMuonKey {this, "L2CombinedMuonContainerName", "HLT_MuonL2CBInfo", "L2muComb container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSAMuonKey {this, "EFSAMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSAMlbktMuonKey {this, "EFSAMlbktMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSANewFastMuonKey {this, "EFSANewFastMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFCBMuonKey {this, "EFCBMuonContainerName", "HLT_MuonsCB_RoI", "EFCBMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSAFSMuonKey {this, "EFSAFSMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSAFSMlbktMuonKey {this, "EFSAFSMlbktMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFSAFSNewFastMuonKey {this, "EFSAFSNewFastMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"}
SG::ReadHandleKey< xAOD::MuonContainerm_EFCBFSMuonKey {this, "EFCBFSMuonContainerName", "HLT_MuonsCB_FS", "EFCBFSMuon container"}
Gaudi::Property< bool > m_use_extrapolator {this, "UseExtrapolator", false, "Flag to enable the extrapolator for matching offline and trigger muons"}
BooleanProperty m_isPhII {this, "isPhaseII", false, "Whether the muons have been processed with Phase II software"}
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 28 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 419 of file MuonMatchingTool.h.

Constructor & Destructor Documentation

◆ MuonMatchingTool()

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

Definition at line 28 of file MuonMatchingTool.cxx.

29 : AthAlgTool(type, name, parent)
30{}
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()

std::unique_ptr< Trk::TrackParameters > MuonMatchingTool::extTrackToPivot ( const EventContext & ctx,
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
ctxReference to the EventContext
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 640 of file MuonMatchingTool.cxx.

641 {
642 if (!track) return nullptr;
643
644 double trkEta = track->eta();
645 using Return_t = std::unique_ptr<Trk::TrackParameters>;
646
647 // BARREL REGION
648 if (std::abs(trkEta) < 1.05) {
649 Return_t extRPC = extTrackToRPC(ctx, *track);
650 if (!extRPC) {
651 return extTrackToTGC(ctx, *track);
652 }
653 //If the extrapolated eta is in the endcap region, return the TGC extrapolation
654 if (std::abs(extRPC->position().eta()) >= 1.05){
655 if (Return_t extTGC = extTrackToTGC(ctx, *track)) {
656 return extTGC;
657 }
658 }
659 //If the extrapolated eta is still in the barrel region, or the TGC extrapolation fails, return the RPC extrapolation
660 return extRPC;
661 }
662
663 // ENDCAP REGION (same logic as above, but reversed)
664 Return_t extTGC = extTrackToTGC(ctx, *track);
665 if (!extTGC) {
666 return extTrackToRPC(ctx, *track);
667 }
668 if (std::abs(extTGC->position().eta()) < 1.05) {
669 if (Return_t extRPC = extTrackToRPC(ctx, *track)) {
670 return extRPC;
671 }
672 }
673 return extTGC;
674}
std::unique_ptr< Trk::TrackParameters > extTrackToRPC(const EventContext &ctx, const xAOD::TrackParticle &track) const
std::unique_ptr< Trk::TrackParameters > extTrackToTGC(const EventContext &ctx, const xAOD::TrackParticle &track) const

◆ extTrackToRPC()

std::unique_ptr< Trk::TrackParameters > MuonMatchingTool::extTrackToRPC ( const EventContext & ctx,
const xAOD::TrackParticle & track ) const
private

Definition at line 693 of file MuonMatchingTool.cxx.

694 {
695 Trk::CylinderSurface barrel {7478., 15000.};
696 const bool boundaryCheck = true;
697
698 return m_extrapolator->extrapolate(ctx,
699 trk.perigeeParameters(),
700 barrel,
702 boundaryCheck,
703 Trk::muon);
704}
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
@ anyDirection

◆ extTrackToTGC()

std::unique_ptr< Trk::TrackParameters > MuonMatchingTool::extTrackToTGC ( const EventContext & ctx,
const xAOD::TrackParticle & track ) const
private

Definition at line 677 of file MuonMatchingTool.cxx.

678 {
679 double TGC_Z = ( trk.eta()>0 )? 15153.0:-15153.0;
681 Trk::DiscSurface disc{matrix, 0., 15000.};
682 const bool boundaryCheck = true;
683
684 return m_extrapolator->extrapolate(ctx,
685 trk.perigeeParameters(),
686 disc,
688 boundaryCheck,
689 Trk::muon);
690}
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D

◆ initialize()

StatusCode MuonMatchingTool::initialize ( )
overridevirtual

Definition at line 33 of file MuonMatchingTool.cxx.

33 {
34
35 ATH_CHECK(m_trigDec.retrieve() );
36 ATH_CHECK(m_thresholdTool.retrieve() );
38 ATH_CHECK(m_extrapolator.retrieve() );
39 }
40 ATH_CHECK(m_MuonKey.initialize(!m_MuonKey.empty()));
41 ATH_CHECK(m_MuonRoIKey.initialize());
42 ATH_CHECK(m_L2SAMuonKey.initialize());
44 ATH_CHECK(m_L2CBMuonKey.initialize());
45 ATH_CHECK(m_EFSAMuonKey.initialize());
48 ATH_CHECK(m_EFCBMuonKey.initialize());
49 ATH_CHECK(m_EFSAFSMuonKey.initialize());
52 ATH_CHECK(m_EFCBFSMuonKey.initialize());
53
54 return StatusCode::SUCCESS;
55}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSAFSMuonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSAMuonKey
SG::ReadHandleKey< xAOD::MuonRoIContainer > m_MuonRoIKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSAMlbktMuonKey
ToolHandle< LVL1::ITrigThresholdDecisionTool > m_thresholdTool
SG::ReadHandleKey< xAOD::L2CombinedMuonContainer > m_L2CBMuonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFCBMuonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFCBFSMuonKey
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSAFSMlbktMuonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSANewFastMuonKey
SG::ReadHandleKey< xAOD::L2StandAloneMuonContainer > m_L2SAMuonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_FastRecoSAMuonKey
SG::ReadHandleKey< xAOD::MuonContainer > m_EFSAFSNewFastMuonKey
Gaudi::Property< bool > m_use_extrapolator

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

◆ isMatchedFastRecoSA()

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

Definition at line 621 of file MuonMatchingTool.cxx.

622 {
623 return xAOD::P4Helpers::deltaR(mu, samu, false) < m_L2SAreqdR;
624}
const float m_L2SAreqdR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi

◆ isMatchedL2CB()

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

Definition at line 628 of file MuonMatchingTool.cxx.

629 {
630 return xAOD::P4Helpers::deltaR(cbmu, mu, false) < m_L2CBreqdR;
631}
const float m_L2CBreqdR

◆ isMatchedL2InsideOut()

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

Definition at line 634 of file MuonMatchingTool.cxx.

635 {
636 return xAOD::P4Helpers::deltaR(cbiomu, mu, false) < m_L2InsideOutreqdR;
637}
const float m_L2InsideOutreqdR

◆ isMatchedL2SA()

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

Definition at line 615 of file MuonMatchingTool.cxx.

616 {
617 return xAOD::P4Helpers::deltaR(mu, samu, false) < m_L2SAreqdR;
618}

◆ L1ItemStringToInt()

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

Definition at line 420 of file MuonMatchingTool.h.

420 {
421 if( "L1_MU3V"==l1item) return roiSource==0 ? L1Items::L1B_MU3V : L1Items::L1E_MU3V;
422 if( "L1_MU5VF"==l1item) return roiSource==0 ? L1Items::L1B_MU5VF : L1Items::L1E_MU5VF;
423 if( "L1_MU8F"==l1item) return roiSource==0 ? L1Items::L1B_MU8F : L1Items::L1E_MU8F;
424 if( "L1_MU14FCH"==l1item) return roiSource==0 ? L1Items::L1B_MU14FCH : L1Items::L1E_MU14FCH;
425 if( "L1_MU14FCHR"==l1item) return roiSource==0 ? L1Items::L1B_MU14FCHR : L1Items::L1E_MU14FCHR;
426 return L1Items::ERROR;
427 }

◆ 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 173 of file MuonMatchingTool.cxx.

175 {
176 ATH_MSG_DEBUG("MuonMonitoring::matchEFCB()");
177 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
178
179 return MuonTrack
180 ? match<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, m_EFCBMuonKey.key() + "*.*", &MuonMatchingTool::trigPosForMatchCBTrack)
181 : nullptr;
182}
#define ATH_MSG_DEBUG(x,...)
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 163 of file MuonMatchingTool.cxx.

165 {
166 ATH_MSG_DEBUG("MuonMonitoring::matchEFCB() for TruthParticle");
167 return mu
168 ? match<xAOD::Muon>(mu, std::move(trig), m_EFreqdR, pass, m_EFCBMuonKey.key() + "*.*", &MuonMatchingTool::trigPosForMatchCBTrack)
169 : nullptr;
170}

◆ 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 275 of file MuonMatchingTool.cxx.

277 {
278 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFS()");
279 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
280
281 return MuonTrack ?
282 match<xAOD::Muon>( MuonTrack, std::move(trig), m_EFreqdR, pass, m_EFCBFSMuonKey.key() + ".*", &MuonMatchingTool::trigPosForMatchCBTrack)
283 : nullptr;
284}

◆ 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 265 of file MuonMatchingTool.cxx.

267 {
268 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFS() for TruthParticle");
269 return mu
270 ? match<xAOD::Muon>( mu, std::move(trig), m_EFreqdR, pass, m_EFCBFSMuonKey.key() + ".*", &MuonMatchingTool::trigPosForMatchCBTrack)
271 : nullptr;
272}

◆ 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 287 of file MuonMatchingTool.cxx.

288 {
289 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFSLinkInfo()");
290 bool pass = false;
291 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
292
293 return MuonTrack
294 ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, m_EFCBFSMuonKey.key() + ".*", &MuonMatchingTool::trigPosForMatchCBTrack)
295 : TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>{};
296}
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
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 299 of file MuonMatchingTool.cxx.

300 {
301 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBFSReadHandle()");
302 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
303
304 return MuonTrack
306 : nullptr;
307}
const T * matchReadHandle(const OFFL *offl, float reqdR, const 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 185 of file MuonMatchingTool.cxx.

186 {
187 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBLinkInfo()");
188 bool pass = false;
189 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
190
191 return MuonTrack
192 ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, m_EFCBMuonKey.key() + "*.*", &MuonMatchingTool::trigPosForMatchCBTrack)
193 : TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>{};
194}

◆ 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 197 of file MuonMatchingTool.cxx.

198 {
199 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBReadHandle()");
200 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
201
202 return MuonTrack
204 : nullptr;
205}

◆ 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 310 of file MuonMatchingTool.cxx.

312 {
313 ATH_MSG_DEBUG("MuonMonitoring::matchEFIso()");
314 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
315
316 return MuonTrack
317 ? match<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsIso", &MuonMatchingTool::trigPosForMatchCBTrack)
318 : nullptr;
319}

◆ 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 322 of file MuonMatchingTool.cxx.

324 {
325 ATH_MSG_DEBUG("MuonMonitoring::matchEFIso() for truth particle");
326 return mu
327 ? match<xAOD::Muon>( mu, std::move(trig), m_EFreqdR, pass, "HLT_MuonsIso", &MuonMatchingTool::trigPosForMatchCBTrack)
328 : nullptr;
329}

◆ 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 363 of file MuonMatchingTool.cxx.

364 {
365 ATH_MSG_DEBUG("MuonMonitoring::matchEFCBLinkInfo()");
366 bool pass = false;
367 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
368
369 return MuonTrack
370 ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, "HLT_MuonsIso", &MuonMatchingTool::trigPosForMatchCBTrack)
371 : TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>{};
372}

◆ 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 105 of file MuonMatchingTool.cxx.

107 {
108 ATH_MSG_DEBUG("MuonMonitoring::matchEFSA()");
109 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
110
111 const std::string& containerKey {trig.contains("newFast")
112 ? m_EFSANewFastMuonKey.key()
113 : (trig.contains("mlbkt") ? m_EFSAMlbktMuonKey.key() : m_EFSAMuonKey.key())};
114
115 return MuonTrack
116 ? match<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, containerKey + ".*", &MuonMatchingTool::trigPosForMatchSATrack)
117 : nullptr;
118}
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 121 of file MuonMatchingTool.cxx.

123 {
124 ATH_MSG_DEBUG("MuonMonitoring::matchEFSA() for truth particle");
125
126 const std::string& containerKey {trig.contains("newFast")
127 ? m_EFSANewFastMuonKey.key()
128 : (trig.contains("mlbkt") ? m_EFSAMlbktMuonKey.key() : m_EFSAMuonKey.key())};
129
130 return mu
131 ? match<xAOD::Muon>(mu, std::move(trig), m_EFreqdR, pass, containerKey + ".*", &MuonMatchingTool::trigPosForMatchSATrack)
132 : nullptr;
133}

◆ 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 208 of file MuonMatchingTool.cxx.

210 {
211 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFS()");
212 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
213
214 const std::string& containerKey {trig.contains("newFast")
216 : (trig.contains("mlbkt") ? m_EFSAFSMlbktMuonKey.key() : m_EFSAFSMuonKey.key())};
217
218 return MuonTrack
219 ? match<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, containerKey + ".*", &MuonMatchingTool::trigPosForMatchSATrack)
220 : nullptr;
221}

◆ 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 224 of file MuonMatchingTool.cxx.

226 {
227 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFS() for truth particle");
228
229 const std::string& containerKey {trig.contains("newFast")
231 : (trig.contains("mlbkt") ? m_EFSAFSMlbktMuonKey.key() : m_EFSAFSMuonKey.key())};
232
233 return mu
234 ? match<xAOD::Muon>(mu, std::move(trig), m_EFreqdR, pass, containerKey + ".*", &MuonMatchingTool::trigPosForMatchSATrack)
235 : nullptr;
236}

◆ 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 239 of file MuonMatchingTool.cxx.

240 {
241 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFSLinkInfo()");
242 bool pass = false;
243 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
244
245 const std::string& containerKey {trig.contains("newFast")
247 : (trig.contains("mlbkt") ? m_EFSAFSMlbktMuonKey.key() : m_EFSAFSMuonKey.key())};
248
249 return MuonTrack
250 ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, containerKey + ".*", &MuonMatchingTool::trigPosForMatchSATrack)
251 : TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>{};
252}

◆ 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 255 of file MuonMatchingTool.cxx.

256 {
257 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAFSReadHandle()");
258 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
259 return MuonTrack
261 : nullptr;
262}

◆ 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 136 of file MuonMatchingTool.cxx.

137 {
138 ATH_MSG_DEBUG("MuonMonitoring::matchEFSALinkInfo()");
139 bool pass = false;
140 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
141
142 const std::string& containerKey {trig.contains("newFast")
143 ? m_EFSANewFastMuonKey.key()
144 : (trig.contains("mlbkt") ? m_EFSAMlbktMuonKey.key() : m_EFSAMuonKey.key())};
145
146 return MuonTrack
147 ? matchLinkInfo<xAOD::Muon>(MuonTrack, std::move(trig), m_EFreqdR, pass, containerKey + ".*", &MuonMatchingTool::trigPosForMatchSATrack)
148 : TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>{};
149}

◆ 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 152 of file MuonMatchingTool.cxx.

153 {
154 ATH_MSG_DEBUG("MuonMonitoring::matchEFSAReadHandle()");
155 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
156
157 return MuonTrack
159 : nullptr;
160}

◆ matchFastRecoSA() [1/2]

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

Function that searches for a EF fast reco muon (PhaseII) 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_newfast_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 392 of file MuonMatchingTool.cxx.

395 {
396 ATH_MSG_DEBUG("MuonMonitoring::matchFastRecoSA()");
397 float reqdR = m_L2SAreqdR;
399 reqdR = reqdRL1byPt(mu->pt());
400 const Amg::Vector3D extPos = offlineMuonAtPivot(ctx, *mu);
401 if(extPos.norm()>ZERO_LIMIT){
402 return match<xAOD::Muon>( &extPos, trig, reqdR, pass);
403 }
404 }
405 return match<xAOD::Muon>( mu, trig, reqdR, pass, m_FastRecoSAMuonKey.key());
406}
static const double ZERO_LIMIT
Amg::Vector3D offlineMuonAtPivot(const EventContext &ctx, 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.

◆ matchFastRecoSA() [2/2]

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

Function that searches for a EF fast reco standalone muon (PhaseII) candidate and judges if it is matched to a given truth particle.

Parameters
muTruth particle around which the candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_newfast_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 417 of file MuonMatchingTool.cxx.

419 {
420 ATH_MSG_DEBUG("MuonMonitoring::matchFastRecoSA() from TruthParticle");
421 return match<xAOD::Muon>( mu, trig, m_L2SAreqdR, pass, m_FastRecoSAMuonKey.key());
422}

◆ matchFastRecoSAReadHandle()

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

Function that searches for a EF fast reco standalone muon (PhaseII) 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 459 of file MuonMatchingTool.cxx.

460 {
461 ATH_MSG_DEBUG("MuonMonitoring::matchFastRecoSAReadHandle()");
462 float reqdR = m_L2SAreqdR;
464 reqdR = reqdRL1byPt(mu->pt());
465 const Amg::Vector3D extPos = offlineMuonAtPivot(ctx, *mu);
466 if(extPos.norm()>ZERO_LIMIT){
467 return matchReadHandle<xAOD::Muon>(&extPos, reqdR, m_FastRecoSAMuonKey, ctx);
468 }
469 }
470 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
471 return MuonTrack
472 ? matchReadHandle<xAOD::Muon>(MuonTrack, reqdR, m_FastRecoSAMuonKey, ctx)
473 : nullptr;
474}

◆ matchFastRecoSAtoOff()

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

Function that searches for an offline muon matched to EF Fast Reco SA 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 601 of file MuonMatchingTool.cxx.

602 {
603 return matchOff(ctx, samu, m_L2SAreqdR,
604 [this](const xAOD::Muon* mu) {return MuonMatchingTool::PosForMatchSATrack(mu, m_isPhII);});
605}
const xAOD::Muon * matchOff(const EventContext &ctx, const T *trig, float reqdR, std::function< std::tuple< bool, double, double >(const xAOD::Muon *)> offlinePosForMatchFunc, std::function< std::tuple< bool, double, double >(const T *)> trigPosForMatchFunc=&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 > PosForMatchSATrack(const xAOD::Muon *mu, const bool isPhaseII=false)
BooleanProperty m_isPhII
Muon_v1 Muon
Reference the current persistent version:

◆ matchL1() [1/3]

const xAOD::MuonRoI * MuonMatchingTool::matchL1 ( const EventContext & ctx,
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 563 of file MuonMatchingTool.cxx.

566 {
567 double refEta = mu->eta();
568 double refPhi = mu->phi();
569 double reqdR = 0.25;
570
572 reqdR = reqdRL1byPt(mu->pt());
573 const Amg::Vector3D extPos = offlineMuonAtPivot(ctx, *mu);
574 if(extPos.norm()>ZERO_LIMIT){
575 refEta = extPos.eta();
576 refPhi = extPos.phi();
577 }
578 }
579 return matchL1(ctx, refEta, refPhi, reqdR, trig, pass);
580}
const xAOD::MuonRoI * matchL1(const EventContext &ctx, 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 EventContext & ctx,
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 583 of file MuonMatchingTool.cxx.

586 {
587 double refEta = mu->eta();
588 double refPhi = mu->phi();
589 double reqdR = 0.25;
590 return matchL1(ctx, refEta, refPhi, reqdR, trig, pass);
591}

◆ matchL1() [3/3]

const xAOD::MuonRoI * MuonMatchingTool::matchL1 ( const EventContext & ctx,
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 512 of file MuonMatchingTool.cxx.

517 {
518
520 const TrigConf::HLTChain* chainCfg = m_trigDec->ExperimentalAndExpertMethods().getChainConfigurationDetails(trig);
521 const std::string L1toMatch = chainCfg->lower_chain_name().substr(3);
522
523 SG::ReadHandle<xAOD::MuonRoIContainer> L1rois(m_MuonRoIKey, ctx);
524 const xAOD::MuonRoI* closest = nullptr;
525
526 for (const xAOD::MuonRoI* l1muon : *L1rois){
527
528 // get all L1 thresholds from the L1 menu along with whether the L1roi passed each of those or not
529 const std::vector<std::pair<std::shared_ptr<TrigConf::L1Threshold>, bool> > L1thr_list = m_thresholdTool-> getThresholdDecisions(
530 l1muon->roiWord(), ctx);
531
532 // check the L1 threshold we are looking for
533 bool L1thr_isMatch = false;
534 for(const std::pair<std::shared_ptr<TrigConf::L1Threshold>, bool>& L1thr : L1thr_list){
535 if (L1toMatch == L1thr.first->name()){
536 L1thr_isMatch = L1thr.second;
537 break;
538 }
539 }
540 if (!L1thr_isMatch) continue;
541
542 double l1muonEta = l1muon->eta();
543 double l1muonPhi = l1muon->phi();
544
545 double deta = refEta - l1muonEta;
546 double dphi = xAOD::P4Helpers::deltaPhi(refPhi, l1muonPhi);
547 double dR = std::sqrt(deta*deta + dphi*dphi);
548 ATH_MSG_DEBUG("L1 muon candidate eta=" << l1muonEta << " phi=" << l1muonPhi << " dR=" << dR);
549 if( dR<reqdR ){
550 reqdR = dR;
551 pass = true;
552 closest = l1muon;
553 ATH_MSG_DEBUG("*** L1 muon eta=" << l1muonEta << " phi=" << l1muonPhi << " dR=" << dR << " isPassed=true" );
554 }
555 else{
556 ATH_MSG_DEBUG("*** L1 muon eta=" << l1muonEta << " phi=" << l1muonPhi << " dR=" << dR << " isPassed=false" );
557 }
558 }
559 return closest;
560}
const std::string & lower_chain_name() const
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
MuonRoI_v1 MuonRoI
Definition MuonRoI.h:15

◆ matchL2CB() [1/2]

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 477 of file MuonMatchingTool.cxx.

479 {
480 ATH_MSG_DEBUG("MuonMonitoring::matchL2CB()");
481 return match<xAOD::L2CombinedMuon>(mu, std::move(trig), m_L2CBreqdR, pass, m_L2CBMuonKey.key());
482}

◆ matchL2CB() [2/2]

const xAOD::L2CombinedMuon * MuonMatchingTool::matchL2CB ( const xAOD::TruthParticle * 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 truth muon.

Parameters
muTruth 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 485 of file MuonMatchingTool.cxx.

487 {
488 ATH_MSG_DEBUG("MuonMonitoring::matchL2CB() from TruthParticle");
489 return match<xAOD::L2CombinedMuon>(mu, std::move(trig), m_L2CBreqdR, pass, m_L2CBMuonKey.key());
490}

◆ 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 501 of file MuonMatchingTool.cxx.

502 {
503 ATH_MSG_DEBUG("MuonMonitoring::matchL2CBReadHandle()");
504 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::Primary);
505
506 return MuonTrack
508 : nullptr;
509}

◆ 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 608 of file MuonMatchingTool.cxx.

609 {
611}
static std::tuple< bool, double, double > PosForMatchCBTrack(const xAOD::Muon *mu)

◆ matchL2SA() [1/2]

const xAOD::L2StandAloneMuon * MuonMatchingTool::matchL2SA ( const EventContext & ctx,
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 375 of file MuonMatchingTool.cxx.

378 {
379 ATH_MSG_DEBUG("MuonMonitoring::matchL2SA()");
380 float reqdR = m_L2SAreqdR;
382 reqdR = reqdRL1byPt(mu->pt());
383 const Amg::Vector3D extPos = offlineMuonAtPivot(ctx, *mu);
384 if(extPos.norm()>ZERO_LIMIT){
385 return match<xAOD::L2StandAloneMuon>( &extPos, trig, reqdR, pass);
386 }
387 }
388 return match<xAOD::L2StandAloneMuon>(mu, trig, reqdR, pass, m_L2SAMuonKey.key());
389}

◆ matchL2SA() [2/2]

const xAOD::L2StandAloneMuon * MuonMatchingTool::matchL2SA ( const xAOD::TruthParticle * 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 truth particle.

Parameters
muTruth particle 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 409 of file MuonMatchingTool.cxx.

411 {
412 ATH_MSG_DEBUG("MuonMonitoring::matchL2SA() from TruthParticle");
413 return match<xAOD::L2StandAloneMuon>( mu, trig, m_L2SAreqdR, pass, m_L2SAMuonKey.key());
414}

◆ 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 441 of file MuonMatchingTool.cxx.

442 {
443 ATH_MSG_DEBUG("MuonMonitoring::matchL2SAReadHandle()");
444 float reqdR = m_L2SAreqdR;
446 reqdR = reqdRL1byPt(mu->pt());
447 const Amg::Vector3D extPos = offlineMuonAtPivot(ctx, *mu);
448 if(extPos.norm()>ZERO_LIMIT){
449 return matchReadHandle<xAOD::L2StandAloneMuon>(&extPos, reqdR, m_L2SAMuonKey, ctx);
450 }
451 }
452 const xAOD::TrackParticle* MuonTrack = getMSTrack(*mu);
453 return MuonTrack
455 : nullptr;
456}

◆ 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 594 of file MuonMatchingTool.cxx.

595 {
596 return matchOff(ctx, samu, m_L2SAreqdR,
597 [this](const xAOD::Muon* mu) {return MuonMatchingTool::PosForMatchSATrack(mu, m_isPhII);});
598}

◆ 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::function< std::tuple< bool, double, double >(const xAOD::Muon *)> offlinePosForMatchFunc,
std::function< std::tuple< bool, double, double >(const T *)> trigPosForMatchFunc = &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,
const 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()

Amg::Vector3D MuonMatchingTool::offlineMuonAtPivot ( const EventContext & ctx,
const xAOD::Muon & mu ) const
private

Definition at line 57 of file MuonMatchingTool.cxx.

58 {
59 const xAOD::TrackParticle* track{mu.trackParticle(xAOD::Muon::TrackParticleType::Primary)};
60 std::unique_ptr<Trk::TrackParameters> extPars{extTrackToPivot(ctx, track)};
61 return extPars ? extPars->position() : Amg::Vector3D::Zero();
62}
std::unique_ptr< Trk::TrackParameters > extTrackToPivot(const EventContext &ctx, 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 97 of file MuonMatchingTool.cxx.

97 {
98 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle);
99 return MuonTrack
100 ? std::forward_as_tuple(true, MuonTrack->eta(), MuonTrack->phi())
101 : std::forward_as_tuple(false, 0., 0.);
102}
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,
const bool isPhaseII = false )
static

Definition at line 85 of file MuonMatchingTool.cxx.

86 {
87 const xAOD::Muon::TrackParticleType type {isPhaseII
88 ? xAOD::Muon::TrackParticleType::Primary
89 : xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle};
90 const xAOD::TrackParticle* MuonTrack = mu->trackParticle(type);
91 return MuonTrack
92 ? std::forward_as_tuple(true, MuonTrack->eta(), MuonTrack->phi())
93 : std::forward_as_tuple(false, 0., 0.);
94}

◆ 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 707 of file MuonMatchingTool.cxx.

707 {
708 double dR = 0.08;
709 if( mupt < 10000. ) {
710 dR = -0.00001*mupt + 0.18;
711 }
712 return dR;
713}

◆ 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 332 of file MuonMatchingTool.cxx.

334 {
335 const xAOD::TrackParticle* MatchedTrack = nullptr;
336 const ElementLink<xAOD::MuonContainer> muEL = muLinkInfo.link;
337 float EFEta = (*muEL)->eta();
338 float EFPhi = (*muEL)->phi();
339 float mindR = 999.;
340
341 SG::ReadHandle<xAOD::TrackParticleContainer> trackHandle(ReadHandleKey, ctx);
342 if ( !trackHandle.isValid() ) return MatchedTrack;
343
344 const auto track = m_trigDec->associateToEventView<xAOD::TrackParticleContainer>(trackHandle, muLinkInfo);
347
348 for (xAOD::TrackParticleContainer::const_iterator it = begin; it != end; ++it) {
349
350 float deta = EFEta - (*it)->eta();
351 float dphi = xAOD::P4Helpers::deltaPhi(EFPhi, (*it)->phi() );
352 float dR = std::sqrt(deta*deta + dphi*dphi);
353
354 if( dR< mindR ){
355 mindR = dR;
356 MatchedTrack = (*it);
357 }
358 }
359 return MatchedTrack;
360}
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

◆ searchFastRecoSALinkInfo()

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

Function that searches for the EF fast reco standalone candidate closest to a given offline muon.

Parameters
muOffline muon around which L2MuonSA candidates are searched.
triggerConsidered chain name, e.g. HLT_mu26_newfast_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 433 of file MuonMatchingTool.cxx.

434 {
435 ATH_MSG_DEBUG("MuonMonitoring::searchFastRecoLinkInfo()");
436 bool pass = false;
437 return matchLinkInfo<xAOD::Muon>(mu, std::move(trig), 1000., pass, m_FastRecoSAMuonKey.key());
438}

◆ 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 493 of file MuonMatchingTool.cxx.

494 {
495 ATH_MSG_DEBUG("MuonMonitoring::searchL2CBLinkInfo()");
496 bool pass = false;
497 return matchLinkInfo<xAOD::L2CombinedMuon>(mu, std::move(trig), 1000., pass, m_L2CBMuonKey.key());
498}

◆ 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 425 of file MuonMatchingTool.cxx.

426 {
427 ATH_MSG_DEBUG("MuonMonitoring::searchL2SALinkInfo()");
428 bool pass = false;
429 return matchLinkInfo<xAOD::L2StandAloneMuon>(mu, std::move(trig), 1000., pass, m_L2SAMuonKey.key());
430}

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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 78 of file MuonMatchingTool.cxx.

78 {
79 return mu->muonType() == xAOD::Muon::MuonType::Combined
80 ? std::forward_as_tuple(true, mu->eta(), mu->phi())
81 : std::forward_as_tuple(false, 0., 0.);
82}

◆ trigPosForMatchSATrack()

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

Definition at line 71 of file MuonMatchingTool.cxx.

71 {
72 return mu->muonType() == xAOD::Muon::MuonType::MuonStandAlone
73 ? std::forward_as_tuple(true, mu->eta(), mu->phi())
74 : std::forward_as_tuple(false, 0., 0.);
75}

◆ 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_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_EFCBFSMuonKey

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

Definition at line 518 of file MuonMatchingTool.h.

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

◆ m_EFCBMuonKey

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

Definition at line 514 of file MuonMatchingTool.h.

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

◆ m_EFreqdR

const float MuonMatchingTool::m_EFreqdR = 0.03
private

Definition at line 432 of file MuonMatchingTool.h.

◆ m_EFSAFSMlbktMuonKey

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

Definition at line 516 of file MuonMatchingTool.h.

516{this, "EFSAFSMlbktMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"};

◆ m_EFSAFSMuonKey

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

Definition at line 515 of file MuonMatchingTool.h.

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

◆ m_EFSAFSNewFastMuonKey

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

Definition at line 517 of file MuonMatchingTool.h.

517{this, "EFSAFSNewFastMuonContainerName", "HLT_Muons_FS", "EFSAFSMuon container"};

◆ m_EFSAMlbktMuonKey

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

Definition at line 512 of file MuonMatchingTool.h.

512{this, "EFSAMlbktMuonContainerName", "HLT_Muons_RoI", "EFSAMuon container"};

◆ m_EFSAMuonKey

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

Definition at line 511 of file MuonMatchingTool.h.

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

◆ m_EFSANewFastMuonKey

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

Definition at line 513 of file MuonMatchingTool.h.

513{this, "EFSANewFastMuonContainerName", "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 529 of file MuonMatchingTool.h.

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

◆ m_FastRecoSAMuonKey

SG::ReadHandleKey<xAOD::MuonContainer> MuonMatchingTool::m_FastRecoSAMuonKey {this, "FastRecoSAContainerName", "HLT_FastMuonsInfo", "EFFastRecoSA container (Phase2)"}
private

Definition at line 509 of file MuonMatchingTool.h.

509{this, "FastRecoSAContainerName", "HLT_FastMuonsInfo", "EFFastRecoSA container (Phase2)"};

◆ m_isPhII

BooleanProperty MuonMatchingTool::m_isPhII {this, "isPhaseII", false, "Whether the muons have been processed with Phase II software"}
private

Definition at line 522 of file MuonMatchingTool.h.

522{this, "isPhaseII", false, "Whether the muons have been processed with Phase II software"};

◆ m_L2CBMuonKey

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

Definition at line 510 of file MuonMatchingTool.h.

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

◆ m_L2CBreqdR

const float MuonMatchingTool::m_L2CBreqdR = 0.03
private

Definition at line 430 of file MuonMatchingTool.h.

◆ m_L2InsideOutreqdR

const float MuonMatchingTool::m_L2InsideOutreqdR = 0.01
private

Definition at line 431 of file MuonMatchingTool.h.

◆ m_L2SAMuonKey

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

Definition at line 508 of file MuonMatchingTool.h.

508{this, "L2StandAloneMuonContainerName", "HLT_FastMuons_RoI", "L2MuonSA container"};

◆ m_L2SAreqdR

const float MuonMatchingTool::m_L2SAreqdR = 0.25
private

Definition at line 429 of file MuonMatchingTool.h.

◆ m_MuonKey

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

Definition at line 507 of file MuonMatchingTool.h.

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

◆ m_MuonRoIKey

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

Definition at line 506 of file MuonMatchingTool.h.

506{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 525 of file MuonMatchingTool.h.

525 {
526 this, "TrigThresholdDecisionTool", "LVL1::TrigThresholdDecisionTool/LVL1__TrigThresholdDecisionTool",
527 "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 528 of file MuonMatchingTool.h.

528{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 521 of file MuonMatchingTool.h.

521{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: