ATLAS Offline Software
CaloDmDescrManager.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 /* ****************************************************************************
6  Filename : CaloDmDescrManager.h
7  Author : guennadi.pospelov@cern.ch
8  Created : March, 2007
9  DESCRIPTION : dead material identifiers description package
10  Usage:
11  const CaloDmDescrManager *mgr = CaloDmDescrManager::instance();
12  CaloDmDescrElement *element = mgr->get_element(dm_identifier);
13  Enjoy with element->eta(), element->phi().
14 **************************************************************************** */
15 
16 #ifndef CALODMDETDESCR_CALODMDESCRMANAGER_H
17 #define CALODMDETDESCR_CALODMDESCRMANAGER_H
18 
19 #include "StoreGate/StoreGateSvc.h"
21 
23 
24 
25 class Identifier;
26 class IdentifierHash;
27 class CaloDM_ID;
28 
29 
30 /* ****************************************************************************
31 Description element for dead material calibration hit
32 **************************************************************************** */
34  public:
36  m_eta(0.0),
37  m_deta(0.0),
38  m_phi(0.0),
39  m_dphi(0.0),
40  m_r(0.0),
41  m_z(0.0) {}
42  CaloDmDescrElement(float xeta, float xdeta, float xphi, float xdphi, float xr, float xz) :
43  m_eta( xeta ),
44  m_deta( xdeta ),
45  m_phi( xphi ),
46  m_dphi( xdphi ),
47  m_r( xr ),
48  m_z( xz ) {}
49 
51 
52  void print() const {
53  std::cout << " eta: " << m_eta << " phi: " << m_phi << " deta: " << m_deta << " dphi: " << m_dphi
54  << " r: " << m_r << " z: " << m_z << std::endl;
55  }
56 
57  inline float eta() const { return m_eta; }
58  inline float deta() const { return m_deta; }
59  inline float phi() const { return m_phi; }
60  inline float dphi() const { return m_dphi; }
61  inline float r() const { return m_r; }
62  inline float z() const { return m_z; }
63 
64  private:
65  float m_eta;
66  float m_deta;
67  float m_phi;
68  float m_dphi;
69  float m_r;
70  float m_z;
71 };
72 
73 
74 
75 /* ****************************************************************************
76 Dead Material region definition.
77 **************************************************************************** */
79 {
80  public:
82  m_region_id(0), // first Identifier in this region (etaBin=0, phiBin=0)
83  m_region_hash(0), // hash number of this region
84  m_key(0),
85  m_side(0),
86  m_neta_max(0),
87  m_nphi_max(0),
88  m_eta_min(0.0),
89  m_eta_max(0.0),
90  m_deta(0.0),
91  m_dphi(0.0),
92  m_distance(0.0),
93  m_isBarrel(false) {}
96  int m_key;
97  int m_side;
100  float m_eta_min;
101  float m_eta_max;
102  float m_deta;
103  float m_dphi;
104  float m_distance;
106  std::vector<short > m_CaloSampleNeighbours;
107  std::vector<float > m_CaloSampleEtaMin;
108  std::vector<float > m_CaloSampleEtaMax;
109 
110  // Can use default copy ctor, assignment op, dtor.
111 
112  inline const IdentifierHash region_hash () const { return m_region_hash; }
113  inline const Identifier region_id () const { return m_region_id; }
114  inline float etaMin() const { return m_eta_min; }
115  inline float etaMax() const { return m_eta_max; }
116  inline float deta() const { return m_deta; }
117  inline float dphi() const { return m_dphi; }
118  inline int netaMax() const { return m_neta_max; }
119  inline int nphiMax() const { return m_nphi_max; }
120 };
121 
122 
123 
124 /* ****************************************************************************
125 Dead Material description manager to deal with dead material calibration hits.
126 > Contains vector of 57 Dead Material regions.
127  m_caloDM_ID->lar_region_hash_max() + m_caloDM_ID->tile_region_hash_max() = 57
128 > Contains vector of ~80000 description element for DM calibration hits
129  m_caloDM_ID->lar_zone_hash_max() + m_caloDM_ID->tile_zone_hash_max() ~ 80000
130 **************************************************************************** */
132  public:
135 
136  static const CaloDmDescrManager* instance();
137 
138  int initialize();
139 
140  CaloDmDescrElement* get_element(const Identifier& cellId) const;
141  CaloDmRegion* get_dm_region(const Identifier& cellId) const;
142  IdentifierHash get_dm_hash(const CaloDmRegion *myRegion, float &eta, float &phi) const;
143  int get_dm_key(const Identifier& cellId) const;
144  int get_dm_area(const Identifier& cellId) const;
145  void show_element(const Identifier& cellId) const;
146 
147  static CaloCell_ID::CaloSample get_calo_sample(const std::string &SamplingName);
148  static CaloCell_ID::CaloSample get_calo_sample(const std::string &SamplingName, float &etaMin, float &etaMax);
149 
150  /* iterators over set of DM regions (LAr + Tiles) */
151  std::vector<CaloDmRegion *>::const_iterator reg_begin (void) const;
152  std::vector<CaloDmRegion *>::const_iterator reg_end (void) const;
153 
154  private:
158 
159  CaloDmDescrElement* build_element(const Identifier& cellId, const CaloDmRegion *myRegion);
160  StatusCode load_regions(const std::string& DmRegionFileName);
161  void build_element_vector();
162 
163  std::vector<CaloDmRegion *> m_DmRegionVector;
164  std::vector<CaloDmDescrElement *> m_DmElementVector;
165 };
166 
167 
168 //----------------------------------------------------------------------------
169 inline std::vector<CaloDmRegion *>::const_iterator CaloDmDescrManager::reg_begin (void) const
170 {
171  return(m_DmRegionVector.begin());
172 }
173 
174 inline std::vector<CaloDmRegion *>::const_iterator CaloDmDescrManager::reg_end (void) const
175 {
176  return(m_DmRegionVector.end());
177 }
178 
179 
180 #endif //CALOCALIBHITREC_CALODMDESCRMANAGER_H
CaloDmDescrManager::reg_end
std::vector< CaloDmRegion * >::const_iterator reg_end(void) const
Definition: CaloDmDescrManager.h:174
CaloDmRegion::m_CaloSampleEtaMin
std::vector< float > m_CaloSampleEtaMin
Definition: CaloDmDescrManager.h:107
CaloDmDescrManager::show_element
void show_element(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:95
CaloDmRegion::m_deta
float m_deta
Definition: CaloDmDescrManager.h:102
CaloDmRegion::etaMax
float etaMax() const
Definition: CaloDmDescrManager.h:115
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
CaloDmDescrManager::get_element
CaloDmDescrElement * get_element(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:107
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloDmRegion::nphiMax
int nphiMax() const
Definition: CaloDmDescrManager.h:119
CaloDmDescrElement::m_dphi
float m_dphi
Definition: CaloDmDescrManager.h:68
CaloDmDescrManager::build_element_vector
void build_element_vector()
Definition: CaloDmDescrManager.cxx:254
CaloDmDescrElement::m_z
float m_z
Definition: CaloDmDescrManager.h:70
CaloDmDescrElement::z
float z() const
Definition: CaloDmDescrManager.h:62
CaloDmRegion::netaMax
int netaMax() const
Definition: CaloDmDescrManager.h:118
CaloDmDescrArea.h
CaloDmDescrElement::print
void print() const
Definition: CaloDmDescrManager.h:52
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
CaloDmDescrManager::m_id_helper
const AtlasDetectorID * m_id_helper
Definition: CaloDmDescrManager.h:156
CaloDmDescrManager::load_regions
StatusCode load_regions(const std::string &DmRegionFileName)
Definition: CaloDmDescrManager.cxx:318
CaloDmRegion::m_region_id
Identifier m_region_id
Definition: CaloDmDescrManager.h:94
CaloDmDescrManager::CaloDmDescrManager
CaloDmDescrManager()
Definition: CaloDmDescrManager.cxx:39
CaloDmRegion::region_id
const Identifier region_id() const
Definition: CaloDmDescrManager.h:113
CaloDmDescrManager::get_dm_region
CaloDmRegion * get_dm_region(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:159
CaloCell_ID.h
CaloDmDescrManager::instance
static const CaloDmDescrManager * instance()
Definition: CaloDmDescrManager.cxx:67
CaloDmDescrElement::CaloDmDescrElement
CaloDmDescrElement()
Definition: CaloDmDescrManager.h:35
CaloDmDescrElement::~CaloDmDescrElement
~CaloDmDescrElement()
Definition: CaloDmDescrManager.h:50
CaloDmRegion::m_isBarrel
bool m_isBarrel
Definition: CaloDmDescrManager.h:105
CaloDmDescrElement::m_eta
float m_eta
Definition: CaloDmDescrManager.h:65
CaloDmRegion::m_region_hash
IdentifierHash m_region_hash
Definition: CaloDmDescrManager.h:95
CaloDmRegion
Definition: CaloDmDescrManager.h:79
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloDmDescrElement::phi
float phi() const
Definition: CaloDmDescrManager.h:59
CaloDmRegion::deta
float deta() const
Definition: CaloDmDescrManager.h:116
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloDmDescrManager::reg_begin
std::vector< CaloDmRegion * >::const_iterator reg_begin(void) const
Definition: CaloDmDescrManager.h:169
CaloDmDescrManager
Definition: CaloDmDescrManager.h:131
CaloDmDescrManager::m_DmElementVector
std::vector< CaloDmDescrElement * > m_DmElementVector
Definition: CaloDmDescrManager.h:164
CaloDmRegion::m_dphi
float m_dphi
Definition: CaloDmDescrManager.h:103
CaloDmDescrElement::eta
float eta() const
Definition: CaloDmDescrManager.h:57
CaloDmRegion::m_eta_max
float m_eta_max
Definition: CaloDmDescrManager.h:101
CaloDmDescrElement
Definition: CaloDmDescrManager.h:33
CaloDmDescrElement::m_phi
float m_phi
Definition: CaloDmDescrManager.h:67
CaloDmDescrManager::get_calo_sample
static CaloCell_ID::CaloSample get_calo_sample(const std::string &SamplingName)
Definition: CaloDmDescrManager.cxx:481
CaloDmDescrManager::~CaloDmDescrManager
~CaloDmDescrManager()
Definition: CaloDmDescrManager.cxx:52
CaloDmRegion::m_CaloSampleEtaMax
std::vector< float > m_CaloSampleEtaMax
Definition: CaloDmDescrManager.h:108
CaloDmDescrElement::m_deta
float m_deta
Definition: CaloDmDescrManager.h:66
CaloDmRegion::m_nphi_max
int m_nphi_max
Definition: CaloDmDescrManager.h:99
CaloDmDescrManager::get_dm_hash
IdentifierHash get_dm_hash(const CaloDmRegion *myRegion, float &eta, float &phi) const
Definition: CaloDmDescrManager.cxx:185
CaloDmRegion::CaloDmRegion
CaloDmRegion()
Definition: CaloDmDescrManager.h:81
CaloDmDescrManager::get_dm_key
int get_dm_key(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:132
CaloDmDescrManager::m_caloDM_ID
const CaloDM_ID * m_caloDM_ID
Definition: CaloDmDescrManager.h:155
CaloDmRegion::dphi
float dphi() const
Definition: CaloDmDescrManager.h:117
CaloDmRegion::etaMin
float etaMin() const
Definition: CaloDmDescrManager.h:114
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
CaloDmDescrElement::CaloDmDescrElement
CaloDmDescrElement(float xeta, float xdeta, float xphi, float xdphi, float xr, float xz)
Definition: CaloDmDescrManager.h:42
CaloDmDescrManager::initialize
int initialize()
Definition: CaloDmDescrManager.cxx:77
CaloDM_ID
Helper class for Calo Dead Material offline identifiers.
Definition: CaloDM_ID.h:102
CaloDmDescrManager::build_element
CaloDmDescrElement * build_element(const Identifier &cellId, const CaloDmRegion *myRegion)
Definition: CaloDmDescrManager.cxx:286
CaloDmRegion::m_side
int m_side
Definition: CaloDmDescrManager.h:97
CaloDmDescrManager::m_DmRegionVector
std::vector< CaloDmRegion * > m_DmRegionVector
Definition: CaloDmDescrManager.h:163
CaloDmDescrElement::r
float r() const
Definition: CaloDmDescrManager.h:61
CaloDmRegion::m_key
int m_key
Definition: CaloDmDescrManager.h:96
CaloDmDescrElement::dphi
float dphi() const
Definition: CaloDmDescrManager.h:60
CaloDmDescrManager::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: CaloDmDescrManager.h:157
CaloDmDescrElement::m_r
float m_r
Definition: CaloDmDescrManager.h:69
CaloDmRegion::m_eta_min
float m_eta_min
Definition: CaloDmDescrManager.h:100
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
StoreGateSvc.h
CaloDmRegion::m_CaloSampleNeighbours
std::vector< short > m_CaloSampleNeighbours
Definition: CaloDmDescrManager.h:106
CaloDmRegion::m_distance
float m_distance
Definition: CaloDmDescrManager.h:104
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
CaloDmRegion::m_neta_max
int m_neta_max
Definition: CaloDmDescrManager.h:98
CaloDmDescrElement::deta
float deta() const
Definition: CaloDmDescrManager.h:58
CaloDmDescrManager::get_dm_area
int get_dm_area(const Identifier &cellId) const
Definition: CaloDmDescrManager.cxx:147
ServiceHandle< StoreGateSvc >
CaloDmRegion::region_hash
const IdentifierHash region_hash() const
Definition: CaloDmDescrManager.h:112
Identifier
Definition: IdentifierFieldParser.cxx:14