diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py index aa18add7adfcf44313f1a3f52bd660b87e5debad..1533991b8e8f0a0a11faa5bdccea729641f10b5e 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py @@ -10,7 +10,7 @@ def EFMuonMonConfig(helper): monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT') # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] + monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_2mu14_L12MU10'] monAlg.Group = GroupName # configuration of etaphi2D and Ratio plots for non-specific chain @@ -37,7 +37,6 @@ def EFMuonMonConfig(helper): for chain in monAlg.MonitoredChains: histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/EFMuon/'+chain) - # basic EDM variables # EFSA diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py index c28dd2979f506cafd178f7aa536b3834271f20f5..bf6f3fff3c88ca29a94d22901cb1e5be1519d905 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py @@ -10,7 +10,7 @@ def L2MuonSAMonConfig(helper): monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT') # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20'] + monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_2mu14_L12MU10'] monAlg.Group = GroupName # configuration of etaphi2D and Ratio plots for non-specific chain diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py index d76221f436dd48ab321dee9da0321921ef06fc1c..27742b57f752ffd486bbb871170325922f187316 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py @@ -10,7 +10,7 @@ def L2muCombMonConfig(helper): monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT') # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20'] + monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_2mu14_L12MU10'] monAlg.Group = GroupName # configuration of etaphi2D and Ratio plots for non-specific chain diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py index b5267dbe59889f01de992b3045e9215172b9fc17..eeae591308ee1767a0b9f018e127dd5d0e674db2 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py @@ -22,8 +22,8 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): from AthenaConfiguration.ComponentFactory import CompFactory # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - # To do: add multi-muon chain and msonly chain - Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] + # To do: add noL1 chain + Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10'] for chain in Chains: monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ttbar_'+chain) @@ -31,7 +31,6 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.Method = 'TTbarTagAndProbe' - monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined monAlg.MonitoredChains = [chain] threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups() monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)] @@ -41,9 +40,7 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): GroupName = 'Eff_ttbar_'+chain histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ttbar/'+chain) - if "ivar" not in chain: - monAlg.doEFIso = False - + PlotConfig(monAlg, chain) defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain) return @@ -54,8 +51,8 @@ def TrigMuonEfficiencyMonZTPConfig(helper): from AthenaConfiguration.ComponentFactory import CompFactory # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. - # To do: add multi-muon chain and msonly chain - Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] + # To do: add noL1 chain + Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10'] for chain in Chains: monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ZTP_'+chain) @@ -63,7 +60,6 @@ def TrigMuonEfficiencyMonZTPConfig(helper): monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.Method = 'ZTagAndProbe' - monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined monAlg.MonitoredChains = [chain] threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups() monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)] @@ -73,15 +69,30 @@ def TrigMuonEfficiencyMonZTPConfig(helper): GroupName = 'Eff_ZTP_'+chain histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ZTP/'+chain) - if "ivar" not in chain: - monAlg.doEFIso = False - + PlotConfig(monAlg, chain) defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain) return +def PlotConfig(monAlg, chain): + + if "msonly" in chain: + monAlg.MuonType = ROOT.xAOD.Muon_v1.MuonStandAlone + else: + monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined + + if "msonly" in chain: + monAlg.doL2CB = False + monAlg.doEFCB = False + if "ivar" not in chain: + monAlg.doEFIso = False + + if "0eta105" in chain: + monAlg.BarrelOnly = True + + def defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain): def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax): @@ -93,51 +104,55 @@ def defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain): title='L1MU Efficiency '+chain+';'+xlabel+';Efficiency', type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_Upstream', - title='L2MuonSA Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_L1pass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - - histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_offlineCB', - title='L2MuonSA Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - - histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_Upstream', - title='L2muComb Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2SApass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + if monAlg.doL2SA: + histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_Upstream', + title='L2MuonSA Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_L1pass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + + histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_offlineCB', + title='L2MuonSA Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + + if monAlg.doL2CB: + histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_Upstream', + title='L2muComb Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2SApass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_offlineCB', - title='L2muComb Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_offlineCB', + title='L2muComb Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_Upstream', - title='EFSA Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2CBpass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + if monAlg.doEFSA: + histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_Upstream', + title='EFSA Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2CBpass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB', - title='EFSA Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB', + title='EFSA Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB_passedL2SA', - title='EFSA Muon Efficiency passed L2SA '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2SApass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB_passedL2SA', + title='EFSA Muon Efficiency passed L2SA '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2SApass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_Upstream', - title='EFCB Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', - cutmask=GroupName+'_EFSApass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + if monAlg.doEFCB: + histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_Upstream', + title='EFCB Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', + cutmask=GroupName+'_EFSApass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB', - title='EFCB Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB', + title='EFCB Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) - histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB_passedL2CB', - title='EFCB Muon Efficiency passed L2CB '+chain+' wrt offlineCB;'+xlabel+';Efficiency', - cutmask=GroupName+'_L2CBpass', - type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) + histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB_passedL2CB', + title='EFCB Muon Efficiency passed L2CB '+chain+' wrt offlineCB;'+xlabel+';Efficiency', + cutmask=GroupName+'_L2CBpass', + type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) if monAlg.doEFIso: diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx index b97e9f985b752bfe0b003815aa4c9defb5076aad..92b072e62eeebd8235578fc725969b1efc1a48f8 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.cxx @@ -20,6 +20,17 @@ StatusCode EFMuonMonMT :: initialize(){ ATH_CHECK( m_MStrackContainerKey.initialize() ); ATH_CHECK( m_CBtrackContainerKey.initialize() ); ATH_CHECK( m_muonIso30Key.initialize() ); + + for( std::string chain : m_monitored_chains ){ + m_doEFSA[chain] = true; + + if( chain.find("msonly") != std::string::npos ) m_doEFCB[chain] = false; + else m_doEFCB[chain] = true; + + if( chain.find("ivar") != std::string::npos ) m_doEFIso[chain] = true; + else m_doEFIso[chain] = false; + } + return sc; } @@ -31,65 +42,71 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext &ctx, const s const float ZERO_LIMIT = 0.00001; // 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)->muonType() != xAOD::Muon::MuonType::MuonStandAlone ) continue; - - auto EFSAPt = Monitored::Scalar<float>(chain+"_EFSA_Pt", -999.); - auto EFSAEta = Monitored::Scalar<float>(chain+"_EFSA_Eta", -999.); - auto EFSAPhi = Monitored::Scalar<float>(chain+"_EFSA_Phi", -999.); - - EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); - EFSAEta = (*muSAEL)->eta(); - EFSAPhi = (*muSAEL)->phi(); - - fill(m_group+"_"+chain, EFSAPt, EFSAEta, EFSAPhi); + if( m_doEFSA.at(chain) ){ + 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)->muonType() != xAOD::Muon::MuonType::MuonStandAlone ) continue; + + auto EFSAPt = Monitored::Scalar<float>(chain+"_EFSA_Pt", -999.); + auto EFSAEta = Monitored::Scalar<float>(chain+"_EFSA_Eta", -999.); + auto EFSAPhi = Monitored::Scalar<float>(chain+"_EFSA_Phi", -999.); + + EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge(); + EFSAEta = (*muSAEL)->eta(); + EFSAPhi = (*muSAEL)->phi(); + + fill(m_group+"_"+chain, 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)->muonType() != xAOD::Muon::MuonType::Combined ) continue; - - auto EFCBPt = Monitored::Scalar<float>(chain+"_EFCB_Pt", -999.); - auto EFCBEta = Monitored::Scalar<float>(chain+"_EFCB_Eta", -999.); - auto EFCBPhi = Monitored::Scalar<float>(chain+"_EFCB_Phi", -999.); - - EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); - EFCBEta = (*muCBEL)->eta(); - EFCBPhi = (*muCBEL)->phi(); - - fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi); + if( m_doEFCB.at(chain) ){ + 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)->muonType() != xAOD::Muon::MuonType::Combined ) continue; + + auto EFCBPt = Monitored::Scalar<float>(chain+"_EFCB_Pt", -999.); + auto EFCBEta = Monitored::Scalar<float>(chain+"_EFCB_Eta", -999.); + auto EFCBPhi = Monitored::Scalar<float>(chain+"_EFCB_Phi", -999.); + + EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge(); + EFCBEta = (*muCBEL)->eta(); + EFCBPhi = (*muCBEL)->phi(); + + fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi); + } } // EFIso - std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContIso = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsIso"); - for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muIsoLinkInfo : featureContIso) { - ATH_CHECK( muIsoLinkInfo.isValid() ); - const ElementLink<xAOD::MuonContainer> muIsoEL = muIsoLinkInfo.link; - if ( (*muIsoEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; - - // basic variables used decision - auto PtCone03 = Monitored::Scalar<float>(chain+"_PtCone03",-999.); - auto PtCone03overMuonPt = Monitored::Scalar<float>(chain+"_PtCone03overMuonPt",-999.); - - SG::ReadDecorHandle<xAOD::MuonContainer, double> muonIso30 ( m_muonIso30Key, ctx ); - float ptcone30 = muonIso30(*(*muIsoEL)); - - if (ptcone30 > ZERO_LIMIT ){ - PtCone03 = ptcone30/1e3; - PtCone03overMuonPt = ptcone30 / (*muIsoEL)->pt(); + if( m_doEFIso.at(chain) ){ + std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContIso = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsIso"); + for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muIsoLinkInfo : featureContIso) { + ATH_CHECK( muIsoLinkInfo.isValid() ); + const ElementLink<xAOD::MuonContainer> muIsoEL = muIsoLinkInfo.link; + if ( (*muIsoEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; + + // basic variables used decision + auto PtCone03 = Monitored::Scalar<float>(chain+"_PtCone03",-999.); + auto PtCone03overMuonPt = Monitored::Scalar<float>(chain+"_PtCone03overMuonPt",-999.); + + SG::ReadDecorHandle<xAOD::MuonContainer, double> muonIso30 ( m_muonIso30Key, ctx ); + float ptcone30 = muonIso30(*(*muIsoEL)); + + if (ptcone30 > ZERO_LIMIT ){ + PtCone03 = ptcone30/1e3; + PtCone03overMuonPt = ptcone30 / (*muIsoEL)->pt(); + } + + fill(m_group+"_"+chain, PtCone03, PtCone03overMuonPt); } - - fill(m_group+"_"+chain, PtCone03, PtCone03overMuonPt); } return StatusCode::SUCCESS; @@ -107,7 +124,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext // OfflineSA - if( OfflineSATrack ){ + if( m_doEFSA.at(chain) && OfflineSATrack ){ auto OfflineSAPt = Monitored::Scalar<float>(chain+"_OfflineSA_Pt",-999.); auto OfflineSAEta = Monitored::Scalar<float>(chain+"_OfflineSA_Eta",-999.); auto OfflineSAPhi = Monitored::Scalar<float>(chain+"_OfflineSA_Phi",-999.); @@ -177,7 +194,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext // OfflineCB - if( OfflineCBTrack ){ + if( m_doEFCB.at(chain) && OfflineCBTrack ){ auto OfflineCBPt = Monitored::Scalar<float>(chain+"_OfflineCB_Pt",-999.); auto OfflineCBEta = Monitored::Scalar<float>(chain+"_OfflineCB_Eta",-999.); auto OfflineCBPhi = Monitored::Scalar<float>(chain+"_OfflineCB_Phi",-999.); @@ -249,7 +266,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext // offoine isolation variable float OfflineIsoptcone30=-1.; mu->isolation(OfflineIsoptcone30, xAOD::Iso::IsolationType::ptvarcone30); - if ( OfflineIsoptcone30 > ZERO_LIMIT ){ + if ( m_doEFIso.at(chain) && OfflineIsoptcone30 > ZERO_LIMIT ){ auto OfflineIsoPtCone03 = Monitored::Scalar<float>(chain+"_OfflineIsoPtCone03",-999.); auto OfflineIsoPtCone03overMuonPt = Monitored::Scalar<float>(chain+"_OfflineIsoPtCone03overMuonPt",-999.); diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h index 59bca7ce2fd103a52945fb36a6fc0a6138d536e4..e0248264e289f2cbf60e37100a3194a7a8246a34 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/EFMuonMonMT.h @@ -31,7 +31,9 @@ class EFMuonMonMT : public TrigMuonMonitorAlgorithm{ SG::ReadHandleKey<xAOD::TrackParticleContainer> m_CBtrackContainerKey {this, "CBtrackContainerName", "HLT_CBCombinedMuon_RoITrackParticles", "EFCBMuon container"}; SG::ReadDecorHandleKey<xAOD::MuonContainer> m_muonIso30Key {this, "MuonIso03Name", "HLT_MuonsIso.ptcone03", "Isolation in ptcone03" }; - + std::map<std::string, bool> m_doEFSA {}; + std::map<std::string, bool> m_doEFCB {}; + std::map<std::string, bool> m_doEFIso {}; }; #endif //TRIGMUONMONITORINGMT_EFMUONMONMT_H diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx index 363ad0adcdaa68a75067520f764960afbe95adf7..4fb627e73ca965f30187fbbc683a1ec39fd0642b 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.cxx @@ -211,17 +211,23 @@ StatusCode TrigMuonEfficiencyMonMT :: selectMuonsTagAndProbe(SG::ReadHandle<xAOD bool pass1 = false; bool pass2 = false; - m_matchTool->matchEFCB(dimu.first, m_tag_trig, pass1); - m_matchTool->matchEFCB(dimu.second, m_tag_trig, pass2); + m_matchTool->matchEFIso(dimu.first, m_tag_trig, pass1); + m_matchTool->matchEFIso(dimu.second, m_tag_trig, pass2); if(pass1){ if(std::find(probes.begin(), probes.end(), dimu.second)==probes.end()){ - probes.push_back(dimu.second); + if(m_BarrelOnly){ + if( std::abs( dimu.second->eta() ) > 0. && std::abs( dimu.second->eta() ) < 1.05 ) probes.push_back(dimu.second); + } + else probes.push_back(dimu.second); } } if(pass2){ if(std::find(probes.begin(), probes.end(), dimu.first)==probes.end()){ - probes.push_back(dimu.first); + if(m_BarrelOnly){ + if( std::abs( dimu.first->eta() ) > 0. && std::abs( dimu.first->eta() ) < 1.05 ) probes.push_back(dimu.first); + } + else probes.push_back(dimu.first); } } } diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h index 7210665c5e7f1688b37c740049ffad9da51bd874..7850fc077746d3430b0108bdf95d290d14af0d20 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/TrigMuonEfficiencyMonMT.h @@ -42,6 +42,7 @@ class TrigMuonEfficiencyMonMT : public TrigMuonMonitorAlgorithm{ Gaudi::Property<bool> m_doEFSA {this, "doEFSA", true, "Flag to analyze EFSA"}; Gaudi::Property<bool> m_doEFCB {this, "doEFCB", true, "Flag to analyze EFCB"}; Gaudi::Property<bool> m_doEFIso {this, "doEFIso", true, "Flag to analyze EFIso"}; + Gaudi::Property<bool> m_BarrelOnly {this, "BarrelOnly", false, "Flag to BarrelOnly"}; Gaudi::Property<bool> m_use_extrapolator {this, "UseExtrapolator", false, "Flag to activate the track extrapolator"}; Gaudi::Property<double> m_mass_lowlim {this, "MassLowLim", 81., "Lower mass limit for the tag and probe method"}; Gaudi::Property<double> m_mass_highlim {this, "MassHighLim", 101., "Higher mass limit for the tag and probe method"};