CMS 3D CMS Logo

HGCalGeomTools.cc
Go to the documentation of this file.
3 
4 //#define EDM_ML_DEBUG
5 
6 double HGCalGeomTools::radius(double z, std::vector<double> const& zFront,
7  std::vector<double> const& rFront,
8  std::vector<double> const& slope) {
9 
10  double r(0);
11 #ifdef EDM_ML_DEBUG
12  unsigned int ik(0);
13 #endif
14  for (unsigned int k=0; k<slope.size(); ++k) {
15  if (z < zFront[k]) break;
16  r = rFront[k] + (z - zFront[k]) * slope[k];
17 #ifdef EDM_ML_DEBUG
18  ik = k;
19 #endif
20  }
21 #ifdef EDM_ML_DEBUG
22  edm::LogVerbatim("HGCalGeom") << "DDHGCalGeomTools: Z " << z << ":" << ik
23  << " R " << r;
24 #endif
25  return r;
26 }
27 
28 double HGCalGeomTools::radius(double z, int layer0, int layerf,
29  std::vector<double> const& zFront,
30  std::vector<double> const& rFront) {
31 
32  double r(0);
33 #ifdef EDM_ML_DEBUG
34  unsigned int ik(0);
35 #endif
36  for (unsigned int k=0; k<rFront.size(); ++k) {
37  int k1 = layerf-layer0+(int)(k);
38  if (k1 < (int)(zFront.size())) {
39  if (z < zFront[k1]) break;
40  r = rFront[k];
41 #ifdef EDM_ML_DEBUG
42  ik = k;
43 #endif
44  }
45  }
46 #ifdef EDM_ML_DEBUG
47  edm::LogVerbatim("HGCalGeom") << "DDHGCalGeomTools: Z " << z << ":" << ik
48  << " R " << r;
49 #endif
50  return r;
51 }
static double radius(double z, std::vector< double > const &zFront, std::vector< double > const &rFront, std::vector< double > const &slope)
static const double slope[3]
float float float z
int k[5][pyjets_maxn]