CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Alignment/LaserAlignment/src/LASGlobalLoop.cc

Go to the documentation of this file.
00001 
00002 #include "Alignment/LaserAlignment/interface/LASGlobalLoop.h"
00003 
00004 
00008 LASGlobalLoop::LASGlobalLoop() {
00009 }
00010 
00011 
00012 
00013 
00014 
00019 bool LASGlobalLoop::TECLoop( int& subdet, int& ring, int& beam, int& disk ) const {
00020 
00021   if( subdet > 1 ) {
00022     std::cerr << " [LASGlobalLoop::TECLoop] ** ERROR: Endcap loop running on TIB/TOB (subdetector > 1)" << std::endl;
00023     throw 1;
00024   }
00025 
00026   ++disk;
00027 
00028   if( disk == 9 ) { 
00029     ++beam;
00030     disk = 0;
00031 
00032     if( beam == 8 ) {
00033       ++ring;
00034       beam = 0;
00035 
00036       if( ring == 2 ) {
00037         ++subdet;
00038         ring = 0;
00039 
00040         if( subdet == 2 ) return false;
00041 
00042       }
00043     }
00044   }
00045 
00046   return true;
00047 
00048 }
00049 
00050 
00051 
00052 
00053 
00058 bool LASGlobalLoop::TIBTOBLoop( int& subdet, int& beam, int& position ) const {
00059 
00060   if( subdet < 2 ) {
00061     std::cerr << " [LASGlobalLoop::TIBTOBLoop] ** ERROR: Barrel loop running on TEC (subdetector < 2)" << std::endl;
00062     throw 1;
00063   }
00064 
00065   ++position;
00066 
00067   if( position == 6 ) {
00068     ++beam;
00069     position = 0;
00070 
00071     if( beam == 8 ) {
00072       ++subdet;
00073       beam = 0;
00074       
00075       if( subdet == 4 ) return false;
00076 
00077     }
00078   }
00079 
00080   return true;
00081 
00082 }
00083 
00084 
00085 
00086 
00087 
00092 bool LASGlobalLoop::TEC2TECLoop( int& subdet, int& beam, int& disk ) const {
00093 
00094   if( subdet > 1 ) {
00095     std::cerr << " [LASGlobalLoop::TEC2TECLoop] ** ERROR: TEC loop running on TIB/TOB (subdetector > 1)" << std::endl;
00096     throw 1;
00097   }
00098 
00099   ++disk;
00100 
00101   if( disk == 5 ) {
00102     ++beam;
00103     disk = 0;
00104 
00105     if( beam == 8 ) {
00106       ++subdet;
00107       beam = 0;
00108       
00109       if( subdet == 2 ) return false;
00110 
00111     }
00112   }
00113 
00114   return true;
00115 
00116 }