ATLAS Offline Software
VariableDependency.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef RINGERSELECTORTOOLS_TOOLS_VARIABLEDEPENDENCY_H
6 #define RINGERSELECTORTOOLS_TOOLS_VARIABLEDEPENDENCY_H
7 
8 // STL includes:
9 #include <stdexcept>
10 #include <cmath>
11 #include <sstream>
12 #include <iostream>
13 
14 // ROOT includes:
15 #include <TDirectory.h>
16 
17 // Local includes:
19 
20 
24 namespace Ringer {
25 
32 class DepVarStruct {
33 public:
35  const float et;
37  const float eta;
39  const float pileupEstimation;
40 
41  DepVarStruct(const float et, const float eta, const float pileupEstimation = 0.):
42  et(et),
43  eta(eta),
45 };
46 
47 //class IVariableDependency
48 //{
49 // public:
50 // /**
51 // * Check if depVar is within this procedure range
52 // **/
53 // virtual bool isWithinRange(const DepVarStruct &depVar) const = 0;
54 //
55 // /**
56 // * Check if eta is within this procedure eta range
57 // **/
58 // virtual bool isWithinEtaRange(const float eta) const = 0;
59 //
60 // /**
61 // * Set this procedure to be eta dependent:
62 // **/
63 // virtual void setEtaDep(const float etaMin, const float etaMax) = 0;
64 //
65 // /**
66 // * Check if et is within this procedure et range
67 // **/
68 // virtual bool isWithinEtRange(const float et) const = 0;
69 //
70 // /**
71 // * Set this procedure to be et dependent:
72 // **/
73 // virtual void setEtDep(const float etMin, const float etMax) = 0;
74 //
75 // /**
76 // * Set this procedure to be et, eta dependent:
77 // **/
78 // virtual void setEtaEtDep(const float etaMin, const float etaMax,
79 // const float etMin, const float etMax) = 0;
80 //
81 // virtual ~IVariableDependency(){;}
82 //};
83 
88 class VariableDependency /*: virtual public IVariableDependency*/
89 {
90  public:
91 
95  VariableDependency() = default;
96 
100  VariableDependency(const float etaMin, const float etaMax,
101  EtaDependency etaDependency)
102  : m_etaDependency(etaDependency),
103  m_etaMin(etaMin),
105  {}
106 
110  VariableDependency(const float etMin, const float etMax,
111  EtDependency etDependency)
112  : m_etDependency(etDependency),
113  m_etMin(etMin),
114  m_etMax(etMax)
115  {}
116 
120  VariableDependency(const float etaMin, const float etaMax,
121  const float etMin, const float etMax)
122  : m_etaMin(etaMin),
123  m_etaMax(etaMax),
124  m_etMin(etMin),
125  m_etMax(etMax)
126  {}
127 
131  bool isWithinRange(const DepVarStruct &depVar) const /*override
132  final*/;
133 
137  bool isWithinEtaRange(const float eta) const /*override
138  final*/;
139 
143  EtaDependency etaDep() const /*override final*/;
144 
148  float etaMin() const /*override final*/;
149 
153  float etaMax() const /*override final*/;
154 
158  float etMin() const /*override final*/;
159 
163  float etMax() const /*override final*/;
164 
168  void setEtaDep(const float etaMin, const float etaMax) /*override
169  final*/;
170 
174  bool isWithinEtRange(const float et) const /*override
175  final*/;
176 
180  EtDependency etDep() const /*override final*/;
181 
185  void setEtDep(const float etMin, const float etMax) /*override
186  final*/;
187 
191  void setEtaEtDep(const float etaMin, const float etaMax,
192  const float etMin, const float etMax) /*override
193  final*/;
194 
200  std::string type() const;
201 
205  static void read(VariableDependency *varDep,
206  TDirectory *configDir,
207  unsigned writtenVersion);
208 
214  void writeDepInfo(TDirectory *configDir) const;
215 
220  virtual ~VariableDependency(){;}
221 
222  private:
223 
228 
230  float m_etaMin{0}, m_etaMax{0};
231 
233  float m_etMin{0}, m_etMax{0};
234 };
235 
236 } // namespace Ringer
237 
238 #endif // RINGERSELECTORTOOLS_TOOLS_VARIABLEDEPENDENCY_H
239 
240 #ifndef INCLUDE_HEADER_ONLY // Use to avoid circular includes
241 #include "VariableDependency.icc"
242 #endif // INCLUDE_HEADER_ONLY
Ringer::DepVarStruct::pileupEstimation
const float pileupEstimation
Holds the currently being used pile-up estimation.
Definition: VariableDependency.h:39
et
Extra patterns decribing particle interation process.
Ringer::VariableDependency::m_etMax
float m_etMax
Definition: VariableDependency.h:233
Ringer::VariableDependency::VariableDependency
VariableDependency(const float etaMin, const float etaMax, EtaDependency etaDependency)
Ctor for eta dependent case.
Definition: VariableDependency.h:100
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Ringer::VariableDependency::isWithinEtaRange
bool isWithinEtaRange(const float eta) const
Check if eta is within this procedure range.
Ringer::VariableDependency::setEtDep
void setEtDep(const float etMin, const float etMax)
Set this procedure to be et dependent.
Ringer::VariableDependency::m_etaDependency
EtaDependency m_etaDependency
Whether there is eta dependency.
Definition: VariableDependency.h:225
Ringer::VariableDependency::etMin
float etMin() const
Get et min.
Ringer::EtIndependent
@ EtIndependent
Definition: RingerSelectorToolsEnums.h:96
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Ringer::VariableDependency::VariableDependency
VariableDependency(const float etMin, const float etMax, EtDependency etDependency)
Ctor for et dependent case.
Definition: VariableDependency.h:110
Ringer::DepVarStruct::DepVarStruct
DepVarStruct(const float et, const float eta, const float pileupEstimation=0.)
Definition: VariableDependency.h:41
Ringer::DepVarStruct::et
const float et
Holds particle transverse energy.
Definition: VariableDependency.h:35
Ringer::VariableDependency::isWithinRange
bool isWithinRange(const DepVarStruct &depVar) const
Check if depVar is within this procedure range.
Ringer::VariableDependency::m_etaMax
float m_etaMax
Definition: VariableDependency.h:230
Ringer::VariableDependency::m_etDependency
EtDependency m_etDependency
Whether there is et dependency.
Definition: VariableDependency.h:227
Ringer::VariableDependency::setEtaEtDep
void setEtaEtDep(const float etaMin, const float etaMax, const float etMin, const float etMax)
Set this procedure to be et dependent.
Ringer::VariableDependency::VariableDependency
VariableDependency(const float etaMin, const float etaMax, const float etMin, const float etMax)
Ctor for et/eta dependent case.
Definition: VariableDependency.h:120
Ringer::VariableDependency::etaDep
EtaDependency etaDep() const
Returns whether it is et dependent.
Ringer::VariableDependency::isWithinEtRange
bool isWithinEtRange(const float et) const
Check if et is within this procedure et range.
Ringer::EtDependency
EtDependency
Specify et position dependency.
Definition: RingerSelectorToolsEnums.h:95
Ringer::VariableDependency::etMax
float etMax() const
Get et max.
Ringer::VariableDependency::m_etaMin
float m_etaMin
Eta bounded region where RingerProcedure may be applied.
Definition: VariableDependency.h:230
Ringer::DepVarStruct::eta
const float eta
Holds eta position.
Definition: VariableDependency.h:37
VariableDependency.icc
Ringer::VariableDependency::writeDepInfo
void writeDepInfo(TDirectory *configDir) const
Write variable dependency to directory.
Ringer::VariableDependency::VariableDependency
VariableDependency()=default
Ctor for independent.
Ringer::EtaDependency
EtaDependency
Specify eta position dependency.
Definition: RingerSelectorToolsEnums.h:81
RingerSelectorToolsDefs.h
Ringer::VariableDependency::type
std::string type() const
Return this variable dependency string.
Ringer::EtaIndependent
@ EtaIndependent
Definition: RingerSelectorToolsEnums.h:82
Ringer::VariableDependency
Interface for possible Eta and Et variable dependency.
Definition: VariableDependency.h:89
Ringer::VariableDependency::setEtaDep
void setEtaDep(const float etaMin, const float etaMax)
Set this procedure to be eta dependent:
Ringer::VariableDependency::etaMin
float etaMin() const
Get eta min.
Ringer::DepVarStruct
Definition: VariableDependency.h:32
Ringer::VariableDependency::etaMax
float etaMax() const
Get eta max.
Ringer::VariableDependency::m_etMin
float m_etMin
Et bounded region where RingerProcedure may be applied.
Definition: VariableDependency.h:233
Ringer::VariableDependency::etDep
EtDependency etDep() const
Returns whether it is et dependent.
Ringer
Namespace dedicated for Ringer utilities.
Definition: CaloRingsDefs.h:9
Ringer::VariableDependency::read
static void read(VariableDependency *varDep, TDirectory *configDir, unsigned writtenVersion)
Read variable dependency from directory.