Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:28

0001 #include "Alignment/TrackerAlignment/interface/TrackerNameSpace.h"
0002 
0003 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0004 
0005 //______________________________________________________________________________
0006 align::TrackerNameSpace ::TrackerNameSpace(const TrackerTopology* topology)
0007     : trackerTopology_(topology),
0008       tpb_(topology),
0009       tpe_(topology),
0010       tib_(topology),
0011       tob_(topology),
0012       tid_(topology),
0013       tec_(topology) {}
0014 
0015 //______________________________________________________________________________
0016 align::TrackerNameSpace::TPB ::TPB(const TrackerTopology* topology) : trackerTopology_(topology) {}
0017 
0018 //______________________________________________________________________________
0019 unsigned int align::TrackerNameSpace::TPB ::moduleNumber(align::ID id) const { return trackerTopology_->pxbModule(id); }
0020 
0021 //______________________________________________________________________________
0022 unsigned int align::TrackerNameSpace::TPB ::ladderNumber(align::ID id) const {
0023   unsigned int l = trackerTopology_->pxbLadder(id);  // increases with phi
0024   unsigned int c = trackerTopology_->pxbLayer(id) - 1;
0025 
0026   // Ladder in 1st quadrant: number = lpqc_ + 1 - l     (1 to lpqc_)
0027   // Ladder in 2nd quadrant: number = l - lpqc_         (1 to lpqc_)
0028   // Ladder in 3rd quadrant: number = l - lpqc_         (lpqc_ + 1 to 2 * lpqc_)
0029   // Ladder in 4th quadrant: number = 5 * lpqc_ + 1 - l (lpqc_ + 1 to 2 * lpqc_)
0030 
0031   return l > 3 * lpqc_[c] ? 5 * lpqc_[c] + 1 - l :  // ladder in 4th quadrant
0032              (l > lpqc_[c] ? l - lpqc_[c] :         // ladder not in 1st quadrant
0033                   lpqc_[c] + 1 - l);
0034 }
0035 
0036 //______________________________________________________________________________
0037 unsigned int align::TrackerNameSpace::TPB ::layerNumber(align::ID id) const { return trackerTopology_->pxbLayer(id); }
0038 
0039 //______________________________________________________________________________
0040 unsigned int align::TrackerNameSpace::TPB ::halfBarrelNumber(align::ID id) const {
0041   unsigned int l = trackerTopology_->pxbLadder(id);  // increases with phi
0042   unsigned int c = trackerTopology_->pxbLayer(id) - 1;
0043 
0044   return l > lpqc_[c] && l <= 3 * lpqc_[c] ? 1 : 2;
0045 }
0046 
0047 //______________________________________________________________________________
0048 unsigned int align::TrackerNameSpace::TPB ::barrelNumber(align::ID) const { return 1; }
0049 
0050 //______________________________________________________________________________
0051 align::TrackerNameSpace::TPE ::TPE(const TrackerTopology* topology) : trackerTopology_(topology) {}
0052 
0053 unsigned int align::TrackerNameSpace::TPE ::moduleNumber(align::ID id) const { return trackerTopology_->pxfModule(id); }
0054 
0055 unsigned int align::TrackerNameSpace::TPE ::panelNumber(align::ID id) const { return trackerTopology_->pxfPanel(id); }
0056 
0057 unsigned int align::TrackerNameSpace::TPE ::bladeNumber(align::ID id) const {
0058   unsigned int b = trackerTopology_->pxfBlade(id);  // 1 to 24 in increasing phi
0059 
0060   // Blade in 1st quadrant: number = bpqd_ + 1 - b     (1 to bpqd_)
0061   // Blade in 2nd quadrant: number = b - bpqd_         (1 to bpqd_)
0062   // Blade in 3rd quadrant: number = b - bpqd_         (bpqd_ + 1 to 2 * bpqd_)
0063   // Blade in 4th quadrant: number = 5 * bpqd_ + 1 - b (bpqd_ + 1 to 2 * bpqd_)
0064 
0065   return b > 3 * bpqd_ ?  // blade in 4th quadrant
0066              5 * bpqd_ + 1 - b
0067                        : (b > bpqd_ ?  // blade not in 1st quadrant
0068                               b - bpqd_
0069                                     : bpqd_ + 1 - b);
0070 }
0071 
0072 unsigned int align::TrackerNameSpace::TPE ::halfDiskNumber(align::ID id) const { return trackerTopology_->pxfDisk(id); }
0073 
0074 unsigned int align::TrackerNameSpace::TPE ::halfCylinderNumber(align::ID id) const {
0075   unsigned int b = trackerTopology_->pxfBlade(id);  // 1 to 24 in increasing phi
0076 
0077   return b > bpqd_ && b <= 3 * bpqd_ ? 1 : 2;
0078 }
0079 
0080 unsigned int align::TrackerNameSpace::TPE ::endcapNumber(align::ID id) const { return trackerTopology_->pxfSide(id); }
0081 
0082 align::TrackerNameSpace::TIB ::TIB(const TrackerTopology* topology) : trackerTopology_(topology) {}
0083 
0084 unsigned int align::TrackerNameSpace::TIB ::moduleNumber(align::ID id) const { return trackerTopology_->tibModule(id); }
0085 
0086 unsigned int align::TrackerNameSpace::TIB ::stringNumber(align::ID id) const {
0087   std::vector<unsigned int> s = trackerTopology_->tibStringInfo(id);
0088   // s[1]: surface lower = 1, upper = 2
0089   // s[2]: string no. increases with phi
0090 
0091   unsigned int l = 2 * (trackerTopology_->tibLayer(id) - 1) + s[1] - 1;
0092 
0093   // String on +y surface: number = s                (1 to sphs_)
0094   // String in -y surface: number = 2 * sphs_ + 1 - s (1 to sphs_)
0095 
0096   return s[2] > sphs_[l] ? 2 * sphs_[l] + 1 - s[2] : s[2];
0097 }
0098 
0099 unsigned int align::TrackerNameSpace::TIB ::surfaceNumber(align::ID id) const {
0100   return trackerTopology_->tibStringInfo(id)[1];
0101 }
0102 
0103 unsigned int align::TrackerNameSpace::TIB ::halfShellNumber(align::ID id) const {
0104   std::vector<unsigned int> s = trackerTopology_->tibStringInfo(id);
0105   // s[1]: surface lower = 1, upper = 2
0106   // s[2]: string no. increases with phi
0107 
0108   unsigned int l = 2 * (trackerTopology_->tibLayer(id) - 1) + s[1] - 1;
0109 
0110   return s[2] > sphs_[l] ? 1 : 2;
0111 }
0112 
0113 unsigned int align::TrackerNameSpace::TIB ::layerNumber(align::ID id) const { return trackerTopology_->tibLayer(id); }
0114 
0115 unsigned int align::TrackerNameSpace::TIB ::halfBarrelNumber(align::ID id) const {
0116   return trackerTopology_->tibStringInfo(id)[0];
0117 }
0118 
0119 unsigned int align::TrackerNameSpace::TIB ::barrelNumber(align::ID) const { return 1; }
0120 
0121 align::TrackerNameSpace::TOB ::TOB(const TrackerTopology* topology) : trackerTopology_(topology) {}
0122 
0123 unsigned int align::TrackerNameSpace::TOB ::moduleNumber(align::ID id) const { return trackerTopology_->tobModule(id); }
0124 
0125 unsigned int align::TrackerNameSpace::TOB ::rodNumber(align::ID id) const {
0126   return trackerTopology_->tobRodInfo(id)[1];
0127 }
0128 
0129 unsigned int align::TrackerNameSpace::TOB ::layerNumber(align::ID id) const { return trackerTopology_->tobLayer(id); }
0130 
0131 unsigned int align::TrackerNameSpace::TOB ::halfBarrelNumber(align::ID id) const {
0132   return trackerTopology_->tobRodInfo(id)[0];
0133 }
0134 
0135 unsigned int align::TrackerNameSpace::TOB ::barrelNumber(align::ID) const { return 1; }
0136 
0137 align::TrackerNameSpace::TID ::TID(const TrackerTopology* topology) : trackerTopology_(topology) {}
0138 
0139 unsigned int align::TrackerNameSpace::TID ::moduleNumber(align::ID id) const {
0140   return trackerTopology_->tidModuleInfo(id)[1];
0141 }
0142 
0143 unsigned int align::TrackerNameSpace::TID ::sideNumber(align::ID id) const {
0144   return trackerTopology_->tidModuleInfo(id)[0];
0145 }
0146 
0147 unsigned int align::TrackerNameSpace::TID ::ringNumber(align::ID id) const { return trackerTopology_->tidRing(id); }
0148 
0149 unsigned int align::TrackerNameSpace::TID ::diskNumber(align::ID id) const { return trackerTopology_->tidWheel(id); }
0150 
0151 unsigned int align::TrackerNameSpace::TID ::endcapNumber(align::ID id) const { return trackerTopology_->tidSide(id); }
0152 
0153 align::TrackerNameSpace::TEC ::TEC(const TrackerTopology* topology) : trackerTopology_(topology) {}
0154 
0155 unsigned int align::TrackerNameSpace::TEC ::moduleNumber(align::ID id) const { return trackerTopology_->tecModule(id); }
0156 
0157 unsigned int align::TrackerNameSpace::TEC ::ringNumber(align::ID id) const { return trackerTopology_->tecRing(id); }
0158 
0159 unsigned int align::TrackerNameSpace::TEC ::petalNumber(align::ID id) const {
0160   return trackerTopology_->tecPetalInfo(id)[1];
0161 }
0162 
0163 unsigned int align::TrackerNameSpace::TEC ::sideNumber(align::ID id) const {
0164   return trackerTopology_->tecPetalInfo(id)[0];
0165 }
0166 
0167 unsigned int align::TrackerNameSpace::TEC ::diskNumber(align::ID id) const { return trackerTopology_->tecWheel(id); }
0168 
0169 unsigned int align::TrackerNameSpace::TEC ::endcapNumber(align::ID id) const { return trackerTopology_->tecSide(id); }