#include <Geometry/TrackerNumberingBuilder/plugins/CmsTrackerWheelBuilder.h>
Private Member Functions | |
virtual void | buildComponent (DDFilteredView &, GeometricDet *, std::string) |
virtual void | sortNS (DDFilteredView &, GeometricDet *) |
Definition at line 11 of file CmsTrackerWheelBuilder.h.
void CmsTrackerWheelBuilder::buildComponent | ( | DDFilteredView & | fv, | |
GeometricDet * | g, | |||
std::string | s | |||
) | [private, virtual] |
Implements CmsTrackerLevelBuilder.
Definition at line 14 of file CmsTrackerWheelBuilder.cc.
References GeometricDet::addComponent(), CmsTrackerLevelBuilder::build(), ExtractStringFromDDD::getString(), GeometricDet::petal, GeometricDet::ring, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum, and CmsTrackerStringToEnum::type().
00014 { 00015 CmsTrackerRingBuilder theCmsTrackerRingBuilder ; 00016 CmsTrackerPetalBuilder theCmsTrackerPetalBuilder ; 00017 00018 GeometricDet * subdet = new GeometricDet(&fv,theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(s,&fv))); 00019 switch (theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(s,&fv))){ 00020 case GeometricDet::ring: 00021 theCmsTrackerRingBuilder.build(fv,subdet,s); 00022 break; 00023 case GeometricDet::petal: 00024 theCmsTrackerPetalBuilder.build(fv,subdet,s); 00025 break; 00026 default: 00027 edm::LogError("CmsTrackerWheelBuilder")<<" ERROR - I was expecting a Ring or Petal, I got a "<<ExtractStringFromDDD::getString(s,&fv); 00028 } 00029 g->addComponent(subdet); 00030 }
void CmsTrackerWheelBuilder::sortNS | ( | DDFilteredView & | fv, | |
GeometricDet * | det | |||
) | [private, virtual] |
Reimplemented from CmsTrackerLevelBuilder.
Definition at line 32 of file CmsTrackerWheelBuilder.cc.
References GeometricDet::addComponents(), GeometricDet::clearComponents(), GeometricDet::components(), i, GeometricDet::petal, pyDBSRunClass::temp, TrackerStablePhiSort(), GeometricDet::translation(), and z.
00032 { 00033 GeometricDet::GeometricDetContainer comp = det->components(); 00034 00035 if(comp.size()){ 00036 if(comp.front()->type()==GeometricDet::petal){ 00037 GeometricDet::GeometricDetContainer compfw; 00038 GeometricDet::GeometricDetContainer compbw; 00039 compfw.clear(); 00040 compbw.clear(); 00041 for(uint32_t i=0; i<comp.size();i++){ 00042 if(fabs(comp[i]->translation().z())<fabs(det->translation().z())){ 00043 compfw.push_back(comp[i]); 00044 }else{ 00045 compbw.push_back(comp[i]); 00046 } 00047 } 00048 00049 TrackerStablePhiSort(compfw.begin(), compfw.end(), ExtractPhiModule()); 00050 TrackerStablePhiSort(compbw.begin(), compbw.end(), ExtractPhiModule()); 00051 00052 // 00053 // TEC 00054 // Wheel Part: 3 bits [back:1 front:2] 00055 // Petal Number: 4 bits [1,...,8] 00056 // 00057 for(uint32_t i=0; i<compbw.size(); i++){ 00058 uint32_t temp = i+1; 00059 temp|=(1<<4); 00060 compbw[i]->setGeographicalID(DetId(temp)); 00061 } 00062 for(uint32_t i=0; i<compfw.size(); i++){ 00063 uint32_t temp = i+1; 00064 temp|=(2<<4); 00065 compfw[i]->setGeographicalID(DetId(temp)); 00066 } 00067 00068 det->clearComponents(); 00069 det->addComponents(compfw); 00070 det->addComponents(compbw); 00071 00072 }else{ 00073 std::stable_sort(comp.begin(),comp.end(),LessR_module()); 00074 00075 // TID 00076 // Disk Number: 2 bits [1,2,3] 00077 for(uint32_t i=0; i<comp.size(); i++){ 00078 comp[i]->setGeographicalID(DetId(i+1)); 00079 } 00080 00081 det->clearComponents(); 00082 det->addComponents(comp); 00083 } 00084 }else{ 00085 edm::LogError("CmsTrackerWheelBuilder")<<"Where are the Petals or Rings?"; 00086 } 00087 00088 }