CMS 3D CMS Logo

AHCalGeometry.cc
Go to the documentation of this file.
3 
5 
6 std::pair<double, double> AHCalGeometry::getXY(const AHCalDetId& id) const {
7  int row = id.irow();
8  int col = id.icol();
9  double shiftx = (col > 0) ? -0.5 * ahcal_->deltaX() : 0.5 * ahcal_->deltaX();
10  double shifty = (row > 0) ? -0.5 * ahcal_->deltaY() : 0.5 * ahcal_->deltaY();
11  return std::pair<double, double>(col * ahcal_->deltaX() + shiftx, row * ahcal_->deltaY() + shifty);
12 }
13 
14 double AHCalGeometry::getZ(const AHCalDetId& id) const {
15  int lay = id.depth();
16  return (ahcal_->zFirst() + (lay - 1) * ahcal_->deltaZ());
17 }
std::unique_ptr< AHCalParameters > ahcal_
Definition: AHCalGeometry.h:27
col
Definition: cuy.py:1010
AHCalGeometry()=delete
double getZ(const AHCalDetId &id) const
std::pair< double, double > getXY(const AHCalDetId &id) const
get the local coordinate in the plane and along depth
Definition: AHCalGeometry.cc:6