33 throw cms::Exception(
"TypeMismatch") <<
"Argument is not an AlignableMuon";
66 double scale_ = 0, scaleError_ = 0, phiX_ = 0, phiY_ = 0, phiZ_ = 0;
67 double dX_ = 0, dY_ = 0, dZ_ = 0;
69 std::ostringstream
error;
71 std::vector<std::string> parameterNames =
Parameters.getParameterNames();
72 for (std::vector<std::string>::iterator iParam = parameterNames.begin(); iParam != parameterNames.end(); iParam++) {
73 if ((*iParam) ==
"scale")
74 scale_ =
Parameters.getParameter<
double>(*iParam);
75 else if ((*iParam) ==
"distribution")
77 else if ((*iParam) ==
"scaleError")
78 scaleError_ =
Parameters.getParameter<
double>(*iParam);
79 else if ((*iParam) ==
"phiX")
80 phiX_ =
Parameters.getParameter<
double>(*iParam);
81 else if ((*iParam) ==
"phiY")
82 phiY_ =
Parameters.getParameter<
double>(*iParam);
83 else if ((*iParam) ==
"phiZ")
84 phiZ_ =
Parameters.getParameter<
double>(*iParam);
85 else if ((*iParam) ==
"dX")
86 dX_ =
Parameters.getParameter<
double>(*iParam);
87 else if ((*iParam) ==
"dY")
88 dY_ =
Parameters.getParameter<
double>(*iParam);
89 else if ((*iParam) ==
"dZ")
90 dZ_ =
Parameters.getParameter<
double>(*iParam);
91 else if (
Parameters.retrieve(*iParam).typeCode() !=
'P') {
92 if (!
error.str().length())
93 error <<
"Unknown parameter name(s): ";
94 error <<
" " << *iParam;
98 param.push_back(scale_);
99 param.push_back(scaleError_);
100 param.push_back(phiX_);
101 param.push_back(phiY_);
102 param.push_back(phiZ_);
103 param.push_back(dX_);
104 param.push_back(dY_);
105 param.push_back(dZ_);
106 if (distribution_ ==
"gaussian")
108 else if (distribution_ ==
"flat")
110 else if (distribution_ ==
"fix")
121 double scale_ = param[0];
122 double scaleError_ = param[1];
123 double phiX_ = param[2];
124 double phiY_ = param[3];
125 double phiZ_ = param[4];
126 double dX_ = param[5];
127 double dY_ = param[6];
128 double dZ_ = param[7];
129 double dist_ = param[8];
131 double dx = scale_ * dX_;
132 double dy = scale_ * dY_;
133 double dz = scale_ * dZ_;
134 double phix = scale_ * phiX_;
135 double phiy = scale_ * phiY_;
136 double phiz = scale_ * phiZ_;
137 double errorx = scaleError_ * dX_;
138 double errory = scaleError_ * dY_;
139 double errorz = scaleError_ * dZ_;
140 double errorphix = scaleError_ * phiX_;
141 double errorphiy = scaleError_ * phiY_;
142 double errorphiz = scaleError_ * phiZ_;
144 errorDisp.push_back(errorx);
145 errorDisp.push_back(errory);
146 errorDisp.push_back(errorz);
148 errorRotation.push_back(errorphix);
149 errorRotation.push_back(errorphiy);
150 errorRotation.push_back(errorphiz);
153 std::fill_n(
index[0][0], 5 * 4 * 14, -1);
156 for (
const auto& iter : DTchambers) {
158 index[myId.wheel() + 2][myId.station() - 1][myId.sector() - 1] =
counter;
162 for (
int sector = 0; sector < 12; sector++) {
168 disp.push_back(disp_[0]);
169 disp.push_back(disp_[1]);
170 disp.push_back(disp_[2]);
174 }
else if (dist_ == 1) {
177 disp.push_back(disp_[0]);
178 disp.push_back(disp_[1]);
179 disp.push_back(disp_[2]);
194 if (sector == 3 &&
station == 3) {
197 }
else if (sector == 9 &&
station == 3) {
211 double scale_ = param[0];
212 double scaleError_ = param[1];
213 double phiX_ = param[2];
214 double phiY_ = param[3];
215 double phiZ_ = param[4];
216 double dX_ = param[5];
217 double dY_ = param[6];
218 double dZ_ = param[7];
219 double dist_ = param[8];
221 double dx = scale_ * dX_;
222 double dy = scale_ * dY_;
223 double dz = scale_ * dZ_;
224 double phix = scale_ * phiX_;
225 double phiy = scale_ * phiY_;
226 double phiz = scale_ * phiZ_;
227 double errorx = scaleError_ * dX_;
228 double errory = scaleError_ * dY_;
229 double errorz = scaleError_ * dZ_;
230 double errorphix = scaleError_ * phiX_;
231 double errorphiy = scaleError_ * phiY_;
232 double errorphiz = scaleError_ * phiZ_;
234 errorDisp.push_back(errorx);
235 errorDisp.push_back(errory);
236 errorDisp.push_back(errorz);
238 errorRotation.push_back(errorphix);
239 errorRotation.push_back(errorphiy);
240 errorRotation.push_back(errorphiz);
242 int index[2][4][4][36];
243 int sector_index[2][4][4][36];
244 std::fill_n(
index[0][0][0], 2 * 4 * 4 * 36, -1);
245 std::fill_n(sector_index[0][0][0], 2 * 4 * 4 * 36, -1);
248 for (
const auto& iter : CSCchambers) {
249 CSCDetId myId(iter->geomDetId().rawId());
250 index[myId.endcap() - 1][myId.station() - 1][myId.ring() - 1][myId.chamber() - 1] =
counter;
251 sector_index[myId.endcap() - 1][myId.station() - 1][myId.ring() - 1][myId.chamber() - 1] =
259 for (
int sector = 1; sector < 7; sector++) {
265 disp.push_back(disp_[0]);
266 disp.push_back(disp_[1]);
267 disp.push_back(disp_[2]);
271 }
else if (dist_ == 1) {
274 disp.push_back(disp_[0]);
275 disp.push_back(disp_[1]);
276 disp.push_back(disp_[2]);
299 for (
int r_counter = 0; r_counter < 2; r_counter++) {
330 double scale_ = param[0];
331 double scaleError_ = param[1];
332 double phiX_ = param[2];
333 double phiY_ = param[3];
334 double phiZ_ = param[4];
335 double dX_ = param[5];
336 double dY_ = param[6];
337 double dZ_ = param[7];
339 double dx = scale_ * dX_;
340 double dy = scale_ * dY_;
341 double dz = scale_ * dZ_;
342 double phix = scale_ * phiX_;
343 double phiy = scale_ * phiY_;
344 double phiz = scale_ * phiZ_;
345 double errorx = scaleError_ * dX_;
346 double errory = scaleError_ * dY_;
347 double errorz = scaleError_ * dZ_;
348 double errorphix = scaleError_ * phiX_;
349 double errorphiy = scaleError_ * phiY_;
350 double errorphiz = scaleError_ * phiZ_;
352 errorDisp.push_back(errorx);
353 errorDisp.push_back(errory);
354 errorDisp.push_back(errorz);
356 errorRotation.push_back(errorphix);
357 errorRotation.push_back(errorphiy);
358 errorRotation.push_back(errorphiz);
361 for (
const auto& iter : GEMSuperChambers) {
365 disp.push_back(disp_[0]);
366 disp.push_back(disp_[1]);
367 disp.push_back(disp_[2]);
382 double scale_ = param[0];
383 double scaleError_ = param[1];
384 double phiX_ = param[2];
385 double phiY_ = param[3];
386 double phiZ_ = param[4];
387 double dX_ = param[5];
388 double dY_ = param[6];
389 double dZ_ = param[7];
390 double dist_ = param[8];
391 double dx = scale_ * dX_;
392 double dy = scale_ * dY_;
393 double dz = scale_ * dZ_;
394 double phix = scale_ * phiX_;
395 double phiy = scale_ * phiY_;
396 double phiz = scale_ * phiZ_;
397 double errorx = scaleError_ * dX_;
398 double errory = scaleError_ * dY_;
399 double errorz = scaleError_ * dZ_;
400 double errorphix = scaleError_ * phiX_;
401 double errorphiy = scaleError_ * phiY_;
402 double errorphiz = scaleError_ * phiZ_;
409 disp.push_back(disp_[0]);
410 disp.push_back(disp_[1]);
411 disp.push_back(disp_[2]);
415 }
else if (dist_ == 1) {
418 disp.push_back(disp_[0]);
419 disp.push_back(disp_[1]);
420 disp.push_back(disp_[2]);
432 for (
const auto& iter : DTbarrel) {
438 for (
const auto& iter : CSCendcaps) {
444 for (
const auto& iter : GEMendcaps) {
465 disp[0] += dispRot.
x();
466 disp[1] += dispRot.y();
467 disp[2] += dispRot.z();