Skip to content
Snippets Groups Projects
Commit d376487b authored by Nils Erik Krumnack's avatar Nils Erik Krumnack
Browse files

Merge branch '21.2-ATmuonIsolationWPupdate' into '21.2'

Removing unsupported muon isolation WP and adding new supported ones

See merge request atlas/athena!20971
parents b044b0a5 53bdc412
No related branches found
No related tags found
No related merge requests found
Showing
with 108 additions and 134 deletions
......@@ -64,8 +64,8 @@ cutfilepath = ROOT.PathResolver.find_file(cutfilename,
returnCode = CITest("TOPQ1 MC",
cutfilename,
cutfilepath,
"/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/AnalysisTop/ContinuousIntegration/MC/p3390/"+
"mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_TOPQ1.e6337_e5984_s3126_r9364_r9315_p3390/DAOD_TOPQ1.12720282._000339.pool.root.1",
"/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/AnalysisTop/ContinuousIntegration/MC/p3731/"+
"mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_TOPQ1.e6337_s3126_r9364_p3731/DAOD_TOPQ1.16479625._003348.pool.root.1",
[("#NEvents.*","NEvents 100")])
if returnCode != 0:
......@@ -75,8 +75,8 @@ if returnCode != 0:
returnCode = CITest("TOPQ1 DATA",
cutfilename,
cutfilepath,
"/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/AnalysisTop/ContinuousIntegration/Data/p3388/"+
"data16_13TeV.00297730.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3388/DAOD_TOPQ1.12646828._000040.pool.root.1",
"/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/AnalysisTop/ContinuousIntegration/Data/p3730/"+
"Data_16_p3730/DAOD_TOPQ1.16771725._000150.pool.root.1",
[("#NEvents.*","NEvents 3000")])
if returnCode != 0:
......
......@@ -46,7 +46,7 @@ ElectronIsolationLoose None
MuonQuality Medium
MuonQualityLoose Medium
MuonIsolation Gradient
MuonIsolation FCTight_FixedRad
MuonIsolationLoose None
# DoTight/DoLoose to activate the loose and tight trees
......
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000027.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000153.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000393.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000073.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000228.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000422.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000132.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000279.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000146.pool.root.1
root://eosatlas//eos/atlas/atlascerngroupdisk/phys-top/topreco/rel21/data/data16_13TeV.00311321.physics_Main.deriv.DAOD_TOPQ1.r9264_p3083_p3142/DAOD_TOPQ1.11286123._000368.pool.root.1
/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/AnalysisTop/ContinuousIntegration/Data/p3730/Data_16_p3730/DAOD_TOPQ1.16771725._000150.pool.root.1
/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/AnalysisTop/ContinuousIntegration/MC/p3390/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_TOPQ1.e6337_e5984_s3126_r9364_r9315_p3390/DAOD_TOPQ1.12720282._000339.pool.root.1
/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/dev/AnalysisTop/ContinuousIntegration/MC/p3731/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_TOPQ1.e6337_s3126_r9364_p3731/DAOD_TOPQ1.16479625._003348.pool.root.1
......@@ -43,7 +43,7 @@ ElectronIsolationLoose None
MuonQuality Medium
MuonQualityLoose Medium
MuonIsolation Gradient
MuonIsolation FCTight_FixedRad
MuonIsolationLoose None
# DoTight/DoLoose to activate the loose and tight trees
......
......@@ -39,7 +39,8 @@ LargeRToptaggingConfigFile NFC
### Reclustered jet configuration
UseRCJets True
UseRCJetSubstructure True
###commenting out as it fails on data with the most recent ptag
#UseRCJetSubstructure True
RCJetEta 2.0
UseVarRCJets True
VarRCJetMassScale m_w,m_t
......@@ -86,7 +87,7 @@ PhotonUseRadiativeZ False
### Muon configuration
MuonQuality Medium
MuonQualityLoose Medium
MuonIsolation Gradient
MuonIsolation FCTight_FixedRad
MuonIsolationLoose None
### Tau configuration
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#include "TopCPTools/TopIsolationCPTools.h"
......@@ -62,16 +62,14 @@ StatusCode IsolationCPTools::setupIsolation() {
// Muon Isolation WPs
std::set<std::string> muon_isolations{{
"LooseTrackOnly",
"Loose",
"Gradient",
"GradientLoose",
"FixedCutTight",
"FixedCutTightTrackOnly",
"FixedCutLoose",
"FCTight",
"FCLoose",
"FCTightTrackOnly",
"FCTightTrackOnly_FixedRad",
"FCLoose_FixedRad",
"FCTight_FixedRad",
"FixedCutPflowTight",
"FixedCutPflowLoose",
}};
// Electron Isolation WPs include all of those defined for
......
......@@ -68,7 +68,7 @@ ConfigurationSettings::ConfigurationSettings() : m_configured(false) {
registerParameter("MuonEta", "Absolute Muon eta cut for object selection. Default 2.5.", "2.5" );
registerParameter("MuonQuality", "Muon quality cut for object selection. Options are VeryLoose, Loose, Medium (default) and Tight", "Medium");
registerParameter("MuonQualityLoose", "Muon quality cut for object selection. Options are VeryLoose, Loose, Medium (default) and Tight", "Medium");
registerParameter("MuonIsolation","Isolation to use : Gradient, GradientLoose, Tight, Loose, LooseTrackOnly, FixedCutTight, FixedCutTightTrackOnly, FixedCutLoose, FCTight, FCLoose, FCTightTrackOnly, PromptLepton, None","Gradient");
registerParameter("MuonIsolation","Isolation to use : FCTight, FCLoose, FCTightTrackOnly, FCTightTrackOnly_FixedRad, FCLoose_FixedRad, FCTight_FixedRad, FixedCutPflowTight, FixedCutPflowLoose, None","FCTight_FixedRad");
registerParameter("MuonIsolationLoose","Isolation to use : Gradient, GradientLoose, Tight, Loose, LooseTrackOnly, FixedCutTight, FixedCutTightTrackOnly, FixedCutLoose, FCTight, FCLoose, FCTightTrackOnly, PromptLepton, None","None");
registerParameter("MuonIsolationSF", "Force muon isolation SF (e.g. None). EXPERIMENTAL!", " ");
registerParameter("MuonIsolationSFLoose", "Force muon isolation SF (e.g. None). EXPERIMENTAL!", " ");
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id: MuonObjectCollectionMaker.cxx 810751 2017-09-29 14:41:39Z iconnell $
......@@ -26,82 +26,71 @@ namespace top{
m_recommendedSystematics(),
m_calibrationPeriodTool("CP::MuonCalibrationPeriodTool"),
m_isolationTool_LooseTrackOnly("CP::IsolationTool_LooseTrackOnly"),
m_isolationTool_Loose("CP::IsolationTool_Loose"),
m_isolationTool_Gradient("CP::IsolationTool_Gradient"),
m_isolationTool_GradientLoose("CP::IsolationTool_GradientLoose"),
m_isolationTool_FixedCutTight("CP::IsolationTool_FixedCutTight"),
m_isolationTool_FixedCutTightTrackOnly("CP::IsolationTool_FixedCutTightTrackOnly"),
m_isolationTool_FixedCutLoose("CP::IsolationTool_FixedCutLoose"),
m_isolationTool_FCTight("CP::IsolationTool_FCTight"),
m_isolationTool_FCLoose("CP::IsolationTool_FCLoose"),
m_isolationTool_FCTightTrackOnly("CP::IsolationTool_FCTightTrackOnly"),
m_isolationTool_FCTightTrackOnly_FixedRad("CP::IsolationTool_FCTightTrackOnly_FixedRad"),
m_isolationTool_FCLoose_FixedRad("CP::IsolationTool_FCLoose_FixedRad"),
m_isolationTool_FCTight_FixedRad("CP::IsolationTool_FCTight_FixedRad"),
m_isolationTool_FixedCutPflowTight("CP::IsolationTool_FixedCutPflowTight"),
m_isolationTool_FixedCutPflowLoose("CP::IsolationTool_FixedCutPflowLoose"),
m_muonSelectionToolVeryLooseVeto("CP::MuonSelectionToolVeryLooseVeto")
{
declareProperty( "config" , m_config );
declareProperty( "config" , m_config );
declareProperty( "MuonCalibrationPeriodTool" , m_calibrationPeriodTool );
declareProperty( "IsolationTool_LooseTrackOnly" , m_isolationTool_LooseTrackOnly );
declareProperty( "IsolationTool_Loose" , m_isolationTool_Loose );
declareProperty( "IsolationTool_Gradient" , m_isolationTool_Gradient );
declareProperty( "IsolationTool_GradientLoose" , m_isolationTool_GradientLoose );
declareProperty( "IsolationTool_FixedCutTight" , m_isolationTool_FixedCutTight );
declareProperty( "IsolationTool_FixedCutTightTrackOnly" , m_isolationTool_FixedCutTightTrackOnly );
declareProperty( "IsolationTool_FixedCutLoose" , m_isolationTool_FixedCutLoose );
declareProperty( "IsolationTool_FCTight" , m_isolationTool_FCTight );
declareProperty( "IsolationTool_FCLoose" , m_isolationTool_FCLoose );
declareProperty( "IsolationTool_FCTightTrackOnly" , m_isolationTool_FCTightTrackOnly );
declareProperty( "IsolationTool_FCTightTrackOnly_FixedRad" ,m_isolationTool_FCTightTrackOnly_FixedRad );
declareProperty( "IsolationTool_FCLoose_FixedRad" ,m_isolationTool_FCLoose_FixedRad );
declareProperty( "IsolationTool_FCTight_FixedRad" ,m_isolationTool_FCTight_FixedRad );
declareProperty( "IsolationTool_FixedCutPflowTight" ,m_isolationTool_FixedCutPflowTight );
declareProperty( "IsolationTool_FixedCutPflowLoose" ,m_isolationTool_FixedCutPflowLoose );
declareProperty( "MuonSelectionToolVeryLooseVeto" , m_muonSelectionToolVeryLooseVeto );
}
StatusCode MuonObjectCollectionMaker::initialize()
{
ATH_MSG_INFO(" top::MuonObjectCollectionMaker initialize" );
ATH_MSG_INFO(" top::MuonObjectCollectionMaker initialize" );
top::check( m_calibrationPeriodTool.retrieve() , "Failed to retrieve muon calibration tool" );
top::check( m_isolationTool_LooseTrackOnly.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_Loose.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_Gradient.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_GradientLoose.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FixedCutTight.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FixedCutTightTrackOnly.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FixedCutLoose.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FCTight.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FCLoose.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FCTightTrackOnly.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FCTightTrackOnly_FixedRad.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FCLoose_FixedRad.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FCTight_FixedRad.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FixedCutPflowTight.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_isolationTool_FixedCutPflowLoose.retrieve() , "Failed to retrieve Isolation Tool" );
top::check( m_muonSelectionToolVeryLooseVeto.retrieve() , "Failed to retrieve Selection Tool" );
///-- Set Systematics Information --///
const std:: string& syststr = m_config->systematics();
std::set<std::string> syst;
std::set<std::string> syst;
if( !m_config->isSystNominal(syststr) && !m_config->isSystAll(syststr)){
bool ok = m_config->getSystematicsList(syststr, syst);
if (!ok) {
ATH_MSG_ERROR(" top::MuonObjectCollectionMaker could not determine systematic list" );
return StatusCode::FAILURE;
ATH_MSG_ERROR(" top::MuonObjectCollectionMaker could not determine systematic list" );
return StatusCode::FAILURE;
}
if (m_config->contains(syst, "AllMuons")) {
syst.clear();
syst.clear();
}
}
specifiedSystematics( syst );
m_config->systematicsMuons( specifiedSystematics() );
ATH_MSG_INFO(" top::MuonObjectCollectionMaker completed initialize" );
return StatusCode::SUCCESS;
}
StatusCode MuonObjectCollectionMaker::execute(bool executeNominal)
{
static SG::AuxElement::ConstAccessor<float> ptvarcone30_TightTTVA_pt1000("ptvarcone30_TightTTVA_pt1000");
static SG::AuxElement::Accessor<char> AnalysisTop_Isol_FCTight("AnalysisTop_Isol_FCTight");
static SG::AuxElement::Accessor<char> AnalysisTop_Isol_FCLoose("AnalysisTop_Isol_FCLoose");
static SG::AuxElement::Accessor<char> AnalysisTop_Isol_FCTightTrackOnly("AnalysisTop_Isol_FCTightTrackOnly");
const xAOD::EventInfo* eventInfo(nullptr);
top::check( evtStore()->retrieve( eventInfo, m_config->sgKeyEventInfo() ), "Failed to retrieve EventInfo");
float beam_pos_sigma_x = eventInfo->beamPosSigmaX();
......@@ -122,26 +111,26 @@ namespace top{
///-- Get base muons and tracks from xAOD --///
const xAOD::MuonContainer* xaod(nullptr);
top::check( evtStore()->retrieve( xaod , m_config->sgKeyMuons() ) , "Failed to retrieve Muons" );
///-- Loop over all systematics --///
for( auto systematic : m_specifiedSystematics ){
///-- if executeNominal, skip other systematics (and vice-versa) --///
if(executeNominal && !m_config->isSystNominal(m_config->systematicName(systematic.hash()))) continue;
if(!executeNominal && m_config->isSystNominal(m_config->systematicName(systematic.hash()))) continue;
///-- Tell tool which systematic to use --///
top::check( m_calibrationPeriodTool->applySystematicVariation( systematic ) , "Failed to applySystematicVariation" );
top::check( m_calibrationPeriodTool->applySystematicVariation( systematic ) , "Failed to applySystematicVariation" );
///-- Shallow copy of the xAOD --///
std::pair< xAOD::MuonContainer*, xAOD::ShallowAuxContainer* > shallow_xaod_copy = xAOD::shallowCopyContainer( *xaod );
///-- Loop over the xAOD Container and apply corrections--///
for( auto muon : *(shallow_xaod_copy.first) ){
///-- Apply momentum correction --///
///-- Apply momentum correction --///
if (muon->primaryTrackParticle()) {
top::check( m_calibrationPeriodTool->applyCorrection( *muon ) , "Failed to applyCorrection" );
top::check( m_calibrationPeriodTool->applyCorrection( *muon ) , "Failed to applyCorrection" );
// don't do the decorations unless the muons are at least Loose
// this is because it may fail if the muons are at just VeryLoose
......@@ -159,49 +148,46 @@ namespace top{
muon->auxdecor<float>("delta_z0_sintheta") = delta_z0*std::sin( muon->primaryTrackParticle()->theta() );
}
}
}
///-- Isolation selection --///
char passIsol_LooseTrackOnly(0),passIsol_Loose(0),passIsol_FixedCutTightTrackOnly(0);
char passIsol_Gradient(0),passIsol_GradientLoose(0),passIsol_FixedCutLoose(0);
char passIsol_FixedCutTight(0);
if (m_isolationTool_LooseTrackOnly->accept( *muon )) {passIsol_LooseTrackOnly = 1;}
if (m_isolationTool_Loose->accept( *muon )) {passIsol_Loose = 1;}
if (m_isolationTool_Gradient->accept( *muon )) {passIsol_Gradient = 1;}
if (m_isolationTool_GradientLoose->accept( *muon )) {passIsol_GradientLoose = 1;}
if (m_isolationTool_FixedCutTight->accept( *muon )) {passIsol_FixedCutTight = 1;}
if (m_isolationTool_FixedCutTightTrackOnly->accept( *muon )) {passIsol_FixedCutTightTrackOnly = 1;}
if (m_isolationTool_FixedCutLoose->accept( *muon )) {passIsol_FixedCutLoose = 1;}
muon->auxdecor<char>("AnalysisTop_Isol_LooseTrackOnly") = passIsol_LooseTrackOnly;
muon->auxdecor<char>("AnalysisTop_Isol_Loose") = passIsol_Loose;
muon->auxdecor<char>("AnalysisTop_Isol_Gradient") = passIsol_Gradient;
muon->auxdecor<char>("AnalysisTop_Isol_GradientLoose") = passIsol_GradientLoose;
muon->auxdecor<char>("AnalysisTop_Isol_FixedCutTight") = passIsol_FixedCutTight;
muon->auxdecor<char>("AnalysisTop_Isol_FixedCutTightTrackOnly") = passIsol_FixedCutTightTrackOnly;
muon->auxdecor<char>("AnalysisTop_Isol_FixedCutLoose") = passIsol_FixedCutLoose;
if (ptvarcone30_TightTTVA_pt1000.isAvailable(*muon)) {
AnalysisTop_Isol_FCTight(*muon) = (m_isolationTool_FCTight->accept(*muon) ? 1 : 0);
AnalysisTop_Isol_FCLoose(*muon) = (m_isolationTool_FCLoose->accept(*muon) ? 1 : 0);
AnalysisTop_Isol_FCTightTrackOnly(*muon) = (m_isolationTool_FCTightTrackOnly->accept(*muon) ? 1 : 0);
}
// PromptLeptonIsolation - Some protection incase things change in R21
if(muon->isAvailable<float>("PromptLeptonIso_TagWeight")){
muon->auxdecor<char>("AnalysisTop_Isol_PromptLepton") = (muon->auxdata<float>("PromptLeptonIso_TagWeight") < -0.5) ? 1 : 0;
}
else{
muon->auxdecor<char>("AnalysisTop_Isol_PromptLepton") = 0;
}
// ///-- Isolation selection --///
char passIsol_FCTight(0),passIsol_FCLoose(0),passIsol_FCTightTrackOnly(0);
char passIsol_FCTightTrackOnly_FixedRad(0),passIsol_FCLoose_FixedRad(0),passIsol_FCTight_FixedRad(0);
char passIsol_FixedCutPflowTight(0),passIsol_FixedCutPflowLoose(0);
if (m_isolationTool_FCTight->accept( *muon )) {passIsol_FCTight = 1;}
if (m_isolationTool_FCLoose->accept( *muon )) {passIsol_FCLoose = 1;}
if (m_isolationTool_FCTightTrackOnly->accept( *muon )) {passIsol_FCTightTrackOnly = 1;}
if (m_isolationTool_FCTightTrackOnly_FixedRad->accept( *muon )) {passIsol_FCTightTrackOnly_FixedRad = 1;}
if (m_isolationTool_FCLoose_FixedRad->accept( *muon )) {passIsol_FCLoose_FixedRad = 1;}
if (m_isolationTool_FCTight_FixedRad->accept( *muon )) {passIsol_FCTight_FixedRad = 1;}
if (m_isolationTool_FixedCutPflowTight->accept( *muon )) {passIsol_FixedCutPflowTight = 1;}
if (m_isolationTool_FixedCutPflowLoose->accept( *muon )) {passIsol_FixedCutPflowLoose = 1;}
muon->auxdecor<char>("AnalysisTop_Isol_FCTight") = passIsol_FCTight;
muon->auxdecor<char>("AnalysisTop_Isol_FCLoose") = passIsol_FCLoose;
muon->auxdecor<char>("AnalysisTop_Isol_FCTightTrackOnly") = passIsol_FCTightTrackOnly;
muon->auxdecor<char>("AnalysisTop_Isol_FCTightTrackOnly_FixedRad") = passIsol_FCTightTrackOnly_FixedRad;
muon->auxdecor<char>("AnalysisTop_Isol_FCLoose_FixedRad") = passIsol_FCLoose_FixedRad;
muon->auxdecor<char>("AnalysisTop_Isol_FCTight_FixedRad") = passIsol_FCTight_FixedRad;
muon->auxdecor<char>("AnalysisTop_Isol_FixedCutPflowTight") = passIsol_FixedCutPflowTight;
muon->auxdecor<char>("AnalysisTop_Isol_FixedCutPflowLoose") = passIsol_FixedCutPflowLoose;
// PromptLeptonIsolation - Some protection incase things change in R21
if(muon->isAvailable<float>("PromptLeptonIso_TagWeight")){
muon->auxdecor<char>("AnalysisTop_Isol_PromptLepton") = (muon->auxdata<float>("PromptLeptonIso_TagWeight") < -0.5) ? 1 : 0;
}
else{
muon->auxdecor<char>("AnalysisTop_Isol_PromptLepton") = 0;
}
}
///-- set links to original objects- needed for MET calculation --///
bool setLinks = xAOD::setOriginalObjectLink( *xaod, *shallow_xaod_copy.first );
if (!setLinks)
ATH_MSG_ERROR(" Cannot set original object links for muons, MET recalculation may struggle" );
ATH_MSG_ERROR(" Cannot set original object links for muons, MET recalculation may struggle" );
///-- Save corrected xAOD Container to StoreGate / TStore --///
std::string outputSGKey = m_config->sgKeyMuons( systematic.hash() );
std::string outputSGKeyAux = outputSGKey + "Aux.";
......@@ -210,40 +196,40 @@ namespace top{
xAOD::TReturnCode saveAux = evtStore()->tds()->record( shallow_xaod_copy.second , outputSGKeyAux );
if( !save || !saveAux ){
return StatusCode::FAILURE;
}
} // Loop over all systematics
}
} // Loop over all systematics
return StatusCode::SUCCESS;
}
StatusCode MuonObjectCollectionMaker::printout()
{
///-- Loop over all systematics --///
for( auto systematic : m_specifiedSystematics ){
const xAOD::MuonContainer* xaod(nullptr);
top::check( evtStore()->retrieve( xaod , m_config->sgKeyMuons( systematic.hash() ) ) , "Failed to retrieve Muons" );
top::check( evtStore()->retrieve( xaod , m_config->sgKeyMuons( systematic.hash() ) ) , "Failed to retrieve Muons" );
ATH_MSG_INFO(" Muons with sgKey = "<< m_config->sgKeyMuons( systematic.hash() ) );
for( auto muon : *xaod ){
ATH_MSG_INFO(" MU pT , eta = "<< muon->pt() <<" , "<< muon->eta() );
}
}
return StatusCode::SUCCESS;
return StatusCode::SUCCESS;
}
void MuonObjectCollectionMaker::specifiedSystematics( const std::set<std::string>& specifiedSystematics )
{
///-- Get the recommended systematics from the tool, in std::vector format --///
const std::vector<CP::SystematicSet> systList = CP::make_systematics_vector( m_calibrationPeriodTool->recommendedSystematics() );
for (auto s : systList) {
m_recommendedSystematics.push_back(s);
if (s.name() == "") {
m_specifiedSystematics.push_back(s);
}
///-- MC only --///
if (m_config->isMC()) {
///-- Are we only doing Nominal? Did the user specify specific systematics to use? --///
......@@ -254,17 +240,17 @@ namespace top{
if (specifiedSystematics.size() > 0) {
for (auto i : specifiedSystematics) {
if ( i == s.name() ) {
m_specifiedSystematics.push_back(s);
m_specifiedSystematics.push_back(s);
}
}
}
}
}
}
m_recommendedSystematics.sort();
m_recommendedSystematics.sort();
m_recommendedSystematics.unique();
m_specifiedSystematics.sort();
m_specifiedSystematics.unique();
m_specifiedSystematics.unique();
}
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// $Id: MuonObjectCollectionMaker.h 799839 2017-03-08 11:07:28Z grancagn $
......@@ -79,16 +79,14 @@ namespace top{
ToolHandle<CP::IMuonCalibrationAndSmearingTool> m_calibrationTool2017;
///-- Isolation --///
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_LooseTrackOnly;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_Loose;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_Gradient;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_GradientLoose;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FixedCutTight;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FixedCutTightTrackOnly;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FixedCutLoose;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FCTight;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FCLoose;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FCTightTrackOnly;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FCTightTrackOnly_FixedRad;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FCLoose_FixedRad;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FCTight_FixedRad;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FixedCutPflowTight;
ToolHandle<CP::IIsolationSelectionTool> m_isolationTool_FixedCutPflowLoose;
// the following is needed to make sure all muons for which d0sig is calculated are at least Loose
ToolHandle<CP::IMuonSelectionTool> m_muonSelectionToolVeryLooseVeto;
......
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