#include <Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDiskBuilder.h>
Private Member Functions | |
virtual void | buildComponent (DDFilteredView &, GeometricDet *, std::string) |
virtual void | sortNS (DDFilteredView &, GeometricDet *) |
Definition at line 10 of file CmsTrackerDiskBuilder.h.
void CmsTrackerDiskBuilder::buildComponent | ( | DDFilteredView & | fv, | |
GeometricDet * | g, | |||
std::string | s | |||
) | [private, virtual] |
Implements CmsTrackerLevelBuilder.
Definition at line 12 of file CmsTrackerDiskBuilder.cc.
References GeometricDet::addComponent(), CmsTrackerLevelBuilder::build(), ExtractStringFromDDD::getString(), GeometricDet::panel, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum, and CmsTrackerStringToEnum::type().
00012 { 00013 00014 CmsTrackerPanelBuilder theCmsTrackerPanelBuilder; 00015 GeometricDet * subdet = new GeometricDet(&fv,theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(s,&fv))); 00016 00017 switch (theCmsTrackerStringToEnum.type(ExtractStringFromDDD::getString(s,&fv))){ 00018 case GeometricDet::panel: 00019 theCmsTrackerPanelBuilder.build(fv,subdet,s); 00020 break; 00021 default: 00022 edm::LogError("CmsTrackerDiskBuilder")<<" ERROR - I was expecting a Panel, I got a "<<ExtractStringFromDDD::getString(s,&fv); 00023 } 00024 g->addComponent(subdet); 00025 }
void CmsTrackerDiskBuilder::sortNS | ( | DDFilteredView & | fv, | |
GeometricDet * | det | |||
) | [private, virtual] |
Reimplemented from CmsTrackerLevelBuilder.
Definition at line 27 of file CmsTrackerDiskBuilder.cc.
References GeometricDet::addComponents(), GeometricDet::clearComponents(), GeometricDet::components(), fn, j, GeometricDet::panel, pyDBSRunClass::temp, TrackerStablePhiSort(), and z.
00027 { 00028 00029 GeometricDet::GeometricDetContainer & comp = det->components(); 00030 00031 switch(det->components().front()->type()){ 00032 case GeometricDet::panel: 00033 TrackerStablePhiSort(comp.begin(),comp.end(), ExtractPhi()); 00034 break; 00035 default: 00036 edm::LogError("CmsTrackerDiskBuilder")<<"ERROR - wrong SubDet to sort..... "<<det->components().front()->type(); 00037 } 00038 00039 GeometricDet::GeometricDetContainer zminpanels; // Here z refers abs(z); 00040 GeometricDet::GeometricDetContainer zmaxpanels; // So, zmin panel is always closer to ip. 00041 00042 uint32_t totalblade = comp.size()/2; 00043 if ( totalblade != 24 ) 00044 edm::LogError("CmsTrackerDiskBuilder")<<"ERROR, The Total Number of Blade in one disk is "<<totalblade; 00045 00046 zminpanels.reserve(totalblade); 00047 zmaxpanels.reserve(totalblade); 00048 for( uint32_t j=0; j<totalblade ;j++) 00049 { 00050 if ( fabs( comp[2*j]->translation().z() ) > fabs( comp[ 2*j +1 ]->translation().z() ) ) { 00051 zmaxpanels.push_back(comp[2*j] ); 00052 zminpanels.push_back(comp[2*j+1]); 00053 00054 }else if ( fabs( comp[2*j]->translation().z() ) < fabs( comp[ 2*j +1 ]->translation().z() ) ) { 00055 zmaxpanels.push_back(comp[2*j+1] ); 00056 zminpanels.push_back(comp[2*j]); 00057 00058 }else { 00059 edm::LogWarning("CmsTrackerDiskBuilder")<<"WARNING - The Z of both panels are equal! "; 00060 } 00061 00062 } 00063 00064 for ( uint32_t fn=0; fn< zminpanels.size(); fn++) { 00065 uint32_t blade = fn+1; 00066 uint32_t panel = 1; 00067 uint32_t temp = (blade<<2) | panel; 00068 zminpanels[fn]->setGeographicalID(temp); 00069 } 00070 00071 for (uint32_t bn=0; bn< zmaxpanels.size(); bn++) { 00072 uint32_t blade = bn+1; 00073 uint32_t panel = 2; 00074 uint32_t temp = (blade<<2) | panel; 00075 zmaxpanels[bn]->setGeographicalID(temp); 00076 } 00077 00078 det->clearComponents(); 00079 00080 det->addComponents(zminpanels); 00081 det->addComponents(zmaxpanels); 00082 }