Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:03

0001 
0002 #include "Alignment/LaserAlignment/interface/LASGlobalLoop.h"
0003 
0004 ///
0005 ///
0006 ///
0007 LASGlobalLoop::LASGlobalLoop() {}
0008 
0009 ///
0010 /// full TEC loop (both endcaps)
0011 /// with starting values given by parameter values
0012 ///
0013 bool LASGlobalLoop::TECLoop(int& subdet, int& ring, int& beam, int& disk) const {
0014   if (subdet > 1) {
0015     std::cerr << " [LASGlobalLoop::TECLoop] ** ERROR: Endcap loop running on TIB/TOB (subdetector > 1)" << std::endl;
0016     throw 1;
0017   }
0018 
0019   ++disk;
0020 
0021   if (disk == 9) {
0022     ++beam;
0023     disk = 0;
0024 
0025     if (beam == 8) {
0026       ++ring;
0027       beam = 0;
0028 
0029       if (ring == 2) {
0030         ++subdet;
0031         ring = 0;
0032 
0033         if (subdet == 2)
0034           return false;
0035       }
0036     }
0037   }
0038 
0039   return true;
0040 }
0041 
0042 ///
0043 /// full TIB+TOB loop
0044 /// with starting values given by parameter values
0045 ///
0046 bool LASGlobalLoop::TIBTOBLoop(int& subdet, int& beam, int& position) const {
0047   if (subdet < 2) {
0048     std::cerr << " [LASGlobalLoop::TIBTOBLoop] ** ERROR: Barrel loop running on TEC (subdetector < 2)" << std::endl;
0049     throw 1;
0050   }
0051 
0052   ++position;
0053 
0054   if (position == 6) {
0055     ++beam;
0056     position = 0;
0057 
0058     if (beam == 8) {
0059       ++subdet;
0060       beam = 0;
0061 
0062       if (subdet == 4)
0063         return false;
0064     }
0065   }
0066 
0067   return true;
0068 }
0069 
0070 ///
0071 /// full TEC AT loop
0072 /// with starting values given by parameter values
0073 ///
0074 bool LASGlobalLoop::TEC2TECLoop(int& subdet, int& beam, int& disk) const {
0075   if (subdet > 1) {
0076     std::cerr << " [LASGlobalLoop::TEC2TECLoop] ** ERROR: TEC loop running on TIB/TOB (subdetector > 1)" << std::endl;
0077     throw 1;
0078   }
0079 
0080   ++disk;
0081 
0082   if (disk == 5) {
0083     ++beam;
0084     disk = 0;
0085 
0086     if (beam == 8) {
0087       ++subdet;
0088       beam = 0;
0089 
0090       if (subdet == 2)
0091         return false;
0092     }
0093   }
0094 
0095   return true;
0096 }