Geometry/HGCalCommonData/test/HGCGeometryTester.cc
// ------------ method called to produce the data  ------------
method called to produce the data
method called to produce the data
void HGCGeometryTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
  const auto& pDD = iSetup.getData(ddToken_);
  DDExpandedView eview(pDD);
  std::map<std::string, std::pair<double, double> > svPars;
  do {
    const DDLogicalPart& logPart = eview.logicalPart();
    const std::string& name = logPart.name().fullname();
    if ((name.find("HGCal") != std::string::npos) && (name.find("Sensitive") != std::string::npos)) {
      size_t pos = name.find("Sensitive") + 9;
      int layer = atoi(name.substr(pos, name.size() - 1).c_str());
      if (svPars.find(name) == svPars.end()) {
        std::vector<double> solidPar = eview.logicalPart().solid().parameters();
        if (square_) {
          svPars[name] = std::pair<double, double>(solidPar[3], 0.5 * (solidPar[4] + solidPar[5]));
          edm::LogVerbatim("HGCalGeomX") << name << " Layer " << layer << " " << solidPar[3] << " " << solidPar[4]
                                         << " " << solidPar[5];
        } else {
          svPars[name] = std::pair<double, double>(solidPar[0], 0.5 * (solidPar[2] - solidPar[1]));
          edm::LogVerbatim("HGCalGeomX") << name << " Layer " << layer << " " << solidPar[0] << " " << solidPar[1]
                                         << " " << solidPar[2];
        }
      }
    }
  } while (eview.next());
}
void HGCGeometryTester :: analyze ( const edm :: Event & iEvent , const edm :: EventSetup & iSetup ) { const auto & pDD = iSetup . getData ( ddToken_ ) ; DDExpandedView eview ( pDD ) ; std :: map < std :: string , std :: pair < double , double > > svPars ; do { const DDLogicalPart & logPart = eview . logicalPart ( ) ; const std :: string & name = logPart . name ( ) . fullname ( ) ; if ( ( name . find ( " " ) != std :: string :: npos ) && ( name . find ( " " ) != std :: string :: npos ) ) { size_t pos = name . find ( " " ) + 9 ; int layer = atoi ( name . substr ( pos , name . size ( ) - 1 ) . c_str ( ) ) ; if ( svPars . find ( name ) == svPars . end ( ) ) { std :: vector < double > solidPar = eview . logicalPart ( ) . solid ( ) . parameters ( ) ; if ( square_ ) { svPars [ name ] = std :: pair < double , double > ( solidPar [ 3 ] , 0.5 * ( solidPar [ 4 ] + solidPar [ 5 ] ) ) ; edm :: LogVerbatim ( " " ) << name << " " << layer << " " << solidPar [ 3 ] << " " << solidPar [ 4 ] << " " << solidPar [ 5 ] ; } else { svPars [ name ] = std :: pair < double , double > ( solidPar [ 0 ] , 0.5 * ( solidPar [ 2 ] - solidPar [ 1 ] ) ) ; edm :: LogVerbatim ( " " ) << name << " " << layer << " " << solidPar [ 0 ] << " " << solidPar [ 1 ] << " " << solidPar [ 2 ] ; } } } } while ( eview . next ( ) ) ; }
method called to produce the data
method called to produce the data
// parse the DD for sensitive volumes // only EE sensitive volumes for the moment // print half height and widths for the trapezoid