11 : theBeamSpot(0.,0.,0.),
12 scaleDT_( par.getParameter<bool>(
"scaleDT") )
139 if( (outerHit->isDT() && innerHit->isCSC())
140 || (outerHit->isDT() && innerHit->isDT() && (innerPoint.
perp() > outerPoint.
perp()))
141 || (outerHit->isCSC() && innerHit->isCSC() && (fabs(innerPoint.
z()) > fabs(outerPoint.
z()))) )
143 innerHit = secondHit;
145 innerPoint = innerHit->globalPosition() -
theBeamSpot;
146 outerPoint = outerHit->globalPosition() -
theBeamSpot;
149 double phiInner = innerPoint.
phi();
150 double phiOuter = outerPoint.
phi();
152 double etaInner = innerPoint.
eta();
153 double etaOuter = outerPoint.
eta();
170 double dPhi = phiInner - phiOuter;
186 double eta = fabs(etaOuter);
189 std::vector <int> stationCoded(2);
190 stationCoded[0] = stationCoded[1] = 999;
192 DetId detId_inner = innerHit->hit()->geographicalId();
193 DetId detId_outer = outerHit->hit()->geographicalId();
198 std::ostringstream os0 ;
199 std::ostringstream os1 ;
200 os0 <<
abs(stationCoded[0]);
201 os1 <<
abs(stationCoded[1]);
207 bool singleSegment =
false;
209 if( stationCoded[0] == stationCoded[1]){
211 singleSegment =
true;
214 double gvPerpPos = gv.
x()*gv.
x() + gv.
y()*gv.
y();
215 if (gvPerpPos < 1
e-32) gvPerpPos = 1
e-32;
216 gvPerpPos=
sqrt(gvPerpPos);
219 double cosDpsi = (gv.
x()*innerPoint.
x() + gv.
y()*innerPoint.
y());
221 cosDpsi /=
sqrt(innerPoint.
x()*innerPoint.
x() + innerPoint.
y()*innerPoint.
y());
222 cosDpsi /= gvPerpPos;
223 cosDpsi = cosDpsi > 1 ? 1 : cosDpsi;
224 cosDpsi = cosDpsi < -1 ? -1 : cosDpsi;
227 double axb = ( innerPoint.
x()*gv.
y() ) - ( innerPoint.
y()*gv.
x() ) ;
228 sign = (axb < 0.) ? 1 : -1;
230 double dpsi = fabs(acos(cosDpsi)) ;
234 if (fabs(dpsi) < 0.00005) {
242 std::ostringstream os;
244 combination =
"SMB_"+os.str();
246 else if(innerHit->isCSC())
249 std::ostringstream os;
251 if(ring == 4) ring = 1;
253 combination =
"SME_"+os.str();
255 else if(innerHit->isME0())
258 std::ostringstream os;
261 combination =
"SME_"+os.str();
269 if(stationCoded[0]<0){
270 if(stationCoded[1]<0){
272 combination =
"DT_" + os0.str() + os1.str();
276 eta = fabs(etaInner);
277 if(-1==stationCoded[0]){
278 switch (stationCoded[1]){
280 combination =
"OL_1213";
283 combination =
"OL_1222";
286 combination =
"OL_1232";
293 else if (-2==stationCoded[0]){
294 if(1==stationCoded[1]){
295 combination =
"OL_2213";
299 combination =
"OL_2222";
308 if(stationCoded[1]<0){
314 combination =
"CSC_" + os0.str() + os1.str();
315 if(
"CSC_04" == combination){
316 combination =
"CSC_14";
322 std::vector<double> pTestimate(2);
324 if(init_combination!=combination){
329 edm::LogWarning(
"BadSegmentCombination") <<
"Cannot find parameters for combo " << combination;
330 pTestimate[0] = pTestimate[1] = 100;
336 pTestimate =
getPt(parametersItr->second, eta, dPhi, combination, detId_outer);
340 pTestimate =
getPt(parametersItr->second, eta, dPhi);
344 pTestimate[0] = fabs(pTestimate[0]);
345 pTestimate[1] = fabs(pTestimate[1]);
347 pTestimate[0] *= double(sign);
352 pTestimate[0] = pTestimate[1] = 100;
371 DetId detId(hit->hit()->geographicalId());
378 else if( hit->isCSC() ){
382 if(result == 1 && (1 == cscID.
ring() || 4 == cscID.
ring()) )
385 else if( hit->isME0() ){
388 else if(hit->isRPC()){
396 double h = fabs(eta);
397 double estPt = ( vPara[0] + vPara[1]*h + vPara[2]*h*
h ) / dPhi;
398 double estSPt = ( vPara[3] + vPara[4]*h + vPara[5]*h*
h ) / dPhi;
400 std::vector<double> paraPt ;
401 paraPt.push_back( estPt );
402 paraPt.push_back( estSPt ) ;
409 double h = fabs(eta);
410 double estPt = ( vPara[0] + vPara[1]*h + vPara[2]*h*
h ) / dPhi;
412 double estSPt = ( vPara[3] + vPara[4]*h + vPara[5]*h*
h ) / dPhi;
416 if(combination[0] ==
'D') {
420 std::ostringstream os;
421 os << combination <<
"_" << wheel <<
"_scale";
425 double t1 = scalesItr->second[0];
426 double scaleFactor = 1./( 1. + t1/( estPt + 10. ) ) ;
433 std::vector<double> paraPt ;
434 paraPt.push_back( estPt );
435 paraPt.push_back( estSPt ) ;
T getParameter(std::string const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Geom::Phi< T > phi() const
Abs< T >::type abs(const T &t)
std::shared_ptr< MuonTransientTrackingRecHit const > ConstMuonRecHitPointer
int station() const
Return the station number.
int wheel() const
Return the wheel number.