CMS 3D CMS Logo

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