ATLAS Offline Software
HIEventShapeSummaryUtils.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 HIEVENTUTILS_HIEVENTSHAPESUMMARYUTILS_H
6 #define HIEVENTUTILS_HIEVENTSHAPESUMMARYUTILS_H
7 
10 #include <functional>
11 #include <vector>
12 #include <set>
13 
14 namespace HI
15 {
16 
18  const std::function<bool (const xAOD::HIEventShape*)>& incFunction,
19  const std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)>& addFunction);
20 
22  const std::function<bool (const xAOD::HIEventShape*)>& incFunction);
23 
24 
26  const std::set<unsigned int>& indices,
27  const std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)>& addFunction);
28 
30  {
31 
33 
34  AddEventShape(float ww) : match_num_harmonics(true), m_weight(ww){};
35  constexpr AddEventShape() : match_num_harmonics(true), m_weight(1){};
36  void operator()(xAOD::HIEventShape* slice, const xAOD::HIEventShape* in_slice) const;
37 
38  private:
39  float m_weight;
40  };
41 
43 
44 
45  // Predicates
46 
47  struct ByLayer
48  {
49  int layer;
50  ByLayer(int ll) : layer(ll){};
51  bool operator()(const xAOD::HIEventShape* in_slice) {return (in_slice->layer()==layer);};
52  };
53 
54  struct ByLayers
55  {
56  std::initializer_list<int> layers;
57  constexpr ByLayers(std::initializer_list<int> ll) : layers(ll) {};
58  bool operator()(const xAOD::HIEventShape* in_slice)
59  {
60  for(int i : layers)
61  {
62  if(i==in_slice->layer()) return true;
63  }
64  return false;
65  };
66  };
67 
68  struct ByEtaRange
69  {
70  float eta_min;
71  float eta_max;
72  constexpr ByEtaRange(float eta_min_i, float eta_max_i) : eta_min(eta_min_i), eta_max(eta_max_i){};
73  bool operator()(const xAOD::HIEventShape* in_slice) {return (in_slice->etaMin() > eta_min && in_slice->etaMax() < eta_max);};
74  };
75 
77  {
80 
81  constexpr ByLayersWithEtaRange(ByLayers& ll,float eta_min_i, float eta_max_i) : layers_sel(ll), range_sel(eta_min_i,eta_max_i){};
82  bool operator()(const xAOD::HIEventShape* in_slice) {return (layers_sel(in_slice) && range_sel(in_slice));};
83  };
84 
85  struct ByLayersP
86  {
89  constexpr ByLayersP(std::initializer_list<int> ll) : layers_sel(ll), range_sel(-1e-4,1000){};
90  bool operator()(const xAOD::HIEventShape* in_slice) {return (layers_sel(in_slice) && range_sel(in_slice));};
91  };
92 
93  struct ByLayersN
94  {
97  constexpr ByLayersN(std::initializer_list<int> ll) : layers_sel(ll), range_sel(-1000,1e-4){};
98  bool operator()(const xAOD::HIEventShape* in_slice) {return (layers_sel(in_slice) && range_sel(in_slice));};
99  };
100 
101  float getModulation(const xAOD::HIEventShape* es, const std::vector<unsigned int>& harmonics, float phi);
102  int setHarmonics(std::vector<unsigned int>& in);
103 }
104 
105 #endif
HI::AddES
constexpr AddEventShape AddES
Definition: HIEventShapeSummaryUtils.h:42
HI::ByLayersP::operator()
bool operator()(const xAOD::HIEventShape *in_slice)
Definition: HIEventShapeSummaryUtils.h:90
xAOD::HIEventShape_v2::etaMin
float etaMin() const
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
HI::ByLayersWithEtaRange::ByLayersWithEtaRange
constexpr ByLayersWithEtaRange(ByLayers &ll, float eta_min_i, float eta_max_i)
Definition: HIEventShapeSummaryUtils.h:81
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
xAOD::HIEventShape_v2::layer
int layer() const
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
HI::ByLayers::layers
std::initializer_list< int > layers
Definition: HIEventShapeSummaryUtils.h:56
HI::AddEventShape::operator()
void operator()(xAOD::HIEventShape *slice, const xAOD::HIEventShape *in_slice) const
Definition: HIEventShapeSummaryUtils.cxx:10
HI::ByEtaRange
Definition: HIEventShapeSummaryUtils.h:69
xAOD::HIEventShape_v2
Interface class for the HI reconstruction EDM.
Definition: HIEventShape_v2.h:31
HI::ByLayer::ByLayer
ByLayer(int ll)
Definition: HIEventShapeSummaryUtils.h:50
HI::ByLayersWithEtaRange::layers_sel
ByLayers layers_sel
Definition: HIEventShapeSummaryUtils.h:78
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
HI::ByLayersN::operator()
bool operator()(const xAOD::HIEventShape *in_slice)
Definition: HIEventShapeSummaryUtils.h:98
HIEventShape.h
HIEventShapeContainer.h
HI::ByLayersWithEtaRange::range_sel
ByEtaRange range_sel
Definition: HIEventShapeSummaryUtils.h:79
HI::AddEventShape::AddEventShape
AddEventShape(float ww)
Definition: HIEventShapeSummaryUtils.h:34
HI::ByLayers::ByLayers
constexpr ByLayers(std::initializer_list< int > ll)
Definition: HIEventShapeSummaryUtils.h:57
HI::ByEtaRange::eta_min
float eta_min
Definition: HIEventShapeSummaryUtils.h:70
HI::ByLayersN::ByLayersN
constexpr ByLayersN(std::initializer_list< int > ll)
Definition: HIEventShapeSummaryUtils.h:97
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
HI::setHarmonics
int setHarmonics(std::vector< unsigned int > &in)
Definition: HIEventShapeSummaryUtils.cxx:90
xAOD::HIEventShape_v2::etaMax
float etaMax() const
HI
Definition: HIEventDefs.h:14
HI::ByLayer::layer
int layer
Definition: HIEventShapeSummaryUtils.h:49
HI::ByLayersP::range_sel
ByEtaRange range_sel
Definition: HIEventShapeSummaryUtils.h:88
HI::AddEventShape::m_weight
float m_weight
Definition: HIEventShapeSummaryUtils.h:39
HI::ByLayer::operator()
bool operator()(const xAOD::HIEventShape *in_slice)
Definition: HIEventShapeSummaryUtils.h:51
HI::ByLayersWithEtaRange
Definition: HIEventShapeSummaryUtils.h:77
HI::fillSummary
void fillSummary(const xAOD::HIEventShapeContainer *in, xAOD::HIEventShape *out, const std::function< bool(const xAOD::HIEventShape *)> &incFunction, const std::function< void(xAOD::HIEventShape *, const xAOD::HIEventShape *)> &addFunction)
Definition: HIEventShapeSummaryUtils.cxx:53
HI::ByLayersWithEtaRange::operator()
bool operator()(const xAOD::HIEventShape *in_slice)
Definition: HIEventShapeSummaryUtils.h:82
HI::ByLayersN
Definition: HIEventShapeSummaryUtils.h:94
HI::AddEventShape::AddEventShape
constexpr AddEventShape()
Definition: HIEventShapeSummaryUtils.h:35
HI::ByLayer
Definition: HIEventShapeSummaryUtils.h:48
HI::ByEtaRange::operator()
bool operator()(const xAOD::HIEventShape *in_slice)
Definition: HIEventShapeSummaryUtils.h:73
HI::ByEtaRange::ByEtaRange
constexpr ByEtaRange(float eta_min_i, float eta_max_i)
Definition: HIEventShapeSummaryUtils.h:72
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
HI::getModulation
float getModulation(const xAOD::HIEventShape *es, const std::vector< unsigned int > &harmonics, float phi)
Definition: HIEventShapeSummaryUtils.cxx:80
HI::ByLayersP::ByLayersP
constexpr ByLayersP(std::initializer_list< int > ll)
Definition: HIEventShapeSummaryUtils.h:89
HI::ByLayers::operator()
bool operator()(const xAOD::HIEventShape *in_slice)
Definition: HIEventShapeSummaryUtils.h:58
HI::ByLayers
Definition: HIEventShapeSummaryUtils.h:55
HI::AddEventShape::match_num_harmonics
bool match_num_harmonics
Definition: HIEventShapeSummaryUtils.h:32
HI::ByLayersP
Definition: HIEventShapeSummaryUtils.h:86
HI::ByLayersN::range_sel
ByEtaRange range_sel
Definition: HIEventShapeSummaryUtils.h:96
HI::ByEtaRange::eta_max
float eta_max
Definition: HIEventShapeSummaryUtils.h:71
HI::AddEventShape
Definition: HIEventShapeSummaryUtils.h:30
HI::ByLayersP::layers_sel
ByLayers layers_sel
Definition: HIEventShapeSummaryUtils.h:87
HI::ByLayersN::layers_sel
ByLayers layers_sel
Definition: HIEventShapeSummaryUtils.h:95
DiTauMassTools::TauTypes::ll
@ ll
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:49