ATLAS Offline Software
CaloDetDescrElement.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CaloDetDescr/CaloDetDescrElement.h"
6 
7 #include <iostream>
8 #include <iomanip>
9 #include <cmath>
10 
12  const IdentifierHash onl1,
13  const IdentifierHash onl2,
14  const CaloDetDescriptor* descriptor)
15  : m_descriptor(descriptor)
16  , m_caloHash(descriptor
17  ? IdentifierHash(subcaloHash + descriptor->caloCellMin())
18  : subcaloHash)
19  , m_eta(0.)
20  , m_phi(0.)
21  , m_sinTh(0.)
22  , m_cosTh(0.)
23  , m_deta(0.)
24  , m_dphi(0.)
25  , m_volume(0.)
26  , m_sinPhi(0.)
27  , m_cosPhi(0.)
28  , m_r(0.)
29  , m_eta_raw(0.)
30  , m_phi_raw(0.)
31  , m_r_raw(0.)
32  , m_dr(0.)
33  , m_x(0.)
34  , m_y(0.)
35  , m_z(0.)
36  , m_x_raw(0.)
37  , m_y_raw(0.)
38  , m_z_raw(0.)
39  , m_dx(0.)
40  , m_dy(0.)
41  , m_dz(0.)
42  , m_onl1(onl1)
43  , m_onl2(onl2)
44 {
46  if(is_tile()) {
47  // Tile
51  } else if (m_descriptor) {
52  // LAr
54  } else{
55  // MBTS
57  }
58 }
59 
61 = default;
62 
65 {
66  if(m_descriptor){
67  return (m_descriptor->get_calo_helper())->cell_id(calo_hash());
68  }
69  else{ // MBTS
70  return (customID());
71  }
72 }
73 
74 void
76 {
77  std::cout << std::endl << " CaloDetDescrElement print: "
78  << std::endl << std::endl;
79 
80  std::cout << "Eta = " << m_eta << std::endl;
81  std::cout << "Phi = " << m_phi << std::endl;
82  std::cout << "r = " << m_r << std::endl;
83 }
84 
86 {
87  return 0;
88 }
89 
91 {
92  if(m_descriptor){
93  return m_descriptor->is_lar_em();
94  }
95  return false;
96 }
97 
99 {
100  if(m_descriptor){
101  return m_descriptor->is_lar_em_barrel();
102  }
103  return false;
104 }
105 
107 {
108  if(m_descriptor){
109  return m_descriptor->is_lar_em_endcap();
110  }
111  return false;
112 }
113 
115 {
116  if(m_descriptor){
118  }
119  return false;
120 }
121 
123 {
124  if(m_descriptor){
126  }
127  return false;
128 }
129 
131 {
132  if(m_descriptor){
133  return m_descriptor->is_lar_hec();
134  }
135  return false;
136 }
137 
139 {
140  if(m_descriptor){
141  return m_descriptor->is_lar_fcal();
142  }
143  return false;
144 }
145 
146 void
148  const IdentifierHash onl2)
149 {
150  m_onl1 = onl1;
151  m_onl2 = onl2;
152 }
153 
155 {
156  m_x = m_x_raw;
157  m_y = m_y_raw;
158  m_z = m_z_raw;
159 
160  m_eta = m_eta_raw;
161  m_phi = m_phi_raw;
162  m_r = m_r_raw;
163 }
164 
166 {
167  return {};
168 }
CaloDetDescrElement::onl2
IdentifierHash onl2() const
cell online identifier 2
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:408
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloDetDescrElement::is_lar_em_endcap_inner
bool is_lar_em_endcap_inner() const
cell belongs to the inner wheel of EM end cap
Definition: CaloDetDescrElement.cxx:114
CaloDetDescrElement::propagateRaw
void propagateRaw()
In test beam configurations force XXX=XXX_RAW.
Definition: CaloDetDescrElement.cxx:154
CaloDetDescriptor::is_lar_fcal
bool is_lar_fcal() const
descriptor belongs to FCAL
Definition: CaloDetDescriptor.h:491
CaloDetDescrElement::m_z_raw
float m_z_raw
cartesian coordinates : Z raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:314
CaloDetDescrElement::is_lar_em_endcap_outer
bool is_lar_em_endcap_outer() const
cell belongs to the outer wheel of EM end cap
Definition: CaloDetDescrElement.cxx:122
CaloDetDescrElement::m_eta_raw
float m_eta_raw
cylindric coordinates : eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:286
CaloDetDescriptor::is_lar_hec
bool is_lar_hec() const
descriptor belongs to HEC
Definition: CaloDetDescriptor.h:486
CaloDetDescrElement::m_phi_raw
float m_phi_raw
cylindric coordinates : phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:289
CaloDetDescrElement::is_lar_em_endcap
bool is_lar_em_endcap() const
cell belongs to EM end cap
Definition: CaloDetDescrElement.cxx:106
CaloDetDescrElement::m_phi
float m_phi
cylindric coordinates : phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:252
CaloDetDescriptor::is_lar_em_endcap_inner
bool is_lar_em_endcap_inner() const
descriptor belongs to the inner wheel of EM end cap
Definition: CaloDetDescriptor.h:476
CaloDetDescrElement::print
virtual void print() const
print element contents
Definition: CaloDetDescrElement.cxx:75
CaloDetDescrElement::m_z
float m_z
cartesian coordinates : Z
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:305
CaloDetDescrElement::onl1
IdentifierHash onl1() const
cell online identifier 1
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:404
CaloDetDescriptor::get_calo_helper
const CaloCell_Base_ID * get_calo_helper() const
get Calo Cell ID helper
Definition: CaloDetDescriptor.h:523
CaloDetDescrElement::identify
Identifier identify() const override final
cell identifier
Definition: CaloDetDescrElement.cxx:64
CaloDetDescrElement::m_sample
CaloCell_ID::CaloSample m_sample
@bried the sampling for this element
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:327
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
CaloDetDescriptor::is_lar_em_endcap_outer
bool is_lar_em_endcap_outer() const
descriptor belongs to the outer wheel of EM end cap
Definition: CaloDetDescriptor.h:481
CaloCell_ID::CaloSample
CaloSampling::CaloSample CaloSample
Definition: CaloCell_ID.h:53
CaloDetDescrElement::m_y_raw
float m_y_raw
cartesian coordinates : Y raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:311
CaloDetDescrElement::m_x_raw
float m_x_raw
cartesian coordinates : X raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:308
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
CaloDetDescrElement::m_descriptor
const CaloDetDescriptor * m_descriptor
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:243
CaloDetDescrElement::m_onl1
IdentifierHash m_onl1
Tiles need 2 online hashed id.
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:331
CaloDetDescrElement::m_r_raw
float m_r_raw
cylindric coordinates : r_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:292
CaloDetDescrElement::set_online
void set_online(const IdentifierHash onl1, const IdentifierHash onl2)
set cell online identifiers (Tile)
Definition: CaloDetDescrElement.cxx:147
CaloDetDescrElement::m_r
float m_r
cylindric coordinates : r
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:283
CaloDetDescrElement::m_onl2
IdentifierHash m_onl2
Tiles need 2 online hashed id.
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:334
CaloDetDescriptor::is_lar_em
bool is_lar_em() const
descriptor belongs to EM calorimeter
Definition: CaloDetDescriptor.h:461
Tile_Base_ID::sampling
int sampling(const Identifier &id) const
Definition: Tile_Base_ID.h:164
CaloDetDescriptor::is_lar_em_barrel
bool is_lar_em_barrel() const
descriptor belongs to EM barrel
Definition: CaloDetDescriptor.h:466
CaloDetDescrElement::is_lar_fcal
bool is_lar_fcal() const
cell belongs to FCAL
Definition: CaloDetDescrElement.cxx:138
CaloDetDescriptor::getSampling
CaloCell_ID::CaloSample getSampling(IdentifierHash onecalo_hash) const
get sampling
Definition: CaloDetDescriptor.cxx:185
CaloDetDescrElement::is_tile
bool is_tile() const
cell belongs to Tile
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
CaloDetDescriptor::is_lar_em_endcap
bool is_lar_em_endcap() const
descriptor belongs to EM end cap
Definition: CaloDetDescriptor.h:471
CaloDetDescrElement::m_x
float m_x
cartesian coordinates : X
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:299
CaloDetDescrElement::is_lar_em
bool is_lar_em() const
cell belongs to EM calorimeter
Definition: CaloDetDescrElement.cxx:90
CaloDetDescrElement::is_lar_em_barrel
bool is_lar_em_barrel() const
cell belongs to EM barrel
Definition: CaloDetDescrElement.cxx:98
CaloDetDescrElement::getLayer
virtual int getLayer() const
cell layer
Definition: CaloDetDescrElement.cxx:85
CaloDetDescriptor
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
Definition: CaloDetDescriptor.h:58
CaloDetDescrElement::customID
virtual Identifier customID() const
Definition: CaloDetDescrElement.cxx:165
CaloDetDescrElement::m_y
float m_y
cartesian coordinates : Y
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:302
IdentifierHash
Definition: IdentifierHash.h:38
CaloDetDescrElement::is_lar_hec
bool is_lar_hec() const
cell belongs to HEC
Definition: CaloDetDescrElement.cxx:130
CaloDetDescrElement::m_eta
float m_eta
cylindric coordinates : eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:249
CaloCell_Base_ID::tile_idHelper
const Tile_Base_ID * tile_idHelper() const
access to Tile idHelper
Definition: CaloCell_Base_ID.h:355
CaloDetDescrElement::CaloDetDescrElement
CaloDetDescrElement()=delete
Constructor, hidden.
CaloDetDescrElement::~CaloDetDescrElement
virtual ~CaloDetDescrElement()
virtual destructor