00001 #include "Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h" 00002 #include "DetectorDescription/Core/interface/DDFilteredView.h" 00003 #include "DetectorDescription/Core/interface/DDCompactView.h" 00004 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" 00005 #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h" 00006 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerBuilder.h" 00007 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.h" 00008 00009 using namespace cms; 00010 00011 DDDCmsTrackerContruction::DDDCmsTrackerContruction(){ 00012 00013 } 00014 00015 const GeometricDet* DDDCmsTrackerContruction::construct(const DDCompactView* cpv){ 00016 attribute = "TkDDDStructure"; // could come from .orcarc 00017 std::string value = "any"; 00018 DDSpecificsFilter filter; 00019 DDValue ddv(attribute,value,0); 00020 filter.setCriteria(ddv,DDSpecificsFilter::not_equals); 00021 00022 DDFilteredView fv(*cpv); 00023 fv.addFilter(filter); 00024 if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(attribute,&fv)) != GeometricDet::Tracker){ 00025 fv.firstChild(); 00026 if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(attribute,&fv)) != GeometricDet::Tracker){ 00027 00028 throw cms::Exception("Configuration") <<" The first child of the DDFilteredView is not what is expected \n" 00029 <<ExtractStringFromDDD::getString(attribute,&fv)<<"\n"; 00030 } 00031 } 00032 00033 GeometricDet* tracker = new GeometricDet(&fv,GeometricDet::Tracker); 00034 CmsTrackerBuilder theCmsTrackerBuilder; 00035 theCmsTrackerBuilder.build(fv,tracker,attribute); 00036 00037 00038 CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder; 00039 00040 tracker = theCmsTrackerDetIdBuilder.buildId(tracker); 00041 fv.parent(); 00042 // 00043 // set the Tracker 00044 // 00045 //TrackerMapDDDtoID::instance().setTracker(tracker); 00046 //NOTE: If it is decided that the TrackerMapDDDtoID should be 00047 // constructed here, then we should return from this 00048 // function so that the EventSetup can manage it 00049 00050 return tracker; 00051 } 00052