test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
LASBarrelAlignmentParameterSet Class Reference

#include <LASBarrelAlignmentParameterSet.h>

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:

Definition at line 24 of file LASBarrelAlignmentParameterSet.h.

Constructor & Destructor Documentation

LASBarrelAlignmentParameterSet::LASBarrelAlignmentParameterSet ( )

Definition at line 9 of file LASBarrelAlignmentParameterSet.cc.

References Init().

9  {
10 
11  Init();
12 
13 }

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().

87  {
88 
89  if( aBeam < 0 || aBeam > 7 ) {
90  throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal beam index: " << aBeam << "." << std::endl;
91  }
92 
93  if( aParameter < 0 || aParameter > 1 ) {
94  throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal beam parameter index: " << aParameter << "." << std::endl;
95  }
96 
97  return beamParameters.at( aBeam ).at( aParameter );
98 
99 }
std::vector< std::vector< std::pair< double, double > > > beamParameters
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 LASAlignmentTubeAlgorithm::CalculateParameters(), LASBarrelAlgorithm::CalculateParameters(), LASAlignmentTubeAlgorithm::GetTEC2TECAlignmentParameterCorrection(), LASAlignmentTubeAlgorithm::GetTIBTOBAlignmentParameterCorrection(), Print(), and LASGeometryUpdater::TrackerUpdate().

53  {
54 
55  if( aSubdetector < 0 || aSubdetector > 5 ) {
56  throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal subdetector index: " << aSubdetector << "." << std::endl;
57  }
58 
59  if( aDisk < 0 || aDisk > 1 ) {
60  throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal endface index: " << aDisk << "." << std::endl;
61  }
62 
63  if( aParameter < 0 || aParameter > 2 ) {
64  throw cms::Exception( "Laser Alignment" ) << " [LASBarrelAlignmentParameterSet::GetParameter] ERROR ** Illegal parameter index: " << aParameter << "." << std::endl;
65  }
66 
67 
68  // would use a switch here, but this creates problems..
69  if( aSubdetector == 0 ) return tecPlusParameters.at( aDisk ).at( aParameter );
70  else if( aSubdetector == 1 ) return tecMinusParameters.at( aDisk ).at( aParameter );
71  else if( aSubdetector == 2 ) return tibPlusParameters.at( aDisk ).at( aParameter );
72  else if( aSubdetector == 3 ) return tibMinusParameters.at( aDisk ).at( aParameter );
73  else if( aSubdetector == 4 ) return tobPlusParameters.at( aDisk ).at( aParameter );
74  else return tobMinusParameters.at( aDisk ).at( aParameter );
75 
76 
77 }
std::vector< std::vector< std::pair< double, double > > > tecPlusParameters
std::vector< std::vector< std::pair< double, double > > > tobPlusParameters
std::vector< std::vector< std::pair< double, double > > > tobMinusParameters
std::vector< std::vector< std::pair< double, double > > > tibMinusParameters
std::vector< std::vector< std::pair< double, double > > > tecMinusParameters
std::vector< std::vector< std::pair< double, double > > > tibPlusParameters
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().

22  {
23 
24  // could use a single vector<vector<vector<pair<> > > >
25  // but better split it in 6 parts
26  for( int i = 0; i < 2; ++i ) { // twice; once for each endface
27  tecPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) );
28  tecMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) );
29  tibPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) );
30  tibMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) );
31  tobPlusParameters.push_back ( std::vector<std::pair<double,double> >( 3 ) );
32  tobMinusParameters.push_back( std::vector<std::pair<double,double> >( 3 ) );
33  }
34 
35  // the beam parameters (8 beams * 2 pars) are stored in one single container
36  for( int i = 0; i < 8; ++i ) {
37  beamParameters.push_back( std::vector<std::pair<double,double> >( 2 ) );
38  }
39 
40 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::vector< std::pair< double, double > > > tecPlusParameters
std::vector< std::vector< std::pair< double, double > > > tobPlusParameters
std::vector< std::vector< std::pair< double, double > > > tobMinusParameters
std::vector< std::vector< std::pair< double, double > > > tibMinusParameters
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 > > > tibPlusParameters
void LASBarrelAlignmentParameterSet::Print ( void  )

pretty-print all parameter and error values

Definition at line 108 of file LASBarrelAlignmentParameterSet.cc.

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, GetBeamParameter(), GetParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and subdetNames.

Referenced by LaserAlignment::endRunProduce().

108  {
109 
110  std::cout << std::endl << " [LASBarrelAlignmentParameterSet::Print] -- Parameter list [rad/mm]: " << std::endl;
111 
112  const std::string subdetNames[6] = { " TEC+ ", " TEC- ", " TIB+ ", " TIB- ", " TOB+ ", " TOB- " };
113 
114  std::cout << " Detector parameters: " << std::endl;
115  std::cout << " --------------------" << std::endl;
116  std::cout << " Values: PHI1 X1 Y1 PHI2 X2 Y2 " << std::endl;
117  for( int subdet = 0; subdet < 6; ++subdet ) {
118  std::cout <<subdetNames[subdet];
119  for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 0, par ).first;
120  for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 1, par ).first;
121  std::cout << std::endl;
122  }
123 
124  std::cout << " Errors: PHI1 X1 Y1 PHI2 X2 Y2 " << std::endl;
125  for( int subdet = 0; subdet < 6; ++subdet ) {
126  std::cout <<subdetNames[subdet];
127  for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 0, par ).second;
128  for( int par = 0; par < 3; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetParameter( subdet, 1, par ).second;
129  std::cout << std::endl;
130  }
131 
132  std::cout << std::endl;
133  std::cout << " Beam parameters: " << std::endl;
134  std::cout << " ----------------" << std::endl;
135  std::cout << " Values: PHI1 PHI2" << std::endl;
136  for( int beam = 0; beam < 8; ++beam ) {
137  std::cout << " beam " << beam;
138  for( int par = 0; par < 2; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetBeamParameter( beam, par ).first;
139  std::cout << std::endl;
140  }
141 
142  std::cout << " Errors: PHI1 PHI2" << std::endl;
143  for( int beam = 0; beam < 8; ++beam ) {
144  std::cout << " beam " << beam;
145  for( int par = 0; par < 2; ++par ) std::cout << std::right << std::setw( 12 ) << std::setprecision( 6 ) << std::fixed << GetBeamParameter( beam, par ).second;
146  std::cout << std::endl;
147  }
148 
149  std::cout << " [LASBarrelAlignmentParameterSet::Print] -- End parameter list." << std::endl;
150 
151 }
std::pair< double, double > & GetParameter(int aSubdetector, int aDisk, int aParameter)
std::pair< double, double > & GetBeamParameter(int aBeam, int aParameter)
tuple cout
Definition: gather_cfg.py:145
static const char * subdetNames[]

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().