00001 00002 #include "Alignment/LaserAlignment/src/LASBarrelAlignmentParameterSet.h" 00003 00004 00005 00009 LASBarrelAlignmentParameterSet::LASBarrelAlignmentParameterSet(){ 00010 00011 Init(); 00012 00013 } 00014 00015 00016 00017 00018 00022 void LASBarrelAlignmentParameterSet::Init( void ) { 00023 00024 // could use a single vector<vector<vector<pair<> > > > 00025 // but better split it in 6 parts 00026 00027 for( int i = 0; i < 2; ++i ) { // twice; once for each endface 00028 tecPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) ); 00029 tecMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) ); 00030 tibPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) ); 00031 tibMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) ); 00032 tobPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) ); 00033 tobMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) ); 00034 } 00035 00036 } 00037 00038 00039 00040 00041 00049 std::pair<double,double>& LASBarrelAlignmentParameterSet::GetParameter( int aSubdetector, int aDisk, int aParameter ) { 00050 00051 if( aSubdetector < 0 || aSubdetector > 5 ) { 00052 throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal subdetector index: " << aSubdetector << "." << std::endl; 00053 } 00054 00055 if( aDisk < 0 || aDisk > 1 ) { 00056 throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal endface index: " << aDisk << "." << std::endl; 00057 } 00058 00059 if( aParameter < 0 || aParameter > 2 ) { 00060 throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal parameter index: " << aParameter << "." << std::endl; 00061 } 00062 00063 00064 // would use a switch here, but this creates problems.. 00065 if( aSubdetector == 0 ) return tecPlusParameters.at( aDisk ).at( aParameter ); 00066 else if( aSubdetector == 1 ) return tecMinusParameters.at( aDisk ).at( aParameter ); 00067 else if( aSubdetector == 2 ) return tibPlusParameters.at( aDisk ).at( aParameter ); 00068 else if( aSubdetector == 3 ) return tibMinusParameters.at( aDisk ).at( aParameter ); 00069 else if( aSubdetector == 4 ) return tobPlusParameters.at( aDisk ).at( aParameter ); 00070 else return tobMinusParameters.at( aDisk ).at( aParameter ); 00071 00072 00073 }