31 throw cms::Exception(
"TypeMismatch") <<
"Argument is not an AlignableMuon";
61 double scale_ = 0, scaleError_ = 0, phiX_ = 0, phiY_ = 0, phiZ_ = 0;
62 double dX_ = 0, dY_ = 0, dZ_ = 0;
64 std::ostringstream
error;
66 std::vector<std::string> parameterNames =
Parameters.getParameterNames();
67 for (std::vector<std::string>::iterator iParam = parameterNames.begin(); iParam != parameterNames.end(); iParam++) {
68 if ((*iParam) ==
"scale")
69 scale_ =
Parameters.getParameter<
double>(*iParam);
70 else if ((*iParam) ==
"distribution")
72 else if ((*iParam) ==
"scaleError")
73 scaleError_ =
Parameters.getParameter<
double>(*iParam);
74 else if ((*iParam) ==
"phiX")
75 phiX_ =
Parameters.getParameter<
double>(*iParam);
76 else if ((*iParam) ==
"phiY")
77 phiY_ =
Parameters.getParameter<
double>(*iParam);
78 else if ((*iParam) ==
"phiZ")
79 phiZ_ =
Parameters.getParameter<
double>(*iParam);
80 else if ((*iParam) ==
"dX")
81 dX_ =
Parameters.getParameter<
double>(*iParam);
82 else if ((*iParam) ==
"dY")
83 dY_ =
Parameters.getParameter<
double>(*iParam);
84 else if ((*iParam) ==
"dZ")
85 dZ_ =
Parameters.getParameter<
double>(*iParam);
86 else if (
Parameters.retrieve(*iParam).typeCode() !=
'P') {
87 if (!
error.str().length())
88 error <<
"Unknown parameter name(s): ";
89 error <<
" " << *iParam;
93 param.push_back(scale_);
94 param.push_back(scaleError_);
95 param.push_back(phiX_);
96 param.push_back(phiY_);
97 param.push_back(phiZ_);
100 param.push_back(dZ_);
101 if (distribution_ ==
"gaussian")
103 else if (distribution_ ==
"flat")
105 else if (distribution_ ==
"fix")
116 double scale_ = param[0];
117 double scaleError_ = param[1];
118 double phiX_ = param[2];
119 double phiY_ = param[3];
120 double phiZ_ = param[4];
121 double dX_ = param[5];
122 double dY_ = param[6];
123 double dZ_ = param[7];
124 double dist_ = param[8];
126 double dx = scale_ * dX_;
127 double dy = scale_ * dY_;
128 double dz = scale_ * dZ_;
129 double phix = scale_ * phiX_;
130 double phiy = scale_ * phiY_;
131 double phiz = scale_ * phiZ_;
132 double errorx = scaleError_ * dX_;
133 double errory = scaleError_ * dY_;
134 double errorz = scaleError_ * dZ_;
135 double errorphix = scaleError_ * phiX_;
136 double errorphiy = scaleError_ * phiY_;
137 double errorphiz = scaleError_ * phiZ_;
139 errorDisp.push_back(errorx);
140 errorDisp.push_back(errory);
141 errorDisp.push_back(errorz);
143 errorRotation.push_back(errorphix);
144 errorRotation.push_back(errorphiy);
145 errorRotation.push_back(errorphiz);
148 std::fill_n(
index[0][0], 5 * 4 * 14, -1);
151 for (
const auto& iter : DTchambers) {
153 index[myId.wheel() + 2][myId.station() - 1][myId.sector() - 1] =
counter;
157 for (
int sector = 0; sector < 12; sector++) {
163 disp.push_back(disp_[0]);
164 disp.push_back(disp_[1]);
165 disp.push_back(disp_[2]);
169 }
else if (dist_ == 1) {
172 disp.push_back(disp_[0]);
173 disp.push_back(disp_[1]);
174 disp.push_back(disp_[2]);
189 if (sector == 3 &&
station == 3) {
192 }
else if (sector == 9 &&
station == 3) {
206 double scale_ = param[0];
207 double scaleError_ = param[1];
208 double phiX_ = param[2];
209 double phiY_ = param[3];
210 double phiZ_ = param[4];
211 double dX_ = param[5];
212 double dY_ = param[6];
213 double dZ_ = param[7];
214 double dist_ = param[8];
216 double dx = scale_ * dX_;
217 double dy = scale_ * dY_;
218 double dz = scale_ * dZ_;
219 double phix = scale_ * phiX_;
220 double phiy = scale_ * phiY_;
221 double phiz = scale_ * phiZ_;
222 double errorx = scaleError_ * dX_;
223 double errory = scaleError_ * dY_;
224 double errorz = scaleError_ * dZ_;
225 double errorphix = scaleError_ * phiX_;
226 double errorphiy = scaleError_ * phiY_;
227 double errorphiz = scaleError_ * phiZ_;
229 errorDisp.push_back(errorx);
230 errorDisp.push_back(errory);
231 errorDisp.push_back(errorz);
233 errorRotation.push_back(errorphix);
234 errorRotation.push_back(errorphiy);
235 errorRotation.push_back(errorphiz);
237 int index[2][4][4][36];
238 int sector_index[2][4][4][36];
239 std::fill_n(
index[0][0][0], 2 * 4 * 4 * 36, -1);
240 std::fill_n(sector_index[0][0][0], 2 * 4 * 4 * 36, -1);
243 for (
const auto& iter : CSCchambers) {
244 CSCDetId myId(iter->geomDetId().rawId());
245 index[myId.endcap() - 1][myId.station() - 1][myId.ring() - 1][myId.chamber() - 1] =
counter;
246 sector_index[myId.endcap() - 1][myId.station() - 1][myId.ring() - 1][myId.chamber() - 1] =
254 for (
int sector = 1; sector < 7; sector++) {
260 disp.push_back(disp_[0]);
261 disp.push_back(disp_[1]);
262 disp.push_back(disp_[2]);
266 }
else if (dist_ == 1) {
269 disp.push_back(disp_[0]);
270 disp.push_back(disp_[1]);
271 disp.push_back(disp_[2]);
294 for (
int r_counter = 0; r_counter < 2; r_counter++) {
326 double scale_ = param[0];
327 double scaleError_ = param[1];
328 double phiX_ = param[2];
329 double phiY_ = param[3];
330 double phiZ_ = param[4];
331 double dX_ = param[5];
332 double dY_ = param[6];
333 double dZ_ = param[7];
334 double dist_ = param[8];
335 double dx = scale_ * dX_;
336 double dy = scale_ * dY_;
337 double dz = scale_ * dZ_;
338 double phix = scale_ * phiX_;
339 double phiy = scale_ * phiY_;
340 double phiz = scale_ * phiZ_;
341 double errorx = scaleError_ * dX_;
342 double errory = scaleError_ * dY_;
343 double errorz = scaleError_ * dZ_;
344 double errorphix = scaleError_ * phiX_;
345 double errorphiy = scaleError_ * phiY_;
346 double errorphiz = scaleError_ * phiZ_;
353 disp.push_back(disp_[0]);
354 disp.push_back(disp_[1]);
355 disp.push_back(disp_[2]);
359 }
else if (dist_ == 1) {
362 disp.push_back(disp_[0]);
363 disp.push_back(disp_[1]);
364 disp.push_back(disp_[2]);
376 for (
const auto& iter : DTbarrel) {
382 for (
const auto& iter : CSCendcaps) {
403 disp[0] += dispRot.
x();
404 disp[1] += dispRot.y();
405 disp[2] += dispRot.z();