ATLAS Offline Software
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
7 
18 class CaloCell_ID;
19 class CaloDM_ID;
20 class CaloDmDescrManager;
22 class McEventCollection;
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 
206  bool m_doDeadL;
207  bool m_doDeadM;
208  bool m_doDeadT;
211  float m_energyMin;
214  float m_apars_r0;
216 
217  static double angle_mollier_factor(double x) ;
218 };
219 
220 #endif // CALOCALIBCLUSTERMOMENTSMAKER2_H
221 
222 
223 
224 
225 
226 
ReadHandleKeyArray.h
CaloCalibClusterMomentsMaker2::m_truthParticleContainerKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
ReadHandleKey for truth particle container.
Definition: CaloCalibClusterMomentsMaker2.h:177
CaloCalibClusterMomentsMaker2::m_apars_r0
float m_apars_r0
Definition: CaloCalibClusterMomentsMaker2.h:214
CaloCalibClusterMomentsMaker2::m_caloDM_ID
const CaloDM_ID * m_caloDM_ID
Definition: CaloCalibClusterMomentsMaker2.h:184
CaloCalibClusterMomentsMaker2::kCalibFracHAD
@ kCalibFracHAD
Definition: CaloCalibClusterMomentsMaker2.h:200
CaloCalibClusterMomentsMaker2::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusColl) const override
Execute on an entire collection of clusters.
Definition: CaloCalibClusterMomentsMaker2.cxx:275
CaloCalibClusterMomentsMaker2::moment_name_vector
std::vector< moment_name_pair > moment_name_vector
vector of pairs defined above.
Definition: CaloCalibClusterMomentsMaker2.h:103
CaloCalibClusterMomentsMaker2::moment_name_pair
std::pair< std::string, xAOD::CaloCluster::MomentType > moment_name_pair
typedef for a pair to index the enums defined in CaloClusterMoment with a string.
Definition: CaloCalibClusterMomentsMaker2.h:100
CaloCalibClusterMomentsMaker2::m_i_phi_eta
std::array< std::vector< std::vector< CalibHitIPhiIEtaRange > >, 3 > m_i_phi_eta
Definition: CaloCalibClusterMomentsMaker2.h:195
CaloCalibClusterMomentsMaker2::MyClusInfo::ClusCalibEnergy::Add
void Add(double eng, int nsmp)
Definition: CaloCalibClusterMomentsMaker2.h:75
CaloCalibClusterMomentsMaker2::m_momentsAOD
std::set< xAOD::CaloCluster::MomentType > m_momentsAOD
set holding the list of moment enums which go in the first store i.e.
Definition: CaloCalibClusterMomentsMaker2.h:160
CaloCalibClusterMomentsMaker2::m_rmaxOut
double m_rmaxOut[3]
Definition: CaloCalibClusterMomentsMaker2.h:193
CaloCalibClusterMomentsMaker2::moment_name_set
std::set< moment_name_pair > moment_name_set
set of pairs defined above.
Definition: CaloCalibClusterMomentsMaker2.h:106
TruthParticleContainer.h
CaloClusterCollectionProcessor::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *collection) const =0
Execute on an entire collection of clusters.
CaloCalibClusterMomentsMaker2::m_calo_id
const CaloCell_ID * m_calo_id
Definition: CaloCalibClusterMomentsMaker2.h:182
CaloCalibClusterMomentsMaker2::m_energyMin
float m_energyMin
Definition: CaloCalibClusterMomentsMaker2.h:211
CaloClusterCollectionProcessor
Definition: CaloClusterCollectionProcessor.h:32
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
CaloCalibClusterMomentsMaker2::m_useParticleID
bool m_useParticleID
Definition: CaloCalibClusterMomentsMaker2.h:209
CaloCalibClusterMomentsMaker2::m_momentsNamesAOD
std::vector< std::string > m_momentsNamesAOD
vector holding the list of moment names which go in the first store i.e.
Definition: CaloCalibClusterMomentsMaker2.h:152
CaloCalibClusterMomentsMaker2::m_doOutOfClusterL
bool m_doOutOfClusterL
Definition: CaloCalibClusterMomentsMaker2.h:203
SG::ReadHandleKey< xAOD::TruthParticleContainer >
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibDeadInArea
std::array< double, CaloDmDescrArea::DMA_MAX > engCalibDeadInArea
Definition: CaloCalibClusterMomentsMaker2.h:91
TruthParticleContainer
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticleContainer.h:42
x
#define x
CaloCalibClusterMomentsMaker2::CalibHitIPhiIEtaRange::iPhi
char iPhi
Definition: CaloCalibClusterMomentsMaker2.h:52
CaloCalibrationHitContainer.h
CaloCalibClusterMomentsMaker2::m_apars_alpha
float m_apars_alpha
Definition: CaloCalibClusterMomentsMaker2.h:213
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
CaloCell_ID.h
CaloCalibClusterMomentsMaker2::m_energyMinCalib
float m_energyMinCalib
Definition: CaloCalibClusterMomentsMaker2.h:212
CaloCalibClusterMomentsMaker2::MyClusInfo::Add
void Add(double eng, int nsmp, int pid=0)
Definition: CaloCalibClusterMomentsMaker2.h:82
CaloCalibClusterMomentsMaker2::CellInfoSet_t
std::map< Identifier, MyCellInfo > CellInfoSet_t
Definition: CaloCalibClusterMomentsMaker2.h:64
CaloCalibClusterMomentsMaker2::MyClusInfo::ClusCalibEnergy
Definition: CaloCalibClusterMomentsMaker2.h:71
CaloCalibClusterMomentsMaker2::m_MatchDmType
int m_MatchDmType
Definition: CaloCalibClusterMomentsMaker2.h:215
CaloCalibClusterMomentsMaker2::CaloCalibClusterMomentsMaker2
CaloCalibClusterMomentsMaker2(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloCalibClusterMomentsMaker2.cxx:53
CaloCalibClusterMomentsMaker2::m_n_phi_out
int m_n_phi_out
Definition: CaloCalibClusterMomentsMaker2.h:188
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibDead
double engCalibDead
Definition: CaloCalibClusterMomentsMaker2.h:90
CaloCalibClusterMomentsMaker2::m_DMCalibrationHitContainerNames
SG::ReadHandleKeyArray< CaloCalibrationHitContainer > m_DMCalibrationHitContainerNames
vector of dead material calibration hit container names to use.
Definition: CaloCalibClusterMomentsMaker2.h:174
CaloCalibClusterMomentsMaker2::kCalibFracEM
@ kCalibFracEM
Definition: CaloCalibClusterMomentsMaker2.h:200
CaloCalibClusterMomentsMaker2::ClusInfo_t
std::vector< MyClusInfo > ClusInfo_t
Definition: CaloCalibClusterMomentsMaker2.h:94
CaloCalibClusterMomentsMaker2::m_doOutOfClusterM
bool m_doOutOfClusterM
Definition: CaloCalibClusterMomentsMaker2.h:204
CaloDmDescrManager.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloCalibClusterMomentsMaker2::kMatchDmTight
@ kMatchDmTight
Definition: CaloCalibClusterMomentsMaker2.h:199
CaloCalibClusterMomentsMaker2::kCalibFracREST
@ kCalibFracREST
Definition: CaloCalibClusterMomentsMaker2.h:200
CaloCalibClusterMomentsMaker2::MyClusInfo::ClusCalibEnergy::engTot
double engTot
Definition: CaloCalibClusterMomentsMaker2.h:73
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibOut
double engCalibOut
Definition: CaloCalibClusterMomentsMaker2.h:89
CaloDmDescrManager
Definition: CaloDmDescrManager.h:131
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCalibClusterMomentsMaker2::m_n_eta_out
int m_n_eta_out
Definition: CaloCalibClusterMomentsMaker2.h:189
CaloCalibClusterMomentsMaker2::MyCellInfo::Add
void Add(const MyCellInfo &other)
Definition: CaloCalibClusterMomentsMaker2.h:61
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
CaloCalibClusterMomentsMaker2::m_doDeadM
bool m_doDeadM
Definition: CaloCalibClusterMomentsMaker2.h:207
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
CaloCalibClusterMomentsMaker2::MyClusInfo::ClusCalibEnergy::engSmp
std::array< double, CaloSampling::Unknown+1 > engSmp
Definition: CaloCalibClusterMomentsMaker2.h:74
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CaloCalibClusterMomentsMaker2::m_doDeadEnergySharing
bool m_doDeadEnergySharing
Definition: CaloCalibClusterMomentsMaker2.h:202
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibIn
ClusCalibEnergy engCalibIn
Definition: CaloCalibClusterMomentsMaker2.h:88
CaloCalibClusterMomentsMaker2::m_caloDmDescrManager
const CaloDmDescrManager * m_caloDmDescrManager
Definition: CaloCalibClusterMomentsMaker2.h:186
CaloCalibClusterMomentsMaker2::m_CalibrationHitContainerNames
SG::ReadHandleKeyArray< CaloCalibrationHitContainer > m_CalibrationHitContainerNames
vector of calibration hit container names to use.
Definition: CaloCalibClusterMomentsMaker2.h:167
CaloCalibClusterMomentsMaker2::keys_dm_energy_sharing
keys_dm_energy_sharing
Definition: CaloCalibClusterMomentsMaker2.h:199
CaloCalibClusterMomentsMaker2
Calculate calibration hit based moments for CaloCluster objects using Primary Particle ID.
Definition: CaloCalibClusterMomentsMaker2.h:44
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloCalibClusterMomentsMaker2::MyCellInfo::MyCellInfo
MyCellInfo(int iClus, double w)
Definition: CaloCalibClusterMomentsMaker2.h:60
CaloCalibClusterMomentsMaker2::MyCellInfo
Class to store cluster number and weight for calorimeter cells.
Definition: CaloCalibClusterMomentsMaker2.h:58
CaloClusterCollectionProcessor.h
Base class for cluster processing tools called from CaloClusterMaker.
CaloCalibClusterMomentsMaker2::initialize
virtual StatusCode initialize() override
Definition: CaloCalibClusterMomentsMaker2.cxx:145
CaloCalibClusterMomentsMaker2::m_doOutOfClusterT
bool m_doOutOfClusterT
Definition: CaloCalibClusterMomentsMaker2.h:205
CaloCalibClusterMomentsMaker2::m_foundAllContainers
std::atomic< bool > m_foundAllContainers
Definition: CaloCalibClusterMomentsMaker2.h:197
CaloCalibClusterMomentsMaker2::CalibHitIPhiIEtaRange
Class to define range of valid bins in eta x phi plane.
Definition: CaloCalibClusterMomentsMaker2.h:50
CaloCalibClusterMomentsMaker2::m_caloDetDescrMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Conditions Handle Key to access the CaloDetDescrManager.
Definition: CaloCalibClusterMomentsMaker2.h:180
CaloCalibClusterMomentsMaker2::kMatchDmMedium
@ kMatchDmMedium
Definition: CaloCalibClusterMomentsMaker2.h:199
CaloCalibClusterMomentsMaker2::kMatchDmLoose
@ kMatchDmLoose
Definition: CaloCalibClusterMomentsMaker2.h:199
SG::ReadCondHandleKey< CaloDetDescrManager >
CaloCalibClusterMomentsMaker2::m_validNames
moment_name_vector m_validNames
vector holding the names of valid moments which can be calculated.
Definition: CaloCalibClusterMomentsMaker2.h:136
CaloCalibClusterMomentsMaker2::angle_mollier_factor
static double angle_mollier_factor(double x)
Definition: CaloCalibClusterMomentsMaker2.cxx:811
CaloCalibClusterMomentsMaker2::MyClusInfo
Class to store cluster's calibration energies.
Definition: CaloCalibClusterMomentsMaker2.h:69
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
CaloCalibClusterMomentsMaker2::kCalibFracMax
@ kCalibFracMax
Definition: CaloCalibClusterMomentsMaker2.h:200
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCalibClusterMomentsMaker2::m_doDeadT
bool m_doDeadT
Definition: CaloCalibClusterMomentsMaker2.h:208
CaloCalibClusterMomentsMaker2::MyClusInfo::engCalibParticle
std::map< int, ClusCalibEnergy > engCalibParticle
Definition: CaloCalibClusterMomentsMaker2.h:92
CaloCalibClusterMomentsMaker2::CalibHitIPhiIEtaRange::iEtaMax
char iEtaMax
Definition: CaloCalibClusterMomentsMaker2.h:52
CaloDM_ID
Helper class for Calo Dead Material offline identifiers.
Definition: CaloDM_ID.h:102
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCalibClusterMomentsMaker2::keys_calib_frac_origin
keys_calib_frac_origin
Definition: CaloCalibClusterMomentsMaker2.h:200
CaloCalibClusterMomentsMaker2::m_out_phi_max
double m_out_phi_max
Definition: CaloCalibClusterMomentsMaker2.h:190
CaloCalibClusterMomentsMaker2::m_out_eta_max
double m_out_eta_max
Definition: CaloCalibClusterMomentsMaker2.h:191
CaloCalibClusterMomentsMaker2::m_doDeadL
bool m_doDeadL
Definition: CaloCalibClusterMomentsMaker2.h:206
CaloCalibClusterMomentsMaker2::CalibHitIPhiIEtaRange::iEtaMin
char iEtaMin
Definition: CaloCalibClusterMomentsMaker2.h:52
CaloCalibClusterMomentsMaker2::m_momentsNames
std::vector< std::string > m_momentsNames
vector holding the input list of names of moments to calculate.
Definition: CaloCalibClusterMomentsMaker2.h:125
AthAlgTool
Definition: AthAlgTool.h:26
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
CaloCalibClusterMomentsMaker2::m_doCalibFrac
bool m_doCalibFrac
Definition: CaloCalibClusterMomentsMaker2.h:210
CaloCalibClusterMomentsMaker2::m_validMoments
moment_name_set m_validMoments
set of moments which will be calculated.
Definition: CaloCalibClusterMomentsMaker2.h:144
CaloCalibClusterMomentsMaker2::kMatchDmOff
@ kMatchDmOff
Definition: CaloCalibClusterMomentsMaker2.h:199