CMS 3D CMS Logo

Public Member Functions | Private Member Functions

ListIds Class Reference

Inheritance diagram for ListIds:
edm::EDAnalyzer

List of all members.

Public Member Functions

 ListIds (const edm::ParameterSet &)
virtual ~ListIds ()

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
void beginJob ()
void endJob ()

Detailed Description

Definition at line 68 of file ListIds.cc.


Constructor & Destructor Documentation

ListIds::ListIds ( const edm::ParameterSet )

Definition at line 80 of file ListIds.cc.

                                        {
}
ListIds::~ListIds ( ) [virtual]

Definition at line 83 of file ListIds.cc.

                  {
}

Member Function Documentation

void ListIds::analyze ( const edm::Event evt,
const edm::EventSetup setup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 87 of file ListIds.cc.

References DDFilteredView::addFilter(), GeomDet::components(), gather_cfg::cout, dddGetString(), DetId::det(), alcazmumu_cfi::filter, DDFilteredView::firstChild(), GeomDet::geographicalId(), DDFilteredView::geoHistory(), edm::EventSetup::get(), h, i, j, DDFilteredView::logicalPart(), DDLogicalPart::material(), DDBase< N, C >::name(), DDFilteredView::next(), DDSpecificsFilter::not_equals, AlCaHLTBitMon_ParallelJobs::p, CfgNavigationSchool_cfi::parts, position, GeomDet::position(), DetId::rawId(), DDSpecificsFilter::setCriteria(), GeomDet::subDetector(), DetId::subdetId(), align::Tracker, DDFilteredView::translation(), CmsTrackerStringToEnum::type(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

                                                               {
  std::cout << "______________________________ DDD ______________________________" << std::endl;
  edm::ESTransientHandle<DDCompactView> hDdd;
  setup.get<IdealGeometryRecord>().get( hDdd );

  std::string attribute = "TkDDDStructure";
  CmsTrackerStringToEnum theCmsTrackerStringToEnum;
  DDSpecificsFilter filter;
  filter.setCriteria(DDValue(attribute, "any", 0), DDSpecificsFilter::not_equals);
  DDFilteredView fv(*hDdd); 
  fv.addFilter(filter);
  if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker) {
    fv.firstChild();
    if (theCmsTrackerStringToEnum.type(dddGetString(attribute, fv)) != GeometricDet::Tracker)
      throw cms::Exception("Configuration") << "The first child of the DDFilteredView is not what is expected \n"
                                            << dddGetString(attribute, fv);
  }
   
  std::cout << std::fixed << std::setprecision(3);
  do {
    // print the full hierarchy of all Silicon items
    if (fv.logicalPart().material().name() == "materials:Silicon") {
  
      // start from 2 to skip the leading /OCMS[0]/CMSE[1] part
      const DDGeoHistory & history = fv.geoHistory();
      std::cout << '/';
      for (unsigned int h = 2; h < history.size(); ++h) {
        std::cout << '/' << history[h].logicalPart().name().name() << '[' << history[h].copyno() << ']';
      }

      // DD3Vector and DDTranslation are the same type as math::XYZVector
      math::XYZVector position = fv.translation() / 10.;  // mm -> cm
      std::cout << "\t" << position << std::endl;
    }
  } while (fv.next());
  std::cout << std::endl;
  
  std::cout << "______________________________ std::vector<GeomDet*> from TrackerGeometry::dets() ______________________________" << std::endl;
  edm::ESHandle<TrackerGeometry> hGeo;
  setup.get<TrackerDigiGeometryRecord>().get( hGeo );

  std::cout << std::fixed << std::setprecision(3);
  const std::vector<GeomDet*> & dets = hGeo->dets();
  for (unsigned int i = 0; i < dets.size(); ++i) {
    const GeomDet & det = *dets[i];

    // Surface::PositionType is a typedef for Point3DBase<float,GlobalTag> a.k.a. GlobalPoint
    const Surface::PositionType & p = det.position();
    math::XYZVector position(p.x(), p.y(), p.z());

    std::cout << det.subDetector() << '\t' 
              << det.geographicalId().det() << '\t' 
              << det.geographicalId().subdetId() << '\t'
              << det.geographicalId().rawId() << "\t"
              << position;
    const std::vector<const GeomDet*> & parts = det.components();
    if (parts.size()) {
      std::cout << "\t[" << parts[0]->geographicalId().rawId();
      for (unsigned int j = 1; j < parts.size(); ++j)
        std::cout << '\t' << parts[j]->geographicalId().rawId();
      std::cout << ']';
    }
    std::cout << std::endl;
  }
    
}
void ListIds::beginJob ( void  ) [inline, private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file ListIds.cc.

{}
void ListIds::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 155 of file ListIds.cc.

                {
}