ATLAS Offline Software
Loading...
Searching...
No Matches
CaloDetDescriptor Class Reference

This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the calo cells and reduce the size of the CaloDetDescrElements by caching information they have in common. More...

#include <CaloDetDescriptor.h>

Inheritance diagram for CaloDetDescriptor:
Collaboration diagram for CaloDetDescriptor:

Public Member Functions

 CaloDetDescriptor (const Identifier &id, const AtlasDetectorID *helper, const CaloCell_Base_ID *calo_helper, CaloCell_ID::CaloSample sample=CaloCell_ID::Unknown, int layer=CaloCell_ID::NOT_VALID)
 Constructor.
virtual ~CaloDetDescriptor ()
 virtual detructor
virtual void print () const
 print the contents
void dump (std::ostream &os) const
 dump contents to a stream.
void set_n_calo_depth (int n_calo_depth)
 set number of calo depths
void set_depth_in (std::vector< double > &calo_depth)
 set vector of in depths
void set_depth_out (std::vector< double > &calo_depth)
 set vector of out depths
bool is_lar_em () const
 descriptor belongs to EM calorimeter
bool is_lar_em_barrel () const
 descriptor belongs to EM barrel
bool is_lar_em_endcap () const
 descriptor belongs to EM end cap
bool is_lar_em_endcap_inner () const
 descriptor belongs to the inner wheel of EM end cap
bool is_lar_em_endcap_outer () const
 descriptor belongs to the outer wheel of EM end cap
bool is_lar_hec () const
 descriptor belongs to HEC
bool is_lar_fcal () const
 descriptor belongs to FCAL
bool is_tile () const
 descriptor belongs to Tile
CaloCell_ID::CaloSample getSampling (IdentifierHash onecalo_hash) const
 get sampling
CaloCell_ID::CaloSample getSampling () const
 get sampling returns the cached CaloSample, if the descriptor contains more than one sampling, it only returns the first sampling.
CaloCell_ID::SUBCALO getSubCalo () const
 get subcalo
Identifier identify () const override final
 get region identifier
IdentifierHash identifyHash () const override final
 get hash identifier for the region
IdentifierHash calo_hash () const
 get calo hash
IdentifierHash subcalo_hash () const
 get subcalo hash
const CaloCell_Base_IDget_calo_helper () const
 get Calo Cell ID helper
int layer () const
 get layer
IdentifierHash caloCellMin () const
 minimal hash identifier for calo cells in the region
int calo_sign () const
 'ideal' geometry: calo sign
double calo_z_min () const
 'ideal' geometry: z minimal
double calo_z_max () const
 'ideal' geometry: z maximal
double calo_eta_min () const
 'ideal' geometry: eta minimal
double calo_eta_max () const
 'ideal' geometry: eta maximal
double calo_phi_min () const
 'ideal' geometry: phi minimal
double calo_phi_max () const
 'ideal' geometry: phi maximal
double calo_r_min () const
 'ideal' geometry: r minimal
double calo_r_max () const
 'ideal' geometry: r maximal
int n_calo_depth () const
 number of calo depths
void get_depth_in (std::vector< double > &calo_depth) const
 get vector of in depths
void get_depth_out (std::vector< double > &calo_depth) const
 get vector of out depths
double deta () const
 delta eta
double dphi () const
 delta phi
int n_eta () const
 eta granularity
int n_phi () const
 phi granularity
bool get_cylinder_surface (Amg::Transform3D &htrans, double &radius, double &hphi, double &hlength, double &depth) const
 this will be the closest radius of this region
bool get_disk_surface (Amg::Transform3D &htrans, double &z, double &rmin, double &rmax, double &hphisec, double &depth) const
 (for Trk::Surface)
bool is_in (double eta_min, double eta_max, double phi_min, double phi_max) const
 check overlap with a given zone in eta and phi (for LAr only)
int eta_channel (double eta) const
 channel number for a given eta/phi (if outside returns -1).
int phi_channel (double phi) const
 channel number for a given eta/phi (if outside returns -1) Should not be used for FCAL
int eta_channel_raw (double eta) const
 channel number for a given eta/phi raw (if outside returns -1).
int phi_channel_raw (double phi) const
 channel number for a given eta/phi raw (if outside returns -1) Should not be used for FCAL
double reg_min () const
 eta min and max once misaligned
double reg_max () const
 eta min and max once misaligned
double lar_eta_min () const
 minimal Eta for LAr region
double lar_phi_min () const
 minimal Phi for LAr region
void setCaloEtaMin (double eta_min)
 Set Eta Min.
void setCaloEtaMax (double eta_max)
 Set Eta Max.
void setCaloPhiMin (double phi_min)
 Set Phi Min.
void setCaloPhiMax (double phi_max)
 Set Phi Max.
void setCaloZMin (double z_min)
 Set Z Min.
void setCaloZMax (double z_max)
 Set Z Max.
void setCaloRMin (double r_min)
 Set R Min.
void setCaloRMax (double r_max)
 Set R Max.
void setLArRegMin (double reg_min)
 Set LAr Region Eta Min.
void setLArRegMax (double reg_max)
 Set LAr Region Eta Max.
void setLArPhiMin (double phi_min)
 Set LAr Region Phi Min.
void setLArEtaMin (double eta_min)
 Set LAr Region Phi Max.
void set_eta_phi_granularity (int neta, double deta, int nphi, double dphi)
 Set Phi granularity.
const Amg::Transform3Dtransform () const
 Get the current transformation matrix.
void set_transform (const Amg::Transform3D &transform)
 Set the transformation matrix.
virtual const IdHelpergetHelper () const

Protected Attributes

double m_calo_eta_min
 minimal Eta (to be defined in the derived classes)
double m_calo_eta_max
 maximal Eta (to be defined in the derived classes)
double m_calo_phi_min
 minimal Phi (to be defined in the derived classes)
double m_calo_phi_max
 maximal Phi (to be defined in the derived classes)
double m_calo_r_min
 minimal R (to be defined in the derived classes)
double m_calo_r_max
 maximal R (to be defined in the derived classes)
double m_calo_z_min
 minimal Z (to be defined in the derived classes)
double m_calo_z_max
 maximal Z (to be defined in the derived classes)
int m_n_calo_depth
 number of depths
std::vector< double > m_calo_depth_in
 in depths
std::vector< double > m_calo_depth_out
 out depths
Amg::Transform3D m_transform
 misalignment transformation
double m_lar_reg_min
 minimal Abs Eta for LAr region
double m_lar_reg_max
 maximal Abs Eta for LAr region
double m_lar_phi_min
 minimal Phi for LAr region
double m_lar_eta_min
 minimal Eta for LAr region
int m_etachan_min
 minimal Eta channel number

Private Attributes

const AtlasDetectorIDm_helper
 Atlas Detector ID helper.
const CaloCell_Base_IDm_calo_helper
 Calo Cell ID helper.
Identifier m_id
 Region identifier.
bool m_is_lar_em
 descriptor belongs to EM calorimeter
bool m_is_lar_em_barrel
 descriptor belongs to EM barrel
bool m_is_lar_em_endcap
 descriptor belongs to EM end cap
bool m_is_lar_em_endcap_inner
 descriptor belongs to the inner wheel of EM end cap
bool m_is_lar_em_endcap_outer
 descriptor belongs to the outer wheel of EM end cap
bool m_is_lar_hec
 descriptor belongs to HEC
bool m_is_lar_fcal
 descriptor belongs to FCAL
bool m_is_tile
 descriptor belongs to Tile
int m_calo_sign
 calo sign
int m_layer
 layer
CaloCell_ID::CaloSample m_calo_sampl
 Calo Sample.
CaloCell_ID::SUBCALO m_calo_num
 Subcalo.
IdentifierHash m_calocell_min
 minimal hash id of region cells
double m_lar_deta
 delta eta (LAr)
double m_lar_dphi
 delta phi (LAr)
int m_lar_n_eta
 eta granularity (LAr)
int m_lar_n_phi
 phi granularity (LAr)

Detailed Description

This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the calo cells and reduce the size of the CaloDetDescrElements by caching information they have in common.

There is 1 Descriptor per region of homogeneous grannularity.

1) Phi convention :

The calorimeter convention is to start cell counting at phi=0 and increment up to 2pi ==> the old 0 to 2pi convention is kept internally to Descriptors, and official Atlas one (pi,pi) applied to the CaloDetDescrElements and all methods concerning channels.

2) Data members :

All the m_calo_xxx numbers are "ideal", i.e. correspond to a HepGeom::Transform3D(0.,0.,0.,0.,0.,0.) and are NOT recalculated when a different one is set.

WARNING : eta is always>0 and one has to multiply it by calo_sign()

3) Coordinate systems : we (unfortunately) need 3 on them !!!

  cylindric for EMB:   eta,phi,cylinder-radius

ec_cylindric for EMEC and HEC: eta, phi, z cartesian for FCAL: x,y,z

Coordinates are kept coherent: set_cylindric re-computes the cartesian coordinates and vice-versa.

Definition at line 57 of file CaloDetDescriptor.h.

Constructor & Destructor Documentation

◆ CaloDetDescriptor()

CaloDetDescriptor::CaloDetDescriptor ( const Identifier & id,
const AtlasDetectorID * helper,
const CaloCell_Base_ID * calo_helper,
CaloCell_ID::CaloSample sample = CaloCell_ID::Unknown,
int layer = CaloCell_ID::NOT_VALID )

Constructor.

Parameters
id{IN] region identifier
helper[IN] Atlas Detector ID helper
calo_helper[IN] Calo Cell ID helper
sample[IN] sample
layer[IN] layer

Definition at line 12 of file CaloDetDescriptor.cxx.

17 : m_id (id),
20{
22 m_calo_helper=calo_helper;
23
24 // --m_is_xxx
25 m_is_lar_em = m_calo_helper->is_em(id);
26 m_is_lar_em_barrel = m_calo_helper->is_em_barrel(id);
27 m_is_lar_em_endcap = m_calo_helper->is_em_endcap(id);
28 m_is_lar_em_endcap_inner = m_calo_helper->is_em_endcap_inner(id);
29 m_is_lar_em_endcap_outer = m_calo_helper->is_em_endcap_outer(id);
30 m_is_lar_hec = m_calo_helper->is_hec(id);
31 m_is_lar_fcal = m_calo_helper->is_fcal(id);
32 m_is_tile = m_calo_helper->is_tile(id);
33
34 // -- m_calo_sign
35 if (m_is_tile)
36 m_calo_sign = m_calo_helper->side(id);
37 else {
38 int posneg = m_calo_helper->pos_neg(id);
39 if (posneg == 0)
40 m_calo_sign = 0;
41 else
42 m_calo_sign = (int)(posneg/std::abs(posneg));
43 }
44
45 // -- m_layer
47
48 // -- m_calo_sampl
49 if(m_is_tile)
50 {
51 if(sample != CaloCell_ID::Unknown)
52 {
54 }
55 else
56 {
57 const Tile_Base_ID* tileid = static_cast<const Tile_Base_ID*>(m_helper);
58 if(tileid->is_tile_barrel(id))
59 m_calo_sampl = CaloCell_ID::TileBar0;
60 else if(tileid->is_tile_extbarrel(id))
61 m_calo_sampl = CaloCell_ID::TileExt0;
62 else if(tileid->is_tile_gap(id))
64 ((int)CaloCell_ID::TileGap1 - 1);
65 else
66 m_calo_sampl = CaloCell_ID::Unknown;
67 }
68 }
69 else
71
72 // -- m_calo_num
74
75 // -- m_calocell_min
76 IdentifierHash junk;
77 m_calo_helper->calo_cell_hash_range(id,m_calocell_min,junk);
78
79 // -- m_lar_deta, m_lar_n_eta (phi)
80 m_lar_deta = (double) m_calo_helper->etaGranularity(id);
81 m_lar_dphi = (double) m_calo_helper->phiGranularity(id);
82 m_lar_n_eta = m_calo_helper->eta_max(id) - m_calo_helper->eta_min(id) + 1;
83 m_lar_n_phi = m_calo_helper->phi_max(id) - m_calo_helper->phi_min(id) + 1;
84
85 // To be initialized in the derived classes:
86 m_calo_phi_min = 0.;
87 m_calo_phi_max = 0.;
88 m_calo_r_min = 0.;
89 m_calo_r_max = 0.;
90 m_calo_z_min = 0.;
91 m_calo_z_max = 0.;
92
93 m_lar_reg_min = 999999.;
94 m_lar_reg_max = -999999.;
95 m_lar_phi_min = 999999.;
96 m_lar_eta_min = 0.;
97
99 m_calo_depth_in.resize(0);
100 m_calo_depth_out.resize(0);
101
102 // Eigen doesn't default-initialize things.
103 m_transform.setIdentity();
104
105 m_etachan_min = m_calo_helper->eta_min(m_id);
106}
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
double m_calo_eta_max
maximal Eta (to be defined in the derived classes)
double m_lar_eta_min
minimal Eta for LAr region
bool m_is_lar_em_endcap_outer
descriptor belongs to the outer wheel of EM end cap
double m_calo_r_max
maximal R (to be defined in the derived classes)
std::vector< double > m_calo_depth_in
in depths
int m_lar_n_eta
eta granularity (LAr)
int layer() const
get layer
double m_calo_phi_min
minimal Phi (to be defined in the derived classes)
const CaloCell_Base_ID * m_calo_helper
Calo Cell ID helper.
double m_calo_phi_max
maximal Phi (to be defined in the derived classes)
double m_lar_phi_min
minimal Phi for LAr region
double m_lar_reg_max
maximal Abs Eta for LAr region
std::vector< double > m_calo_depth_out
out depths
IdentifierHash m_calocell_min
minimal hash id of region cells
double m_calo_eta_min
minimal Eta (to be defined in the derived classes)
double m_calo_z_max
maximal Z (to be defined in the derived classes)
CaloCell_ID::CaloSample m_calo_sampl
Calo Sample.
CaloCell_ID::SUBCALO m_calo_num
Subcalo.
int m_n_calo_depth
number of depths
bool m_is_lar_hec
descriptor belongs to HEC
double m_lar_dphi
delta phi (LAr)
bool m_is_tile
descriptor belongs to Tile
bool m_is_lar_em_barrel
descriptor belongs to EM barrel
bool m_is_lar_em_endcap
descriptor belongs to EM end cap
Identifier m_id
Region identifier.
bool m_is_lar_em
descriptor belongs to EM calorimeter
double m_lar_deta
delta eta (LAr)
double m_calo_z_min
minimal Z (to be defined in the derived classes)
bool m_is_lar_em_endcap_inner
descriptor belongs to the inner wheel of EM end cap
Amg::Transform3D m_transform
misalignment transformation
const AtlasDetectorID * m_helper
Atlas Detector ID helper.
int m_etachan_min
minimal Eta channel number
int m_lar_n_phi
phi granularity (LAr)
double m_lar_reg_min
minimal Abs Eta for LAr region
bool m_is_lar_fcal
descriptor belongs to FCAL
double m_calo_r_min
minimal R (to be defined in the derived classes)
bool is_tile_barrel(const Identifier &id) const
Test of an Identifier to see if it belongs to a particular part of the calorimeter.
bool is_tile_extbarrel(const Identifier &id) const
bool is_tile_gap(const Identifier &id) const

◆ ~CaloDetDescriptor()

CaloDetDescriptor::~CaloDetDescriptor ( )
virtualdefault

virtual detructor

Member Function Documentation

◆ calo_eta_max()

double CaloDetDescriptor::calo_eta_max ( ) const
inline

'ideal' geometry: eta maximal

Definition at line 563 of file CaloDetDescriptor.h.

564{
565 return m_calo_eta_max;
566}

◆ calo_eta_min()

double CaloDetDescriptor::calo_eta_min ( ) const
inline

'ideal' geometry: eta minimal

Definition at line 558 of file CaloDetDescriptor.h.

559{
560 return m_calo_eta_min;
561}

◆ calo_hash()

IdentifierHash CaloDetDescriptor::calo_hash ( ) const
inline

get calo hash

Definition at line 512 of file CaloDetDescriptor.h.

513{
514 return m_calo_helper->calo_region_hash(m_id);
515}

◆ calo_phi_max()

double CaloDetDescriptor::calo_phi_max ( ) const
inline

'ideal' geometry: phi maximal

Definition at line 573 of file CaloDetDescriptor.h.

574{
575 return m_calo_phi_max;
576}

◆ calo_phi_min()

double CaloDetDescriptor::calo_phi_min ( ) const
inline

'ideal' geometry: phi minimal

Definition at line 568 of file CaloDetDescriptor.h.

569{
570 return m_calo_phi_min;
571}

◆ calo_r_max()

double CaloDetDescriptor::calo_r_max ( ) const
inline

'ideal' geometry: r maximal

Definition at line 583 of file CaloDetDescriptor.h.

584{
585 return m_calo_r_max;
586}

◆ calo_r_min()

double CaloDetDescriptor::calo_r_min ( ) const
inline

'ideal' geometry: r minimal

Definition at line 578 of file CaloDetDescriptor.h.

579{
580 return m_calo_r_min;
581}

◆ calo_sign()

int CaloDetDescriptor::calo_sign ( ) const
inline

'ideal' geometry: calo sign

Definition at line 543 of file CaloDetDescriptor.h.

544{
545 return m_calo_sign;
546}

◆ calo_z_max()

double CaloDetDescriptor::calo_z_max ( ) const
inline

'ideal' geometry: z maximal

Definition at line 553 of file CaloDetDescriptor.h.

554{
555 return m_calo_z_max;
556}

◆ calo_z_min()

double CaloDetDescriptor::calo_z_min ( ) const
inline

'ideal' geometry: z minimal

Definition at line 548 of file CaloDetDescriptor.h.

549{
550 return m_calo_z_min;
551}

◆ caloCellMin()

IdentifierHash CaloDetDescriptor::caloCellMin ( ) const
inline

minimal hash identifier for calo cells in the region

Definition at line 538 of file CaloDetDescriptor.h.

539{
540 return m_calocell_min;
541}

◆ deta()

double CaloDetDescriptor::deta ( ) const
inline

delta eta

Definition at line 588 of file CaloDetDescriptor.h.

589{
590 return m_lar_deta;
591}

◆ dphi()

double CaloDetDescriptor::dphi ( ) const
inline

delta phi

Definition at line 593 of file CaloDetDescriptor.h.

594{
595 return m_lar_dphi;
596}

◆ dump()

void CaloDetDescriptor::dump ( std::ostream & os) const

dump contents to a stream.

Definition at line 116 of file CaloDetDescriptor.cxx.

117{
118 os << " CaloDetDescriptor print: \n\n";
119
120 os << m_calo_helper->print_to_string(m_id);
121
122 if(m_calo_helper->is_em_endcap(m_id))
123 os << " LAr EM ENDCAP: " << (int) m_calo_sampl << " " << (int) m_calo_num << "\n";
124 else if(m_calo_helper->is_em_barrel(m_id))
125 os << " LAr EM BARREL: " << (int) m_calo_sampl << " " << (int) m_calo_num << "\n";
126 else if(m_calo_helper->is_lar_hec(m_id))
127 os << " LAr HEC: " << (int) m_calo_sampl << " " << (int) m_calo_num << "\n";
128 else if(m_calo_helper->is_lar_fcal(m_id))
129 os << " LAr Fcal: " << (int) m_calo_sampl << " " << (int) m_calo_num << "\n";
130 else
131 {
132 if(!m_is_tile) os << " UNKNOW LAr decriptor !!!! \n";
133 }
134
135 os << "Ideal values before alignment :\n";
136 os << " eta_min eta_max deta n_eta phi_min phi_max dphi n_phi \n";
137 os << std::setw(9) << std::setprecision(4) << calo_eta_min() << " "
138 << std::setw(9) << std::setw(9) << std::setprecision(4) << calo_eta_max() << " "
139 << std::setw(9) << std::setprecision(4) << deta() << " "
140 << std::setw(9) << std::setprecision(4) << n_eta() << " "
141 << std::setw(9) << std::setprecision(4) << calo_phi_min() << " "
142 << std::setw(9) << std::setprecision(4) << calo_phi_max() << " "
143 << std::setw(9) << std::setprecision(4) << dphi() << " "
144 << std::setw(9) << std::setprecision(4) << n_phi() << "\n";
145
146 os << " r_min z_min r_max z_max sign\n";
147
148 os << std::setprecision(4) << calo_r_min() << " "
149 << std::setprecision(4) << calo_r_max() << " "
150 << std::setprecision(4) << calo_z_min() << " "
151 << std::setprecision(4) << calo_z_max() << " "
152 << std::setprecision(1) << calo_sign() << "\n";
153
154 Amg::RotationMatrix3D rot= m_transform.rotation ();
155
156 //calculate euler angles
157 double theta1, psi1, phi1;
158 if (std::abs(std::abs(rot(2,1))-1.0f) > 0.00001)
159 {
160 theta1 = -std::asin(rot(2,0));
161 psi1 = std::atan2(rot(2,1)/std::cos(theta1), rot(2,2)/std::cos(theta1));
162 phi1 = std::atan2(rot(1,0)/std::cos(theta1), rot(0,0)/std::cos(theta1));
163 } else {
164 phi1 = 0;
165 if(rot(2,0) == -1){
166 theta1 = M_PI*0.5;
167 psi1 = std::atan2(rot(0,1),rot(0,2));
168 } else {
169 theta1 = -(M_PI * 0.5);
170 psi1 = std::atan2(-rot(0,1), -rot(0,2));
171 }
172 }
173
174 os << "\nEigenTransform phi,theta,psi,x,y,z: "
175 << phi1 << " " << theta1 << " "
176 << psi1 << " " << m_transform(0,3) << " "
177 << m_transform(1,3) << " " << m_transform(2,3) << "\n\n";
178
179 os << std::setprecision(4) << "in real world (can be <0)"
180 << m_lar_reg_min << " " << m_lar_reg_max << " "
181 << m_lar_phi_min << " " << m_lar_eta_min << "\n\n";
182}
#define M_PI
double calo_phi_max() const
'ideal' geometry: phi maximal
double deta() const
delta eta
int n_phi() const
phi granularity
double calo_eta_min() const
'ideal' geometry: eta minimal
double dphi() const
delta phi
double calo_z_min() const
'ideal' geometry: z minimal
double calo_z_max() const
'ideal' geometry: z maximal
double calo_r_min() const
'ideal' geometry: r minimal
double calo_r_max() const
'ideal' geometry: r maximal
double calo_eta_max() const
'ideal' geometry: eta maximal
double calo_phi_min() const
'ideal' geometry: phi minimal
int calo_sign() const
'ideal' geometry: calo sign
int n_eta() const
eta granularity
Eigen::Matrix< double, 3, 3 > RotationMatrix3D

◆ eta_channel()

int CaloDetDescriptor::eta_channel ( double eta) const

channel number for a given eta/phi (if outside returns -1).

Should not be used for FCAL

Definition at line 260 of file CaloDetDescriptor.cxx.

261{
262 int result = -1;
263 // if(m_calo_sign*eta<0) return result;
265
266
267 if(std::abs(eta) + 0.00001 >= m_lar_eta_min)
268 result = (int)((std::abs(eta) - m_lar_eta_min)/m_lar_deta) + m_etachan_min;
269
271
272 return result;
273}
Scalar eta() const
pseudorapidity method

◆ eta_channel_raw()

int CaloDetDescriptor::eta_channel_raw ( double eta) const

channel number for a given eta/phi raw (if outside returns -1).

Should not be used for FCAL

Definition at line 290 of file CaloDetDescriptor.cxx.

291{
292 int result = -1;
295
296
297 if(std::abs(eta) + 0.00001 >= m_calo_eta_min)
298 result = (int)((std::abs(eta) - m_calo_eta_min)/m_lar_deta);
299
300 if(result>=(m_lar_n_eta+m_etachan_min)) result = m_lar_n_eta -1;
301
302 return result;
303}

◆ get_calo_helper()

const CaloCell_Base_ID * CaloDetDescriptor::get_calo_helper ( ) const
inline

get Calo Cell ID helper

Definition at line 523 of file CaloDetDescriptor.h.

524{
525 return m_calo_helper;
526}

◆ get_cylinder_surface()

bool CaloDetDescriptor::get_cylinder_surface ( Amg::Transform3D & htrans,
double & radius,
double & hphi,
double & hlength,
double & depth ) const

this will be the closest radius of this region

this will be the closest radius of this region (for Trk::Surface)

Definition at line 199 of file CaloDetDescriptor.cxx.

204{
205 // For cylinders : htrans is the displacement compared to a cylinder centered along the
206 // z axis
207
208 htrans = m_transform;
210 hlength = m_calo_z_max;
211 hphi = 0.5*m_lar_dphi*m_lar_n_phi;
213
214 if (m_is_tile)
215 {
216 // need to shift tile cylinders (half-barrels, ext.barrels and ITC)
217 hlength = m_calo_z_max-m_calo_z_min;
218 double z = m_calo_sign*(m_calo_z_min + m_calo_z_max)/2.;
220 htrans = (htrans) * vec;
221 }
222
223 return true;
224}
std::vector< size_t > vec
#define z
std::string depth
tag string for intendation
Definition fastadd.cxx:46
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D

◆ get_depth_in()

void CaloDetDescriptor::get_depth_in ( std::vector< double > & calo_depth) const

get vector of in depths

Parameters
calo_depth[OUT] vector of in depths

Definition at line 325 of file CaloDetDescriptor.cxx.

326{
327 calo_depth.resize(m_n_calo_depth);
328 for (int i=0; i<m_n_calo_depth; i++)
329 calo_depth [i] = m_calo_depth_in[i];
330}

◆ get_depth_out()

void CaloDetDescriptor::get_depth_out ( std::vector< double > & calo_depth) const

get vector of out depths

Parameters
calo_depth[OUT] vector of out depths

Definition at line 332 of file CaloDetDescriptor.cxx.

333{
334 calo_depth.resize(m_n_calo_depth);
335 for (int i=0; i<m_n_calo_depth; i++)
336 calo_depth [i] = m_calo_depth_out[i];
337}

◆ get_disk_surface()

bool CaloDetDescriptor::get_disk_surface ( Amg::Transform3D & htrans,
double & z,
double & rmin,
double & rmax,
double & hphisec,
double & depth ) const

(for Trk::Surface)

Definition at line 226 of file CaloDetDescriptor.cxx.

232{
233 // For disks : htrans is the position of the entrance surface, i.e. the alignment
234 // heptransform + a z shift to put the entrance at the right z.
235
236 htrans = m_transform;
239
240 Amg::Translation3D vec(0.,0.,z);
241 htrans = (htrans) * vec;
242
243 rmin = m_calo_r_min;
244 rmax = m_calo_r_max;
245 hphisec = 0.5*m_lar_dphi*m_lar_n_phi;
246
247 return true;
248}

◆ getHelper()

const IdHelper * Identifiable::getHelper ( ) const
virtualinherited

Definition at line 18 of file Identifiable.cxx.

18 {
19 return (nullptr);
20}

◆ getSampling() [1/2]

CaloCell_ID::CaloSample CaloDetDescriptor::getSampling ( ) const
inline

get sampling returns the cached CaloSample, if the descriptor contains more than one sampling, it only returns the first sampling.

Definition at line 134 of file CaloDetDescriptor.h.

135 { return m_calo_sampl ;
136 }

◆ getSampling() [2/2]

CaloCell_ID::CaloSample CaloDetDescriptor::getSampling ( IdentifierHash onecalo_hash) const

get sampling

Parameters
onecalo_hash[IN] hash identifier if the descriptor contains more than one sampling, add offset calculated from hash id.

Definition at line 185 of file CaloDetDescriptor.cxx.

186{
188 {
189 const Tile_Base_ID* tileid = reinterpret_cast<const Tile_Base_ID*> (m_helper);
190 Identifier id = tileid->cell_id (onecalo_hash);
191 return (CaloCell_ID::CaloSample) (m_calo_sampl + tileid->sample(id));
192 }
193 else
194 {
195 return m_calo_sampl;
196 }
197}
int sample(const Identifier &id) const
Identifier cell_id(const Identifier &any_id) const

◆ getSubCalo()

CaloCell_Base_ID::SUBCALO CaloDetDescriptor::getSubCalo ( ) const
inline

get subcalo

Definition at line 533 of file CaloDetDescriptor.h.

534{
535 return m_calo_num;
536}

◆ identify()

Identifier CaloDetDescriptor::identify ( ) const
inlinefinaloverridevirtual

get region identifier

Implements Identifiable.

Definition at line 501 of file CaloDetDescriptor.h.

502{
503 return m_id;
504}

◆ identifyHash()

IdentifierHash CaloDetDescriptor::identifyHash ( ) const
inlinefinaloverridevirtual

get hash identifier for the region

Reimplemented from Identifiable.

Definition at line 506 of file CaloDetDescriptor.h.

507{
508 int num;
509 return m_calo_helper->subcalo_region_hash(m_id, num);
510}

◆ is_in()

bool CaloDetDescriptor::is_in ( double eta_min,
double eta_max,
double phi_min,
double phi_max ) const

check overlap with a given zone in eta and phi (for LAr only)

Parameters
eta_min[IN] lower eta boundary of the zone
eta_max[IN] higher eta boundary of the zone
phi_min[IN] lower phi boundary of the zone
phi_max[IN] higher phi boundary of the zone

Definition at line 250 of file CaloDetDescriptor.cxx.

254{
255 bool result = (eta_min + 0.00001 <= m_lar_reg_max &&
256 eta_max >= m_lar_reg_min + 0.00001);
257 return result;
258}

◆ is_lar_em()

bool CaloDetDescriptor::is_lar_em ( ) const
inline

descriptor belongs to EM calorimeter

Definition at line 461 of file CaloDetDescriptor.h.

462{
463 return m_is_lar_em;
464}

◆ is_lar_em_barrel()

bool CaloDetDescriptor::is_lar_em_barrel ( ) const
inline

descriptor belongs to EM barrel

Definition at line 466 of file CaloDetDescriptor.h.

467{
468 return m_is_lar_em_barrel;
469}

◆ is_lar_em_endcap()

bool CaloDetDescriptor::is_lar_em_endcap ( ) const
inline

descriptor belongs to EM end cap

Definition at line 471 of file CaloDetDescriptor.h.

472{
473 return m_is_lar_em_endcap;
474}

◆ is_lar_em_endcap_inner()

bool CaloDetDescriptor::is_lar_em_endcap_inner ( ) const
inline

descriptor belongs to the inner wheel of EM end cap

Definition at line 476 of file CaloDetDescriptor.h.

477{
479}

◆ is_lar_em_endcap_outer()

bool CaloDetDescriptor::is_lar_em_endcap_outer ( ) const
inline

descriptor belongs to the outer wheel of EM end cap

Definition at line 481 of file CaloDetDescriptor.h.

482{
484}

◆ is_lar_fcal()

bool CaloDetDescriptor::is_lar_fcal ( ) const
inline

descriptor belongs to FCAL

Definition at line 491 of file CaloDetDescriptor.h.

492{
493 return m_is_lar_fcal;
494}

◆ is_lar_hec()

bool CaloDetDescriptor::is_lar_hec ( ) const
inline

descriptor belongs to HEC

Definition at line 486 of file CaloDetDescriptor.h.

487{
488 return m_is_lar_hec;
489}

◆ is_tile()

bool CaloDetDescriptor::is_tile ( ) const
inline

descriptor belongs to Tile

Definition at line 496 of file CaloDetDescriptor.h.

497{
498 return m_is_tile;
499}

◆ lar_eta_min()

double CaloDetDescriptor::lar_eta_min ( ) const
inline

minimal Eta for LAr region

Definition at line 618 of file CaloDetDescriptor.h.

619{
620 return m_lar_eta_min;
621}

◆ lar_phi_min()

double CaloDetDescriptor::lar_phi_min ( ) const
inline

minimal Phi for LAr region

Definition at line 623 of file CaloDetDescriptor.h.

624{
625 return m_lar_phi_min;
626}

◆ layer()

int CaloDetDescriptor::layer ( ) const
inline

get layer

Definition at line 528 of file CaloDetDescriptor.h.

529{
530 return m_layer;
531}

◆ n_calo_depth()

int CaloDetDescriptor::n_calo_depth ( ) const

number of calo depths

Definition at line 322 of file CaloDetDescriptor.cxx.

323{ return m_n_calo_depth; }

◆ n_eta()

int CaloDetDescriptor::n_eta ( ) const
inline

eta granularity

Definition at line 598 of file CaloDetDescriptor.h.

599{
600 return m_lar_n_eta;
601}

◆ n_phi()

int CaloDetDescriptor::n_phi ( ) const
inline

phi granularity

Definition at line 603 of file CaloDetDescriptor.h.

604{
605 return m_lar_n_phi;
606}

◆ phi_channel()

int CaloDetDescriptor::phi_channel ( double phi) const

channel number for a given eta/phi (if outside returns -1) Should not be used for FCAL

Definition at line 275 of file CaloDetDescriptor.cxx.

276{
277 double phi_fixed = phi ;
278
279 // -M_PI,M_PI convention :
280 if (phi <= m_lar_phi_min)
281 phi_fixed = phi_fixed + 2.0*M_PI;
282
283 int chan = (int)((phi_fixed - m_lar_phi_min)/m_lar_dphi) + m_calo_helper->phi_min(m_id);
284
285 if(chan >= m_lar_n_phi + m_calo_helper->phi_min(m_id)) chan = -1;
286
287 return chan;
288}
Scalar phi() const
phi method

◆ phi_channel_raw()

int CaloDetDescriptor::phi_channel_raw ( double phi) const

channel number for a given eta/phi raw (if outside returns -1) Should not be used for FCAL

Definition at line 305 of file CaloDetDescriptor.cxx.

306{
307 double phi_fixed = phi ;
308
309 // -M_PI,M_PI convention :
310 if (phi <= m_calo_phi_min)
311 phi_fixed = phi_fixed + 2.0*M_PI;
312
313 int chan = (int)((phi_fixed - m_calo_phi_min)/m_lar_dphi) + m_calo_helper->phi_min(m_id);
314
315 if(chan >= m_lar_n_phi + m_calo_helper->phi_min(m_id)) chan = -1;
316
317 return chan;
318}

◆ print()

void CaloDetDescriptor::print ( ) const
virtual

print the contents

Definition at line 111 of file CaloDetDescriptor.cxx.

112{
113 dump(std::cout);
114}
void dump(std::ostream &os) const
dump contents to a stream.

◆ reg_max()

double CaloDetDescriptor::reg_max ( ) const
inline

eta min and max once misaligned

Definition at line 613 of file CaloDetDescriptor.h.

614{
615 return m_lar_reg_max;
616}

◆ reg_min()

double CaloDetDescriptor::reg_min ( ) const
inline

eta min and max once misaligned

Definition at line 608 of file CaloDetDescriptor.h.

609{
610 return m_lar_reg_min;
611}

◆ set_depth_in()

void CaloDetDescriptor::set_depth_in ( std::vector< double > & calo_depth)

set vector of in depths

Parameters
calo_depth[IN] vector of in depths

Definition at line 347 of file CaloDetDescriptor.cxx.

348{
349 for (int i=0; i<m_n_calo_depth; i++)
350 m_calo_depth_in[i] = calo_depth[i];
351}

◆ set_depth_out()

void CaloDetDescriptor::set_depth_out ( std::vector< double > & calo_depth)

set vector of out depths

Parameters
calo_depth[IN] vector of out depths

Definition at line 353 of file CaloDetDescriptor.cxx.

354{
355 for (int i=0; i<m_n_calo_depth; i++)
356 m_calo_depth_out[i] = calo_depth[i];
357}

◆ set_eta_phi_granularity()

void CaloDetDescriptor::set_eta_phi_granularity ( int neta,
double deta,
int nphi,
double dphi )

Set Phi granularity.

Definition at line 359 of file CaloDetDescriptor.cxx.

363{
366 m_lar_n_eta = neta;
367 m_lar_n_phi = nphi;
368}

◆ set_n_calo_depth()

void CaloDetDescriptor::set_n_calo_depth ( int n_calo_depth)

set number of calo depths

Parameters
n_calo_depth[IN} number of depths

Definition at line 340 of file CaloDetDescriptor.cxx.

341{
345}
int n_calo_depth() const
number of calo depths

◆ set_transform()

void CaloDetDescriptor::set_transform ( const Amg::Transform3D & transform)
inline

Set the transformation matrix.

Definition at line 696 of file CaloDetDescriptor.h.

697{
699}
const Amg::Transform3D & transform() const
Get the current transformation matrix.

◆ setCaloEtaMax()

void CaloDetDescriptor::setCaloEtaMax ( double eta_max)
inline

Set Eta Max.

Definition at line 633 of file CaloDetDescriptor.h.

634{
635 m_calo_eta_max = eta_max;
636}

◆ setCaloEtaMin()

void CaloDetDescriptor::setCaloEtaMin ( double eta_min)
inline

Set Eta Min.

Definition at line 628 of file CaloDetDescriptor.h.

629{
630 m_calo_eta_min = eta_min;
631}

◆ setCaloPhiMax()

void CaloDetDescriptor::setCaloPhiMax ( double phi_max)
inline

Set Phi Max.

Definition at line 643 of file CaloDetDescriptor.h.

644{
645 m_calo_phi_max = phi_max;
646}

◆ setCaloPhiMin()

void CaloDetDescriptor::setCaloPhiMin ( double phi_min)
inline

Set Phi Min.

Definition at line 638 of file CaloDetDescriptor.h.

639{
640 m_calo_phi_min = phi_min;
641}

◆ setCaloRMax()

void CaloDetDescriptor::setCaloRMax ( double r_max)
inline

Set R Max.

Definition at line 663 of file CaloDetDescriptor.h.

664{
665 m_calo_r_max = r_max;
666}

◆ setCaloRMin()

void CaloDetDescriptor::setCaloRMin ( double r_min)
inline

Set R Min.

Definition at line 658 of file CaloDetDescriptor.h.

659{
660 m_calo_r_min = r_min;
661}

◆ setCaloZMax()

void CaloDetDescriptor::setCaloZMax ( double z_max)
inline

Set Z Max.

Definition at line 653 of file CaloDetDescriptor.h.

654{
655 m_calo_z_max = z_max;
656}

◆ setCaloZMin()

void CaloDetDescriptor::setCaloZMin ( double z_min)
inline

Set Z Min.

Definition at line 648 of file CaloDetDescriptor.h.

649{
650 m_calo_z_min = z_min;
651}

◆ setLArEtaMin()

void CaloDetDescriptor::setLArEtaMin ( double eta_min)
inline

Set LAr Region Phi Max.

Definition at line 683 of file CaloDetDescriptor.h.

684{
685 m_lar_eta_min = eta_min;
686}

◆ setLArPhiMin()

void CaloDetDescriptor::setLArPhiMin ( double phi_min)
inline

Set LAr Region Phi Min.

Definition at line 678 of file CaloDetDescriptor.h.

679{
680 m_lar_phi_min = phi_min;
681}

◆ setLArRegMax()

void CaloDetDescriptor::setLArRegMax ( double reg_max)
inline

Set LAr Region Eta Max.

Definition at line 673 of file CaloDetDescriptor.h.

674{
676}
double reg_max() const
eta min and max once misaligned

◆ setLArRegMin()

void CaloDetDescriptor::setLArRegMin ( double reg_min)
inline

Set LAr Region Eta Min.

Definition at line 668 of file CaloDetDescriptor.h.

669{
671}
double reg_min() const
eta min and max once misaligned

◆ subcalo_hash()

IdentifierHash CaloDetDescriptor::subcalo_hash ( ) const
inline

get subcalo hash

Definition at line 517 of file CaloDetDescriptor.h.

518{
519 int num;
520 return m_calo_helper->subcalo_region_hash(m_id, num);
521}

◆ transform()

const Amg::Transform3D & CaloDetDescriptor::transform ( ) const
inline

Get the current transformation matrix.

Definition at line 689 of file CaloDetDescriptor.h.

690{
691 return m_transform;
692}

Member Data Documentation

◆ m_calo_depth_in

std::vector<double> CaloDetDescriptor::m_calo_depth_in
protected

in depths

Definition at line 435 of file CaloDetDescriptor.h.

◆ m_calo_depth_out

std::vector<double> CaloDetDescriptor::m_calo_depth_out
protected

out depths

Definition at line 438 of file CaloDetDescriptor.h.

◆ m_calo_eta_max

double CaloDetDescriptor::m_calo_eta_max
protected

maximal Eta (to be defined in the derived classes)

Definition at line 410 of file CaloDetDescriptor.h.

◆ m_calo_eta_min

double CaloDetDescriptor::m_calo_eta_min
protected

minimal Eta (to be defined in the derived classes)

Definition at line 407 of file CaloDetDescriptor.h.

◆ m_calo_helper

const CaloCell_Base_ID* CaloDetDescriptor::m_calo_helper
private

Calo Cell ID helper.

Definition at line 339 of file CaloDetDescriptor.h.

◆ m_calo_num

CaloCell_ID::SUBCALO CaloDetDescriptor::m_calo_num
private

Subcalo.

Definition at line 382 of file CaloDetDescriptor.h.

◆ m_calo_phi_max

double CaloDetDescriptor::m_calo_phi_max
protected

maximal Phi (to be defined in the derived classes)

Definition at line 416 of file CaloDetDescriptor.h.

◆ m_calo_phi_min

double CaloDetDescriptor::m_calo_phi_min
protected

minimal Phi (to be defined in the derived classes)

Definition at line 413 of file CaloDetDescriptor.h.

◆ m_calo_r_max

double CaloDetDescriptor::m_calo_r_max
protected

maximal R (to be defined in the derived classes)

Definition at line 422 of file CaloDetDescriptor.h.

◆ m_calo_r_min

double CaloDetDescriptor::m_calo_r_min
protected

minimal R (to be defined in the derived classes)

Definition at line 419 of file CaloDetDescriptor.h.

◆ m_calo_sampl

CaloCell_ID::CaloSample CaloDetDescriptor::m_calo_sampl
private

Calo Sample.

Definition at line 378 of file CaloDetDescriptor.h.

◆ m_calo_sign

int CaloDetDescriptor::m_calo_sign
private

calo sign

Definition at line 371 of file CaloDetDescriptor.h.

◆ m_calo_z_max

double CaloDetDescriptor::m_calo_z_max
protected

maximal Z (to be defined in the derived classes)

Definition at line 428 of file CaloDetDescriptor.h.

◆ m_calo_z_min

double CaloDetDescriptor::m_calo_z_min
protected

minimal Z (to be defined in the derived classes)

Definition at line 425 of file CaloDetDescriptor.h.

◆ m_calocell_min

IdentifierHash CaloDetDescriptor::m_calocell_min
private

minimal hash id of region cells

Definition at line 386 of file CaloDetDescriptor.h.

◆ m_etachan_min

int CaloDetDescriptor::m_etachan_min
protected

minimal Eta channel number

Definition at line 458 of file CaloDetDescriptor.h.

◆ m_helper

const AtlasDetectorID* CaloDetDescriptor::m_helper
private

Atlas Detector ID helper.

Definition at line 336 of file CaloDetDescriptor.h.

◆ m_id

Identifier CaloDetDescriptor::m_id
private

Region identifier.

Definition at line 342 of file CaloDetDescriptor.h.

◆ m_is_lar_em

bool CaloDetDescriptor::m_is_lar_em
private

descriptor belongs to EM calorimeter

Definition at line 346 of file CaloDetDescriptor.h.

◆ m_is_lar_em_barrel

bool CaloDetDescriptor::m_is_lar_em_barrel
private

descriptor belongs to EM barrel

Definition at line 349 of file CaloDetDescriptor.h.

◆ m_is_lar_em_endcap

bool CaloDetDescriptor::m_is_lar_em_endcap
private

descriptor belongs to EM end cap

Definition at line 352 of file CaloDetDescriptor.h.

◆ m_is_lar_em_endcap_inner

bool CaloDetDescriptor::m_is_lar_em_endcap_inner
private

descriptor belongs to the inner wheel of EM end cap

Definition at line 355 of file CaloDetDescriptor.h.

◆ m_is_lar_em_endcap_outer

bool CaloDetDescriptor::m_is_lar_em_endcap_outer
private

descriptor belongs to the outer wheel of EM end cap

Definition at line 358 of file CaloDetDescriptor.h.

◆ m_is_lar_fcal

bool CaloDetDescriptor::m_is_lar_fcal
private

descriptor belongs to FCAL

Definition at line 364 of file CaloDetDescriptor.h.

◆ m_is_lar_hec

bool CaloDetDescriptor::m_is_lar_hec
private

descriptor belongs to HEC

Definition at line 361 of file CaloDetDescriptor.h.

◆ m_is_tile

bool CaloDetDescriptor::m_is_tile
private

descriptor belongs to Tile

Definition at line 367 of file CaloDetDescriptor.h.

◆ m_lar_deta

double CaloDetDescriptor::m_lar_deta
private

delta eta (LAr)

Definition at line 390 of file CaloDetDescriptor.h.

◆ m_lar_dphi

double CaloDetDescriptor::m_lar_dphi
private

delta phi (LAr)

Definition at line 393 of file CaloDetDescriptor.h.

◆ m_lar_eta_min

double CaloDetDescriptor::m_lar_eta_min
protected

minimal Eta for LAr region

Definition at line 455 of file CaloDetDescriptor.h.

◆ m_lar_n_eta

int CaloDetDescriptor::m_lar_n_eta
private

eta granularity (LAr)

Definition at line 396 of file CaloDetDescriptor.h.

◆ m_lar_n_phi

int CaloDetDescriptor::m_lar_n_phi
private

phi granularity (LAr)

Definition at line 399 of file CaloDetDescriptor.h.

◆ m_lar_phi_min

double CaloDetDescriptor::m_lar_phi_min
protected

minimal Phi for LAr region

Definition at line 452 of file CaloDetDescriptor.h.

◆ m_lar_reg_max

double CaloDetDescriptor::m_lar_reg_max
protected

maximal Abs Eta for LAr region

Definition at line 449 of file CaloDetDescriptor.h.

◆ m_lar_reg_min

double CaloDetDescriptor::m_lar_reg_min
protected

minimal Abs Eta for LAr region

Definition at line 446 of file CaloDetDescriptor.h.

◆ m_layer

int CaloDetDescriptor::m_layer
private

layer

Definition at line 374 of file CaloDetDescriptor.h.

◆ m_n_calo_depth

int CaloDetDescriptor::m_n_calo_depth
protected

number of depths

Definition at line 432 of file CaloDetDescriptor.h.

◆ m_transform

Amg::Transform3D CaloDetDescriptor::m_transform
protected

misalignment transformation

Definition at line 442 of file CaloDetDescriptor.h.


The documentation for this class was generated from the following files: