CMS 3D CMS Logo

LASGlobalLoop Class Reference

helper class for looping over LASGlobalData objects (si-strip module loops). More...

#include <Alignment/LaserAlignment/src/LASGlobalLoop.h>

List of all members.

Public Member Functions

 LASGlobalLoop ()
bool TEC2TECLoop (int &, int &, int &) const
 full TEC AT loop with starting values given by parameter values
bool TECLoop (int &, int &, int &, int &) const
 full TEC loop (both endcaps) with starting values given by parameter values
bool TIBTOBLoop (int &, int &, int &) const
 full TIB+TOB loop with starting values given by parameter values


Detailed Description

helper class for looping over LASGlobalData objects (si-strip module loops).

Use exactly as:

 LASGlobalLoop theLoop;
 int det = 0, ring = 0, beam = 0, disk = 0;
 do {
   // det,ring,beam,disk will loop the full TEC+,TEC-
 } while ( loop.TECLoop( det, ring, beam, disk ) );
 int pos = 0;
 det = 2; // set subdetector to TIB
 beam = 0;
 do {
   // dto.
 } while( loop.TIBTOBLoop( det, beam, disk ) );

Definition at line 24 of file LASGlobalLoop.h.


Constructor & Destructor Documentation

LASGlobalLoop::LASGlobalLoop (  ) 

Definition at line 8 of file LASGlobalLoop.cc.

00008                              {
00009 }


Member Function Documentation

bool LASGlobalLoop::TEC2TECLoop ( int subdet,
int beam,
int disk 
) const

full TEC AT loop with starting values given by parameter values

Definition at line 92 of file LASGlobalLoop.cc.

References TestMuL1L2Filter_cff::cerr, and lat::endl().

Referenced by LaserAlignment::beginJob(), LaserAlignment::CalculateNominalCoordinates(), LaserAlignment::endJob(), fcn(), LaserAlignment::fillPedestalProfiles(), LaserAlignment::produce(), and LASBarrelAlgorithm::ReadMisalignmentFromFile().

00092                                                                          {
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 }

bool LASGlobalLoop::TECLoop ( int subdet,
int ring,
int beam,
int disk 
) const

full TEC loop (both endcaps) with starting values given by parameter values

Definition at line 19 of file LASGlobalLoop.cc.

References TestMuL1L2Filter_cff::cerr, and lat::endl().

Referenced by LaserAlignment::beginJob(), LaserAlignment::CalculateNominalCoordinates(), LASEndcapAlgorithm::CalculateParameters(), LaserAlignment::endJob(), LaserAlignment::fillPedestalProfiles(), LaserAlignment::produce(), and LASBarrelAlgorithm::ReadMisalignmentFromFile().

00019                                                                                 {
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 }

bool LASGlobalLoop::TIBTOBLoop ( int subdet,
int beam,
int position 
) const

full TIB+TOB loop with starting values given by parameter values

Definition at line 58 of file LASGlobalLoop.cc.

References TestMuL1L2Filter_cff::cerr, and lat::endl().

Referenced by LaserAlignment::beginJob(), LaserAlignment::CalculateNominalCoordinates(), LaserAlignment::endJob(), fcn(), LaserAlignment::fillPedestalProfiles(), LaserAlignment::isATBeam(), LaserAlignment::produce(), and LASBarrelAlgorithm::ReadMisalignmentFromFile().

00058                                                                             {
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 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:27 2009 for CMSSW by  doxygen 1.5.4