CMS 3D CMS Logo

LASEndcapAlignmentParameterSet.cc

Go to the documentation of this file.
00001 
00002 #include "Alignment/LaserAlignment/src/LASEndcapAlignmentParameterSet.h"
00003 
00004 
00005 
00006 
00010 LASEndcapAlignmentParameterSet::LASEndcapAlignmentParameterSet() {
00011 
00012   Init();
00013   
00014 }
00015 
00016 
00017 
00018 
00019 
00023 void LASEndcapAlignmentParameterSet::Init( void ) {
00024 
00025   // could use a single vector<vector<vector<pair<> > > >
00026   // but better split it in 2 parts
00027 
00028   for( int i = 0; i < 9; ++i ) { // nine times; once for each disk
00029     tecPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) );
00030     tecMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) );
00031   }
00032 
00033 }
00034 
00035 
00036 
00037 
00038 
00046 std::pair<double,double>& LASEndcapAlignmentParameterSet::GetParameter( int aSubdetector, int aDisk, int aParameter ) {
00047 
00048   if( aSubdetector < 0 || aSubdetector > 1 ) {
00049     throw cms::Exception( "Laser Alignment" ) << " [LASEndcapAlignmentParameterSet::GetParameter] ERROR ** Illegal subdetector index: " << aSubdetector << "." << std::endl;
00050   }
00051 
00052   if( aDisk < 0 || aDisk > 8 ) {
00053     throw cms::Exception( "Laser Alignment" ) << " [LASEndcapAlignmentParameterSet::GetParameter] ERROR ** Illegal endface index: " << aDisk << "." << std::endl;
00054   }
00055   
00056   if( aParameter < 0 || aParameter > 2 ) {
00057     throw cms::Exception( "Laser Alignment" ) << " [LASEndcapAlignmentParameterSet::GetParameter] ERROR ** Illegal parameter index: " << aParameter << "." << std::endl;
00058   }
00059 
00060 
00061   if( aSubdetector == 0 ) return tecPlusParameters.at( aDisk ).at( aParameter );
00062   return tecMinusParameters.at( aDisk ).at( aParameter );
00063 
00064 }
00065 
00066 
00067 
00068 
00069 
00073 void LASEndcapAlignmentParameterSet::Dump( void ) {
00074   
00075   std::cout << " [LASEndcapAlignmentParameterSet::Dump] -- Dumping parameters in format: deltaPhi±e, deltaX±e, deltaY±e" << std::endl;
00076   for( int det = 0; det < 2; ++det ) {
00077     std::cout << "   " << (det==0 ? "TEC+" : "TEC-") << ": " << std::endl;
00078     for( int disk = 0; disk < 9; ++disk ) {
00079       std::cout << "     disk " << disk << ": ";
00080       for( int par = 0; par < 3; ++par ) std::cout << std::setw( 5 ) << GetParameter( det, disk, par ).first 
00081                                                    << " ± " << std::setw( 5 ) << std::left << GetParameter( det, disk, par ).second;
00082       std::cout << std::endl;
00083     }
00084   }
00085   std::cout << " [LASEndcapAlignmentParameterSet::Dump] -- End of dump." << std::endl << std::endl;
00086 
00087 }
00088 

Generated on Tue Jun 9 17:24:08 2009 for CMSSW by  doxygen 1.5.4