CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Alignment/TrackerAlignment/interface/TPBNameSpace.h

Go to the documentation of this file.
00001 #ifndef Alignment_TrackerAlignment_TPBNameSpace_H
00002 #define Alignment_TrackerAlignment_TPBNameSpace_H
00003 
00015 #include "CondFormats/Alignment/interface/Definitions.h"
00016 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
00017 #include "Geometry/Records/interface/IdealGeometryRecord.h"
00018 
00019 namespace align
00020 {
00021   namespace tpb
00022   {
00024     const unsigned int lpqc[] = {5, 8, 11};
00025 
00027     inline unsigned int moduleNumber(align::ID, const TrackerTopology*);
00028 
00031     inline unsigned int ladderNumber(align::ID, const TrackerTopology*);
00032 
00034     inline unsigned int layerNumber(align::ID, const TrackerTopology*);
00035 
00037     inline unsigned int halfBarrelNumber(align::ID, const TrackerTopology*);
00038   }
00039 }
00040 
00041 unsigned int align::tpb::moduleNumber(align::ID id, const TrackerTopology* tTopo)
00042 {
00043   return tTopo->pxbModule(id);
00044 }
00045 
00046 unsigned int align::tpb::ladderNumber(align::ID id, const TrackerTopology* tTopo)
00047 {
00048   
00049 
00050   unsigned int l = tTopo->pxbLadder(id); // increases with phi
00051   unsigned int c = tTopo->pxbLayer(id) - 1;
00052 
00053 // Ladder in 1st quadrant: number = lpqc + 1 - l     (1 to lpqc)
00054 // Ladder in 2nd quadrant: number = l - lpqc         (1 to lpqc)
00055 // Ladder in 3rd quadrant: number = l - lpqc         (lpqc + 1 to 2 * lpqc)
00056 // Ladder in 4th quadrant: number = 5 * lpqc + 1 - l (lpqc + 1 to 2 * lpqc)
00057 
00058   return l > 3 * lpqc[c] ? // ladder in 4th quadrant
00059     5 * lpqc[c] + 1 - l :
00060     (l > lpqc[c] ? // ladder not in 1st quadrant
00061      l - lpqc[c] : lpqc[c] + 1 - l);
00062 }
00063 
00064 unsigned int align::tpb::layerNumber(align::ID id, const TrackerTopology* tTopo)
00065 {
00066   return tTopo->pxbLayer(id);
00067 }
00068 
00069 unsigned int align::tpb::halfBarrelNumber(align::ID id, const TrackerTopology* tTopo)
00070 {
00071   
00072 
00073   unsigned int l = tTopo->pxbLadder(id); // increases with phi
00074   unsigned int c = tTopo->pxbLayer(id) - 1;
00075 
00076   return l > lpqc[c] && l <= 3 * lpqc[c] ? 1 : 2;
00077 }
00078 
00079 #endif