#include <RecoEgamma/EgammaElectronAlgos/interface/BarrelMeasurementEstimator.h>
Public Member Functions | |
BarrelMeasurementEstimator (float phiMin, float phiMax, float zMin, float zMax) | |
BarrelMeasurementEstimator () | |
virtual BarrelMeasurementEstimator * | clone () const |
virtual bool | estimate (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const |
Returns true if the TrajectoryStateOnSurface is compatible with the BoundPlane, false otherwise. | |
virtual std::pair< bool, double > | estimate (const TrajectoryStateOnSurface &ts, GlobalPoint &gp) const |
virtual std::pair< bool, double > | estimate (const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const |
Returns pair( true, value) if the TrajectoryStateOnSurface is compatible with the RecHit, and pair( false, value) if it is not compatible. | |
MeasurementEstimator::Local2DVector | maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const |
Returns the size of the compatibility region around the local position of the TrajectoryStateOnSurface along the directions of local x and y axis. | |
void | setPhiRange (float dummyphiMin, float dummyphiMax) |
void | setZRange (float zmin, float zmax) |
Private Attributes | |
float | thePhiMax |
float | thePhiMin |
float | theZMax |
float | theZMin |
Definition at line 32 of file BarrelMeasurementEstimator.h.
BarrelMeasurementEstimator::BarrelMeasurementEstimator | ( | ) | [inline] |
BarrelMeasurementEstimator::BarrelMeasurementEstimator | ( | float | phiMin, | |
float | phiMax, | |||
float | zMin, | |||
float | zMax | |||
) | [inline] |
virtual BarrelMeasurementEstimator* BarrelMeasurementEstimator::clone | ( | void | ) | const [inline, virtual] |
Implements MeasurementEstimator.
Definition at line 60 of file BarrelMeasurementEstimator.h.
References BarrelMeasurementEstimator().
00061 { 00062 return new BarrelMeasurementEstimator(*this); 00063 }
bool BarrelMeasurementEstimator::estimate | ( | const TrajectoryStateOnSurface & | ts, | |
const BoundPlane & | plane | |||
) | const [virtual] |
Returns true if the TrajectoryStateOnSurface is compatible with the BoundPlane, false otherwise.
The TrajectoryStateOnSurface must be on the plane.
Implements MeasurementEstimator.
Definition at line 69 of file BarrelMeasurementEstimator.cc.
References TrajectoryStateOnSurface::globalParameters(), GlobalTrajectoryParameters::position(), rangesIntersect(), thePhiMax, thePhiMin, theZMax, and theZMin.
00070 { 00071 00072 typedef std::pair<float,float> Range; 00073 00074 00075 GlobalPoint trajPos(ts.globalParameters().position()); 00076 GlobalDetRangeZPhi detRange(plane); 00077 00078 Range trajZRange(trajPos.z() - fabs(theZMin), trajPos.z() + fabs(theZMax)); 00079 Range trajPhiRange(trajPos.phi() - fabs(thePhiMin), trajPos.phi() + fabs(thePhiMax)); 00080 00081 if(rangesIntersect(trajZRange, detRange.zRange()) && 00082 rangesIntersect(trajPhiRange, detRange.phiRange(), PhiLess())) { 00083 return true; 00084 } 00085 else { 00086 // cout <<cout<<" barrel boundpl est returns false!!"<<endl; 00087 // cout<<"BarrelMeasurementEstimator(estimate) :thePhiMin,thePhiMax, theZMin,theZMax "<<thePhiMin<<" "<<thePhiMax<<" "<< theZMin<<" "<<theZMax<<endl; 00088 // cout<<" trajZRange "<<trajZRange.first<<" "<<trajZRange.second<<endl; 00089 // cout<<" trajPhiRange "<<trajPhiRange.first<<" "<<trajPhiRange.second<<endl; 00090 // cout<<" detZRange "<<detRange.zRange().first<<" "<<detRange.zRange().second<<endl; 00091 // cout<<" detPhiRange "<<detRange.phiRange().first<<" "<<detRange.phiRange().second<<endl; 00092 // cout<<" intersect z: "<<rangesIntersect(trajZRange, detRange.zRange())<<endl; 00093 // cout<<" intersect phi: "<<rangesIntersect(trajPhiRange, detRange.phiRange(), PhiLess())<<endl; 00094 return false; 00095 } 00096 00097 }
std::pair< bool, double > BarrelMeasurementEstimator::estimate | ( | const TrajectoryStateOnSurface & | ts, | |
GlobalPoint & | gp | |||
) | const [virtual] |
Definition at line 37 of file BarrelMeasurementEstimator.cc.
References TrajectoryStateOnSurface::globalParameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), thePhiMin, theZMax, theZMin, and PV3DBase< T, PVType, FrameType >::z().
00038 { 00039 float tsPhi = ts.globalParameters().position().phi(); 00040 float myR = gp.perp(); 00041 float myZ = gp.z(); 00042 00043 float myZmax = theZMax; 00044 float myZmin = theZMin; 00045 00046 if(fabs(myZ)<30. && myR>8.) 00047 { 00048 myZmax = 0.09; 00049 myZmin = -0.09; 00050 } 00051 00052 float rhPhi = gp.phi(); 00053 00054 float zDiff = ts.globalParameters().position().z() - gp.z(); 00055 float phiDiff = tsPhi - rhPhi; 00056 if (phiDiff > pi) phiDiff -= twopi; 00057 if (phiDiff < -pi) phiDiff += twopi; 00058 00059 if ( phiDiff < thePhiMax && phiDiff > thePhiMin && 00060 zDiff < myZmax && zDiff > myZmin) { 00061 00062 return std::pair<bool,double>(true,1.); 00063 } else { 00064 00065 return std::pair<bool,double>(false,0.); 00066 } 00067 }
std::pair< bool, double > BarrelMeasurementEstimator::estimate | ( | const TrajectoryStateOnSurface & | ts, | |
const TransientTrackingRecHit & | hit | |||
) | const [virtual] |
Returns pair( true, value) if the TrajectoryStateOnSurface is compatible with the RecHit, and pair( false, value) if it is not compatible.
The TrajectoryStateOnSurface must be on the same Surface as the RecHit. For an estimator where there is no value computed, e.g. fixed window estimator, only the first(bool) part is of interest.
Implements MeasurementEstimator.
Definition at line 29 of file BarrelMeasurementEstimator.cc.
References TransientTrackingRecHit::det(), TrackingRecHit::localPosition(), lp, GeomDet::surface(), and Surface::toGlobal().
Referenced by PixelHitMatcher::compatibleSeeds().
00030 { 00031 LocalPoint lp = hit.localPosition(); 00032 GlobalPoint gp = hit.det()->surface().toGlobal( lp); 00033 return this->estimate(ts,gp); 00034 }
MeasurementEstimator::Local2DVector BarrelMeasurementEstimator::maximalLocalDisplacement | ( | const TrajectoryStateOnSurface & | ts, | |
const BoundPlane & | plane | |||
) | const [virtual] |
Returns the size of the compatibility region around the local position of the TrajectoryStateOnSurface along the directions of local x and y axis.
The TrajectoryStateOnSurface must be on the plane. This method allows to limit the search for compatible detectors or RecHits. The MeasurementEstimator should not return "true" for any RecHit or BoundPlane which is entirely outside of the compatibility region defined by maximalLocalDisplacement().
Reimplemented from MeasurementEstimator.
Definition at line 100 of file BarrelMeasurementEstimator.cc.
References TrajectoryStateOnSurface::hasError(), asciidump::le, TrajectoryStateOnSurface::localError(), LocalTrajectoryError::positionError(), funct::sqrt(), LocalError::xx(), and LocalError::yy().
00102 { 00103 float nSigmaCut = 3.; 00104 if ( ts.hasError()) { 00105 LocalError le = ts.localError().positionError(); 00106 return Local2DVector( sqrt(le.xx())*nSigmaCut, sqrt(le.yy())*nSigmaCut); 00107 } 00108 else return Local2DVector(99999,99999); 00109 }
void BarrelMeasurementEstimator::setPhiRange | ( | float | dummyphiMin, | |
float | dummyphiMax | |||
) | [inline] |
Definition at line 38 of file BarrelMeasurementEstimator.h.
References thePhiMax, and thePhiMin.
Referenced by PixelHitMatcher::set1stLayer(), and PixelHitMatcher::set2ndLayer().
void BarrelMeasurementEstimator::setZRange | ( | float | zmin, | |
float | zmax | |||
) | [inline] |
Definition at line 44 of file BarrelMeasurementEstimator.h.
References theZMax, and theZMin.
Referenced by PixelHitMatcher::set1stLayerZRange().
float BarrelMeasurementEstimator::thePhiMax [private] |
Definition at line 72 of file BarrelMeasurementEstimator.h.
Referenced by estimate(), and setPhiRange().
float BarrelMeasurementEstimator::thePhiMin [private] |
Definition at line 71 of file BarrelMeasurementEstimator.h.
Referenced by estimate(), and setPhiRange().
float BarrelMeasurementEstimator::theZMax [private] |
Definition at line 74 of file BarrelMeasurementEstimator.h.
Referenced by estimate(), and setZRange().
float BarrelMeasurementEstimator::theZMin [private] |
Definition at line 73 of file BarrelMeasurementEstimator.h.
Referenced by estimate(), and setZRange().