5#include "Identifier/Identifier.h"
38 int posneg = m_calo_helper->pos_neg(id);
42 m_calo_sign = (int)(posneg/std::abs(posneg));
51 if(sample != CaloCell_ID::Unknown)
53 m_calo_sampl = sample;
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))
63 m_calo_sampl = (CaloCell_ID::CaloSample)
64 ((int)CaloCell_ID::TileGap1 - 1);
66 m_calo_sampl = CaloCell_ID::Unknown;
77 m_calo_helper->calo_cell_hash_range(
id,m_calocell_min,junk);
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;
93 m_lar_reg_min = 999999.;
94 m_lar_reg_max = -999999.;
95 m_lar_phi_min = 999999.;
99 m_calo_depth_in.resize(0);
100 m_calo_depth_out.resize(0);
103 m_transform.setIdentity();
105 m_etachan_min = m_calo_helper->eta_min(m_id);
118 os <<
" CaloDetDescriptor print: \n\n";
132 if(!
m_is_tile) os <<
" UNKNOW LAr decriptor !!!! \n";
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";
146 os <<
" r_min z_min r_max z_max sign\n";
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";
157 double theta1, psi1, phi1;
158 if (std::abs(std::abs(rot(2,1))-1.0f) > 0.00001)
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));
167 psi1 = std::atan2(rot(0,1),rot(0,2));
169 theta1 = -(
M_PI * 0.5);
170 psi1 = std::atan2(-rot(0,1), -rot(0,2));
174 os <<
"\nEigenTransform phi,theta,psi,x,y,z: "
175 << phi1 <<
" " << theta1 <<
" "
179 os << std::setprecision(4) <<
"in real world (can be <0)"
220 htrans = (htrans) *
vec;
241 htrans = (htrans) *
vec;
277 double phi_fixed =
phi ;
281 phi_fixed = phi_fixed + 2.0*
M_PI;
307 double phi_fixed =
phi ;
311 phi_fixed = phi_fixed + 2.0*
M_PI;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Definition of CaloDetDescriptor.
std::vector< size_t > vec
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Helper base class for offline cell identifiers.
CaloCell_Base_ID::SUBCALO SUBCALO
CaloSampling::CaloSample CaloSample
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.
double m_calo_eta_max
maximal Eta (to be defined in the derived classes)
double calo_phi_max() const
'ideal' geometry: phi maximal
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 deta() const
delta eta
void set_depth_out(std::vector< double > &calo_depth)
set vector of out depths
double m_calo_r_max
maximal R (to be defined in the derived classes)
int n_phi() const
phi granularity
std::vector< double > m_calo_depth_in
in depths
double calo_eta_min() const
'ideal' geometry: eta minimal
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.
int n_calo_depth() const
number of calo depths
double dphi() const
delta phi
void set_eta_phi_granularity(int neta, double deta, int nphi, double dphi)
Set Phi granularity.
double calo_z_min() const
'ideal' geometry: z minimal
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)
double calo_z_max() const
'ideal' geometry: z maximal
double m_lar_phi_min
minimal Phi for LAr region
double calo_r_min() const
'ideal' geometry: r minimal
double m_lar_reg_max
maximal Abs Eta for LAr region
std::vector< double > m_calo_depth_out
out depths
int eta_channel(double eta) const
channel number for a given eta/phi (if outside returns -1).
double m_calo_eta_min
minimal Eta (to be defined in the derived classes)
virtual ~CaloDetDescriptor()
virtual detructor
double calo_r_max() const
'ideal' geometry: r maximal
double m_calo_z_max
maximal Z (to be defined in the derived classes)
bool get_disk_surface(Amg::Transform3D &htrans, double &z, double &rmin, double &rmax, double &hphisec, double &depth) const
(for Trk::Surface)
CaloCell_ID::CaloSample m_calo_sampl
Calo Sample.
void set_n_calo_depth(int n_calo_depth)
set number of calo depths
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
CaloCell_ID::SUBCALO m_calo_num
Subcalo.
double calo_eta_max() const
'ideal' geometry: eta maximal
int phi_channel(double phi) const
channel number for a given eta/phi (if outside returns -1) Should not be used for FCAL
int m_n_calo_depth
number of depths
void get_depth_in(std::vector< double > &calo_depth) const
get vector of in depths
CaloCell_ID::CaloSample getSampling() const
get sampling returns the cached CaloSample, if the descriptor contains more than one sampling,...
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
double calo_phi_min() const
'ideal' geometry: phi minimal
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
int calo_sign() const
'ideal' geometry: calo sign
void dump(std::ostream &os) const
dump contents to a stream.
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
void set_depth_in(std::vector< double > &calo_depth)
set vector of in depths
virtual void print() const
print the contents
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
int eta_channel_raw(double eta) const
channel number for a given eta/phi raw (if outside returns -1).
const AtlasDetectorID * m_helper
Atlas Detector ID helper.
int m_etachan_min
minimal Eta channel number
int m_lar_n_phi
phi granularity (LAr)
int n_eta() const
eta granularity
double m_lar_reg_min
minimal Abs Eta for LAr region
bool m_is_lar_fcal
descriptor belongs to FCAL
void get_depth_out(std::vector< double > &calo_depth) const
get vector of out depths
double m_calo_r_min
minimal R (to be defined in the derived classes)
This is a "hash" representation of an Identifier.
This class factors out code common between TileID and Tile_SuperCell_ID.
int sample(const Identifier &id) const
Identifier cell_id(const Identifier &any_id) const
std::string depth
tag string for intendation
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D