Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-03 00:59:07

0001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0002 #include "Geometry/HGCalCommonData/interface/HGCalCassette.h"
0003 #include <sstream>
0004 
0005 //#define EDM_ML_DEBUG
0006 
0007 void HGCalCassette::setParameter(int cassette, const std::vector<double>& shifts) {
0008   cassette_ = cassette;
0009   typeHE_ = (cassette_ >= 12);
0010   shifts_.insert(shifts_.end(), shifts.begin(), shifts.end());
0011 #ifdef EDM_ML_DEBUG
0012   edm::LogVerbatim("HGCalGeom") << "# of cassettes = " << cassette_ << " Type " << typeHE_;
0013   std::ostringstream st1;
0014   st1 << " Shifts:";
0015   for (const auto& s : shifts_)
0016     st1 << ":" << s;
0017   edm::LogVerbatim("HGCalGeom") << st1.str();
0018 #endif
0019 }
0020 
0021 std::pair<double, double> HGCalCassette::getShift(int layer, int zside, int cassette) const {
0022   int locc = (zside < 0) ? (cassette - 1) : (typeHE_ ? positHE_[cassette - 1] : positEE_[cassette - 1]);
0023   int loc = 2 * (cassette_ * (layer - 1) + locc);
0024   std::pair<double, double> xy = std::make_pair(shifts_[loc], shifts_[loc + 1]);
0025 #ifdef EDM_ML_DEBUG
0026   edm::LogVerbatim("HGCalGeom") << "HGCalCassette::getShift: Layer " << layer << " zside " << zside << " cassette "
0027                                 << cassette << " Loc " << locc << ":" << loc << " shift " << xy.first << ":"
0028                                 << xy.second;
0029 #endif
0030   return xy;
0031 }