diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoAttributeFiller.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoAttributeFiller.h index c916480d22766bba88082640b823f1ebad1d8270..d60ab27203debb8fa71809c81574d057daff9858 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoAttributeFiller.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoAttributeFiller.h @@ -9,7 +9,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "JetMonitoring/IJetHistoFiller.h" -#include "JetMonitoring/JetVarTool.h" +#include "JetMonitoring/JetHistoVarTool.h" //////////////////////////////////////////////////// /// \class JetHistoAttributeFiller @@ -22,9 +22,9 @@ /// The tool does not directly fill histograms but uses Monitored::Scalar and Monitored::Group /// as is requested by the monitoring framewok. /// -/// The variables are specified by means of IJetVarTool which are just configurable version +/// The variables are specified by means of IJetHistoVarTool which are just configurable version /// of the JetVariable class. -/// The IJetVarTool are set via the properterties VarX, VarY and VarZ +/// The IJetHistoVarTool are set via the properterties VarX, VarY and VarZ /// The Monitoring Group is specified by the Group property /// /// The tool support plotting variables of type float,int ,vector<float> and vector<int>. @@ -42,10 +42,10 @@ private: Gaudi::Property<std::string> m_group {this,"Group", "undefined"}; - ToolHandle<IJetVarTool> m_varX; - ToolHandle<IJetVarTool> m_varY; + ToolHandle<IJetHistoVarTool> m_varX; + ToolHandle<IJetHistoVarTool> m_varY; - ToolHandle<IJetVarTool> m_varZ; + ToolHandle<IJetHistoVarTool> m_varZ; int m_nVar=1; diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoLeadingJetsRelations.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoLeadingJetsRelations.h index d6b1c178f0f0cb744758fba8aadf0b7b7484ba60..023cba0ca063dfa41d86014bbf6ae74d5353a2e3 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoLeadingJetsRelations.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoLeadingJetsRelations.h @@ -10,7 +10,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "JetMonitoring/IJetHistoFiller.h" -#include "JetMonitoring/JetVarTool.h" +#include "JetMonitoring/JetHistoVarTool.h" //////////////////////////////////////////////////// /// \class JetHistoAttributeFiller @@ -23,9 +23,9 @@ /// The tool does not directly fill histograms but uses Monitored::Scalar and Monitored::Group /// as is requested by the monitoring framewok. /// -/// The variables are specified by means of IJetVarTool which are just configurable version +/// The variables are specified by means of IJetHistoVarTool which are just configurable version /// of the JetVariable class. -/// The IJetVarTool are set via the properterties VarX, VarY and VarZ +/// The IJetHistoVarTool are set via the properterties VarX, VarY and VarZ /// The Monitoring Group is specified by the Group property /// /// The tool support plotting variables of type float,int ,vector<float> and vector<int>. @@ -45,9 +45,9 @@ private: Gaudi::Property<std::string> m_group {this,"Group", "undefined"}; - // ToolHandle<IJetVarTool> m_var; - //ToolHandle<IJetVarTool> m_varY; - //ToolHandle<IJetVarTool> m_varZ; + // ToolHandle<IJetHistoVarTool> m_var; + //ToolHandle<IJetHistoVarTool> m_varY; + //ToolHandle<IJetHistoVarTool> m_varZ; int m_nVar=1; diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h index ac468c2b19f0981cd4a3d043095fb05f748ec7d8..80da49ee4287f034c70b5709003268703d6c751b 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoSelectSort.h @@ -12,7 +12,7 @@ #include "JetInterface/IJetSelector.h" #include "JetMonitoring/IJetHistoFiller.h" -#include "JetMonitoring/JetVarTool.h" +#include "JetMonitoring/JetHistoVarTool.h" @@ -33,7 +33,7 @@ private: ToolHandle<IJetSelector> m_selectTool; Gaudi::Property<int> m_selIndex {this,"SelectedIndex", -1}; - ToolHandle<IJetVarTool> m_sortVar; + ToolHandle<IJetHistoVarTool> m_sortVar; }; diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoTriggEfficiency.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoTriggEfficiency.h index 8b45972aafd4df5036c9c4370fca98fef0b8ecfb..246f83b0b3c0f585c03c7a18a6fa7b933441f284 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoTriggEfficiency.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoTriggEfficiency.h @@ -9,7 +9,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "JetMonitoring/IJetHistoFiller.h" -#include "JetMonitoring/JetVarTool.h" +#include "JetMonitoring/JetHistoVarTool.h" #include "JetInterface/IJetSelector.h" //////////////////////////////////////////////////// @@ -32,7 +32,7 @@ private: Gaudi::Property<std::string> m_probeTrigChain {this, "ProbeTrigChain", "_undefined_"}; Gaudi::Property<size_t> m_jetIndex {this, "Index",0}; ToolHandle<IJetSelector> m_selectTool; - ToolHandle<IJetVarTool> m_jetVar; + ToolHandle<IJetHistoVarTool> m_jetVar; diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetVarTool.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoVarTool.h similarity index 76% rename from Reconstruction/Jet/JetMonitoring/JetMonitoring/JetVarTool.h rename to Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoVarTool.h index 40d04596ba7cc380cd1e7f389c2d0d330211a144..a1aab95586ae96538e0dd6d1ad7f4358a756efbe 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetVarTool.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetHistoVarTool.h @@ -13,10 +13,10 @@ #include "JetMonitoring/JetVariable.h" -static const InterfaceID IID_IJetVarTool("IJetVarTool", 1 , 0); +static const InterfaceID IID_IJetHistoVarTool("IJetHistoVarTool", 1 , 0); /////////////////////////////////////////////////////////// -/// \class JetVarTool +/// \class JetHistoVarTool /// /// This class is a wrapper around JetVar::Variable inheriting AthAlgTool. /// Its purpose is to allow to define a jet variable in the configuration @@ -24,14 +24,14 @@ static const InterfaceID IID_IJetVarTool("IJetVarTool", 1 , 0); /// Client tools include JetHistoAttributeFiller and JetHistoSelectSort /// -class IJetVarTool : virtual public IAlgTool +class IJetHistoVarTool : virtual public IAlgTool { public: // Retrieve interface ID - static const InterfaceID& interfaceID() { return IID_IJetVarTool; } + static const InterfaceID& interfaceID() { return IID_IJetHistoVarTool; } - virtual ~IJetVarTool(){} + virtual ~IJetHistoVarTool(){} /// the value of the variable for a given Jet virtual float value(const xAOD::Jet &) const = 0; @@ -42,10 +42,10 @@ public: }; -class JetVarTool : public AthAlgTool, virtual public IJetVarTool { +class JetHistoVarTool : public AthAlgTool, virtual public IJetHistoVarTool { public: - JetVarTool( const std::string& type, const std::string & name ,const IInterface* parent); - virtual ~JetVarTool(){} + JetHistoVarTool( const std::string& type, const std::string & name ,const IInterface* parent); + virtual ~JetHistoVarTool(){} virtual StatusCode initialize() ; diff --git a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSelectorAttribute.h b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSelectorAttribute.h index 65d46352366c30a67b7a3471856301a4efc50fbf..e4db59d70a32f9fb8e6e69e94f45d21b732e5049 100644 --- a/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSelectorAttribute.h +++ b/Reconstruction/Jet/JetMonitoring/JetMonitoring/JetSelectorAttribute.h @@ -9,7 +9,7 @@ #include "AsgTools/AsgTool.h" #include "JetInterface/IJetSelector.h" -#include "JetMonitoring/JetVarTool.h" +#include "JetMonitoring/JetHistoVarTool.h" namespace JetVar { @@ -33,7 +33,7 @@ class JetSelectorAttribute : public asg::AsgTool , virtual public IJetSelector float m_min; float m_max; - ToolHandle<IJetVarTool> m_var; + ToolHandle<IJetHistoVarTool> m_var; }; diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py index 550208da0ad78187fdde1bfc80009e7f3b319bad..4ff471d95ec31700960bafe37cfee9deb8eb7147 100644 --- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py +++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringConfig.py @@ -185,7 +185,7 @@ class ToolSpec(ConfigDict): class VarSpec(ToolSpec): """A dictionary specialized to contain a jet variable specification""" def __init__(self, Name , Type='float', Index=-1, Scale=1): - # by default we allow only the properties of a JetVarTool + # by default we allow only the properties of a JetHistoVarTool if Name.endswith(':GeV'): Scale=0.001 Name = Name[:-4] @@ -202,8 +202,8 @@ class VarSpec(ToolSpec): def toTool(self): - from JetMonitoring.JetMonitoringConf import JetVarTool - return JetVarTool(self.Name, **self) + from JetMonitoring.JetMonitoringConf import JetHistoVarTool + return JetHistoVarTool(self.Name, **self) def vname(self): if self.Index ==-1: return self.Name diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringExample.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringExample.py index ba162ed74478f213c2a6d801cefaec1ef93e19fb..da872c5229d70559f46520fcc8dba14aa442f899 100644 --- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringExample.py +++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringExample.py @@ -23,8 +23,7 @@ def jetMonitoringExampleConfig(inputFlags): # Declare a configuration dictionnary for a JetContainer from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec, SelectSpec, ToolSpec #from JetMonitoring.JetStandardHistoSpecs import knownHistos - - # Create a python dictionnary containing the configuration options related to 1 JetContainer. + # we use a specialized dictionnary (JetMonAlgSpec) which will be translated into the final C++ tool ak4conf = JetMonAlgSpec( "ak4lcMon", diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py new file mode 100644 index 0000000000000000000000000000000000000000..e972817af473df0391848d71d98302411d9fbe8b --- /dev/null +++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringStandard.py @@ -0,0 +1,108 @@ +# +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# + +'''@file JetMonitoringExample.py +@author P-A. Delsart +@date 2019-03-12 +@brief Main python configuration for the Run III Jet Monitoring +''' + + +def jetMonAntiKt4LCTopo(): + '''Sets-up AntiKt4 monitoring.''' + + + # Declare a configuration dictionnary for a JetContainer + from JetMonitoring.JetMonitoringConfig import JetMonAlgSpec, HistoSpec, SelectSpec, ToolSpec + + # we use a specialized dictionnary (JetMonAlgSpec) which will be translated into the final C++ tool + ak4conf = JetMonAlgSpec( + "ak4lcMon", + JetContainerName = "AntiKt4LCTopoJets", + # TriggerChain = '' , --> no trigger filter yet. + ) + + + # Now start filling the histo spec list + ak4conf.appendHistos( + # This python list can be filled with various type of entries : + # We can give aliases of standard spec : + "pt", + "highpt", + "m", + "eta", + + "leadingJetsRel", + + + + # or we can directly add our custom histo specification in the form of a HistoSpec : + HistoSpec('HECFrac', (50,-0.1,1.4), title="HEC E fraction;HEC frac;" ), + # the basic call is : HistoSpec( variable, histobins, title='histotile;xtitle,ytitle') + + + # 2D histos + "pt;m", + "pt;eta", + + + # TProfile2D : just use 3 variables. For now the sytem will automatically + # interpret it as a TProfile2D (the 3rd variable being profiled) + "phi;eta;e", # --> Average Energy vs pt and eta + + + # Histograms build from a selection of filtered jets. + SelectSpec( 'central', # the name of the selection + '|eta|<0.5', # selection expression. The form 'min<var<max' is automatically interpreted. + + FillerTools = [ + "pt", + "m", + "eta", + ] ), + + # another selection : only sub-leading jets + SelectSpec( 'subleading', + '', # no selection on variables + SelectedIndex=1, # force 2nd (sub-leading) jet (we would set 0 for leading jets) + path='standardHistos', # force the path where the histos are saved in the final ROOT file + FillerTools = [ + "pt", + "m", + ] ), + + + SelectSpec( 'highJVF', + '0.3<JVF[0]', # JVF is a vector<float> for each jets. Here we cut on the 0th entry of this vector + FillerTools = [ + "pt", + ] ), + # Selecting jets passing the LooseBad selection from the JetCleaningTool. + SelectSpec( 'LooseBadJets', + 'LooseBad', # this is not in the form 'min<x<max', so it will be assumed 'LooseBad' is an entry existing in JetStandardHistoSpecs.knownSelector + FillerTools = [ + "pt", + ] ), + + + ) + return ak4conf + + + + + +def standardJetMonitoring(inputFlags): + """Standard jet monitoring function to be inserted from top-level algs. + returns an a component accumulator as given by AthMonitorCfgHelper.result() + Details of what goes into jet monitoring will be implemented by dedicated functions such as jetMonAntiKt4LCTopo(). + """ + + from AthenaMonitoring import AthMonitorCfgHelper + helper = AthMonitorCfgHelper(inputFlags,'ExampleAthMonitorCfg') + + ak4conf = jetMonAntiKt4LCTopo() + ak4conf.toAlg(helper) # adds the ak4conf as a JEtMonitoringAlg to the helper + + return helper.result() # the AthMonitorCfgHelper returns an accumulator to be used by the general configuration system. diff --git a/Reconstruction/Jet/JetMonitoring/src/JetVarTool.cxx b/Reconstruction/Jet/JetMonitoring/src/JetHistoVarTool.cxx similarity index 62% rename from Reconstruction/Jet/JetMonitoring/src/JetVarTool.cxx rename to Reconstruction/Jet/JetMonitoring/src/JetHistoVarTool.cxx index f4305aa80272ecc6192775359d593984ce68f6e5..0a769ac8cc72b2c85d3cc8002bf15577399e8bb0 100644 --- a/Reconstruction/Jet/JetMonitoring/src/JetVarTool.cxx +++ b/Reconstruction/Jet/JetMonitoring/src/JetHistoVarTool.cxx @@ -2,19 +2,19 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include "JetMonitoring/JetVarTool.h" +#include "JetMonitoring/JetHistoVarTool.h" -JetVarTool::JetVarTool( const std::string& type, const std::string & name ,const IInterface* parent): +JetHistoVarTool::JetHistoVarTool( const std::string& type, const std::string & name ,const IInterface* parent): AthAlgTool( type, name, parent ) { - declareInterface<IJetVarTool>(this); + declareInterface<IJetHistoVarTool>(this); } -StatusCode JetVarTool::initialize() { +StatusCode JetHistoVarTool::initialize() { if(m_name=="") m_name = name(); m_v.reset( JetVar::Variable::create( m_name, m_type, m_index) ); @@ -29,6 +29,6 @@ StatusCode JetVarTool::initialize() { } -float JetVarTool::value(const xAOD::Jet &j) const { +float JetHistoVarTool::value(const xAOD::Jet &j) const { return m_v->value(j) ; } diff --git a/Reconstruction/Jet/JetMonitoring/src/components/JetMonitoring_entries.cxx b/Reconstruction/Jet/JetMonitoring/src/components/JetMonitoring_entries.cxx index df19c61e0389735b4c9b978687e501e459f6782b..584056a1bc0a4ef3aee964bf13395d0d97a99f26 100644 --- a/Reconstruction/Jet/JetMonitoring/src/components/JetMonitoring_entries.cxx +++ b/Reconstruction/Jet/JetMonitoring/src/components/JetMonitoring_entries.cxx @@ -14,7 +14,7 @@ #include "JetMonitoring/JetHistoPtTool.h" #include "JetMonitoring/JetHistoAttributeFiller.h" #include "JetMonitoring/JetHistoTriggEfficiency.h" -#include "JetMonitoring/JetVarTool.h" +#include "JetMonitoring/JetHistoVarTool.h" #include "JetMonitoring/JetHistoSelectSort.h" #include "JetMonitoring/JetSelectorAttributeRunII.h" @@ -38,7 +38,7 @@ DECLARE_COMPONENT( JetHistoPtTool) DECLARE_COMPONENT( JetHistoTriggEfficiency) DECLARE_COMPONENT( JetHistoAttributeFiller) DECLARE_COMPONENT( JetHistoSelectSort) -DECLARE_COMPONENT( JetVarTool) +DECLARE_COMPONENT( JetHistoVarTool) DECLARE_COMPONENT( JetAttributeHisto )