Skip to content
Snippets Groups Projects
Commit 330abd9c authored by Zach Marshall's avatar Zach Marshall
Browse files

Adding VeryLooseLLP cleaning and cleaning up

Adding the very loose LLP jet cleaning working point, used in a number
of SUSY LLP analyses (it should be centralized and provided by a tool).
Adding also a tool that applies the cleaning to the extended Jet/MET
setup for derivations.

Taking the opportunity to do a little code cleanup.  No need to keep
things around in comments that don't exist any more.  Fixing up the
README a bit as well.  Also added the doc to the twiki that the readme
points to.


Former-commit-id: c13794572261cd35ed4718bf241d8a542776fc55
parent 27c4043e
No related branches found
No related tags found
No related merge requests found
...@@ -448,6 +448,23 @@ def eventCleanLooseLLP_xAODColl(jetalg='AntiKt4EMTopo',sequence=DerivationFramew ...@@ -448,6 +448,23 @@ def eventCleanLooseLLP_xAODColl(jetalg='AntiKt4EMTopo',sequence=DerivationFramew
doEvent=True) #Save the event level decoration doEvent=True) #Save the event level decoration
sequence += algCleanLooseLLP sequence += algCleanLooseLLP
def eventCleanVeryLooseLLP_xAODColl(jetalg='AntiKt4EMTopo',sequence=DerivationFrameworkJob):
from JetSelectorTools.JetSelectorToolsConf import ECUtils__EventCleaningTool as EventCleaningTool
from JetSelectorTools.JetSelectorToolsConf import EventCleaningTestAlg
jetcleaningtoolname = "EventCleaningTool_VeryLooseLLP"
prefix = "DFCommonJets_"
#Do not save decorations, which are anyway not listed in AntiKt4EMTopoJetsCPContent.py
ecToolVeryLooseLLP = EventCleaningTool('EventCleaningTool_VeryLooseLLP',CleaningLevel='VeryLooseBadLLP', DoDecorations=False)
ecToolVeryLooseLLP.JetCleanPrefix = prefix
ecToolVeryLooseLLP.JetCleaningTool = getJetCleaningTool("VeryLooseBadLLP")
algCleanVeryLooseLLP = EventCleaningTestAlg('EventCleaningTestAlg_VeryLooseLLP',
EventCleaningTool=ecToolVeryLooseLLP,
JetCollectionName="AntiKt4EMTopoJets",
EventCleanPrefix=prefix,
CleaningLevel="VeryLooseBadLLP",
doEvent=True) #Save the event level decoration
sequence += algCleanVeryLooseLLP
def addRscanJets(jetalg,radius,inputtype,sequence,outputlist): def addRscanJets(jetalg,radius,inputtype,sequence,outputlist):
jetname = "{0}{1}{2}Jets".format(jetalg,int(radius*10),inputtype) jetname = "{0}{1}{2}Jets".format(jetalg,int(radius*10),inputtype)
algname = "jetalg"+jetname algname = "jetalg"+jetname
...@@ -540,6 +557,7 @@ applyOverlapRemoval() ...@@ -540,6 +557,7 @@ applyOverlapRemoval()
eventCleanLoose_xAODColl("AntiKt4EMTopo") eventCleanLoose_xAODColl("AntiKt4EMTopo")
eventCleanTight_xAODColl("AntiKt4EMTopo") eventCleanTight_xAODColl("AntiKt4EMTopo")
eventCleanLooseLLP_xAODColl("AntiKt4EMTopo") eventCleanLooseLLP_xAODColl("AntiKt4EMTopo")
eventCleanVeryLooseLLP_xAODColl("AntiKt4EMTopo")
################################################################## ##################################################################
# Helper to add origin corrected clusters # Helper to add origin corrected clusters
......
...@@ -52,7 +52,7 @@ class EventCleaningTool : public virtual IEventCleaningTool, ...@@ -52,7 +52,7 @@ class EventCleaningTool : public virtual IEventCleaningTool,
virtual StatusCode initialize() override; virtual StatusCode initialize() override;
/** Initialize method */ /** Initialize method */
virtual StatusCode finalize(); virtual StatusCode finalize() override;
virtual bool acceptEvent(const xAOD::JetContainer* jets) const override; virtual bool acceptEvent(const xAOD::JetContainer* jets) const override;
......
...@@ -37,7 +37,7 @@ class JetCleaningTool : public asg::AsgTool , virtual public IJetSelector ...@@ -37,7 +37,7 @@ class JetCleaningTool : public asg::AsgTool , virtual public IJetSelector
public: public:
/** Levels of cut */ /** Levels of cut */
enum CleaningLevel{ LooseBad , LooseBadLLP, LooseBadTrigger, TightBad , UnknownCut }; enum CleaningLevel{ VeryLooseBadLLP , LooseBad , LooseBadLLP, LooseBadTrigger, TightBad , UnknownCut };
/** Standard constructor */ /** Standard constructor */
JetCleaningTool(const std::string& name="JetCleaningTool"); JetCleaningTool(const std::string& name="JetCleaningTool");
...@@ -70,7 +70,6 @@ class JetCleaningTool : public asg::AsgTool , virtual public IJetSelector ...@@ -70,7 +70,6 @@ class JetCleaningTool : public asg::AsgTool , virtual public IJetSelector
const double hecf, const double hecf,
const double larq, const double larq,
const double hecq, const double hecq,
//const double time, //in ns
const double sumpttrk, //in MeV, same as sumpttrk const double sumpttrk, //in MeV, same as sumpttrk
const double eta, //emscale Eta const double eta, //emscale Eta
const double pt, //in MeV, same as sumpttrk const double pt, //in MeV, same as sumpttrk
......
...@@ -70,7 +70,7 @@ The tool can be constructed in C++ or python using one of three constructors: ...@@ -70,7 +70,7 @@ The tool can be constructed in C++ or python using one of three constructors:
- A constructor taking both the name and the level - A constructor taking both the name and the level
The level can also be explicitly set in job options via the CutLevel property. The The level can also be explicitly set in job options via the CutLevel property. The
levels available levels are: VeryLooseBad , LooseBad , MediumBad , and TightBad . Each levels available levels are: VeryLooseBadLLP , LooseBad , LooseBadLLP , and TightBad . Each
level is described on the TWiki. There are three interface functions that help you level is described on the TWiki. There are three interface functions that help you
clean your jets: clean your jets:
......
...@@ -283,6 +283,17 @@ const Root::TAccept& JetCleaningTool::accept( const double emf, ...@@ -283,6 +283,17 @@ const Root::TAccept& JetCleaningTool::accept( const double emf,
//============================================================= //=============================================================
if(m_doUgly && fmaxIndex==17) return m_accept; if(m_doUgly && fmaxIndex==17) return m_accept;
//=============================================================
//Run-II very loose LLP cuts
// From https://indico.cern.ch/event/642438/contributions/2704590/attachments/1514445/2362870/082117a_HCW_NCB_LLP.pdf
//=============================================================
if (VeryLooseBadLLP == m_cutLevel){
if (fmax>0.80) return m_accept;
if (emf>0.96) return m_accept;
m_accept.setCutResult( "Cleaning", true );
return m_accept;
}
//============================================================= //=============================================================
//Run-II loose cuts //Run-II loose cuts
//============================================================= //=============================================================
...@@ -295,12 +306,9 @@ const Root::TAccept& JetCleaningTool::accept( const double emf, ...@@ -295,12 +306,9 @@ const Root::TAccept& JetCleaningTool::accept( const double emf,
} }
if(fmax>0.99 && std::fabs(eta)<2) return m_accept; if(fmax>0.99 && std::fabs(eta)<2) return m_accept;
//HEC spike-- gone as of 2017! //HEC spike-- gone as of 2017!
//if(std::fabs(negE*0.001)>60) return m_accept;
if(hecf>0.5 && std::fabs(hecq)>0.5 && AverageLArQF/65535>0.8) return m_accept; if(hecf>0.5 && std::fabs(hecq)>0.5 && AverageLArQF/65535>0.8) return m_accept;
//EM calo noise //EM calo noise
if(emf>0.95 && std::fabs(larq)>0.8 && std::fabs(eta)<2.8 && AverageLArQF/65535>0.8) return m_accept; if(emf>0.95 && std::fabs(larq)>0.8 && std::fabs(eta)<2.8 && AverageLArQF/65535>0.8) return m_accept;
//// New pre-sampler topoclustering algorithm cut
//if(fmaxIndex==0 && fmax>0.6) return m_accept;
// LLP cleaning uses negative energy cut // LLP cleaning uses negative energy cut
// (https://indico.cern.ch/event/472320/contribution/8/attachments/1220731/1784456/JetTriggerMeeting_20160102.pdf) // (https://indico.cern.ch/event/472320/contribution/8/attachments/1220731/1784456/JetTriggerMeeting_20160102.pdf)
if (useLLP && std::fabs(negE*0.001)>4 && fmax >0.85) return m_accept; if (useLLP && std::fabs(negE*0.001)>4 && fmax >0.85) return m_accept;
...@@ -310,15 +318,6 @@ const Root::TAccept& JetCleaningTool::accept( const double emf, ...@@ -310,15 +318,6 @@ const Root::TAccept& JetCleaningTool::accept( const double emf,
return m_accept; return m_accept;
} }
//=============================================================
//Run-II medium cuts
//=============================================================
// Medium == loose right now
//if(MediumBad==m_cutLevel){
// m_accept.setCutResult( "Cleaning", true );
// return m_accept;
//}
//============================================================= //=============================================================
//Run-II tight cuts //Run-II tight cuts
//============================================================= //=============================================================
...@@ -403,7 +402,6 @@ const Root::TAccept& JetCleaningTool::accept( const xAOD::Jet& jet) const ...@@ -403,7 +402,6 @@ const Root::TAccept& JetCleaningTool::accept( const xAOD::Jet& jet) const
HECFrac, HECFrac,
LArQuality, LArQuality,
HECQuality, HECQuality,
//jet.getAttribute<float>(xAOD::JetAttribute::Timing),
sumpttrk, sumpttrk,
jet.eta(), jet.eta(),
jet.pt(), jet.pt(),
...@@ -414,11 +412,6 @@ const Root::TAccept& JetCleaningTool::accept( const xAOD::Jet& jet) const ...@@ -414,11 +412,6 @@ const Root::TAccept& JetCleaningTool::accept( const xAOD::Jet& jet) const
} }
/** Hot cell checks */ /** Hot cell checks */
//const bool containsHotCells( const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const
//{
// return containsHotCells(jet,eInfo.runNumber());
//}
bool JetCleaningTool::containsHotCells( const xAOD::Jet& jet, const unsigned int runNumber) const bool JetCleaningTool::containsHotCells( const xAOD::Jet& jet, const unsigned int runNumber) const
{ {
// Check if the runNumber contains bad cells // Check if the runNumber contains bad cells
...@@ -437,11 +430,10 @@ bool JetCleaningTool::containsHotCells( const xAOD::Jet& jet, const unsigned int ...@@ -437,11 +430,10 @@ bool JetCleaningTool::containsHotCells( const xAOD::Jet& jet, const unsigned int
/** Helpers for cut names */ /** Helpers for cut names */
JetCleaningTool::CleaningLevel JetCleaningTool::getCutLevel( const std::string s ) const JetCleaningTool::CleaningLevel JetCleaningTool::getCutLevel( const std::string s ) const
{ {
//if (s=="VeryLooseBad") return VeryLooseBad; if (s=="VeryLooseBadLLP") return VeryLooseBadLLP;
if (s=="LooseBad") return LooseBad; if (s=="LooseBad") return LooseBad;
if (s=="LooseBadLLP") return LooseBadLLP; if (s=="LooseBadLLP") return LooseBadLLP;
if (s=="LooseBadTrigger") return LooseBadTrigger; if (s=="LooseBadTrigger") return LooseBadTrigger;
//if (s=="MediumBad") return MediumBad;
if (s=="TightBad") return TightBad; if (s=="TightBad") return TightBad;
ATH_MSG_ERROR( "Unknown cut level requested: " << s ); ATH_MSG_ERROR( "Unknown cut level requested: " << s );
return UnknownCut; return UnknownCut;
...@@ -449,11 +441,10 @@ JetCleaningTool::CleaningLevel JetCleaningTool::getCutLevel( const std::string s ...@@ -449,11 +441,10 @@ JetCleaningTool::CleaningLevel JetCleaningTool::getCutLevel( const std::string s
std::string JetCleaningTool::getCutName( const CleaningLevel c) const std::string JetCleaningTool::getCutName( const CleaningLevel c) const
{ {
//if (c==VeryLooseBad) return "VeryLooseBad"; if (c==VeryLooseBadLLP) return "VeryLooseBadLLP";
if (c==LooseBad) return "LooseBad"; if (c==LooseBad) return "LooseBad";
if (c==LooseBadLLP) return "LooseBadLLP"; if (c==LooseBadLLP) return "LooseBadLLP";
if (c==LooseBadTrigger) return "LooseBadTrigger"; if (c==LooseBadTrigger) return "LooseBadTrigger";
//if (c==MediumBad) return "MediumBad";
if (c==TightBad) return "TightBad"; if (c==TightBad) return "TightBad";
return "UnknownCut"; return "UnknownCut";
} }
...@@ -534,6 +525,3 @@ StatusCode JetCleaningTool::readHotCells() ...@@ -534,6 +525,3 @@ StatusCode JetCleaningTool::readHotCells()
// Done // Done
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -22,25 +22,6 @@ from JetSelectorTools.JetCleaningCutDefs import * ...@@ -22,25 +22,6 @@ from JetSelectorTools.JetCleaningCutDefs import *
#def ConfiguredJetCleaningTool_VeryLoose( name, **kw ):
# """
# Configure the JetCleaningTool with the default VeryLoose cuts
# and allow for (re-)setting of all provided cuts.
# """
# # Set some default properties, but don't overwrite them if they already exist
# kw["CutLevel"] = kw.get( "CutLevel" , "VeryLooseBad" )
#
# # Create and instance of the tool
# tool = CfgMgr.JetCleaningTool(name, **kw)
#
# # Configure it with the standard configuration
# JetCleaningToolConfig_VeryLoose( tool )
#
# # Get all provided properties and overwrite the default values with them
# SetToolProperties( tool, **kw )
#
# return tool
def recEventCleaningTool(name='EventCleaningTool'): def recEventCleaningTool(name='EventCleaningTool'):
""" """
Arguments: Arguments:
...@@ -73,29 +54,6 @@ def ConfiguredJetCleaningTool_Loose( name, **kw ): ...@@ -73,29 +54,6 @@ def ConfiguredJetCleaningTool_Loose( name, **kw ):
#def ConfiguredJetCleaningTool_Medium( name, **kw ):
# """
# Configure the JetCleaningTool with the default Medium cuts
# and allow for (re-)setting of all provided cuts.
# """
# # Set some default properties, but don't overwrite them if they already exist
# kw["CutLevel"] = kw.get( "CutLevel" , "MediumBad" )
#
# # Create and instance of the tool
# tool = CfgMgr.JetCleaningTool(name, **kw)
#
# # Configure it with the standard configuration
# JetCleaningToolConfig_Medium( tool )
#
# # Get all provided properties and overwrite the default values with them
# SetToolProperties( tool, **kw )
#
# return tool
def ConfiguredJetCleaningTool_Tight( name, **kw ): def ConfiguredJetCleaningTool_Tight( name, **kw ):
""" """
Configure the JetCleaningTool with the default Tight cuts Configure the JetCleaningTool with the default Tight cuts
......
...@@ -14,14 +14,6 @@ ...@@ -14,14 +14,6 @@
from PATCore.HelperUtils import GetTool from PATCore.HelperUtils import GetTool
#def JetCleaningToolConfig_VeryLoose(theTool) :
# """
# This defines the jet cleaning cut values for the very Loose (Looser) operating point
# """
# theTool = GetTool(theTool)
# theTool.CutLevel = 'VeryLooseBad'
# pass
def JetCleaningToolConfig_Loose(theTool) : def JetCleaningToolConfig_Loose(theTool) :
""" """
This defines the jet cleaning cut values for the Loose operating point. This defines the jet cleaning cut values for the Loose operating point.
...@@ -30,14 +22,6 @@ def JetCleaningToolConfig_Loose(theTool) : ...@@ -30,14 +22,6 @@ def JetCleaningToolConfig_Loose(theTool) :
theTool.CutLevel = 'LooseBad' theTool.CutLevel = 'LooseBad'
pass pass
#def JetCleaningToolConfig_Medium(theTool) :
# """
# This defines the jet cleaning cut values for the Medium operating point.
# """
# theTool = GetTool(theTool)
# theTool.CutLevel = 'MediumBad'
# pass
def JetCleaningToolConfig_Tight(theTool) : def JetCleaningToolConfig_Tight(theTool) :
""" """
This defines the jet cleaning cut values for the Tight operating point. This defines the jet cleaning cut values for the Tight operating point.
......
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