Commit d343997f authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'MuonOfflineMon_EFMuon' into 'master'

Implement EFSA and EFCB plots to Offline MuonMonitoringMT

See merge request !35226
parents fb205702 1bd065a5
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
import ROOT
def EFMuonMonConfig(helper):
from AthenaConfiguration.ComponentFactory import CompFactory
# HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20']
for chain in Chains:
GroupName = 'EFMuon_'+chain
monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT_'+chain)
monAlg.MuonType = ROOT.xAOD.Muon_v1.MuonStandAlone
monAlg.MonitoredChains = [chain]
monAlg.Group = GroupName
histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/EFMuon/'+chain)
# basic EDM variables
# EFSA
histGroup.defineHistogram(GroupName+'_EFSA_Pt;EFSA_Pt',
title='EFSA Pt '+chain+';p_{T} [GeV];Events',
type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
histGroup.defineHistogram(GroupName+'_EFSA_Eta;EFSA_Eta',
title='EFSA Eta '+chain+';#eta;Events',
type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
histGroup.defineHistogram(GroupName+'_EFSA_Phi;EFSA_Phi',
title='EFSA Phi '+chain+';#phi;Events',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_EFSA_Eta,'+GroupName+'_EFSA_Phi;EFSA_Eta_vs_Phi',
title='EFSA Eta vs Phi '+chain+';#eta;#phi',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
# EFCB
histGroup.defineHistogram(GroupName+'_EFCB_Pt;EFCB_Pt',
title='EFCB Pt '+chain+';p_{T} [GeV];Events',
type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
histGroup.defineHistogram(GroupName+'_EFCB_Eta;EFCB_Eta',
title='EFCB Eta '+chain+';#eta;Events',
type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
histGroup.defineHistogram(GroupName+'_EFCB_Phi;EFCB_Phi',
title='EFCB Phi '+chain+';#phi;Events',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_EFCB_Eta,'+GroupName+'_EFCB_Phi;EFCB_Eta_vs_Phi',
title='EFCB Eta vs Phi '+chain+';#eta;#phi',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
# OfflineSA
histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt',
title='OfflineSA Pt '+chain+';p_{T} [GeV];Events',
type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta',
title='OfflineSA Eta '+chain+';#eta;Events',
type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi',
title='OfflineSA Phi '+chain+';#phi;Events',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSA_Phi;OfflineSA_Eta_vs_Phi',
title='OfflineSA Eta vs Phi '+chain+';#eta;#phi',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
# OfflineCB
histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt',
title='OfflineCB Pt '+chain+';p_{T} [GeV];Events',
type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta',
title='OfflineCB Eta '+chain+';#eta;Events',
type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi',
title='OfflineCB Phi '+chain+';#phi;Events',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCB_Phi;OfflineCB_Eta_vs_Phi',
title='OfflineCB Eta vs Phi '+chain+';#eta;#phi',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
# correlation histograms
# EFSA vs. OfflineSA muons
histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_MatchedEFSA_Pt;EFSA_OfflineSA_PtCor',
title='PtCor EFSA OfflineSA '+chain+';OfflineSA p_{T} [GeV];EFSA p_{T} [GeV]',
cutmask=GroupName+'_matchedEFSA',
type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_MatchedEFSA_Phi;EFSA_OfflineSA_PhiCor',
title='PhiCor EFSA OfflineSA '+chain+';OfflineSA #phi;EFSA #phi',
cutmask=GroupName+'_matchedEFSA',
type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_MatchedEFSA_Eta;EFSA_OfflineSA_EtaCor',
title='EtaCor EFSA OfflineSA '+chain+';OfflineSA #eta;EFSA #eta',
cutmask=GroupName+'_matchedEFSA',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
histGroup.defineHistogram(GroupName+'_SAdPt;EFSA_OfflineSA_dPt',
title='dPt EFSA OfflineSA '+chain+';dPt [GeV];Events',
cutmask=GroupName+'_matchedEFSA',
type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.)
histGroup.defineHistogram(GroupName+'_SAdEta;EFSA_OfflineSA_dEta',
title='dEta EFSA OfflineSA '+chain+';dEta;Events',
cutmask=GroupName+'_matchedEFSA',
type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.)
histGroup.defineHistogram(GroupName+'_SAdPhi;EFSA_OfflineSA_dPhi',
title='dPhi EFSA OfflineSA '+chain+';dPhi;Events',
cutmask=GroupName+'_matchedEFSA',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_SAdR;EFSA_OfflineSA_dR',
title='dR EFSA OfflineSA '+chain+';dR;Events',
cutmask=GroupName+'_matchedEFSA',
type='TH1F', path='',xbins=110,xmin=0.,xmax=11.)
histGroup.defineHistogram(GroupName+'_OfflineSA_Pt;OfflineSA_Pt_AwareEFSA',
title='OfflineSA Pt AwareEFSA '+chain+';OfflineSA p_{T} [GeV];Events',
cutmask=GroupName+'_matchedEFSA',
type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
histGroup.defineHistogram(GroupName+'_OfflineSA_Phi;OfflineSA_Phi_AwareEFSA',
title='OfflineSA Phi AwareEFSA '+chain+';OfflineSA #phi;Events',
cutmask=GroupName+'_matchedEFSA',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_OfflineSA_Eta;OfflineSA_Eta_AwareEFSA',
title='OfflineSA Eta AwareEFSA '+chain+';OfflineSA #eta;Events',
cutmask=GroupName+'_matchedEFSA',
type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
# OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA)
histGroup.defineHistogram(GroupName+'_OfflineSA_Pt,'+GroupName+'_OfflineSAmatchedL2SA_Pt;OfflineSA_matchedEFSA_matchedL2SA_PtCor',
title='PtCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA p_{T} [GeV];OfflineSA matched to L2SA p_{T} [GeV]',
cutmask=GroupName+'_matchedL2SA',
type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
histGroup.defineHistogram(GroupName+'_OfflineSA_Phi,'+GroupName+'_OfflineSAmatchedL2SA_Phi;OfflineSA_matchedEFSA_matchedL2SA_PhiCor',
title='PhiCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #phi;OfflineSA matched to L2SA #phi',
cutmask=GroupName+'_matchedL2SA',
type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_OfflineSA_Eta,'+GroupName+'_OfflineSAmatchedL2SA_Eta;OfflineSA_matchedEFSA_matchedL2SA_EtaCor',
title='EtaCor OfflineSA (matched to EFSA) vs. OfflineSA (matched to L2SA) '+chain+';OfflineSA matched to EFSA #eta;OfflineSA matched to L2SA #eta',
cutmask=GroupName+'_matchedL2SA',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
# EFCB vs. OfflineCB muons
histGroup.defineHistogram(GroupName+'_EFCB_Pt,'+GroupName+'_OfflineCB_Pt;EFCB_OfflineCB_PtCor',
title='PtCor EFCB OfflineCB '+chain+';OfflineCB p_{T} [GeV];EFCB p_{T} [GeV];',
cutmask=GroupName+'_matchedEFCB',
type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
histGroup.defineHistogram(GroupName+'_EFCB_Phi,'+GroupName+'_OfflineCB_Phi;EFCB_OfflineCB_PhiCor',
title='PhiCor EFCB OfflineCB '+chain+';OfflineCB #phi;EFCB #phi;',
cutmask=GroupName+'_matchedEFCB',
type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_EFCB_Eta,'+GroupName+'_OfflineCB_Eta;EFCB_OfflineCB_EtaCor',
title='EtaCor EFCB OfflineCB '+chain+';OfflineCB #eta;EFCB #eta;',
cutmask=GroupName+'_matchedEFCB',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
histGroup.defineHistogram(GroupName+'_CBdPt;EFCB_OfflineCB_dPt',
title='dPt EFCB OfflineCB '+chain+';dPt [GeV];Events',
cutmask=GroupName+'_matchedEFCB',
type='TH1F', path='',xbins=100,xmin=-10.,xmax=10.)
histGroup.defineHistogram(GroupName+'_CBdEta;EFCB_OfflineCB_dEta',
title='dEta EFCB OfflineCB '+chain+';dEta;Events',
cutmask=GroupName+'_matchedEFCB',
type='TH1F', path='',xbins=200,xmin=-5.,xmax=5.)
histGroup.defineHistogram(GroupName+'_CBdPhi;EFCB_OfflineCB_dPhi',
title='dPhi EFCB OfflineCB '+chain+';dPhi;Events',
cutmask=GroupName+'_matchedEFCB',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_CBdR;EFCB_OfflineCB_dR',
title='dR EFCB OfflineCB '+chain+';dR;Events',
cutmask=GroupName+'_matchedEFCB',
type='TH1F', path='',xbins=110,xmin=0.,xmax=11.)
histGroup.defineHistogram(GroupName+'_OfflineCB_Pt;OfflineCB_Pt_AwareEFCB',
title='OfflineCB Pt AwareEFCB '+chain+';OfflineCB p_{T} [GeV];Events',
cutmask=GroupName+'_matchedEFCB',
type='TH1F', path='',xbins=210,xmin=-105.,xmax=105.)
histGroup.defineHistogram(GroupName+'_OfflineCB_Phi;OfflineCB_Phi_AwareEFCB',
title='OfflineCB Phi AwareEFCB '+chain+';OfflineCB #phi;Events',
cutmask=GroupName+'_matchedEFCB',
type='TH1F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_OfflineCB_Eta;OfflineCB_Eta_AwareEFCB',
title='OfflineCB Eta AwareEFCB '+chain+';OfflineCB #eta;Events',
cutmask=GroupName+'_matchedEFCB',
type='TH1F', path='',xbins=108,xmin=-2.7,xmax=2.7)
# OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB)
histGroup.defineHistogram(GroupName+'_OfflineCB_Pt,'+GroupName+'_OfflineCBmatchedL2CB_Pt;OfflineCB_matchedEFCB_matchedL2CB_PtCor',
title='PtCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB p_{T} [GeV];OfflineCB matched to L2CB p_{T} [GeV]',
cutmask=GroupName+'_matchedL2CB',
type='TH2F', path='',xbins=210,xmin=-105.,xmax=105., ybins=210,ymin=-105.,ymax=105.)
histGroup.defineHistogram(GroupName+'_OfflineCB_Phi,'+GroupName+'_OfflineCBmatchedL2CB_Phi;OfflineCB_matchedEFCB_matchedL2CB_PhiCor',
title='PhiCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #phi;OfflineCB matched to L2CB #phi',
cutmask=GroupName+'_matchedL2CB',
type='TH2F', path='',xbins=96,xmin=-ROOT.TMath.Pi(),xmax=ROOT.TMath.Pi(), ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
histGroup.defineHistogram(GroupName+'_OfflineCB_Eta,'+GroupName+'_OfflineCBmatchedL2CB_Eta;OfflineCB_matchedEFCB_matchedL2CB_EtaCor',
title='EtaCor OfflineCB (matched to EFCB) vs. OfflineCB (matched to L2CB) '+chain+';OfflineCB matched to EFCB #eta;OfflineCB matched to L2CB #eta',
cutmask=GroupName+'_matchedL2CB',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=108,ymin=-2.7,ymax=2.7)
return
......@@ -72,7 +72,7 @@ def L2MuonSAMonConfig(helper):
# L1 RoI eta vs. phi in case mF failed
histGroup.defineHistogram(GroupName+'_roiEta,'+GroupName+'_roiPhi;L2MuonSA_failed_L1_eta_vs_phi',
title='L1 RoI Eta vs. Phi in case of L2MuonSA failure '+chain+';#eta;#phi',
cutmask=GroupName+'mf_failure',
cutmask=GroupName+'_mf_failure',
type='TH2F', path='',xbins=108,xmin=-2.7,xmax=2.7, ybins=96,ymin=-ROOT.TMath.Pi(),ymax=ROOT.TMath.Pi())
......
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from TrigMuonMonitoringMT.L2muCombMonConfig import L2muCombMonConfig
from TrigMuonMonitoringMT.L2MuonSAMonConfig import L2MuonSAMonConfig
from TrigMuonMonitoringMT.L1MuonMonConfig import L1MuonMonConfig
from TrigMuonMonitoringMT.L2MuonSAMonConfig import L2MuonSAMonConfig
from TrigMuonMonitoringMT.L2muCombMonConfig import L2muCombMonConfig
from TrigMuonMonitoringMT.EFMuonMonConfig import EFMuonMonConfig
from TrigMuonMonitoringMT.TrigMuonEfficiencyMonConfig import TrigMuonEfficiencyMonConfig
......@@ -15,6 +16,7 @@ def TrigMuonMonConfig(inputFlags):
L1MuonMonConfig(helper)
L2MuonSAMonConfig(helper)
L2muCombMonConfig(helper)
EFMuonMonConfig(helper)
TrigMuonEfficiencyMonConfig(helper)
return helper.result()
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#include "EFMuonMonMT.h"
#include "xAODTrigMuon/TrigMuonDefs.h"
#include "MuonMatchingTool.h"
EFMuonMonMT :: EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator )
: TrigMuonMonitorAlgorithm(name, pSvcLocator)
{}
StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext& , const std::string &chain) const {
ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
// EFSA
std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContSA = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_Muons_");
for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muSALinkInfo : featureContSA) {
ATH_CHECK( muSALinkInfo.isValid() );
const ElementLink<xAOD::MuonContainer> muSAEL = muSALinkInfo.link;
if ( ! (*muSAEL)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle) ) continue;
// basic EDM variables
auto EFSAPt = Monitored::Scalar<float>(m_group+"_EFSA_Pt",-999.);
auto EFSAEta = Monitored::Scalar<float>(m_group+"_EFSA_Eta",-999.);
auto EFSAPhi = Monitored::Scalar<float>(m_group+"_EFSA_Phi",-999.);
EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); // convert to GeV
EFSAEta = (*muSAEL)->eta();
EFSAPhi = (*muSAEL)->phi();
fill(m_group, EFSAPt, EFSAEta, EFSAPhi);
}
// EFCB
std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContCB = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsCB");
for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muCBLinkInfo : featureContCB) {
ATH_CHECK( muCBLinkInfo.isValid() );
const ElementLink<xAOD::MuonContainer> muCBEL = muCBLinkInfo.link;
if ( ! (*muCBEL)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle) ) continue;
// basic EDM variables
auto EFCBPt = Monitored::Scalar<float>(m_group+"_EFCB_Pt",-999.);
auto EFCBEta = Monitored::Scalar<float>(m_group+"_EFCB_Eta",-999.);
auto EFCBPhi = Monitored::Scalar<float>(m_group+"_EFCB_Phi",-999.);
EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); // convert to GeV
EFCBEta = (*muCBEL)->eta();
EFCBPhi = (*muCBEL)->phi();
fill(m_group, EFCBPt, EFCBEta, EFCBPhi);
}
return StatusCode::SUCCESS;
}
StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const {
ATH_MSG_DEBUG ("Filling histograms for " << name() << "...");
const xAOD::TrackParticle* OfflineSATrack = mu->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
const xAOD::TrackParticle* OfflineCBTrack = mu->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle);
// OfflineSA
if( OfflineSATrack ){
auto OfflineSAPt = Monitored::Scalar<float>(m_group+"_OfflineSA_Pt",-999.);
auto OfflineSAEta = Monitored::Scalar<float>(m_group+"_OfflineSA_Eta",-999.);
auto OfflineSAPhi = Monitored::Scalar<float>(m_group+"_OfflineSA_Phi",-999.);
auto matchedEFSA = Monitored::Scalar<bool>(m_group+"_matchedEFSA",false);
auto matchedL2SA = Monitored::Scalar<bool>(m_group+"_matchedL2SA",false);
auto OfflineSAmatchedL2SAPt = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Pt",-999.);
auto OfflineSAmatchedL2SAEta = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Eta",-999.);
auto OfflineSAmatchedL2SAPhi = Monitored::Scalar<float>(m_group+"_OfflineSAmatchedL2SA_Phi",-999.);
auto MatchedEFSAPt = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Pt",-999.);
auto MatchedEFSAEta = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Eta",-999.);
auto MatchedEFSAPhi = Monitored::Scalar<float>(m_group+"_MatchedEFSA_Phi",-999.);
auto SAdR = Monitored::Scalar<float>(m_group+"_SAdR",1000.);
auto SAdPt = Monitored::Scalar<float>(m_group+"_SAdPt",-999.);
auto SAdEta = Monitored::Scalar<float>(m_group+"_SAdEta",-999.);
auto SAdPhi = Monitored::Scalar<float>(m_group+"_SAdPhi",-999.);
// basic EDM variables
OfflineSAPt = OfflineSATrack->pt()/1e3 * OfflineSATrack->charge(); // convert to GeV
OfflineSAEta = OfflineSATrack->eta();
OfflineSAPhi = OfflineSATrack->phi();
// correlation histograms EFSA vs. OfflineSA
// get the EFSA muon matched to offlineSA muon
const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> EFSAMuonLinkInfo = m_matchTool->matchEFSALinkInfo(mu, chain);
if( EFSAMuonLinkInfo.isValid() ){
const ElementLink<xAOD::MuonContainer> EFSAMuon = EFSAMuonLinkInfo.link;
const xAOD::TrackParticle* EFSATrack = (*EFSAMuon)->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
if ( EFSATrack ){
matchedEFSA = true;
MatchedEFSAPt = EFSATrack->pt()/1e3 * EFSATrack->charge(); // convert to GeV
MatchedEFSAEta = EFSATrack->eta();
MatchedEFSAPhi = EFSATrack->phi();
SAdR = xAOD::P4Helpers::deltaR(OfflineSATrack, EFSATrack, false);
SAdPt = std::abs(OfflineSAPt) - std::abs(MatchedEFSAPt);
SAdEta = OfflineSAEta - MatchedEFSAEta;
SAdPhi = OfflineSAPhi - MatchedEFSAPhi;
// correlation histograms offlineSA (matched to EFSA) vs. offlineSA (matched to L2SA)
// get L2SA feature
const TrigCompositeUtils::Decision* EFSAMuonDecision = EFSAMuonLinkInfo.source;
const TrigCompositeUtils::LinkInfo<xAOD::L2StandAloneMuonContainer> L2SALinkInfo = TrigCompositeUtils::findLink<xAOD::L2StandAloneMuonContainer>(EFSAMuonDecision, "feature");
ATH_CHECK( L2SALinkInfo.isValid() );
const ElementLink<xAOD::L2StandAloneMuonContainer> L2SAEL = L2SALinkInfo.link;
// get offline muon matched to L2SA
const xAOD::Muon *OfflineSAmatchedL2SA = m_matchTool->matchL2SAtoOff(ctx, (*L2SAEL));
if (OfflineSAmatchedL2SA){
const xAOD::TrackParticle* OfflineSATrackmatchedL2SA = OfflineSAmatchedL2SA->trackParticle(xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle);
if ( OfflineSATrackmatchedL2SA ){
matchedL2SA = true;
OfflineSAmatchedL2SAPt = OfflineSATrackmatchedL2SA->pt()/1e3 * OfflineSATrackmatchedL2SA->charge(); // convert to GeV
OfflineSAmatchedL2SAEta = OfflineSATrackmatchedL2SA->eta();
OfflineSAmatchedL2SAPhi = OfflineSATrackmatchedL2SA->phi();
}
}
}
}
fill(m_group, OfflineSAPt, OfflineSAEta, OfflineSAPhi, OfflineSAmatchedL2SAPt, OfflineSAmatchedL2SAEta, OfflineSAmatchedL2SAPhi,
MatchedEFSAPt, MatchedEFSAEta, MatchedEFSAPhi, SAdPt, SAdEta, SAdPhi, SAdR, matchedEFSA, matchedL2SA);
}
// OfflineCB
if( OfflineCBTrack ){
auto OfflineCBPt = Monitored::Scalar<float>(m_group+"_OfflineCB_Pt",-999.);
auto OfflineCBEta = Monitored::Scalar<float>(m_group+"_OfflineCB_Eta",-999.);
auto OfflineCBPhi = Monitored::Scalar<float>(m_group+"_OfflineCB_Phi",-999.);
auto matchedEFCB = Monitored::Scalar<bool>(m_group+"_matchedEFCB",false);
auto matchedL2CB = Monitored::Scalar<bool>(m_group+"_matchedL2CB",false);
auto OfflineCBmatchedL2CBPt = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Pt",-999.);
auto OfflineCBmatchedL2CBEta = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Eta",-999.);
auto OfflineCBmatchedL2CBPhi = Monitored::Scalar<float>(m_group+"_OfflineCBmatchedL2CB_Phi",-999.);
auto MatchedEFCBPt = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Pt",-999.);
auto MatchedEFCBEta = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Eta",-999.);
auto MatchedEFCBPhi = Monitored::Scalar<float>(m_group+"_MatchedEFCB_Phi",-999.);
auto CBdR = Monitored::Scalar<float>(m_group+"_CBdR",1000.);
auto CBdPt = Monitored::Scalar<float>(m_group+"_CBdPt",-999.);
auto CBdEta = Monitored::Scalar<float>(m_group+"_CBdEta",-999.);
auto CBdPhi = Monitored::Scalar<float>(m_group+"_CBdPhi",-999.);
// basic EDM variables
OfflineCBPt = OfflineCBTrack->pt()/1e3 * OfflineCBTrack->charge(); // convert to GeV
OfflineCBEta = OfflineCBTrack->eta();
OfflineCBPhi = OfflineCBTrack->phi();
// correlation histograms EFCB vs. OfflineCB
// get the closest EFCB muon
const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> EFCBMuonLinkInfo = m_matchTool->matchEFCBLinkInfo(mu, chain);
if( EFCBMuonLinkInfo.isValid() ){
const ElementLink<xAOD::MuonContainer> EFCBMuon = EFCBMuonLinkInfo.link;
const xAOD::TrackParticle* EFCBTrack = (*EFCBMuon)->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle);
if ( EFCBTrack ){
matchedEFCB = true;
MatchedEFCBPt = EFCBTrack->pt()/1e3 * EFCBTrack->charge(); // convert to GeV
MatchedEFCBEta = EFCBTrack->eta();
MatchedEFCBPhi = EFCBTrack->phi();
CBdR = xAOD::P4Helpers::deltaR(OfflineCBTrack, EFCBTrack, false);
CBdPt = std::abs(OfflineCBPt) - std::abs(MatchedEFCBPt);
CBdEta = OfflineCBEta - MatchedEFCBEta;
CBdPhi = OfflineCBPhi - MatchedEFCBPhi;
// correlation histograms offlineCB (matched to EFCB) vs. offlineCB (matched to L2CB)
// get L2CB feature
const TrigCompositeUtils::Decision* EFCBMuonDecision = EFCBMuonLinkInfo.source;
const TrigCompositeUtils::LinkInfo<xAOD::L2CombinedMuonContainer> L2CBLinkInfo = TrigCompositeUtils::findLink<xAOD::L2CombinedMuonContainer>(EFCBMuonDecision, "feature");
ATH_CHECK( L2CBLinkInfo.isValid() );
const ElementLink<xAOD::L2CombinedMuonContainer> L2CBEL = L2CBLinkInfo.link;
// get offline muon matched to L2CB
const xAOD::Muon *OfflineCBmatchedL2CB = m_matchTool->matchL2CBtoOff(ctx, (*L2CBEL));
if (OfflineCBmatchedL2CB){
const xAOD::TrackParticle* OfflineCBTrackmatchedL2CB = OfflineCBmatchedL2CB->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle);
if ( OfflineCBTrackmatchedL2CB ){
matchedL2CB = true;
OfflineCBmatchedL2CBPt = OfflineCBTrackmatchedL2CB->pt()/1e3 * OfflineCBTrackmatchedL2CB->charge(); // convert to GeV
OfflineCBmatchedL2CBEta = OfflineCBTrackmatchedL2CB->eta();
OfflineCBmatchedL2CBPhi = OfflineCBTrackmatchedL2CB->phi();
}
}
}
}
fill(m_group, OfflineCBPt, OfflineCBEta, OfflineCBPhi, OfflineCBmatchedL2CBPt, OfflineCBmatchedL2CBEta, OfflineCBmatchedL2CBPhi,
MatchedEFCBPt, MatchedEFCBEta, MatchedEFCBPhi, CBdPt, CBdEta, CBdPhi, CBdR, matchedEFCB, matchedL2CB);
}
return StatusCode::SUCCESS;
}
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGMUONMONITORINGMT_EFMUONMONMT_H
#define TRIGMUONMONITORINGMT_EFMUONMONMT_H
#include "TrigMuonMonitorAlgorithm.h"
#include "xAODMuon/MuonContainer.h"
/*
This is a class for monitoring EFMuon.
*/
class EFMuonMonMT : public TrigMuonMonitorAlgorithm{
public:
EFMuonMonMT(const std::string& name, ISvcLocator* pSvcLocator );
protected:
virtual StatusCode fillVariablesPerChain(const EventContext &ctx, const std::string &chain) const override;
virtual StatusCode fillVariablesPerOfflineMuonPerChain(const EventContext &ctx, const xAOD::Muon* mu, const std::string &chain) const override;
};
#endif //TRIGMUONMONITORINGMT_EFMUONMONMT_H
......@@ -44,7 +44,7 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
roiPhi = (*muEL)->roiPhi();
ATH_MSG_DEBUG("saPt = " << saPt << ", saEta =" << saEta << ", saPhi = " << saPhi << ", saddr = " << saddr);
if(fabs(saPt) < ZERO_LIMIT) mf_failure = true;
if(std::abs(saPt) < ZERO_LIMIT) mf_failure = true;
fill(m_group, roiEta, roiPhi, mf_failure);
if( mf_failure ) continue;
......@@ -91,12 +91,12 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
if(isBarrel){
if( nRPC > 0 ) isL1hitThere = true;
float rpcFitMidSlope = (*muEL)->rpcFitMidSlope();
if( fabs(rpcFitMidSlope) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true;
if( std::abs(rpcFitMidSlope) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true;
}
else {
if( nTGCMidRho > 0 && nTGCMidPhi > 0 ) isL1hitThere = true;
float TGCMid1Z = (*muEL)->tgcMid1Z();
if( fabs(TGCMid1Z) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true;
if( std::abs(TGCMid1Z) > ZERO_LIMIT ) isL1emuOkForTriggerPlane = true;
}
......@@ -127,15 +127,15 @@ StatusCode L2MuonSAMonMT :: fillVariablesPerChain(const EventContext &ctx, const
auto mon_sp_r= Monitored::Collection(m_group+"_MDTpoints_r", sp_r);
auto mon_sp_z= Monitored::Collection(m_group+"_MDTpoints_z", sp_z);
if( fabs((*muEL)->superPointR(inner)) > ZERO_LIMIT ) {
if( std::abs((*muEL)->superPointR(inner)) > ZERO_LIMIT ) {
sp_r.push_back( sign * (*muEL)->superPointR(inner) );
sp_z.push_back( (*muEL)->superPointZ(inner) );
}
if( fabs((*muEL)->superPointR(middle)) > ZERO_LIMIT ) {
if( std::abs((*muEL)->superPointR(middle)) > ZERO_LIMIT ) {
sp_r.push_back( sign * (*muEL)->superPointR(middle) );
sp_z.push_back( (*muEL)->superPointZ(middle) );
}
if( fabs((*muEL)->superPointR(outer)) > ZERO_LIMIT ) {
if( std::abs((*muEL)->superPointR(outer)) > ZERO_LIMIT ) {