CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerStringBuilder.cc

Go to the documentation of this file.
00001 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerStringBuilder.h"
00002 #include "DetectorDescription/Core/interface/DDFilteredView.h"
00003 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
00004 #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h"
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 #include "Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h"
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008 #include <vector>
00009 
00010 
00011 void CmsTrackerStringBuilder::buildComponent(DDFilteredView& fv, GeometricDet* g, std::string s){
00012   CmsDetConstruction theCmsDetConstruction;
00013   theCmsDetConstruction.buildComponent(fv,g,s);  
00014 }
00015 
00016 void CmsTrackerStringBuilder::sortNS(DDFilteredView& fv, GeometricDet* det){
00017   GeometricDet::GeometricDetContainer comp = det->components();
00018 
00019   std::stable_sort(comp.begin(),comp.end(),LessModZ()); 
00020   
00021   if(comp.size()){
00022     for(uint32_t i=0; i<comp.size();i++){
00023       comp[i]->setGeographicalID(DetId(i+1));
00024     }
00025     det->clearComponents();
00026     det->addComponents(comp);
00027   }else{
00028        edm::LogError("CmsTrackerStringBuilder")<<"Where are the String's modules?";
00029   }
00030 }
00031 
00032