Go to the documentation of this file.00001 #include "Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h"
00002 #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h"
00003 #include "DataFormats/DetId/interface/DetId.h"
00004
00005 void CmsDetConstruction::buildComponent(
00006 DDFilteredView& fv,
00007 GeometricDet *mother,
00008 std::string attribute){
00009
00010
00011
00012
00013
00014 GeometricDet * det = new GeometricDet(&fv,theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(attribute,&fv)));
00015 if (theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(attribute,&fv)) == GeometricDet::mergedDet){
00016
00017
00018
00019 bool dodets = fv.firstChild();
00020 while (dodets) {
00021 buildSmallDets(fv,det,attribute);
00022 dodets = fv.nextSibling();
00023
00024
00025
00026 }
00027 fv.parent();
00028 }
00029
00030 mother->addComponent(det);
00031 }
00032
00033 void CmsDetConstruction::buildSmallDets(
00034 DDFilteredView& fv,
00035 GeometricDet *mother,
00036 std::string attribute){
00037
00038 GeometricDet * det =
00039 new GeometricDet(&fv,
00040 theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(attribute,&fv)));
00041 static const std::string stereo = "TrackerStereoDetectors";
00042 if (ExtractStringFromDDD::getString(stereo,&fv) == "true"){
00043 uint32_t temp = 1;
00044 det->setGeographicalID(DetId(temp));
00045 }else{
00046 uint32_t temp = 2;
00047 det->setGeographicalID(DetId(temp));
00048 }
00049
00050 mother->addComponent(det);
00051 }
00052