CMS 3D CMS Logo

LASConstants.cc
Go to the documentation of this file.
1 
2 
5 
9 LASConstants::LASConstants() : atRadius(0.), tecBsZPosition(0.), atZPosition(0.) {}
10 
14 LASConstants::LASConstants(std::vector<edm::ParameterSet> const& theConstConf) {
16 
17  for (std::vector<edm::ParameterSet>::const_iterator iter = theConstConf.begin(); iter < theConstConf.end(); ++iter) {
18  if (iter->getParameter<std::string>("PSetName") == "BeamsplitterKinks")
19  FillBsKinks(*iter);
20  else if (iter->getParameter<std::string>("PSetName") == "Radii")
21  FillRadii(*iter);
22  else if (iter->getParameter<std::string>("PSetName") == "ZPositions")
23  FillZPositions(*iter);
24  else {
25  std::cerr << " [] ** WARNING: Cannot process unknown parameter set named: "
26  << iter->getParameter<std::string>("PSetName") << "." << std::endl;
27  }
28  }
29 }
30 
35 
42 double LASConstants::GetEndcapBsKink(unsigned int det, unsigned int ring, unsigned int beam) const {
43  if (!((det == 0 || det == 1) && (ring == 0 || ring == 1) && (beam < 8U))) { // beam >= 0, since beam is unsigned
44  throw cms::Exception(" [LASConstants::GetEndcapBsKink]")
45  << " ** ERROR: no such element: det " << det << ", ring " << ring << ", beam " << beam << "." << std::endl;
46  }
47 
48  return endcapBsKinks.at(det).at(ring).at(beam);
49 }
50 
54 double LASConstants::GetAlignmentTubeBsKink(unsigned int beam) const {
55  if (beam >= 8U) { // beam >= 0, since beam is unsigned
56  throw cms::Exception(" [LASConstants::GetAlignmentTubeBsKink]")
57  << " ** ERROR: no such beam: " << beam << "." << std::endl;
58  }
59 
60  return alignmentTubeBsKinks.at(beam);
61 }
62 
66 double LASConstants::GetTecRadius(unsigned int ring) const {
67  if (ring > 1U) { // ring >= 0, since ring is unsigned
68  throw cms::Exception(" [LASConstants::GetTecRadius]") << " ** ERROR: no such ring: " << ring << "." << std::endl;
69  }
70 
71  return tecRadii.at(ring);
72 }
73 
77 double LASConstants::GetAtRadius(void) const { return atRadius; }
78 
82 double LASConstants::GetTecZPosition(unsigned int det, unsigned int disk) const {
83  if ((det > 1) || (disk > 8)) {
84  throw cms::Exception(" [LASConstants::GetTecZPosition]")
85  << " ** ERROR: no such element: det " << det << ", disk " << disk << "." << std::endl;
86  }
87 
88  if (det == 0)
89  return tecZPositions.at(disk); // tec+
90  else
91  return -1. * tecZPositions.at(disk); // tec-
92 }
93 
97 double LASConstants::GetTibZPosition(unsigned int pos) const {
98  if (pos > 5) {
99  throw cms::Exception(" [LASConstants::GetTibZPosition]")
100  << " ** ERROR: no such position: " << pos << "." << std::endl;
101  }
102 
103  return tibZPositions.at(pos);
104 }
105 
109 double LASConstants::GetTobZPosition(unsigned int pos) const {
110  if (pos > 5) {
111  throw cms::Exception(" [LASConstants::GetTobZPosition]")
112  << " ** ERROR: no such position: " << pos << "." << std::endl;
113  }
114 
115  return tobZPositions.at(pos);
116 }
117 
121 double LASConstants::GetTecBsZPosition(unsigned int det) const { return tecBsZPosition; }
122 
126 double LASConstants::GetAtBsZPosition(void) const { return atZPosition; }
127 
132  // beam splitter kinks
133 
134  endcapBsKinks.resize(2); // create two dets
135  for (int det = 0; det < 2; ++det) {
136  endcapBsKinks.at(det).resize(2); // create two rings per det
137  for (int ring = 0; ring < 2; ++ring) {
138  endcapBsKinks.at(det).at(ring).resize(8); // 8 beams per ring
139  }
140  }
141 
142  alignmentTubeBsKinks.resize(8); // 8 beams
143 
144  // radii
145  tecRadii.resize(2);
146 
147  // z positions
148  tecZPositions.resize(9);
149  tibZPositions.resize(6);
150  tobZPositions.resize(6);
151 }
152 
156 void LASConstants::FillBsKinks(edm::ParameterSet const& theBsKinkConf) {
157  // tec+
158  endcapBsKinks.at(0).at(0) = theBsKinkConf.getParameter<std::vector<double> >("LASTecPlusRing4BsKinks");
159  endcapBsKinks.at(0).at(1) = theBsKinkConf.getParameter<std::vector<double> >("LASTecPlusRing6BsKinks");
160 
161  // apply global offsets
162  for (unsigned int ring = 0; ring < 2; ++ring) {
163  for (unsigned int beam = 0; beam < 8; ++beam) {
164  endcapBsKinks.at(0).at(ring).at(beam) += theBsKinkConf.getParameter<double>("TecPlusGlobalOffset");
165  }
166  }
167 
168  // tec-
169  endcapBsKinks.at(1).at(0) = theBsKinkConf.getParameter<std::vector<double> >("LASTecMinusRing4BsKinks");
170  endcapBsKinks.at(1).at(1) = theBsKinkConf.getParameter<std::vector<double> >("LASTecMinusRing6BsKinks");
171 
172  // apply global offsets
173  for (unsigned int ring = 0; ring < 2; ++ring) {
174  for (unsigned int beam = 0; beam < 8; ++beam) {
175  endcapBsKinks.at(1).at(ring).at(beam) += theBsKinkConf.getParameter<double>("TecMinusGlobalOffset");
176  }
177  }
178 
179  // at
180  alignmentTubeBsKinks = theBsKinkConf.getParameter<std::vector<double> >("LASAlignmentTubeBsKinks");
181 }
182 
186 void LASConstants::FillRadii(edm::ParameterSet const& theRadiiConf) {
187  tecRadii = theRadiiConf.getParameter<std::vector<double> >("LASTecRadius");
188  atRadius = theRadiiConf.getParameter<double>("LASAtRadius");
189 }
190 
195  tecZPositions = theZPosConf.getParameter<std::vector<double> >("LASTecZPositions");
196  tibZPositions = theZPosConf.getParameter<std::vector<double> >("LASTibZPositions");
197  tobZPositions = theZPosConf.getParameter<std::vector<double> >("LASTobZPositions");
198  tecBsZPosition = theZPosConf.getParameter<double>("LASTecBeamSplitterZPosition");
199  atZPosition = theZPosConf.getParameter<double>("LASAtBeamsplitterZPosition");
200 }
double GetAlignmentTubeBsKink(unsigned int beam) const
Definition: LASConstants.cc:54
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
double GetTecRadius(unsigned int ring) const
Definition: LASConstants.cc:66
double GetEndcapBsKink(unsigned int det, unsigned int ring, unsigned int beam) const
Definition: LASConstants.cc:42
double GetTobZPosition(unsigned int pos) const
void FillRadii(edm::ParameterSet const &)
double GetAtBsZPosition(void) const
double atRadius
Definition: LASConstants.h:38
void FillZPositions(edm::ParameterSet const &)
std::vector< double > tecZPositions
Definition: LASConstants.h:40
std::vector< double > tecRadii
Definition: LASConstants.h:37
double atZPosition
Definition: LASConstants.h:44
double GetTibZPosition(unsigned int pos) const
Definition: LASConstants.cc:97
double tecBsZPosition
Definition: LASConstants.h:43
double GetTecBsZPosition(unsigned int det) const
std::vector< std::vector< std::vector< double > > > endcapBsKinks
Definition: LASConstants.h:34
double GetAtRadius(void) const
Definition: LASConstants.cc:77
std::vector< double > tobZPositions
Definition: LASConstants.h:42
void InitContainers(void)
std::vector< double > alignmentTubeBsKinks
Definition: LASConstants.h:35
double GetTecZPosition(unsigned int det, unsigned int disk) const
Definition: LASConstants.cc:82
std::vector< double > tibZPositions
Definition: LASConstants.h:41
void FillBsKinks(edm::ParameterSet const &)