CMS 3D CMS Logo

HGCalCassette.cc
Go to the documentation of this file.
3 #include <sstream>
4 
5 //#define EDM_ML_DEBUG
6 
7 void HGCalCassette::setParameter(int cassette, const std::vector<double>& shifts) {
8  cassette_ = cassette;
9  typeHE_ = (cassette_ >= 12);
10  shifts_.insert(shifts_.end(), shifts.begin(), shifts.end());
11 #ifdef EDM_ML_DEBUG
12  edm::LogVerbatim("HGCalGeom") << "# of cassettes = " << cassette_ << " Type " << typeHE_;
13  std::ostringstream st1;
14  st1 << " Shifts:";
15  for (const auto& s : shifts_)
16  st1 << ":" << s;
17  edm::LogVerbatim("HGCalGeom") << st1.str();
18 #endif
19 }
20 
21 std::pair<double, double> HGCalCassette::getShift(int layer, int zside, int cassette) const {
22  int locc = (zside < 0) ? (cassette - 1) : (typeHE_ ? positHE_[cassette - 1] : positEE_[cassette - 1]);
23  int loc = 2 * (cassette_ * (layer - 1) + locc);
24  std::pair<double, double> xy = std::make_pair(shifts_[loc], shifts_[loc + 1]);
25 #ifdef EDM_ML_DEBUG
26  edm::LogVerbatim("HGCalGeom") << "HGCalCassette::getShift: Layer " << layer << " zside " << zside << " cassette "
27  << cassette << " Loc " << locc << ":" << loc << " shift " << xy.first << ":"
28  << xy.second;
29 #endif
30  return xy;
31 }
Log< level::Info, true > LogVerbatim
std::pair< double, double > getShift(int layer, int zside, int cassette) const
int zside(DetId const &)
const std::vector< int > positHE_
Definition: HGCalCassette.h:18
constexpr std::array< uint8_t, layerIndexSize > layer
const std::vector< int > positEE_
Definition: HGCalCassette.h:17
std::vector< double > shifts_
Definition: HGCalCassette.h:21
void setParameter(int cassette, const std::vector< double > &shifts)
Definition: HGCalCassette.cc:7