CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

LASBarrelAlignmentParameterSet Class Reference

#include <LASBarrelAlignmentParameterSet.h>

List of all members.

Public Member Functions

std::pair< double, double > & GetBeamParameter (int aBeam, int aParameter)
std::pair< double, double > & GetParameter (int aSubdetector, int aDisk, int aParameter)
 LASBarrelAlignmentParameterSet ()
void Print (void)

Private Member Functions

void Init (void)

Private Attributes

std::vector< std::vector
< std::pair< double, double > > > 
beamParameters
std::vector< std::vector
< std::pair< double, double > > > 
tecMinusParameters
std::vector< std::vector
< std::pair< double, double > > > 
tecPlusParameters
std::vector< std::vector
< std::pair< double, double > > > 
tibMinusParameters
std::vector< std::vector
< std::pair< double, double > > > 
tibPlusParameters
std::vector< std::vector
< std::pair< double, double > > > 
tobMinusParameters
std::vector< std::vector
< std::pair< double, double > > > 
tobPlusParameters

Detailed Description

container for storing the alignment parameters calculated by class LASBarrelAlgorithm

structure: for each of the 6 subdetectors (TEC+-, TIB+-, TOB+-) there's a vector each of these contains two vector<pair<>>, one for each endface in the subdet each of those vector has three pair<> entries, one for each parameter (rot, deltaX, deltaY) each entry is a pair containing <parameter,error>

Definition at line 24 of file LASBarrelAlignmentParameterSet.h.


Constructor & Destructor Documentation

LASBarrelAlignmentParameterSet::LASBarrelAlignmentParameterSet ( )

Definition at line 9 of file LASBarrelAlignmentParameterSet.cc.

References Init().

                                                              {

  Init();
  
}

Member Function Documentation

std::pair< double, double > & LASBarrelAlignmentParameterSet::GetBeamParameter ( int  aBeam,
int  aParameter 
)

return a single beam parameter (pair<> for value, error). we have eight beams with two parameters each (phi1, phi2)

Definition at line 87 of file LASBarrelAlignmentParameterSet.cc.

References beamParameters, and Exception.

Referenced by LASAlignmentTubeAlgorithm::CalculateParameters(), LASAlignmentTubeAlgorithm::GetTEC2TECAlignmentParameterCorrection(), LASAlignmentTubeAlgorithm::GetTIBTOBAlignmentParameterCorrection(), and Print().

                                                                                                    {
  
  if( aBeam < 0 || aBeam > 7 ) {
    throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal beam index: " << aBeam << "." << std::endl;
  }

  if( aParameter < 0 || aParameter > 1 ) {
    throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal beam parameter index: " << aParameter << "." << std::endl;
  }

  return beamParameters.at( aBeam ).at( aParameter );

}
std::pair< double, double > & LASBarrelAlignmentParameterSet::GetParameter ( int  aSubdetector,
int  aDisk,
int  aParameter 
)

function for accessing a single parameter (pair<>); indices are: aSubdetector = 0 (TEC+), 1 (TEC-), 2 (TIB+), 3 (TIB-), 4 (TOB+), 5 (TOB-) aDisk = 0 (lower z), 1 (upper z) aParameter: 0 (rotation angle), 1 (x displacement), 2 (y displacement)

Definition at line 53 of file LASBarrelAlignmentParameterSet.cc.

References Exception, tecMinusParameters, tecPlusParameters, tibMinusParameters, tibPlusParameters, tobMinusParameters, and tobPlusParameters.

Referenced by LASBarrelAlgorithm::CalculateParameters(), LASAlignmentTubeAlgorithm::CalculateParameters(), LASAlignmentTubeAlgorithm::GetTEC2TECAlignmentParameterCorrection(), LASAlignmentTubeAlgorithm::GetTIBTOBAlignmentParameterCorrection(), Print(), and LASGeometryUpdater::TrackerUpdate().

                                                                                                                  {

  if( aSubdetector < 0 || aSubdetector > 5 ) {
    throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal subdetector index: " << aSubdetector << "." << std::endl;
  }

  if( aDisk < 0 || aDisk > 1 ) {
    throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal endface index: " << aDisk << "." << std::endl;
  }
  
  if( aParameter < 0 || aParameter > 2 ) {
    throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal parameter index: " << aParameter << "." << std::endl;
  }


  // would use a switch here, but this creates problems..
  if( aSubdetector == 0 ) return tecPlusParameters.at( aDisk ).at( aParameter );
  else if( aSubdetector == 1 ) return tecMinusParameters.at( aDisk ).at( aParameter );
  else if( aSubdetector == 2 ) return tibPlusParameters.at( aDisk ).at( aParameter );
  else if( aSubdetector == 3 ) return tibMinusParameters.at( aDisk ).at( aParameter );
  else if( aSubdetector == 4 ) return tobPlusParameters.at( aDisk ).at( aParameter );
  else return tobMinusParameters.at( aDisk ).at( aParameter );


}
void LASBarrelAlignmentParameterSet::Init ( void  ) [private]

whatever initialization is needed

Definition at line 22 of file LASBarrelAlignmentParameterSet.cc.

References beamParameters, i, tecMinusParameters, tecPlusParameters, tibMinusParameters, tibPlusParameters, tobMinusParameters, and tobPlusParameters.

Referenced by LASBarrelAlignmentParameterSet().

                                                {

  // could use a single vector<vector<vector<pair<> > > >
  // but better split it in 6 parts
  for( int i = 0; i < 2; ++i ) { // twice; once for each endface
    tecPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) );
    tecMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) );
    tibPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) );
    tibMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) );
    tobPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) );
    tobMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) );
  }

  // the beam parameters (8 beams * 2 pars) are stored in one single container
  for( int i = 0; i < 8; ++i ) {
    beamParameters.push_back( std::vector<std::pair<double,double> >( 2 ) );
  }

}
void LASBarrelAlignmentParameterSet::Print ( void  )

pretty-print all parameter and error values

Definition at line 108 of file LASBarrelAlignmentParameterSet.cc.

References gather_cfg::cout, GetBeamParameter(), GetParameter(), and Gflash::par.

Referenced by LaserAlignment::endRun().

                                                 {
  
  std::cout << std::endl << " [LASBarrelAlignmentParameterSet::Print] -- Parameter list [rad/mm]: " << std::endl;

  const std::string subdetNames[6] = { " TEC+  ", " TEC-  ", " TIB+  ", " TIB-  ", " TOB+  ", " TOB-  " };

  std::cout << " Detector parameters: " << std::endl;
  std::cout << " --------------------" << std::endl;
  std::cout << " Values:     PHI1         X1          Y1         PHI2         X2          Y2   " << std::endl;
  for( int subdet = 0; subdet < 6; ++subdet ) {
    std::cout <<subdetNames[subdet];
    for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 0, par ).first;
    for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 1, par ).first;
    std::cout << std::endl;
  }

  std::cout << " Errors:     PHI1         X1          Y1         PHI2         X2          Y2   " << std::endl;
  for( int subdet = 0; subdet < 6; ++subdet ) {
    std::cout <<subdetNames[subdet];
    for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 0, par ).second;
    for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 1, par ).second;
    std::cout << std::endl;
  }

  std::cout << std::endl;
  std::cout << " Beam parameters: " << std::endl;
  std::cout << " ----------------" << std::endl;
  std::cout << " Values:     PHI1        PHI2" << std::endl;
  for( int beam = 0; beam < 8; ++beam ) {
    std::cout << " beam " << beam;
    for( int par = 0; par < 2; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetBeamParameter( beam, par ).first;
    std::cout << std::endl;
  }

  std::cout << " Errors:     PHI1        PHI2" << std::endl;
  for( int beam = 0; beam < 8; ++beam ) {
    std::cout << " beam " << beam;
    for( int par = 0; par < 2; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetBeamParameter( beam, par ).second;
    std::cout << std::endl;
  }

  std::cout << " [LASBarrelAlignmentParameterSet::Print] -- End parameter list." << std::endl;

}

Member Data Documentation

std::vector<std::vector<std::pair<double,double> > > LASBarrelAlignmentParameterSet::beamParameters [private]

Definition at line 42 of file LASBarrelAlignmentParameterSet.h.

Referenced by GetBeamParameter(), and Init().

std::vector<std::vector<std::pair<double,double> > > LASBarrelAlignmentParameterSet::tecMinusParameters [private]

Definition at line 36 of file LASBarrelAlignmentParameterSet.h.

Referenced by GetParameter(), and Init().

std::vector<std::vector<std::pair<double,double> > > LASBarrelAlignmentParameterSet::tecPlusParameters [private]

Definition at line 35 of file LASBarrelAlignmentParameterSet.h.

Referenced by GetParameter(), and Init().

std::vector<std::vector<std::pair<double,double> > > LASBarrelAlignmentParameterSet::tibMinusParameters [private]

Definition at line 38 of file LASBarrelAlignmentParameterSet.h.

Referenced by GetParameter(), and Init().

std::vector<std::vector<std::pair<double,double> > > LASBarrelAlignmentParameterSet::tibPlusParameters [private]

Definition at line 37 of file LASBarrelAlignmentParameterSet.h.

Referenced by GetParameter(), and Init().

std::vector<std::vector<std::pair<double,double> > > LASBarrelAlignmentParameterSet::tobMinusParameters [private]

Definition at line 40 of file LASBarrelAlignmentParameterSet.h.

Referenced by GetParameter(), and Init().

std::vector<std::vector<std::pair<double,double> > > LASBarrelAlignmentParameterSet::tobPlusParameters [private]

Definition at line 39 of file LASBarrelAlignmentParameterSet.h.

Referenced by GetParameter(), and Init().