Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CaloDetDescrElement.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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 {
45  if(is_tile()) {
46  // Tile
50  } else if (m_descriptor) {
51  // LAr
53  } else{
54  // MBTS
56  }
57 }
58 
60 = default;
61 
64 {
65  if(m_descriptor){
66  return (m_descriptor->get_calo_helper())->cell_id(calo_hash());
67  }
68  else{ // MBTS
69  return (customID());
70  }
71 }
72 
73 void
75 {
76  std::cout << std::endl << " CaloDetDescrElement print: "
77  << std::endl << std::endl;
78 
79  std::cout << "Eta = " << m_eta << std::endl;
80  std::cout << "Phi = " << m_phi << std::endl;
81  std::cout << "r = " << m_r << std::endl;
82 }
83 
85 {
86  return 0;
87 }
88 
90 {
91  if(m_descriptor){
92  return m_descriptor->is_lar_em();
93  }
94  return false;
95 }
96 
98 {
99  if(m_descriptor){
100  return m_descriptor->is_lar_em_barrel();
101  }
102  return false;
103 }
104 
106 {
107  if(m_descriptor){
108  return m_descriptor->is_lar_em_endcap();
109  }
110  return false;
111 }
112 
114 {
115  if(m_descriptor){
117  }
118  return false;
119 }
120 
122 {
123  if(m_descriptor){
125  }
126  return false;
127 }
128 
130 {
131  if(m_descriptor){
132  return m_descriptor->is_lar_hec();
133  }
134  return false;
135 }
136 
138 {
139  if(m_descriptor){
140  return m_descriptor->is_lar_fcal();
141  }
142  return false;
143 }
144 
145 void
147  const IdentifierHash onl2)
148 {
149  m_onl1 = onl1;
150  m_onl2 = onl2;
151 }
152 
154 {
155  m_x = m_x_raw;
156  m_y = m_y_raw;
157  m_z = m_z_raw;
158 
159  m_eta = m_eta_raw;
160  m_phi = m_phi_raw;
161  m_r = m_r_raw;
162 }
163 
165 {
166  return {};
167 }
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:113
CaloDetDescrElement::propagateRaw
void propagateRaw()
In test beam configurations force XXX=XXX_RAW.
Definition: CaloDetDescrElement.cxx:153
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:121
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:105
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:74
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:63
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
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:146
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:137
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:89
CaloDetDescrElement::is_lar_em_barrel
bool is_lar_em_barrel() const
cell belongs to EM barrel
Definition: CaloDetDescrElement.cxx:97
CaloDetDescrElement::getLayer
virtual int getLayer() const
cell layer
Definition: CaloDetDescrElement.cxx:84
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:164
CaloDetDescrElement::m_y
float m_y
cartesian coordinates : Y
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:302
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
CaloDetDescrElement::is_lar_hec
bool is_lar_hec() const
cell belongs to HEC
Definition: CaloDetDescrElement.cxx:129
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
Identifier
Definition: IdentifierFieldParser.cxx:14