CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
LASEndcapAlignmentParameterSet Class Reference

#include <LASEndcapAlignmentParameterSet.h>

Public Member Functions

std::pair< double, double > & GetBeamParameter (int aSubdetector, int aRing, int aBeam, int aParameter)
 
std::pair< double, double > & GetDiskParameter (int aSubdetector, int aDisk, int aParameter)
 
std::pair< double, double > & GetGlobalParameter (int aSubdetector, int aParameter)
 
 LASEndcapAlignmentParameterSet ()
 
void Print (void)
 

Private Member Functions

void Init (void)
 

Private Attributes

std::vector< std::vector< std::vector< std::pair< double, double > > > > tecMinusBeamParameters
 
std::vector< std::vector< std::pair< double, double > > > tecMinusDiskParameters
 
std::vector< std::pair< double, double > > tecMinusGlobalParameters
 
std::vector< std::vector< std::vector< std::pair< double, double > > > > tecPlusBeamParameters
 
std::vector< std::vector< std::pair< double, double > > > tecPlusDiskParameters
 
std::vector< std::pair< double, double > > tecPlusGlobalParameters
 

Detailed Description

container for storing the alignment parameters calculated by class LASEndcapAlgorithm

structure:

TODO:

Definition at line 25 of file LASEndcapAlignmentParameterSet.h.

Constructor & Destructor Documentation

LASEndcapAlignmentParameterSet::LASEndcapAlignmentParameterSet ( )

Definition at line 7 of file LASEndcapAlignmentParameterSet.cc.

References Init().

Member Function Documentation

std::pair< double, double > & LASEndcapAlignmentParameterSet::GetBeamParameter ( int  aSubdetector,
int  aRing,
int  aBeam,
int  aParameter 
)

function for accessing a single beam parameter (pair<>); indices are:

  • aSubdetector = 0 (TEC+), 1 (TEC-)
  • aBeam = 0..7
  • aParameter: 0 (deltaPhi on disk0), 1 (deltaPhi on disk8),

Definition at line 122 of file LASEndcapAlignmentParameterSet.cc.

References Exception, tecMinusBeamParameters, and tecPlusBeamParameters.

Referenced by LASEndcapAlgorithm::CalculateParameters(), LASEndcapAlgorithm::GetAlignmentParameterCorrection(), and Print().

125  {
126  if (aSubdetector < 0 || aSubdetector > 1) {
127  throw cms::Exception("Laser Alignment")
128  << " [LASEndcapAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal subdetector index: " << aSubdetector
129  << "." << std::endl;
130  }
131 
132  if (aRing < 0 || aRing > 1) {
133  throw cms::Exception("Laser Alignment")
134  << " [LASEndcapAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal ring index: " << aRing << "."
135  << std::endl;
136  }
137 
138  if (aBeam < 0 || aBeam > 7) {
139  throw cms::Exception("Laser Alignment")
140  << " [LASEndcapAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal beam index: " << aBeam << "."
141  << std::endl;
142  }
143 
144  if (aParameter < 0 || aParameter > 5) {
145  throw cms::Exception("Laser Alignment")
146  << " [LASEndcapAlignmentParameterSet::GetBeamParameter] ERROR ** Illegal parameter index: " << aParameter << "."
147  << std::endl;
148  }
149 
150  if (aSubdetector == 0)
151  return tecPlusBeamParameters.at(aBeam).at(aRing).at(aParameter);
152  return tecMinusBeamParameters.at(aBeam).at(aRing).at(aParameter);
153 }
std::vector< std::vector< std::vector< std::pair< double, double > > > > tecPlusBeamParameters
std::vector< std::vector< std::vector< std::pair< double, double > > > > tecMinusBeamParameters
std::pair< double, double > & LASEndcapAlignmentParameterSet::GetDiskParameter ( int  aSubdetector,
int  aDisk,
int  aParameter 
)

function for accessing a single disk parameter (pair<>); indices are:

  • aSubdetector = 0 (TEC+), 1 (TEC-)
  • aDisk = 0..8 (from inner to outer)
  • aParameter: 0 (rotation angle), 1 (x displacement), 2 (y displacement)

Definition at line 63 of file LASEndcapAlignmentParameterSet.cc.

References Exception, tecMinusDiskParameters, and tecPlusDiskParameters.

Referenced by LASEndcapAlgorithm::CalculateParameters(), LASGeometryUpdater::EndcapUpdate(), LASEndcapAlgorithm::GetAlignmentParameterCorrection(), Print(), and LASGeometryUpdater::TrackerUpdate().

65  {
66  if (aSubdetector < 0 || aSubdetector > 1) {
67  throw cms::Exception("Laser Alignment")
68  << " [LASEndcapAlignmentParameterSet::GetDiskParameter] ERROR ** Illegal subdetector index: " << aSubdetector
69  << "." << std::endl;
70  }
71 
72  if (aDisk < 0 || aDisk > 8) {
73  throw cms::Exception("Laser Alignment")
74  << " [LASEndcapAlignmentParameterSet::GetDiskParameter] ERROR ** Illegal disk index: " << aDisk << "."
75  << std::endl;
76  }
77 
78  if (aParameter < 0 || aParameter > 2) {
79  throw cms::Exception("Laser Alignment")
80  << " [LASEndcapAlignmentParameterSet::GetDiskParameter] ERROR ** Illegal parameter index: " << aParameter << "."
81  << std::endl;
82  }
83 
84  if (aSubdetector == 0)
85  return tecPlusDiskParameters.at(aDisk).at(aParameter);
86  return tecMinusDiskParameters.at(aDisk).at(aParameter);
87 }
std::vector< std::vector< std::pair< double, double > > > tecPlusDiskParameters
std::vector< std::vector< std::pair< double, double > > > tecMinusDiskParameters
std::pair< double, double > & LASEndcapAlignmentParameterSet::GetGlobalParameter ( int  aSubdetector,
int  aParameter 
)

function for accessing a single global parameter (pair<>); indices are:

  • aSubdetector = 0 (TEC+), 1 (TEC-)
  • aParameter: 0 (global rotation), 1 (global torsion), 2 (global x shift), 3 (global x shear), 4 (global y shift), 5 (global y shear)

Definition at line 97 of file LASEndcapAlignmentParameterSet.cc.

References Exception, tecMinusGlobalParameters, and tecPlusGlobalParameters.

Referenced by LASEndcapAlgorithm::CalculateParameters(), LASEndcapAlgorithm::GetAlignmentParameterCorrection(), and Print().

97  {
98  if (aSubdetector < 0 || aSubdetector > 1) {
99  throw cms::Exception("Laser Alignment")
100  << " [LASEndcapAlignmentParameterSet::GetGlobalParameter] ERROR ** Illegal subdetector index: " << aSubdetector
101  << "." << std::endl;
102  }
103 
104  if (aParameter < 0 || aParameter > 5) {
105  throw cms::Exception("Laser Alignment")
106  << " [LASEndcapAlignmentParameterSet::GetGlobalParameter] ERROR ** Illegal parameter index: " << aParameter
107  << "." << std::endl;
108  }
109 
110  if (aSubdetector == 0)
111  return tecPlusGlobalParameters.at(aParameter);
112  return tecMinusGlobalParameters.at(aParameter);
113 }
std::vector< std::pair< double, double > > tecMinusGlobalParameters
std::vector< std::pair< double, double > > tecPlusGlobalParameters
void LASEndcapAlignmentParameterSet::Init ( void  )
private

whatever initialization is needed

Definition at line 12 of file LASEndcapAlignmentParameterSet.cc.

References EcalCondDBWriter_cfi::beam, relativeConstraints::ring, tecMinusBeamParameters, tecMinusDiskParameters, tecMinusGlobalParameters, tecPlusBeamParameters, tecPlusDiskParameters, and tecPlusGlobalParameters.

Referenced by LASEndcapAlignmentParameterSet().

12  {
13  // could use a single vector<vector<vector<pair<> > > >
14  // but better split it in 2 parts
15 
16  for (unsigned int disk = 0; disk < 9; ++disk) { // nine times; once for each disk
17  tecPlusDiskParameters.push_back(std::vector<std::pair<double, double> >(3));
18  tecMinusDiskParameters.push_back(std::vector<std::pair<double, double> >(3));
19 
20  // compiler won't let me init the pairs within push_back call..
21  for (unsigned int par = 0; par < 3; ++par) {
22  tecPlusDiskParameters.at(disk).at(par) = std::pair<double, double>(0., 0.);
23  tecMinusDiskParameters.at(disk).at(par) = std::pair<double, double>(0., 0.);
24  }
25  }
26 
27  // once for each parameter
28  for (unsigned int par = 0; par < 6; ++par) {
29  tecPlusGlobalParameters.push_back(std::pair<double, double>(0., 0.));
30  tecMinusGlobalParameters.push_back(std::pair<double, double>(0., 0.));
31  }
32 
33  // beam parameters
34  tecPlusBeamParameters.resize(8);
35  tecMinusBeamParameters.resize(8);
36 
37  // now once for each beam: the 2 rings
38  for (unsigned int beam = 0; beam < 8; ++beam) {
39  tecPlusBeamParameters.at(beam).resize(2);
40  tecMinusBeamParameters.at(beam).resize(2);
41 
42  // now once for each ring: the 2 parameters
43  for (unsigned int ring = 0; ring < 2; ++ring) {
44  tecPlusBeamParameters.at(beam).at(ring).resize(2);
45  tecMinusBeamParameters.at(beam).at(ring).resize(2);
46 
47  // now once for each parameter: the pairs (value/error)
48  for (unsigned int par = 0; par < 2; ++par) {
49  tecPlusBeamParameters.at(beam).at(ring).at(par) = std::pair<double, double>(0., 0.);
50  tecMinusBeamParameters.at(beam).at(ring).at(par) = std::pair<double, double>(0., 0.);
51  }
52  }
53  }
54 }
std::vector< std::pair< double, double > > tecMinusGlobalParameters
std::vector< std::pair< double, double > > tecPlusGlobalParameters
std::vector< std::vector< std::pair< double, double > > > tecPlusDiskParameters
std::vector< std::vector< std::vector< std::pair< double, double > > > > tecPlusBeamParameters
std::vector< std::vector< std::pair< double, double > > > tecMinusDiskParameters
std::vector< std::vector< std::vector< std::pair< double, double > > > > tecMinusBeamParameters
void LASEndcapAlignmentParameterSet::Print ( void  )

pretty-printout of all parameter and error values

Definition at line 158 of file LASEndcapAlignmentParameterSet.cc.

References EcalCondDBWriter_cfi::beam, gather_cfg::cout, alignBH_cfg::fixed, GetBeamParameter(), GetDiskParameter(), GetGlobalParameter(), and relativeConstraints::ring.

Referenced by LaserAlignment::endRunProduce().

158  {
159  std::cout << " [LASEndcapAlignmentParameterSet::Print] -- Listing parameters:" << std::endl;
160  std::cout << std::endl;
161  std::cout << " Disk parameters:" << std::endl;
162  std::cout << " ----------------" << std::endl;
163  for (int det = 0; det < 2; ++det) {
164  std::cout
165  << " " << (det == 0 ? "TEC+" : "TEC-")
166  << ": dPHI \xb1 \bE dX \xb1 \bE dY \xb1 \bE (rad/mm): "
167  << std::endl;
168  for (int disk = 0; disk < 9; ++disk) {
169  std::cout << " disk " << disk << ": ";
170  for (int par = 0; par < 3; ++par)
171  std::cout << std::right << std::setw(11) << std::fixed << std::setprecision(6)
172  << GetDiskParameter(det, disk, par).first << " \xb1 " << std::left << std::setw(9) << std::fixed
173  << std::setprecision(6) << GetDiskParameter(det, disk, par).second;
174  std::cout << std::endl;
175  }
176  }
177 
178  for (int det = 0; det < 2; ++det) {
179  std::cout << " " << (det == 0 ? "TEC+" : "TEC-")
180  << " global parameters in format: dPhi0\xb1 \be dPhiT\xb1 \be dX0\xb1 \be dXT\xb1 \be dY0\xb1 \be "
181  "dYT\xb1 \be (rad/mm): "
182  << std::endl;
183  for (int par = 0; par < 6; ++par)
184  std::cout << std::setw(11) << std::setprecision(6) << std::right << GetGlobalParameter(det, par).first << " \xb1 "
185  << std::setw(9) << std::setprecision(6) << std::left << GetGlobalParameter(det, par).second;
186  std::cout << std::endl;
187  }
188 
189  for (int det = 0; det < 2; ++det) {
190  std::cout << " " << (det == 0 ? "TEC+" : "TEC-")
191  << " beam parameters in format: dPhi1\xb1 \be dPhi2\xb1 \be (rad): " << std::endl;
192  for (int ring = 0; ring < 2; ++ring) {
193  std::cout << " ring " << (ring == 0 ? "4" : "6") << ": " << std::endl;
194  for (int beam = 0; beam < 8; ++beam) {
195  std::cout << " beam " << beam << ": ";
196  for (int par = 0; par < 2; ++par)
197  std::cout << std::setw(11) << std::setprecision(6) << std::right
198  << GetBeamParameter(det, ring, beam, par).first << " \xb1 " << std::setw(9) << std::setprecision(6)
199  << std::left << GetBeamParameter(det, ring, beam, par).second;
200  std::cout << std::endl;
201  }
202  }
203  }
204 
205  std::cout << " [LASEndcapAlignmentParameterSet::Print] -- End of list." << std::endl << std::endl;
206 }
std::pair< double, double > & GetGlobalParameter(int aSubdetector, int aParameter)
std::pair< double, double > & GetDiskParameter(int aSubdetector, int aDisk, int aParameter)
std::pair< double, double > & GetBeamParameter(int aSubdetector, int aRing, int aBeam, int aParameter)

Member Data Documentation

std::vector<std::vector<std::vector<std::pair<double, double> > > > LASEndcapAlignmentParameterSet::tecMinusBeamParameters
private

Definition at line 41 of file LASEndcapAlignmentParameterSet.h.

Referenced by GetBeamParameter(), and Init().

std::vector<std::vector<std::pair<double, double> > > LASEndcapAlignmentParameterSet::tecMinusDiskParameters
private

Definition at line 37 of file LASEndcapAlignmentParameterSet.h.

Referenced by GetDiskParameter(), and Init().

std::vector<std::pair<double, double> > LASEndcapAlignmentParameterSet::tecMinusGlobalParameters
private

Definition at line 39 of file LASEndcapAlignmentParameterSet.h.

Referenced by GetGlobalParameter(), and Init().

std::vector<std::vector<std::vector<std::pair<double, double> > > > LASEndcapAlignmentParameterSet::tecPlusBeamParameters
private

Definition at line 40 of file LASEndcapAlignmentParameterSet.h.

Referenced by GetBeamParameter(), and Init().

std::vector<std::vector<std::pair<double, double> > > LASEndcapAlignmentParameterSet::tecPlusDiskParameters
private

Definition at line 36 of file LASEndcapAlignmentParameterSet.h.

Referenced by GetDiskParameter(), and Init().

std::vector<std::pair<double, double> > LASEndcapAlignmentParameterSet::tecPlusGlobalParameters
private

Definition at line 38 of file LASEndcapAlignmentParameterSet.h.

Referenced by GetGlobalParameter(), and Init().