Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:09

0001 #include <memory>
0002 
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 #include "SimG4CMS/HGCalTestBeam/interface/AHCalGeometry.h"
0005 
0006 AHCalGeometry::AHCalGeometry(edm::ParameterSet const& iC) { ahcal_ = std::make_unique<AHCalParameters>(iC); }
0007 
0008 std::pair<double, double> AHCalGeometry::getXY(const AHCalDetId& id) const {
0009   int row = id.irow();
0010   int col = id.icol();
0011   double shiftx = (col > 0) ? -0.5 * ahcal_->deltaX() : 0.5 * ahcal_->deltaX();
0012   double shifty = (row > 0) ? -0.5 * ahcal_->deltaY() : 0.5 * ahcal_->deltaY();
0013   return std::pair<double, double>(col * ahcal_->deltaX() + shiftx, row * ahcal_->deltaY() + shifty);
0014 }
0015 
0016 double AHCalGeometry::getZ(const AHCalDetId& id) const {
0017   int lay = id.depth();
0018   return (ahcal_->zFirst() + (lay - 1) * ahcal_->deltaZ());
0019 }