11 : theBeamSpot(0., 0., 0.), scaleDT_(par.getParameter<bool>(
"scaleDT")) {
127 if ((outerHit->isDT() && innerHit->isCSC()) ||
128 (outerHit->isDT() && innerHit->isDT() && (innerPoint.
perp() > outerPoint.
perp())) ||
129 (outerHit->isCSC() && innerHit->isCSC() && (fabs(innerPoint.
z()) > fabs(outerPoint.
z())))) {
130 innerHit = secondHit;
132 innerPoint = innerHit->globalPosition() -
theBeamSpot;
133 outerPoint = outerHit->globalPosition() -
theBeamSpot;
136 double phiInner = innerPoint.
phi();
137 double phiOuter = outerPoint.
phi();
139 double etaInner = innerPoint.
eta();
140 double etaOuter = outerPoint.
eta();
157 double dPhi = phiInner - phiOuter;
172 double eta = fabs(etaOuter);
174 std::vector<int> stationCoded(2);
175 stationCoded[0] = stationCoded[1] = 999;
177 DetId detId_inner = innerHit->hit()->geographicalId();
178 DetId detId_outer = outerHit->hit()->geographicalId();
183 std::ostringstream os0;
184 std::ostringstream os1;
185 os0 <<
abs(stationCoded[0]);
186 os1 <<
abs(stationCoded[1]);
192 bool singleSegment =
false;
194 if (stationCoded[0] == stationCoded[1]) {
196 singleSegment =
true;
199 double gvPerpPos = gv.
x() * gv.
x() + gv.
y() * gv.
y();
200 if (gvPerpPos < 1
e-32)
202 gvPerpPos =
sqrt(gvPerpPos);
205 double cosDpsi = (gv.
x() * innerPoint.
x() + gv.
y() * innerPoint.
y());
207 cosDpsi /=
sqrt(innerPoint.
x() * innerPoint.
x() + innerPoint.
y() * innerPoint.
y());
208 cosDpsi /= gvPerpPos;
209 cosDpsi = cosDpsi > 1 ? 1 : cosDpsi;
210 cosDpsi = cosDpsi < -1 ? -1 : cosDpsi;
213 double axb = (innerPoint.
x() * gv.
y()) - (innerPoint.
y() * gv.
x());
214 sign = (axb < 0.) ? 1 : -1;
216 double dpsi = fabs(acos(cosDpsi));
220 if (fabs(dpsi) < 0.00005) {
225 if (innerHit->isDT()) {
227 std::ostringstream os;
229 combination =
"SMB_" + os.str();
230 }
else if (innerHit->isCSC()) {
232 std::ostringstream os;
237 combination =
"SME_" + os.str();
238 }
else if (innerHit->isME0()) {
240 std::ostringstream os;
243 combination =
"SME_" + os.str();
248 if (stationCoded[0] < 0) {
249 if (stationCoded[1] < 0) {
251 combination =
"DT_" + os0.str() + os1.str();
254 eta = fabs(etaInner);
255 if (-1 == stationCoded[0]) {
256 switch (stationCoded[1]) {
258 combination =
"OL_1213";
261 combination =
"OL_1222";
264 combination =
"OL_1232";
270 }
else if (-2 == stationCoded[0]) {
271 if (1 == stationCoded[1]) {
272 combination =
"OL_2213";
275 combination =
"OL_2222";
282 if (stationCoded[1] < 0) {
287 combination =
"CSC_" + os0.str() + os1.str();
288 if (
"CSC_04" == combination) {
289 combination =
"CSC_14";
295 std::vector<double> pTestimate(2);
297 if (init_combination != combination) {
302 edm::LogWarning(
"BadSegmentCombination") <<
"Cannot find parameters for combo " << combination;
303 pTestimate[0] = pTestimate[1] = 100;
307 pTestimate =
getPt(parametersItr->second, eta, dPhi, combination, detId_outer);
309 pTestimate =
getPt(parametersItr->second, eta, dPhi);
313 pTestimate[0] = fabs(pTestimate[0]);
314 pTestimate[1] = fabs(pTestimate[1]);
316 pTestimate[0] *= double(sign);
320 pTestimate[0] = pTestimate[1] = 100;
337 DetId detId(hit->hit()->geographicalId());
343 }
else if (hit->isCSC()) {
347 if (result == 1 && (1 == cscID.
ring() || 4 == cscID.
ring()))
349 }
else if (hit->isME0()) {
351 }
else if (hit->isRPC()) {
358 double h = fabs(eta);
359 double estPt = (vPara[0] + vPara[1] * h + vPara[2] * h *
h) / dPhi;
360 double estSPt = (vPara[3] + vPara[4] * h + vPara[5] * h *
h) / dPhi;
362 std::vector<double> paraPt;
363 paraPt.push_back(estPt);
364 paraPt.push_back(estSPt);
374 double h = fabs(eta);
375 double estPt = (vPara[0] + vPara[1] * h + vPara[2] * h *
h) / dPhi;
377 double estSPt = (vPara[3] + vPara[4] * h + vPara[5] * h *
h) / dPhi;
381 if (combination[0] ==
'D') {
385 std::ostringstream os;
386 os << combination <<
"_" << wheel <<
"_scale";
390 double t1 = scalesItr->second[0];
391 double scaleFactor = 1. / (1. + t1 / (estPt + 10.));
398 std::vector<double> paraPt;
399 paraPt.push_back(estPt);
400 paraPt.push_back(estSPt);
Geom::Phi< T > phi() const
Abs< T >::type abs(const T &t)
T getParameter(std::string const &) const
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
Log< level::Warning, false > LogWarning
int station() const
Return the station number.
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
int wheel() const
Return the wheel number.