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
LASConstants Class Reference

#include <LASConstants.h>

Public Member Functions

double GetAlignmentTubeBsKink (unsigned int beam) const
 
double GetAtBsZPosition (void) const
 
double GetAtRadius (void) const
 
double GetEndcapBsKink (unsigned int det, unsigned int ring, unsigned int beam) const
 
double GetTecBsZPosition (unsigned int det) const
 
double GetTecRadius (unsigned int ring) const
 
double GetTecZPosition (unsigned int det, unsigned int disk) const
 
double GetTibZPosition (unsigned int pos) const
 
double GetTobZPosition (unsigned int pos) const
 
 LASConstants ()
 
 LASConstants (std::vector< edm::ParameterSet > const &)
 
 ~LASConstants ()
 

Private Member Functions

void FillBsKinks (edm::ParameterSet const &)
 
void FillRadii (edm::ParameterSet const &)
 
void FillZPositions (edm::ParameterSet const &)
 
void InitContainers (void)
 

Private Attributes

std::vector< double > alignmentTubeBsKinks
 
double atRadius
 
double atZPosition
 
std::vector< std::vector
< std::vector< double > > > 
endcapBsKinks
 
double tecBsZPosition
 
std::vector< double > tecRadii
 
std::vector< double > tecZPositions
 
std::vector< double > tibZPositions
 
std::vector< double > tobZPositions
 

Detailed Description

Definition at line 11 of file LASConstants.h.

Constructor & Destructor Documentation

LASConstants::LASConstants ( )

Definition at line 9 of file LASConstants.cc.

9  {
10 }
LASConstants::LASConstants ( std::vector< edm::ParameterSet > const &  theConstConf)

Definition at line 19 of file LASConstants.cc.

References benchmark_cfg::cerr, FillBsKinks(), FillRadii(), FillZPositions(), and InitContainers().

19  {
20 
22 
23  for( std::vector<edm::ParameterSet>::const_iterator iter = theConstConf.begin(); iter < theConstConf.end(); ++iter ) {
24 
25  if( iter->getParameter<std::string>( "PSetName" ) == "BeamsplitterKinks" ) FillBsKinks( *iter );
26  else if( iter->getParameter<std::string>( "PSetName" ) == "Radii" ) FillRadii( *iter );
27  else if( iter->getParameter<std::string>( "PSetName" ) == "ZPositions" ) FillZPositions( *iter );
28  else {
29  std::cerr << " [] ** WARNING: Cannot process unknown parameter set named: " << iter->getParameter<std::string>( "PSetName" ) << "." << std::endl;
30  }
31 
32  }
33 
34 }
void FillRadii(edm::ParameterSet const &)
void FillZPositions(edm::ParameterSet const &)
void InitContainers(void)
void FillBsKinks(edm::ParameterSet const &)
LASConstants::~LASConstants ( )

Definition at line 43 of file LASConstants.cc.

43  {
44 }

Member Function Documentation

void LASConstants::FillBsKinks ( edm::ParameterSet const &  theBsKinkConf)
private

fill the beamplitter-kink related containers

Definition at line 230 of file LASConstants.cc.

References alignmentTubeBsKinks, endcapBsKinks, edm::ParameterSet::getParameter(), and relativeConstraints::ring.

Referenced by LASConstants().

230  {
231 
232  // tec+
233  endcapBsKinks.at( 0 ).at( 0 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecPlusRing4BsKinks" );
234  endcapBsKinks.at( 0 ).at( 1 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecPlusRing6BsKinks" );
235 
236  // apply global offsets
237  for( unsigned int ring = 0; ring < 2; ++ring ) {
238  for( unsigned int beam = 0; beam < 8; ++beam ) {
239  endcapBsKinks.at( 0 ).at( ring ).at( beam ) += theBsKinkConf.getParameter<double>( "TecPlusGlobalOffset" );
240  }
241  }
242 
243  // tec-
244  endcapBsKinks.at( 1 ).at( 0 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecMinusRing4BsKinks" );
245  endcapBsKinks.at( 1 ).at( 1 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecMinusRing6BsKinks" );
246 
247  // apply global offsets
248  for( unsigned int ring = 0; ring < 2; ++ring ) {
249  for( unsigned int beam = 0; beam < 8; ++beam ) {
250  endcapBsKinks.at( 1 ).at( ring ).at( beam ) += theBsKinkConf.getParameter<double>( "TecMinusGlobalOffset" );
251  }
252  }
253 
254  // at
255  alignmentTubeBsKinks = theBsKinkConf.getParameter<std::vector<double> >( "LASAlignmentTubeBsKinks" );
256 
257 }
std::vector< std::vector< std::vector< double > > > endcapBsKinks
Definition: LASConstants.h:36
std::vector< double > alignmentTubeBsKinks
Definition: LASConstants.h:37
void LASConstants::FillRadii ( edm::ParameterSet const &  theRadiiConf)
private

fill the beam radii

Definition at line 266 of file LASConstants.cc.

References atRadius, edm::ParameterSet::getParameter(), and tecRadii.

Referenced by LASConstants().

266  {
267 
268  tecRadii = theRadiiConf.getParameter<std::vector<double> >( "LASTecRadius" );
269  atRadius = theRadiiConf.getParameter<double>( "LASAtRadius" );
270 
271 }
double atRadius
Definition: LASConstants.h:40
std::vector< double > tecRadii
Definition: LASConstants.h:39
void LASConstants::FillZPositions ( edm::ParameterSet const &  theZPosConf)
private

Definition at line 280 of file LASConstants.cc.

References atZPosition, edm::ParameterSet::getParameter(), tecBsZPosition, tecZPositions, tibZPositions, and tobZPositions.

Referenced by LASConstants().

280  {
281 
282  tecZPositions = theZPosConf.getParameter<std::vector<double> >( "LASTecZPositions" );
283  tibZPositions = theZPosConf.getParameter<std::vector<double> >( "LASTibZPositions" );
284  tobZPositions = theZPosConf.getParameter<std::vector<double> >( "LASTobZPositions" );
285  tecBsZPosition = theZPosConf.getParameter<double>( "LASTecBeamSplitterZPosition" );
286  atZPosition = theZPosConf.getParameter<double>( "LASAtBeamsplitterZPosition" );
287 
288 }
std::vector< double > tecZPositions
Definition: LASConstants.h:42
double atZPosition
Definition: LASConstants.h:46
double tecBsZPosition
Definition: LASConstants.h:45
std::vector< double > tobZPositions
Definition: LASConstants.h:44
std::vector< double > tibZPositions
Definition: LASConstants.h:43
double LASConstants::GetAlignmentTubeBsKink ( unsigned int  beam) const

Returns beamplitter kink for alignment tube beam <beam> (0..7)

Definition at line 73 of file LASConstants.cc.

References alignmentTubeBsKinks, and edm::hlt::Exception.

73  {
74 
75  if( beam >= 8U ) { // beam >= 0, since beam is unsigned
76  throw cms::Exception( " [LASConstants::GetAlignmentTubeBsKink]" ) << " ** ERROR: no such beam: " << beam << "." << std::endl;
77  }
78 
79  return alignmentTubeBsKinks.at( beam );
80 
81 }
std::vector< double > alignmentTubeBsKinks
Definition: LASConstants.h:37
double LASConstants::GetAtBsZPosition ( void  ) const

Definition at line 185 of file LASConstants.cc.

References atZPosition.

185  {
186 
187  return atZPosition;
188 
189 }
double atZPosition
Definition: LASConstants.h:46
double LASConstants::GetAtRadius ( void  ) const

Definition at line 107 of file LASConstants.cc.

References atRadius.

107  {
108 
109  return atRadius;
110 
111 }
double atRadius
Definition: LASConstants.h:40
double LASConstants::GetEndcapBsKink ( unsigned int  det,
unsigned int  ring,
unsigned int  beam 
) const

Returns one beamsplitter kink, parameters are: det (0=TEC+/1=TEC-) ring (0=R4/1=R6) beam (0..7)

Definition at line 56 of file LASConstants.cc.

References endcapBsKinks, and edm::hlt::Exception.

Referenced by LASGeometryUpdater::ApplyBeamKinkCorrections().

56  {
57 
58  if( ! ( ( det == 0 || det == 1 ) && ( ring == 0 || ring == 1 ) && ( beam < 8U ) ) ) { // beam >= 0, since beam is unsigned
59  throw cms::Exception( " [LASConstants::GetEndcapBsKink]" ) << " ** ERROR: no such element: det " << det << ", ring " << ring << ", beam " << beam << "." << std::endl;
60  }
61 
62  return endcapBsKinks.at( det ).at( ring ).at( beam );
63 
64 }
std::vector< std::vector< std::vector< double > > > endcapBsKinks
Definition: LASConstants.h:36
double LASConstants::GetTecBsZPosition ( unsigned int  det) const

Definition at line 172 of file LASConstants.cc.

References tecBsZPosition.

Referenced by LASGeometryUpdater::ApplyBeamKinkCorrections().

172  {
173 
174  return tecBsZPosition;
175 
176 }
double tecBsZPosition
Definition: LASConstants.h:45
double LASConstants::GetTecRadius ( unsigned int  ring) const

Definition at line 90 of file LASConstants.cc.

References edm::hlt::Exception, and tecRadii.

Referenced by LASGeometryUpdater::ApplyBeamKinkCorrections().

90  {
91 
92  if( ring > 1U ) { // ring >= 0, since ring is unsigned
93  throw cms::Exception( " [LASConstants::GetTecRadius]" ) << " ** ERROR: no such ring: " << ring << "." << std::endl;
94  }
95 
96  return tecRadii.at( ring );
97 
98 }
std::vector< double > tecRadii
Definition: LASConstants.h:39
double LASConstants::GetTecZPosition ( unsigned int  det,
unsigned int  disk 
) const

Definition at line 120 of file LASConstants.cc.

References edm::hlt::Exception, and tecZPositions.

Referenced by LASGeometryUpdater::ApplyBeamKinkCorrections().

120  {
121 
122  if( ( det > 1 ) || ( disk > 8 ) ) {
123  throw cms::Exception( " [LASConstants::GetTecZPosition]" ) << " ** ERROR: no such element: det " << det << ", disk " << disk << "." << std::endl;
124  }
125 
126  if( det == 0 ) return tecZPositions.at( disk ); // tec+
127  else return -1. * tecZPositions.at( disk ); // tec-
128 
129 }
std::vector< double > tecZPositions
Definition: LASConstants.h:42
double LASConstants::GetTibZPosition ( unsigned int  pos) const

Definition at line 138 of file LASConstants.cc.

References edm::hlt::Exception, and tibZPositions.

138  {
139 
140  if( pos > 5 ) {
141  throw cms::Exception( " [LASConstants::GetTibZPosition]" ) << " ** ERROR: no such position: " << pos << "." << std::endl;
142  }
143 
144  return tibZPositions.at( pos );
145 
146 }
std::vector< double > tibZPositions
Definition: LASConstants.h:43
double LASConstants::GetTobZPosition ( unsigned int  pos) const

Definition at line 155 of file LASConstants.cc.

References edm::hlt::Exception, and tobZPositions.

155  {
156 
157  if( pos > 5 ) {
158  throw cms::Exception( " [LASConstants::GetTobZPosition]" ) << " ** ERROR: no such position: " << pos << "." << std::endl;
159  }
160 
161  return tobZPositions.at( pos );
162 
163 }
std::vector< double > tobZPositions
Definition: LASConstants.h:44
void LASConstants::InitContainers ( void  )
private

Definition at line 198 of file LASConstants.cc.

References alignmentTubeBsKinks, endcapBsKinks, relativeConstraints::ring, tecRadii, tecZPositions, tibZPositions, and tobZPositions.

Referenced by LASConstants().

198  {
199 
200  // beam splitter kinks
201 
202  endcapBsKinks.resize( 2 ); // create two dets
203  for( int det = 0; det < 2; ++det ) {
204  endcapBsKinks.at( det ).resize( 2 ); // create two rings per det
205  for( int ring = 0; ring < 2; ++ring ) {
206  endcapBsKinks.at( det ).at( ring ).resize( 8 ); // 8 beams per ring
207  }
208  }
209 
210  alignmentTubeBsKinks.resize( 8 ); // 8 beams
211 
212 
213  // radii
214  tecRadii.resize( 2 );
215 
216  // z positions
217  tecZPositions.resize( 9 );
218  tibZPositions.resize( 6 );
219  tobZPositions.resize( 6 );
220 
221 }
std::vector< double > tecZPositions
Definition: LASConstants.h:42
std::vector< double > tecRadii
Definition: LASConstants.h:39
std::vector< std::vector< std::vector< double > > > endcapBsKinks
Definition: LASConstants.h:36
std::vector< double > tobZPositions
Definition: LASConstants.h:44
std::vector< double > alignmentTubeBsKinks
Definition: LASConstants.h:37
std::vector< double > tibZPositions
Definition: LASConstants.h:43

Member Data Documentation

std::vector<double> LASConstants::alignmentTubeBsKinks
private

Definition at line 37 of file LASConstants.h.

Referenced by FillBsKinks(), GetAlignmentTubeBsKink(), and InitContainers().

double LASConstants::atRadius
private

Definition at line 40 of file LASConstants.h.

Referenced by FillRadii(), and GetAtRadius().

double LASConstants::atZPosition
private

Definition at line 46 of file LASConstants.h.

Referenced by FillZPositions(), and GetAtBsZPosition().

std::vector<std::vector<std::vector<double> > > LASConstants::endcapBsKinks
private

Definition at line 36 of file LASConstants.h.

Referenced by FillBsKinks(), GetEndcapBsKink(), and InitContainers().

double LASConstants::tecBsZPosition
private

Definition at line 45 of file LASConstants.h.

Referenced by FillZPositions(), and GetTecBsZPosition().

std::vector<double> LASConstants::tecRadii
private

Definition at line 39 of file LASConstants.h.

Referenced by FillRadii(), GetTecRadius(), and InitContainers().

std::vector<double> LASConstants::tecZPositions
private

Definition at line 42 of file LASConstants.h.

Referenced by FillZPositions(), GetTecZPosition(), and InitContainers().

std::vector<double> LASConstants::tibZPositions
private

Definition at line 43 of file LASConstants.h.

Referenced by FillZPositions(), GetTibZPosition(), and InitContainers().

std::vector<double> LASConstants::tobZPositions
private

Definition at line 44 of file LASConstants.h.

Referenced by FillZPositions(), GetTobZPosition(), and InitContainers().