ATLAS Offline Software
Loading...
Searching...
No Matches
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
14namespace 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
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
Scalar phi() const
phi method
float etaMax() const
eta slice "right" edge
int layer() const
calorimeter layer for which the quantities were calculated 0 - all calorimeter depth others numbers a...
float etaMin() const
eta slice "left" edge
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)
constexpr AddEventShape AddES
int setHarmonics(std::vector< unsigned int > &in)
float getModulation(const xAOD::HIEventShape *es, const std::vector< unsigned int > &harmonics, float phi)
HIEventShapeContainer_v2 HIEventShapeContainer
Define the latest version of the container.
HIEventShape_v2 HIEventShape
Definition of the latest event info version.
void operator()(xAOD::HIEventShape *slice, const xAOD::HIEventShape *in_slice) const
bool operator()(const xAOD::HIEventShape *in_slice)
constexpr ByEtaRange(float eta_min_i, float eta_max_i)
bool operator()(const xAOD::HIEventShape *in_slice)
constexpr ByLayersN(std::initializer_list< int > ll)
bool operator()(const xAOD::HIEventShape *in_slice)
bool operator()(const xAOD::HIEventShape *in_slice)
constexpr ByLayersP(std::initializer_list< int > ll)
constexpr ByLayersWithEtaRange(ByLayers &ll, float eta_min_i, float eta_max_i)
bool operator()(const xAOD::HIEventShape *in_slice)
std::initializer_list< int > layers
bool operator()(const xAOD::HIEventShape *in_slice)
constexpr ByLayers(std::initializer_list< int > ll)