CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LASConstants.cc
Go to the documentation of this file.
1 
2 
5 
10 }
11 
12 
13 
14 
15 
19 LASConstants::LASConstants( std::vector<edm::ParameterSet> const& theConstConf ) {
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 }
35 
36 
37 
38 
39 
44 }
45 
46 
47 
48 
49 
56 double LASConstants::GetEndcapBsKink( unsigned int det, unsigned int ring , unsigned int beam ) const {
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 }
65 
66 
67 
68 
69 
73 double LASConstants::GetAlignmentTubeBsKink( unsigned int beam ) const {
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 }
82 
83 
84 
85 
86 
90 double LASConstants::GetTecRadius( unsigned int ring ) const {
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 }
99 
100 
101 
102 
103 
107 double LASConstants::GetAtRadius( void ) const {
108 
109  return atRadius;
110 
111 }
112 
113 
114 
115 
116 
120 double LASConstants::GetTecZPosition( unsigned int det, unsigned int disk ) const {
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 }
130 
131 
132 
133 
134 
138 double LASConstants::GetTibZPosition( unsigned int pos ) const {
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 }
147 
148 
149 
150 
151 
155 double LASConstants::GetTobZPosition( unsigned int pos ) const {
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 }
164 
165 
166 
167 
168 
172 double LASConstants::GetTecBsZPosition( unsigned int det ) const {
173 
174  return tecBsZPosition;
175 
176 }
177 
178 
179 
180 
181 
185 double LASConstants::GetAtBsZPosition( void ) const {
186 
187  return atZPosition;
188 
189 }
190 
191 
192 
193 
194 
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 }
222 
223 
224 
225 
226 
230 void LASConstants::FillBsKinks( edm::ParameterSet const& theBsKinkConf ) {
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 }
258 
259 
260 
261 
262 
266 void LASConstants::FillRadii( edm::ParameterSet const& theRadiiConf ) {
267 
268  tecRadii = theRadiiConf.getParameter<std::vector<double> >( "LASTecRadius" );
269  atRadius = theRadiiConf.getParameter<double>( "LASAtRadius" );
270 
271 }
272 
273 
274 
275 
276 
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 }
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:90
void FillRadii(edm::ParameterSet const &)
double GetAlignmentTubeBsKink(unsigned int beam) const
Definition: LASConstants.cc:73
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:56
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 &)