ATLAS Offline Software
Loading...
Searching...
No Matches
HIEventShapeSummaryTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef HIEVENTUTILS_HIEVENTSHAPESUMMARYTOOL_H
6#define HIEVENTUTILS_HIEVENTSHAPESUMMARYTOOL_H
7
8#include "AsgTools/AsgTool.h"
10#include <functional>
11#include <string>
12#include <vector>
13#include <map>
17{
19 public:
20 HIEventShapeSummaryTool(const std::string& n);
21
22
23 StatusCode summarize(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShapeContainer* out) const override;
24 StatusCode initialize() override;
25 std::string dumpList() const override;
26
27 private:
28 typedef std::function<bool (const xAOD::HIEventShape*)> function_t;
30 {
31 std::string name;
32 float eta_min{};
33 float eta_max{};
34 int layer{};
36
37 summary_info_t(const std::string& n, float emin, float emax, int ll, function_t ff) : name(n), eta_min(emin), eta_max(emax), layer(ll), func(std::move(ff)) {};
38 };
39
40
41 std::vector<std::string> m_samp_names;
42 std::vector<std::string> m_subcalo_names;
43 bool m_do_sides{};
44
45 //using map instead of unordered version, really do want entries sorted by key
46 std::map<std::string,summary_info_t> m_summary_list;
47
48 int getSubCaloLayer(const std::vector<int>& samps) const;
49 float getSubCaloEtaMin(const std::vector<int>& samps) const;
50 float getSubCaloEtaMax(const std::vector<int>& samps) const;
51 float roundToTenth(float v) const;
52
53 static const std::vector<std::string> s_SubCaloNames;
54 static const std::vector<std::initializer_list<int> > s_SubCaloLists;
55
56};
57
58
59#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
int getSubCaloLayer(const std::vector< int > &samps) const
HIEventShapeSummaryTool(const std::string &n)
std::vector< std::string > m_samp_names
static const std::vector< std::string > s_SubCaloNames
static const std::vector< std::initializer_list< int > > s_SubCaloLists
std::function< bool(const xAOD::HIEventShape *)> function_t
float getSubCaloEtaMin(const std::vector< int > &samps) const
StatusCode summarize(const xAOD::HIEventShapeContainer *in, xAOD::HIEventShapeContainer *out) const override
std::map< std::string, summary_info_t > m_summary_list
std::vector< std::string > m_subcalo_names
float getSubCaloEtaMax(const std::vector< int > &samps) const
StatusCode initialize() override
Dummy implementation of the initialisation function.
std::string dumpList() const override
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
STL namespace.
HIEventShapeContainer_v2 HIEventShapeContainer
Define the latest version of the container.
HIEventShape_v2 HIEventShape
Definition of the latest event info version.
summary_info_t(const std::string &n, float emin, float emax, int ll, function_t ff)