ATLAS Offline Software
JetHistoVarTool.h
Go to the documentation of this file.
1 /* this file is -*- C++ -*-
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JETMONITORING_JETVARTOOL_H
6 #define JETMONITORING_JETVARTOOL_H
7 
8 #include "xAODJet/JetContainer.h"
9 
10 #include "GaudiKernel/IAlgTool.h"
12 
14 
15 
16 static const InterfaceID IID_IJetHistoVarTool("IJetHistoVarTool", 1 , 0);
17 
26 
27 class IJetHistoVarTool : virtual public IAlgTool
28 {
29 public:
30 
31  // Retrieve interface ID
32  static const InterfaceID& interfaceID() { return IID_IJetHistoVarTool; }
33 
34  virtual ~IJetHistoVarTool(){}
35 
37  virtual float value(const xAOD::Jet &) const = 0;
39  virtual const JetVar::Variable * variable() const = 0;
41  virtual std::string describe() const =0;
42 };
43 
44 
45 class JetHistoVarTool : public AthAlgTool, virtual public IJetHistoVarTool {
46 public:
47  JetHistoVarTool( const std::string& type, const std::string & name ,const IInterface* parent);
48  virtual ~JetHistoVarTool(){}
49 
50  virtual StatusCode initialize() ;
51 
52  virtual float value(const xAOD::Jet &) const ;
53  virtual const JetVar::Variable * variable() const {return m_v.get();};
54  virtual std::string describe() const {
55  return m_name+", "+m_type+","+std::to_string(m_index);
56  }
57 
58 
59 private:
60 
61  std::unique_ptr<JetVar::Variable> m_v;
62 
63  Gaudi::Property<std::string> m_name {this,"Name", ""};
64  Gaudi::Property<std::string> m_type {this,"Type", "float"};
65  Gaudi::Property<int> m_index {this,"Index", -1};
66  Gaudi::Property<float> m_scale {this,"Scale", 1.};
67 
68 };
69 
70 
71 #endif
JetHistoVarTool::describe
virtual std::string describe() const
a compact description of the variable.
Definition: JetHistoVarTool.h:54
IJetHistoVarTool::value
virtual float value(const xAOD::Jet &) const =0
the value of the variable for a given Jet
JetHistoVarTool::variable
virtual const JetVar::Variable * variable() const
The actual variable represented by this tool.
Definition: JetHistoVarTool.h:53
JetHistoVarTool::m_v
std::unique_ptr< JetVar::Variable > m_v
Definition: JetHistoVarTool.h:61
JetHistoVarTool::initialize
virtual StatusCode initialize()
Definition: JetHistoVarTool.cxx:17
JetHistoVarTool::JetHistoVarTool
JetHistoVarTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: JetHistoVarTool.cxx:8
IJetHistoVarTool
Definition: JetHistoVarTool.h:28
JetHistoVarTool
Definition: JetHistoVarTool.h:45
JetHistoVarTool::m_type
Gaudi::Property< std::string > m_type
Definition: JetHistoVarTool.h:64
JetHistoVarTool::m_index
Gaudi::Property< int > m_index
Definition: JetHistoVarTool.h:65
JetVar::Variable
Definition: JetVariable.h:51
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JetHistoVarTool::~JetHistoVarTool
virtual ~JetHistoVarTool()
Definition: JetHistoVarTool.h:48
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
IJetHistoVarTool::variable
virtual const JetVar::Variable * variable() const =0
The actual variable represented by this tool.
IJetHistoVarTool::describe
virtual std::string describe() const =0
a compact description of the variable.
JetHistoVarTool::value
virtual float value(const xAOD::Jet &) const
the value of the variable for a given Jet
Definition: JetHistoVarTool.cxx:32
IJetHistoVarTool::interfaceID
static const InterfaceID & interfaceID()
Definition: JetHistoVarTool.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
JetHistoVarTool::m_name
Gaudi::Property< std::string > m_name
Definition: JetHistoVarTool.h:63
JetVariable.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
JetHistoVarTool::m_scale
Gaudi::Property< float > m_scale
Definition: JetHistoVarTool.h:66
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IJetHistoVarTool::~IJetHistoVarTool
virtual ~IJetHistoVarTool()
Definition: JetHistoVarTool.h:34
AthAlgTool
Definition: AthAlgTool.h:26