Geometry/HGCalCommonData/test/HGCalCellPositionTester.cc
// ------------ method called to produce the data  ------------
method called to produce the data
method called to produce the data
void HGCalCellPositionTester::analyze(const edm::Event&, const edm::EventSetup&) {
  const int nFine(12), nCoarse(8);
  const double tol(0.00001);
  HGCalCell wafer(waferSize_, nFine, nCoarse);
  int nCells = (waferType_ == 0) ? nFine : nCoarse;
  int indexMin = (placeIndex_ >= 0) ? placeIndex_ : 0;
  int indexMax = (placeIndex_ >= 0) ? placeIndex_ : 11;
  edm::LogVerbatim("HGCalGeom") << "\nHGCalCellPositionTester:: nCells " << nCells << " and placement index between "
                                << indexMin << " and " << indexMax << "\n\n";
  for (int placeIndex = indexMin; placeIndex <= indexMax; ++placeIndex) {
    for (int iu = 0; iu < 2 * nCells; ++iu) {
      for (int iv = 0; iv < 2 * nCells; ++iv) {
        int u(iu), v(iv);
        if (placeIndex < HGCalCell::cellPlacementExtra) {
          u = iv;
          v = iu;
        }
        if (((v - u) < nCells) && ((u - v) <= nCells)) {
          std::pair<double, double> xy1 = wafer.cellUV2XY1(u, v, placeIndex, waferType_);
          std::pair<double, double> xy2 = wafer.cellUV2XY2(u, v, placeIndex, waferType_);
          double dx = xy1.first - xy2.first;
          double dy = xy1.second - xy2.second;
          std::string comment = ((std::abs(dx) > tol) || (std::abs(dy) > tol)) ? " ***** ERROR *****" : "";
          edm::LogVerbatim("HGCalGeom") << "u = " << u << " v = " << v << " type = " << waferType_
                                        << " placement index " << placeIndex << " x " << xy1.first << ":" << xy2.first
                                        << ":" << dx << " y " << xy1.second << ":" << xy2.second << ":" << dy
                                        << comment;
        }
      }
    }
  }
}
void HGCalCellPositionTester :: analyze ( const edm :: Event & , const edm :: EventSetup & ) { const int nFine ( 12 ) , nCoarse ( 8 ) ; const double tol ( 0.00001 ) ; HGCalCell wafer ( waferSize_ , nFine , nCoarse ) ; int nCells = ( waferType_ == 0 ) ? nFine : nCoarse ; int indexMin = ( placeIndex_ >= 0 ) ? placeIndex_ : 0 ; int indexMax = ( placeIndex_ >= 0 ) ? placeIndex_ : 11 ; edm :: LogVerbatim ( " " ) << " \n " << nCells << " " << indexMin << " " << indexMax << " \n \n " ; for ( int placeIndex = indexMin ; placeIndex <= indexMax ; ++ placeIndex ) { for ( int iu = 0 ; iu < 2 * nCells ; ++ iu ) { for ( int iv = 0 ; iv < 2 * nCells ; ++ iv ) { int u ( iu ) , v ( iv ) ; if ( placeIndex < HGCalCell :: cellPlacementExtra ) { u = iv ; v = iu ; } if ( ( ( v - u ) < nCells ) && ( ( u - v ) <= nCells ) ) { std :: pair < double , double > xy1 = wafer . cellUV2XY1 ( u , v , placeIndex , waferType_ ) ; std :: pair < double , double > xy2 = wafer . cellUV2XY2 ( u , v , placeIndex , waferType_ ) ; double dx = xy1 . first - xy2 . first ; double dy = xy1 . second - xy2 . second ; std :: string comment = ( ( std :: abs ( dx ) > tol ) || ( std :: abs ( dy ) > tol ) ) ? " " : " " ; edm :: LogVerbatim ( " " ) << " " << u << " " << v << " " << waferType_ << " " << placeIndex << " " << xy1 . first << " " << xy2 . first << " " << dx << " " << xy1 . second << " " << xy2 . second << " " << dy << comment ; } } } } }
method called to produce the data
method called to produce the data