10 : theBeamSpot(0.,0.,0.),
11 scaleDT_( par.getParameter<bool>(
"scaleDT") )
138 if( (outerHit->isDT() && innerHit->isCSC())
139 || (outerHit->isDT() && innerHit->isDT() && (innerPoint.
perp() > outerPoint.
perp()))
140 || (outerHit->isCSC() && innerHit->isCSC() && (fabs(innerPoint.
z()) > fabs(outerPoint.
z()))) )
142 innerHit = secondHit;
144 innerPoint = innerHit->globalPosition() -
theBeamSpot;
145 outerPoint = outerHit->globalPosition() -
theBeamSpot;
148 double phiInner = innerPoint.
phi();
149 double phiOuter = outerPoint.
phi();
151 double etaInner = innerPoint.
eta();
152 double etaOuter = outerPoint.
eta();
169 double dPhi = phiInner - phiOuter;
185 double eta = fabs(etaOuter);
188 std::vector <int> stationCoded(2);
189 stationCoded[0] = stationCoded[1] = 999;
191 DetId detId_inner = innerHit->hit()->geographicalId();
192 DetId detId_outer = outerHit->hit()->geographicalId();
197 std::ostringstream os0 ;
198 std::ostringstream os1 ;
199 os0 <<
abs(stationCoded[0]);
200 os1 <<
abs(stationCoded[1]);
206 bool singleSegment =
false;
208 if( stationCoded[0] == stationCoded[1]){
210 singleSegment =
true;
213 double gvPerpPos = gv.
x()*gv.
x() + gv.
y()*gv.
y();
214 if (gvPerpPos < 1
e-32) gvPerpPos = 1
e-32; gvPerpPos=
sqrt(gvPerpPos);
217 double cosDpsi = (gv.
x()*innerPoint.
x() + gv.
y()*innerPoint.
y());
219 cosDpsi /=
sqrt(innerPoint.
x()*innerPoint.
x() + innerPoint.
y()*innerPoint.
y());
220 cosDpsi /= gvPerpPos;
221 cosDpsi = cosDpsi > 1 ? 1 : cosDpsi;
222 cosDpsi = cosDpsi < -1 ? -1 : cosDpsi;
225 double axb = ( innerPoint.
x()*gv.
y() ) - ( innerPoint.
y()*gv.
x() ) ;
226 sign = (axb < 0.) ? 1 : -1;
228 double dpsi = fabs(acos(cosDpsi)) ;
232 if (fabs(dpsi) < 0.00005) {
240 std::ostringstream os;
242 combination =
"SMB_"+os.str();
244 else if(innerHit->isCSC())
247 std::ostringstream os;
249 if(ring == 4) ring = 1;
251 combination =
"SME_"+os.str();
259 if(stationCoded[0]<0){
260 if(stationCoded[1]<0){
262 combination =
"DT_" + os0.str() + os1.str();
266 eta = fabs(etaInner);
267 if(-1==stationCoded[0]){
268 switch (stationCoded[1]){
270 combination =
"OL_1213";
273 combination =
"OL_1222";
276 combination =
"OL_1232";
283 else if (-2==stationCoded[0]){
284 if(1==stationCoded[1]){
285 combination =
"OL_2213";
289 combination =
"OL_2222";
298 if(stationCoded[1]<0){
304 combination =
"CSC_" + os0.str() + os1.str();
305 if(
"CSC_04" == combination){
306 combination =
"CSC_14";
312 std::vector<double> pTestimate(2);
314 if(init_combination!=combination){
319 edm::LogWarning(
"BadSegmentCombination") <<
"Cannot find parameters for combo " << combination;
320 pTestimate[0] = pTestimate[1] = 100;
326 pTestimate =
getPt(parametersItr->second, eta, dPhi, combination, detId_outer);
330 pTestimate =
getPt(parametersItr->second, eta, dPhi);
334 pTestimate[0] = fabs(pTestimate[0]);
335 pTestimate[1] = fabs(pTestimate[1]);
337 pTestimate[0] *= double(sign);
342 pTestimate[0] = pTestimate[1] = 100;
361 DetId detId(hit->hit()->geographicalId());
368 else if( hit->isCSC() ){
372 if(result == 1 && (1 == cscID.
ring() || 4 == cscID.
ring()) )
375 else if(hit->isRPC()){
383 double h = fabs(eta);
384 double estPt = ( vPara[0] + vPara[1]*h + vPara[2]*h*
h ) / dPhi;
385 double estSPt = ( vPara[3] + vPara[4]*h + vPara[5]*h*
h ) / dPhi;
387 std::vector<double> paraPt ;
388 paraPt.push_back( estPt );
389 paraPt.push_back( estSPt ) ;
396 double h = fabs(eta);
397 double estPt = ( vPara[0] + vPara[1]*h + vPara[2]*h*
h ) / dPhi;
399 double estSPt = ( vPara[3] + vPara[4]*h + vPara[5]*h*
h ) / dPhi;
403 if(combination[0] ==
'D') {
407 std::ostringstream os;
408 os << combination <<
"_" << wheel <<
"_scale";
412 double t1 = scalesItr->second[0];
413 double scaleFactor = 1./( 1. + t1/( estPt + 10. ) ) ;
415 estSPt = estSPt * scaleFactor ;
416 estPt = estPt * scaleFactor ;
420 std::vector<double> paraPt ;
421 paraPt.push_back( estPt );
422 paraPt.push_back( estSPt ) ;
T getParameter(std::string const &) const
Geom::Phi< T > phi() const
double dPhi(double phi1, double phi2)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
int station() const
Return the station number.
int wheel() const
Return the wheel number.