ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCalibClusterMomentsMaker2.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CALOCALIBHITREC_CALOCALIBCLUSTERMOMENTSMAKER2_H
6#define CALOCALIBHITREC_CALOCALIBCLUSTERMOMENTSMAKER2_H
17
18class CaloCell_ID;
19class CaloDM_ID;
24
25#include "GaudiKernel/ToolHandle.h"
26
28#include "CaloGeoHelpers/CaloSampling.h"
33
35
36#include <string>
37#include <vector>
38#include <set>
39#include <map>
40#include <atomic>
41#include <array>
42
44{
45 public:
46
51 public:
53 };
54
58 class MyCellInfo : public std::vector<std::pair<int, double> > {
59 public:
60 MyCellInfo(int iClus, double w) { this->emplace_back(iClus, w); }
61 void Add(const MyCellInfo& other) { this->insert(this->end(),other.begin(), other.end()); }
62 };
63
64 typedef std::map<Identifier, MyCellInfo> CellInfoSet_t;
65
69 class MyClusInfo {
70 public:
72 public:
73 double engTot = 0.0;
74 std::array<double,CaloSampling::Unknown+1> engSmp;
75 void Add(double eng, int nsmp)
76 {
77 engTot += eng;
78 engSmp[nsmp] +=eng;
79 }
80 };
81
82 void Add(double eng, int nsmp, int pid = 0)
83 {
84 engCalibIn.Add(eng, nsmp);
85 engCalibParticle[pid].Add(eng, nsmp);
86 }
87
89 double engCalibOut = 0.0;
90 double engCalibDead = 0.0;
91 std::array<double,CaloDmDescrArea::DMA_MAX> engCalibDeadInArea{};
92 std::map<int, ClusCalibEnergy > engCalibParticle{};
93 };
94 typedef std::vector<MyClusInfo> ClusInfo_t;
95
96
99 typedef std::pair<std::string,xAOD::CaloCluster::MomentType>
101
103 typedef std::vector<moment_name_pair> moment_name_vector;
104
106 typedef std::set<moment_name_pair> moment_name_set;
107
108 CaloCalibClusterMomentsMaker2(const std::string& type, const std::string& name,
109 const IInterface* parent);
110
111
113 virtual StatusCode execute(const EventContext& ctx,
114 xAOD::CaloClusterContainer* theClusColl) const override;
115 virtual StatusCode initialize() override;
116
117 private:
118
125 std::vector<std::string> m_momentsNames;
126
137
145
152 std::vector<std::string> m_momentsNamesAOD;
153
160 std::set<xAOD::CaloCluster::MomentType> m_momentsAOD;
161
168
175
177 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthParticleContainerKey{this,"TruthParticles","TruthParticles","ReadHandleKey for truth particle container"};
178
180 SG::ReadCondHandleKey<CaloDetDescrManager> m_caloDetDescrMgrKey{this,"CaloDetDescrManager", "CaloDetDescrManager"};
181
183
185
187
192
193 double m_rmaxOut[3];
194
195 std::array<std::vector<std::vector<CalibHitIPhiIEtaRange>>,3> m_i_phi_eta;
196
197 mutable std::atomic<bool> m_foundAllContainers{};
198
201
216
217 static double angle_mollier_factor(double x) ;
218};
219
220#endif // CALOCALIBCLUSTERMOMENTSMAKER2_H
221
222
223
224
225
226
Base class for cluster processing tools called from CaloClusterMaker.
#define x
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Class to define range of valid bins in eta x phi plane.
Class to store cluster's calibration energies.
std::array< double, CaloDmDescrArea::DMA_MAX > engCalibDeadInArea
std::set< moment_name_pair > moment_name_set
set of pairs defined above.
std::vector< moment_name_pair > moment_name_vector
vector of pairs defined above.
SG::ReadHandleKeyArray< CaloCalibrationHitContainer > m_DMCalibrationHitContainerNames
vector of dead material calibration hit container names to use.
moment_name_vector m_validNames
vector holding the names of valid moments which can be calculated.
std::set< xAOD::CaloCluster::MomentType > m_momentsAOD
set holding the list of moment enums which go in the first store i.e.
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override
Execute on an entire collection of clusters.
moment_name_set m_validMoments
set of moments which will be calculated.
SG::ReadHandleKeyArray< CaloCalibrationHitContainer > m_CalibrationHitContainerNames
vector of calibration hit container names to use.
std::map< Identifier, MyCellInfo > CellInfoSet_t
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
ReadHandleKey for truth particle container.
std::vector< std::string > m_momentsNames
vector holding the input list of names of moments to calculate.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Conditions Handle Key to access the CaloDetDescrManager.
std::array< std::vector< std::vector< CalibHitIPhiIEtaRange > >, 3 > m_i_phi_eta
CaloCalibClusterMomentsMaker2(const std::string &type, const std::string &name, const IInterface *parent)
const CaloDmDescrManager * m_caloDmDescrManager
std::vector< std::string > m_momentsNamesAOD
vector holding the list of moment names which go in the first store i.e.
std::pair< std::string, xAOD::CaloCluster::MomentType > moment_name_pair
typedef for a pair to index the enums defined in CaloClusterMoment with a string.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *collection) const =0
Execute on an entire collection of clusters.
Helper class for Calo Dead Material offline identifiers.
Definition CaloDM_ID.h:102
This class provides the client interface for accessing the detector description information common to...
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Property holding a SG store/key/clid from which a ReadHandle is made.
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.