CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/Alignment/TrackerAlignment/interface/TPENameSpace.h

Go to the documentation of this file.
00001 #ifndef Alignment_CommonAlignment_TPENameSpace_H
00002 #define Alignment_CommonAlignment_TPENameSpace_H
00003 
00015 #include "CondFormats/Alignment/interface/Definitions.h"
00016 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
00017 
00018 namespace align
00019 {
00020   namespace tpe
00021   {
00022     const unsigned int bpqd = 6; // no. of blades per quarter disk
00023 
00025     inline unsigned int moduleNumber( align::ID );
00026 
00028     inline unsigned int panelNumber( align::ID );
00029 
00032     inline unsigned int bladeNumber( align::ID );
00033 
00035     inline unsigned int halfDiskNumber( align::ID );
00036 
00038     inline unsigned int halfCylinderNumber( align::ID );
00039 
00041     inline unsigned int endcapNumber( align::ID );
00042   }
00043 }
00044 
00045 unsigned int align::tpe::moduleNumber(align::ID id)
00046 {
00047   return PXFDetId(id).module();
00048 }
00049 
00050 unsigned int align::tpe::panelNumber(align::ID id)
00051 {
00052   return PXFDetId(id).panel();
00053 }
00054 
00055 unsigned int align::tpe::bladeNumber(align::ID id)
00056 {
00057   unsigned int b = PXFDetId(id).blade(); // 1 to 24 in increasing phi
00058 
00059 // Blade in 1st quadrant: number = bpqd + 1 - b     (1 to bpqd)
00060 // Blade in 2nd quadrant: number = b - bpqd         (1 to bpqd)
00061 // Blade in 3rd quadrant: number = b - bpqd         (bpqd + 1 to 2 * bpqd)
00062 // Blade in 4th quadrant: number = 5 * bpqd + 1 - b (bpqd + 1 to 2 * bpqd)
00063 
00064   return b > 3 * bpqd ? // blade in 4th quadrant
00065     5 * bpqd + 1 - b :
00066     (b > bpqd ? // blade not in 1st quadrant
00067      b - bpqd : bpqd + 1 - b);
00068 }
00069 
00070 unsigned int align::tpe::halfDiskNumber(align::ID id)
00071 {
00072   return PXFDetId(id).disk();
00073 }
00074 
00075 unsigned int align::tpe::halfCylinderNumber(align::ID id)
00076 {
00077   unsigned int b = PXFDetId(id).blade(); // 1 to 24 in increasing phi
00078 
00079   return b > bpqd && b <= 3 * bpqd ? 1 : 2;
00080 }
00081 
00082 unsigned int align::tpe::endcapNumber(align::ID id)
00083 {
00084   return PXFDetId(id).side();
00085 }
00086 
00087 #endif