Skip to content
Snippets Groups Projects
Commit 773aaf15 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'ImplementMoreChainPlot' into 'master'

Implement the multi-muon chain and the msonly chain plots in TrigMuonMonitoringMT, ATR-20317

See merge request atlas/athena!37139
parents 313d1ec6 f114b26b
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ def EFMuonMonConfig(helper): ...@@ -10,7 +10,7 @@ def EFMuonMonConfig(helper):
monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT') monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT')
# HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. # 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 monAlg.Group = GroupName
# configuration of etaphi2D and Ratio plots for non-specific chain # configuration of etaphi2D and Ratio plots for non-specific chain
...@@ -37,7 +37,6 @@ def EFMuonMonConfig(helper): ...@@ -37,7 +37,6 @@ def EFMuonMonConfig(helper):
for chain in monAlg.MonitoredChains: for chain in monAlg.MonitoredChains:
histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/EFMuon/'+chain) histGroup = helper.addGroup(monAlg, GroupName+'_'+chain, 'HLT/MuonMon/EFMuon/'+chain)
# basic EDM variables # basic EDM variables
# EFSA # EFSA
......
...@@ -10,7 +10,7 @@ def L2MuonSAMonConfig(helper): ...@@ -10,7 +10,7 @@ def L2MuonSAMonConfig(helper):
monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT') monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT')
# HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. # 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 monAlg.Group = GroupName
# configuration of etaphi2D and Ratio plots for non-specific chain # configuration of etaphi2D and Ratio plots for non-specific chain
......
...@@ -10,7 +10,7 @@ def L2muCombMonConfig(helper): ...@@ -10,7 +10,7 @@ def L2muCombMonConfig(helper):
monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT') monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT')
# HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. # 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 monAlg.Group = GroupName
# configuration of etaphi2D and Ratio plots for non-specific chain # configuration of etaphi2D and Ratio plots for non-specific chain
......
...@@ -22,8 +22,8 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): ...@@ -22,8 +22,8 @@ def TrigMuonEfficiencyMonTTbarConfig(helper):
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
# HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
# To do: add multi-muon chain and msonly chain # To do: add noL1 chain
Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10']
for chain in Chains: for chain in Chains:
monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ttbar_'+chain) monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ttbar_'+chain)
...@@ -31,7 +31,6 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): ...@@ -31,7 +31,6 @@ def TrigMuonEfficiencyMonTTbarConfig(helper):
monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20'
monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20'
monAlg.Method = 'TTbarTagAndProbe' monAlg.Method = 'TTbarTagAndProbe'
monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined
monAlg.MonitoredChains = [chain] monAlg.MonitoredChains = [chain]
threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups() threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups()
monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)] monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)]
...@@ -41,9 +40,7 @@ def TrigMuonEfficiencyMonTTbarConfig(helper): ...@@ -41,9 +40,7 @@ def TrigMuonEfficiencyMonTTbarConfig(helper):
GroupName = 'Eff_ttbar_'+chain GroupName = 'Eff_ttbar_'+chain
histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ttbar/'+chain) histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ttbar/'+chain)
if "ivar" not in chain: PlotConfig(monAlg, chain)
monAlg.doEFIso = False
defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain) defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain)
return return
...@@ -54,8 +51,8 @@ def TrigMuonEfficiencyMonZTPConfig(helper): ...@@ -54,8 +51,8 @@ def TrigMuonEfficiencyMonZTPConfig(helper):
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
# HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed. # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
# To do: add multi-muon chain and msonly chain # To do: add noL1 chain
Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20'] Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10']
for chain in Chains: for chain in Chains:
monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ZTP_'+chain) monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ZTP_'+chain)
...@@ -63,7 +60,6 @@ def TrigMuonEfficiencyMonZTPConfig(helper): ...@@ -63,7 +60,6 @@ def TrigMuonEfficiencyMonZTPConfig(helper):
monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20'
monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20' monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20'
monAlg.Method = 'ZTagAndProbe' monAlg.Method = 'ZTagAndProbe'
monAlg.MuonType = ROOT.xAOD.Muon_v1.Combined
monAlg.MonitoredChains = [chain] monAlg.MonitoredChains = [chain]
threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups() threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups()
monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)] monAlg.L1Seeds = [regex('L1MU').sub('L1_MU', level1)]
...@@ -73,15 +69,30 @@ def TrigMuonEfficiencyMonZTPConfig(helper): ...@@ -73,15 +69,30 @@ def TrigMuonEfficiencyMonZTPConfig(helper):
GroupName = 'Eff_ZTP_'+chain GroupName = 'Eff_ZTP_'+chain
histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ZTP/'+chain) histGroup = helper.addGroup(monAlg, GroupName, 'HLT/MuonMon/Efficiency/ZTP/'+chain)
if "ivar" not in chain: PlotConfig(monAlg, chain)
monAlg.doEFIso = False
defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain) defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain)
return 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 defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain):
def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax): def defineEachStepHistograms(xvariable, xlabel, xbins, xmin, xmax):
...@@ -93,51 +104,55 @@ def defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain): ...@@ -93,51 +104,55 @@ def defineEfficiencyHistograms(monAlg, histGroup, GroupName, chain):
title='L1MU Efficiency '+chain+';'+xlabel+';Efficiency', title='L1MU Efficiency '+chain+';'+xlabel+';Efficiency',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_Upstream', if monAlg.doL2SA:
title='L2MuonSA Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_Upstream',
cutmask=GroupName+'_L1pass', title='L2MuonSA Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) 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', histGroup.defineHistogram(GroupName+'_L2SApass,'+GroupName+'_'+xvariable+';EffL2SA_'+xvariable+'_wrt_offlineCB',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) 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', if monAlg.doL2CB:
cutmask=GroupName+'_L2SApass', histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_Upstream',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) 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', histGroup.defineHistogram(GroupName+'_L2CBpass,'+GroupName+'_'+xvariable+';EffL2CB_'+xvariable+'_wrt_offlineCB',
title='L2muComb Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', title='L2muComb Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_Upstream', if monAlg.doEFSA:
title='EFSA Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_Upstream',
cutmask=GroupName+'_L2CBpass', title='EFSA Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) cutmask=GroupName+'_L2CBpass',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB', histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB',
title='EFSA Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', title='EFSA Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB_passedL2SA', histGroup.defineHistogram(GroupName+'_EFSApass,'+GroupName+'_'+xvariable+';EffEFSA_'+xvariable+'_wrt_offlineCB_passedL2SA',
title='EFSA Muon Efficiency passed L2SA '+chain+' wrt offlineCB;'+xlabel+';Efficiency', title='EFSA Muon Efficiency passed L2SA '+chain+' wrt offlineCB;'+xlabel+';Efficiency',
cutmask=GroupName+'_L2SApass', cutmask=GroupName+'_L2SApass',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_Upstream', if monAlg.doEFCB:
title='EFCB Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency', histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_Upstream',
cutmask=GroupName+'_EFSApass', title='EFCB Muon Efficiency '+chain+' wrt Upstream;'+xlabel+';Efficiency',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) cutmask=GroupName+'_EFSApass',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB', histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB',
title='EFCB Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency', title='EFCB Muon Efficiency '+chain+' wrt offlineCB;'+xlabel+';Efficiency',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB_passedL2CB', histGroup.defineHistogram(GroupName+'_EFCBpass,'+GroupName+'_'+xvariable+';EffEFCB_'+xvariable+'_wrt_offlineCB_passedL2CB',
title='EFCB Muon Efficiency passed L2CB '+chain+' wrt offlineCB;'+xlabel+';Efficiency', title='EFCB Muon Efficiency passed L2CB '+chain+' wrt offlineCB;'+xlabel+';Efficiency',
cutmask=GroupName+'_L2CBpass', cutmask=GroupName+'_L2CBpass',
type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax) type='TEfficiency', path='',xbins=xbins,xmin=xmin,xmax=xmax)
if monAlg.doEFIso: if monAlg.doEFIso:
......
...@@ -20,6 +20,17 @@ StatusCode EFMuonMonMT :: initialize(){ ...@@ -20,6 +20,17 @@ StatusCode EFMuonMonMT :: initialize(){
ATH_CHECK( m_MStrackContainerKey.initialize() ); ATH_CHECK( m_MStrackContainerKey.initialize() );
ATH_CHECK( m_CBtrackContainerKey.initialize() ); ATH_CHECK( m_CBtrackContainerKey.initialize() );
ATH_CHECK( m_muonIso30Key.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; return sc;
} }
...@@ -31,65 +42,71 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext &ctx, const s ...@@ -31,65 +42,71 @@ StatusCode EFMuonMonMT :: fillVariablesPerChain(const EventContext &ctx, const s
const float ZERO_LIMIT = 0.00001; const float ZERO_LIMIT = 0.00001;
// EFSA // EFSA
std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContSA = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_Muons_.*"); 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() ); for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muSALinkInfo : featureContSA) {
const ElementLink<xAOD::MuonContainer> muSAEL = muSALinkInfo.link; ATH_CHECK( muSALinkInfo.isValid() );
if ( (*muSAEL)->muonType() != xAOD::Muon::MuonType::MuonStandAlone ) continue; 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 EFSAPt = Monitored::Scalar<float>(chain+"_EFSA_Pt", -999.);
auto EFSAPhi = Monitored::Scalar<float>(chain+"_EFSA_Phi", -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(); EFSAPt = (*muSAEL)->pt()/1e3 * (*muSAEL)->charge();
EFSAPhi = (*muSAEL)->phi(); EFSAEta = (*muSAEL)->eta();
EFSAPhi = (*muSAEL)->phi();
fill(m_group+"_"+chain, EFSAPt, EFSAEta, EFSAPhi);
fill(m_group+"_"+chain, EFSAPt, EFSAEta, EFSAPhi);
}
} }
// EFCB // EFCB
std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContCB = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsCB.*"); 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() ); for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muCBLinkInfo : featureContCB) {
const ElementLink<xAOD::MuonContainer> muCBEL = muCBLinkInfo.link; ATH_CHECK( muCBLinkInfo.isValid() );
if ( (*muCBEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; 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 EFCBPt = Monitored::Scalar<float>(chain+"_EFCB_Pt", -999.);
auto EFCBPhi = Monitored::Scalar<float>(chain+"_EFCB_Phi", -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(); EFCBPt = (*muCBEL)->pt()/1e3 * (*muCBEL)->charge();
EFCBPhi = (*muCBEL)->phi(); EFCBEta = (*muCBEL)->eta();
EFCBPhi = (*muCBEL)->phi();
fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi);
fill(m_group+"_"+chain, EFCBPt, EFCBEta, EFCBPhi);
}
} }
// EFIso // EFIso
std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContIso = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsIso"); if( m_doEFIso.at(chain) ){
for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muIsoLinkInfo : featureContIso) { std::vector< TrigCompositeUtils::LinkInfo<xAOD::MuonContainer> > featureContIso = getTrigDecisionTool()->features<xAOD::MuonContainer>( chain, TrigDefs::includeFailedDecisions, "HLT_MuonsIso");
ATH_CHECK( muIsoLinkInfo.isValid() ); for (const TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>& muIsoLinkInfo : featureContIso) {
const ElementLink<xAOD::MuonContainer> muIsoEL = muIsoLinkInfo.link; ATH_CHECK( muIsoLinkInfo.isValid() );
if ( (*muIsoEL)->muonType() != xAOD::Muon::MuonType::Combined ) continue; 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.); // basic variables used decision
auto PtCone03overMuonPt = Monitored::Scalar<float>(chain+"_PtCone03overMuonPt",-999.); 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)); SG::ReadDecorHandle<xAOD::MuonContainer, double> muonIso30 ( m_muonIso30Key, ctx );
float ptcone30 = muonIso30(*(*muIsoEL));
if (ptcone30 > ZERO_LIMIT ){
PtCone03 = ptcone30/1e3; if (ptcone30 > ZERO_LIMIT ){
PtCone03overMuonPt = ptcone30 / (*muIsoEL)->pt(); PtCone03 = ptcone30/1e3;
PtCone03overMuonPt = ptcone30 / (*muIsoEL)->pt();
}
fill(m_group+"_"+chain, PtCone03, PtCone03overMuonPt);
} }
fill(m_group+"_"+chain, PtCone03, PtCone03overMuonPt);
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -107,7 +124,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext ...@@ -107,7 +124,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
// OfflineSA // OfflineSA
if( OfflineSATrack ){ if( m_doEFSA.at(chain) && OfflineSATrack ){
auto OfflineSAPt = Monitored::Scalar<float>(chain+"_OfflineSA_Pt",-999.); auto OfflineSAPt = Monitored::Scalar<float>(chain+"_OfflineSA_Pt",-999.);
auto OfflineSAEta = Monitored::Scalar<float>(chain+"_OfflineSA_Eta",-999.); auto OfflineSAEta = Monitored::Scalar<float>(chain+"_OfflineSA_Eta",-999.);
auto OfflineSAPhi = Monitored::Scalar<float>(chain+"_OfflineSA_Phi",-999.); auto OfflineSAPhi = Monitored::Scalar<float>(chain+"_OfflineSA_Phi",-999.);
...@@ -177,7 +194,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext ...@@ -177,7 +194,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
// OfflineCB // OfflineCB
if( OfflineCBTrack ){ if( m_doEFCB.at(chain) && OfflineCBTrack ){
auto OfflineCBPt = Monitored::Scalar<float>(chain+"_OfflineCB_Pt",-999.); auto OfflineCBPt = Monitored::Scalar<float>(chain+"_OfflineCB_Pt",-999.);
auto OfflineCBEta = Monitored::Scalar<float>(chain+"_OfflineCB_Eta",-999.); auto OfflineCBEta = Monitored::Scalar<float>(chain+"_OfflineCB_Eta",-999.);
auto OfflineCBPhi = Monitored::Scalar<float>(chain+"_OfflineCB_Phi",-999.); auto OfflineCBPhi = Monitored::Scalar<float>(chain+"_OfflineCB_Phi",-999.);
...@@ -249,7 +266,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext ...@@ -249,7 +266,7 @@ StatusCode EFMuonMonMT :: fillVariablesPerOfflineMuonPerChain(const EventContext
// offoine isolation variable // offoine isolation variable
float OfflineIsoptcone30=-1.; float OfflineIsoptcone30=-1.;
mu->isolation(OfflineIsoptcone30, xAOD::Iso::IsolationType::ptvarcone30); 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 OfflineIsoPtCone03 = Monitored::Scalar<float>(chain+"_OfflineIsoPtCone03",-999.);
auto OfflineIsoPtCone03overMuonPt = Monitored::Scalar<float>(chain+"_OfflineIsoPtCone03overMuonPt",-999.); auto OfflineIsoPtCone03overMuonPt = Monitored::Scalar<float>(chain+"_OfflineIsoPtCone03overMuonPt",-999.);
......
...@@ -31,7 +31,9 @@ class EFMuonMonMT : public TrigMuonMonitorAlgorithm{ ...@@ -31,7 +31,9 @@ class EFMuonMonMT : public TrigMuonMonitorAlgorithm{
SG::ReadHandleKey<xAOD::TrackParticleContainer> m_CBtrackContainerKey {this, "CBtrackContainerName", "HLT_CBCombinedMuon_RoITrackParticles", "EFCBMuon container"}; 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" }; 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 #endif //TRIGMUONMONITORINGMT_EFMUONMONMT_H
...@@ -211,17 +211,23 @@ StatusCode TrigMuonEfficiencyMonMT :: selectMuonsTagAndProbe(SG::ReadHandle<xAOD ...@@ -211,17 +211,23 @@ StatusCode TrigMuonEfficiencyMonMT :: selectMuonsTagAndProbe(SG::ReadHandle<xAOD
bool pass1 = false; bool pass1 = false;
bool pass2 = false; bool pass2 = false;
m_matchTool->matchEFCB(dimu.first, m_tag_trig, pass1); m_matchTool->matchEFIso(dimu.first, m_tag_trig, pass1);
m_matchTool->matchEFCB(dimu.second, m_tag_trig, pass2); m_matchTool->matchEFIso(dimu.second, m_tag_trig, pass2);
if(pass1){ if(pass1){
if(std::find(probes.begin(), probes.end(), dimu.second)==probes.end()){ 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(pass2){
if(std::find(probes.begin(), probes.end(), dimu.first)==probes.end()){ 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);
} }
} }
} }
......
...@@ -42,6 +42,7 @@ class TrigMuonEfficiencyMonMT : public TrigMuonMonitorAlgorithm{ ...@@ -42,6 +42,7 @@ class TrigMuonEfficiencyMonMT : public TrigMuonMonitorAlgorithm{
Gaudi::Property<bool> m_doEFSA {this, "doEFSA", true, "Flag to analyze EFSA"}; 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_doEFCB {this, "doEFCB", true, "Flag to analyze EFCB"};
Gaudi::Property<bool> m_doEFIso {this, "doEFIso", true, "Flag to analyze EFIso"}; 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<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_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"}; Gaudi::Property<double> m_mass_highlim {this, "MassHighLim", 101., "Higher mass limit for the tag and probe method"};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment