CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPetalBuilder.h"
00002 #include "DetectorDescription/Core/interface/DDFilteredView.h"
00003 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
00004 #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h"
00005 #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.h"
00006 #include "DataFormats/DetId/interface/DetId.h"
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008 #include <vector>
00009 
00010 
00011 void CmsTrackerPetalBuilder::buildComponent(DDFilteredView& fv, GeometricDet* g, std::string s){
00012 
00013   GeometricDet * det  = 
00014     new GeometricDet(&fv,
00015                      theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(s,&fv)));
00016   CmsTrackerRingBuilder theCmsTrackerRingBuilder;
00017   theCmsTrackerRingBuilder.build(fv,det,s);  
00018   g->addComponent(det);
00019 }
00020 
00021 void CmsTrackerPetalBuilder::sortNS(DDFilteredView& fv, GeometricDet* det){
00022   GeometricDet::GeometricDetContainer & comp = det->components();
00023 
00024   if (comp.front()->type()==GeometricDet::ring)
00025     std::sort(comp.begin(),comp.end(),LessR_module());
00026   else
00027     edm::LogError("CmsTrackerPetalBuilder")<<"ERROR - wrong SubDet to sort..... "<<det->components().front()->type(); 
00028   
00029   // Maximum Number fo TEC Rings is 7 in order 
00030   // to discover from which number we have to start
00031   // the operation is MaxRing - RealRingNumber + 1 (C++)
00032   
00033   uint32_t startring = 8 - comp.size();
00034   
00035   for(uint32_t i=0; i<comp.size(); i++){
00036     comp[i]->setGeographicalID(startring+i);
00037   }
00038 }
00039 
00040 
00041 
00042