CMS 3D CMS Logo

LASConstants.cc
Go to the documentation of this file.
1 
2 
5 
10  atRadius(0.), tecBsZPosition(0.), atZPosition(0.)
11 {
12 }
13 
14 
15 
16 
17 
21 LASConstants::LASConstants( std::vector<edm::ParameterSet> const& theConstConf ) {
22 
24 
25  for( std::vector<edm::ParameterSet>::const_iterator iter = theConstConf.begin(); iter < theConstConf.end(); ++iter ) {
26 
27  if( iter->getParameter<std::string>( "PSetName" ) == "BeamsplitterKinks" ) FillBsKinks( *iter );
28  else if( iter->getParameter<std::string>( "PSetName" ) == "Radii" ) FillRadii( *iter );
29  else if( iter->getParameter<std::string>( "PSetName" ) == "ZPositions" ) FillZPositions( *iter );
30  else {
31  std::cerr << " [] ** WARNING: Cannot process unknown parameter set named: " << iter->getParameter<std::string>( "PSetName" ) << "." << std::endl;
32  }
33 
34  }
35 
36 }
37 
38 
39 
40 
41 
46 }
47 
48 
49 
50 
51 
58 double LASConstants::GetEndcapBsKink( unsigned int det, unsigned int ring , unsigned int beam ) const {
59 
60  if( ! ( ( det == 0 || det == 1 ) && ( ring == 0 || ring == 1 ) && ( beam < 8U ) ) ) { // beam >= 0, since beam is unsigned
61  throw cms::Exception( " [LASConstants::GetEndcapBsKink]" ) << " ** ERROR: no such element: det " << det << ", ring " << ring << ", beam " << beam << "." << std::endl;
62  }
63 
64  return endcapBsKinks.at( det ).at( ring ).at( beam );
65 
66 }
67 
68 
69 
70 
71 
75 double LASConstants::GetAlignmentTubeBsKink( unsigned int beam ) const {
76 
77  if( beam >= 8U ) { // beam >= 0, since beam is unsigned
78  throw cms::Exception( " [LASConstants::GetAlignmentTubeBsKink]" ) << " ** ERROR: no such beam: " << beam << "." << std::endl;
79  }
80 
81  return alignmentTubeBsKinks.at( beam );
82 
83 }
84 
85 
86 
87 
88 
92 double LASConstants::GetTecRadius( unsigned int ring ) const {
93 
94  if( ring > 1U ) { // ring >= 0, since ring is unsigned
95  throw cms::Exception( " [LASConstants::GetTecRadius]" ) << " ** ERROR: no such ring: " << ring << "." << std::endl;
96  }
97 
98  return tecRadii.at( ring );
99 
100 }
101 
102 
103 
104 
105 
109 double LASConstants::GetAtRadius( void ) const {
110 
111  return atRadius;
112 
113 }
114 
115 
116 
117 
118 
122 double LASConstants::GetTecZPosition( unsigned int det, unsigned int disk ) const {
123 
124  if( ( det > 1 ) || ( disk > 8 ) ) {
125  throw cms::Exception( " [LASConstants::GetTecZPosition]" ) << " ** ERROR: no such element: det " << det << ", disk " << disk << "." << std::endl;
126  }
127 
128  if( det == 0 ) return tecZPositions.at( disk ); // tec+
129  else return -1. * tecZPositions.at( disk ); // tec-
130 
131 }
132 
133 
134 
135 
136 
140 double LASConstants::GetTibZPosition( unsigned int pos ) const {
141 
142  if( pos > 5 ) {
143  throw cms::Exception( " [LASConstants::GetTibZPosition]" ) << " ** ERROR: no such position: " << pos << "." << std::endl;
144  }
145 
146  return tibZPositions.at( pos );
147 
148 }
149 
150 
151 
152 
153 
157 double LASConstants::GetTobZPosition( unsigned int pos ) const {
158 
159  if( pos > 5 ) {
160  throw cms::Exception( " [LASConstants::GetTobZPosition]" ) << " ** ERROR: no such position: " << pos << "." << std::endl;
161  }
162 
163  return tobZPositions.at( pos );
164 
165 }
166 
167 
168 
169 
170 
174 double LASConstants::GetTecBsZPosition( unsigned int det ) const {
175 
176  return tecBsZPosition;
177 
178 }
179 
180 
181 
182 
183 
187 double LASConstants::GetAtBsZPosition( void ) const {
188 
189  return atZPosition;
190 
191 }
192 
193 
194 
195 
196 
201 
202  // beam splitter kinks
203 
204  endcapBsKinks.resize( 2 ); // create two dets
205  for( int det = 0; det < 2; ++det ) {
206  endcapBsKinks.at( det ).resize( 2 ); // create two rings per det
207  for( int ring = 0; ring < 2; ++ring ) {
208  endcapBsKinks.at( det ).at( ring ).resize( 8 ); // 8 beams per ring
209  }
210  }
211 
212  alignmentTubeBsKinks.resize( 8 ); // 8 beams
213 
214 
215  // radii
216  tecRadii.resize( 2 );
217 
218  // z positions
219  tecZPositions.resize( 9 );
220  tibZPositions.resize( 6 );
221  tobZPositions.resize( 6 );
222 
223 }
224 
225 
226 
227 
228 
232 void LASConstants::FillBsKinks( edm::ParameterSet const& theBsKinkConf ) {
233 
234  // tec+
235  endcapBsKinks.at( 0 ).at( 0 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecPlusRing4BsKinks" );
236  endcapBsKinks.at( 0 ).at( 1 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecPlusRing6BsKinks" );
237 
238  // apply global offsets
239  for( unsigned int ring = 0; ring < 2; ++ring ) {
240  for( unsigned int beam = 0; beam < 8; ++beam ) {
241  endcapBsKinks.at( 0 ).at( ring ).at( beam ) += theBsKinkConf.getParameter<double>( "TecPlusGlobalOffset" );
242  }
243  }
244 
245  // tec-
246  endcapBsKinks.at( 1 ).at( 0 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecMinusRing4BsKinks" );
247  endcapBsKinks.at( 1 ).at( 1 ) = theBsKinkConf.getParameter<std::vector<double> >( "LASTecMinusRing6BsKinks" );
248 
249  // apply global offsets
250  for( unsigned int ring = 0; ring < 2; ++ring ) {
251  for( unsigned int beam = 0; beam < 8; ++beam ) {
252  endcapBsKinks.at( 1 ).at( ring ).at( beam ) += theBsKinkConf.getParameter<double>( "TecMinusGlobalOffset" );
253  }
254  }
255 
256  // at
257  alignmentTubeBsKinks = theBsKinkConf.getParameter<std::vector<double> >( "LASAlignmentTubeBsKinks" );
258 
259 }
260 
261 
262 
263 
264 
268 void LASConstants::FillRadii( edm::ParameterSet const& theRadiiConf ) {
269 
270  tecRadii = theRadiiConf.getParameter<std::vector<double> >( "LASTecRadius" );
271  atRadius = theRadiiConf.getParameter<double>( "LASAtRadius" );
272 
273 }
274 
275 
276 
277 
278 
283 
284  tecZPositions = theZPosConf.getParameter<std::vector<double> >( "LASTecZPositions" );
285  tibZPositions = theZPosConf.getParameter<std::vector<double> >( "LASTibZPositions" );
286  tobZPositions = theZPosConf.getParameter<std::vector<double> >( "LASTobZPositions" );
287  tecBsZPosition = theZPosConf.getParameter<double>( "LASTecBeamSplitterZPosition" );
288  atZPosition = theZPosConf.getParameter<double>( "LASAtBeamsplitterZPosition" );
289 
290 }
T getParameter(std::string const &) const
double GetTobZPosition(unsigned int pos) const
double GetAtBsZPosition(void) const
double GetTecRadius(unsigned int ring) const
Definition: LASConstants.cc:92
void FillRadii(edm::ParameterSet const &)
double GetAlignmentTubeBsKink(unsigned int beam) const
Definition: LASConstants.cc:75
double atRadius
Definition: LASConstants.h:40
void FillZPositions(edm::ParameterSet const &)
std::vector< double > tecZPositions
Definition: LASConstants.h:42
double GetTibZPosition(unsigned int pos) const
std::vector< double > tecRadii
Definition: LASConstants.h:39
double atZPosition
Definition: LASConstants.h:46
double GetEndcapBsKink(unsigned int det, unsigned int ring, unsigned int beam) const
Definition: LASConstants.cc:58
double GetTecZPosition(unsigned int det, unsigned int disk) const
double GetTecBsZPosition(unsigned int det) const
double tecBsZPosition
Definition: LASConstants.h:45
std::vector< std::vector< std::vector< double > > > endcapBsKinks
Definition: LASConstants.h:36
std::vector< double > tobZPositions
Definition: LASConstants.h:44
double GetAtRadius(void) const
void InitContainers(void)
std::vector< double > alignmentTubeBsKinks
Definition: LASConstants.h:37
std::vector< double > tibZPositions
Definition: LASConstants.h:43
void FillBsKinks(edm::ParameterSet const &)