Commit b1966744 authored by Tomas Dado's avatar Tomas Dado
Browse files

AnalysisTop: Add protection for the PLIV variables

parent 262438d1
......@@ -306,6 +306,11 @@ namespace top {
static const SG::AuxElement::ConstAccessor<float> PLV_PtRel("PromptLeptonInput_PtRel");
static const SG::AuxElement::ConstAccessor<float> PLV_PtFrac("PromptLeptonInput_PtFrac");
static const SG::AuxElement::ConstAccessor<float> PLV_PromptLeptonVeto("PromptLeptonVeto");
static const SG::AuxElement::ConstAccessor<float> PromptLeptonImprovedVeto("PromptLeptonImprovedVeto");
static const SG::AuxElement::ConstAccessor<short> PromptLeptonImprovedInput_MVAXBin("PromptLeptonImprovedInput_MVAXBin");
static const SG::AuxElement::ConstAccessor<float> PromptLeptonImprovedVetoECAP("PromptLeptonImprovedVetoECAP");
static const SG::AuxElement::ConstAccessor<float> PromptLeptonImprovedVetoBARR("PromptLeptonImprovedVetoBARR");
static const SG::AuxElement::ConstAccessor<float> ptvarcone30_TightTTVA_pt500("ptvarcone30_TightTTVA_pt500");
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_Tight("AnalysisTop_Isol_Tight");
......@@ -425,29 +430,33 @@ namespace top {
electron->auxdecor<char>("AnalysisTop_Isol_PromptLeptonVeto") =
(electron->auxdata<float>("PromptLeptonVeto") < -0.5) ? 1 : 0;
// New PLV: https://twiki.cern.ch/twiki/bin/view/AtlasProtected/PromptLeptonTaggerIFF
// For PLV isolation, we need to compute additional variables in the low-pT regime (<12 GeV)
if ( PLV_TrackJetNTrack.isAvailable(*electron) &&
PLV_DRlj.isAvailable(*electron) &&
PLV_PtRel.isAvailable(*electron) &&
PLV_PtFrac.isAvailable(*electron) )
top::check(m_isolationTool_LowPtPLV->augmentPLV(*electron), "Failed to augment electron with LowPtPLV decorations");
else
byhand_LowPtPLV(*electron) = 1.1; // decorate the electron ourselves following IFF default
if ( PLV_PromptLeptonVeto.isAvailable(*electron) &&
ptvarcone30_TightTTVALooseCone_pt1000.isAvailable(*electron) ) {
AnalysisTop_Isol_PLVTight(*electron) = (m_isolationTool_PLVTight->accept(*electron) ? 1 : 0);
AnalysisTop_Isol_PLVLoose(*electron) = (m_isolationTool_PLVLoose->accept(*electron) ? 1 : 0);
AnalysisTop_Isol_PLImprovedTight(*electron) = (m_isolationTool_PLImprovedTight->accept(*electron) ? 1 : 0);
AnalysisTop_Isol_PLImprovedVeryTight(*electron) = (m_isolationTool_PLImprovedVeryTight->accept(*electron) ? 1 : 0);
}
else {
// decorate with special character to indicate failure to retrieve necessary variables
AnalysisTop_Isol_PLVTight(*electron) = 'n';
AnalysisTop_Isol_PLVLoose(*electron) = 'n';
AnalysisTop_Isol_PLImprovedTight(*electron) = 'n';
AnalysisTop_Isol_PLImprovedVeryTight(*electron) = 'n';
}
// New PLV: https://twiki.cern.ch/twiki/bin/view/AtlasProtected/PromptLeptonTaggerIFF
// For PLV isolation, we need to compute additional variables in the low-pT regime (<12 GeV)
if ( PLV_TrackJetNTrack.isAvailable(*electron) &&
PLV_DRlj.isAvailable(*electron) &&
PLV_PtRel.isAvailable(*electron) &&
PLV_PtFrac.isAvailable(*electron) )
top::check(m_isolationTool_LowPtPLV->augmentPLV(*electron), "Failed to augment electron with LowPtPLV decorations");
else
byhand_LowPtPLV(*electron) = 1.1; // decorate the electron ourselves following IFF default
if ( PLV_PromptLeptonVeto.isAvailable(*electron) &&
ptvarcone30_TightTTVALooseCone_pt1000.isAvailable(*electron) ) {
AnalysisTop_Isol_PLVTight(*electron) = (m_isolationTool_PLVTight->accept(*electron) ? 1 : 0);
AnalysisTop_Isol_PLVLoose(*electron) = (m_isolationTool_PLVLoose->accept(*electron) ? 1 : 0);
} else {
AnalysisTop_Isol_PLVTight(*electron) = 'n';
AnalysisTop_Isol_PLVLoose(*electron) = 'n';
}
if (ptvarcone30_TightTTVA_pt500.isAvailable(*electron) && PromptLeptonImprovedVeto.isAvailable(*electron) &&
PromptLeptonImprovedInput_MVAXBin.isAvailable(*electron) && PromptLeptonImprovedVetoECAP.isAvailable(*electron) &&
PromptLeptonImprovedVetoBARR.isAvailable(*electron)) {
AnalysisTop_Isol_PLImprovedTight(*electron) = (m_isolationTool_PLImprovedTight->accept(*electron) ? 1 : 0);
AnalysisTop_Isol_PLImprovedVeryTight(*electron) = (m_isolationTool_PLImprovedVeryTight->accept(*electron) ? 1 : 0);
} else {
// decorate with special character to indicate failure to retrieve necessary variables
AnalysisTop_Isol_PLImprovedTight(*electron) = 'n';
AnalysisTop_Isol_PLImprovedVeryTight(*electron) = 'n';
}
}
///-- set links to original objects- needed for MET calculation --///
......
......@@ -159,8 +159,9 @@ namespace top {
static const SG::AuxElement::ConstAccessor<float> PLV_PtFrac("PromptLeptonInput_PtFrac");
static const SG::AuxElement::ConstAccessor<float> PLV_PromptLeptonVeto("PromptLeptonVeto");
static const SG::AuxElement::ConstAccessor<float> PromptLeptonImprovedVeto("PromptLeptonImprovedVeto");
static const SG::AuxElement::ConstAccessor<short> PromptLeptonImprovedInput_MVAXBin(
"PromptLeptonImprovedInput_MVAXBin");
static const SG::AuxElement::ConstAccessor<short> PromptLeptonImprovedInput_MVAXBin("PromptLeptonImprovedInput_MVAXBin");
static const SG::AuxElement::ConstAccessor<float> PromptLeptonImprovedVetoECAP("PromptLeptonImprovedVetoECAP");
static const SG::AuxElement::ConstAccessor<float> PromptLeptonImprovedVetoBARR("PromptLeptonImprovedVetoBARR");
static const SG::AuxElement::Decorator<float> byhand_LowPtPLV("LowPtPLV");
static const SG::AuxElement::Decorator<int> AnalysisTop_IFFTruthClass("AnalysisTop_IFFTruthClass");
......@@ -319,7 +320,8 @@ namespace top {
passIsol_Loose_VarRad = m_isolationTool_Loose_VarRad->accept(*muon) ? 1 : 0;
}
if (ptvarcone30_TightTTVA_pt500.isAvailable(*muon) && PromptLeptonImprovedVeto.isAvailable(*muon) &&
PromptLeptonImprovedInput_MVAXBin.isAvailable(*muon)) {
PromptLeptonImprovedInput_MVAXBin.isAvailable(*muon) && PromptLeptonImprovedVetoECAP.isAvailable(*muon) &&
PromptLeptonImprovedVetoBARR.isAvailable(*muon)) {
passIsol_PLImprovedTight = m_isolationTool_PLImprovedTight->accept(*muon) ? 1 : 0;
passIsol_PLImprovedVeryTight = m_isolationTool_PLImprovedVeryTight->accept(*muon) ? 1 : 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment