CMS 3D CMS Logo

ConversionBarrelEstimator Class Reference

Defines the search area in the barrel. More...

#include <RecoEgamma/EgammaPhotonAlgos/interface/ConversionBarrelEstimator.h>

Inheritance diagram for ConversionBarrelEstimator:

MeasurementEstimator

List of all members.

Public Member Functions

virtual ConversionBarrelEstimatorclone () const
 ConversionBarrelEstimator (float phiRangeMin, float phiRangeMax, float zRangeMin, float zRangeMax, double nSigma=3.)
 ConversionBarrelEstimator ()
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, 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.
virtual 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.
double nSigmaCut () const

Private Attributes

double theNSigma
float thePhiRangeMax
float thePhiRangeMin
float theZRangeMax
float theZRangeMin


Detailed Description

Defines the search area in the barrel.

Date
2007/03/07 16:48:42
Revision
1.4
Author:
Nancy Marinelli, U. of Notre Dame, US

Definition at line 21 of file ConversionBarrelEstimator.h.


Constructor & Destructor Documentation

ConversionBarrelEstimator::ConversionBarrelEstimator (  )  [inline]

Definition at line 24 of file ConversionBarrelEstimator.h.

Referenced by clone().

00024 {};

ConversionBarrelEstimator::ConversionBarrelEstimator ( float  phiRangeMin,
float  phiRangeMax,
float  zRangeMin,
float  zRangeMax,
double  nSigma = 3. 
) [inline]

Definition at line 25 of file ConversionBarrelEstimator.h.

00026                                                                                         : 
00027                            thePhiRangeMin( phiRangeMin), thePhiRangeMax( phiRangeMax),
00028                            theZRangeMin( zRangeMin), theZRangeMax( zRangeMax), theNSigma(nSigma) {
00029     //    std::cout << " ConversionBarrelEstimator CTOR " << std::endl;
00030 }


Member Function Documentation

virtual ConversionBarrelEstimator* ConversionBarrelEstimator::clone ( void   )  const [inline, virtual]

Implements MeasurementEstimator.

Definition at line 37 of file ConversionBarrelEstimator.h.

References ConversionBarrelEstimator().

00037                                                    {
00038     return new ConversionBarrelEstimator(*this);
00039   } 

bool ConversionBarrelEstimator::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 ConversionBarrelEstimator.cc.

References TrajectoryStateOnSurface::globalParameters(), GlobalTrajectoryParameters::position(), rangesIntersect(), thePhiRangeMax, thePhiRangeMin, and theZRangeMax.

00070                                                                                       {
00071   
00072   typedef     std::pair<float,float>   Range;
00073   //  std::cout << "  ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane) " << std::endl;
00074 
00075   GlobalPoint trajPos(ts.globalParameters().position());
00076   GlobalDetRangeZPhi detRange(plane);
00077   Range trajZRange(trajPos.z() - 2.*theZRangeMax, trajPos.z() + 2.*theZRangeMax);
00078   Range trajPhiRange(trajPos.phi() + thePhiRangeMin, trajPos.phi() + thePhiRangeMax);
00079 
00080 
00081    if(rangesIntersect(trajZRange, detRange.zRange()) &&
00082       rangesIntersect(trajPhiRange, detRange.phiRange(), PhiLess())) {
00083      //     std::cout << "   ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane)  IN RANGE " << std::endl;  
00084     return true;   
00085 
00086 
00087 
00088   } else {
00089 
00090     //    std::cout << "   ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane) NOT IN RANGE " << std::endl;  
00091     return false;
00092 
00093   }
00094 
00095 
00096 }

std::pair< bool, double > ConversionBarrelEstimator::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 13 of file ConversionBarrelEstimator.cc.

References TrajectoryStateOnSurface::globalParameters(), TransientTrackingRecHit::globalPosition(), TrackingRecHit::localPositionError(), PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), HLT_VtxMuL3::result, funct::sqrt(), thePhiRangeMin, theZRangeMax, LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

00014                                                                                                       {
00015   std::pair<bool,double> result;
00016   
00017   //std::cout << "  ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const TransientTrackingRecHit& hit) " << std::endl;
00018  
00019   float tsPhi = ts.globalParameters().position().phi();
00020   GlobalPoint gp = hit.globalPosition();
00021   float rhPhi = gp.phi();
00022   
00023   // allow a z fudge of 2 sigma
00024   float dz = 2. * sqrt(hit.localPositionError().yy()) ;
00025   float zDiff = ts.globalParameters().position().z() - gp.z(); 
00026   float phiDiff = tsPhi - rhPhi;
00027   if (phiDiff > pi) phiDiff -= twopi;
00028   if (phiDiff < -pi) phiDiff += twopi; 
00029   
00030   // add the errors on the window and the point in quadrature
00031   float zrange = sqrt(theZRangeMax*theZRangeMax + dz*dz);
00032   
00033   /*
00034   std::cout << "  BarrelEstimator ts local error " <<ts.localError().positionError()  << " hit local error " << hit.localPositionError() << std::endl; 
00035   std::cout << "  BarrelEstimator:  RecHit at " << gp << " phi " << rhPhi << " eta " << gp.eta() <<  std::endl;
00036   std::cout << "  BarrelEstimator:  ts at " << ts.globalParameters().position() << " phi " <<ts.globalParameters().position().phi() << " eta " << ts.globalParameters().position().eta()<<  std::endl;
00037   std::cout << "                    zrange = +/-" << zrange << ", zDiff = " << zDiff << std::endl;
00038   std::cout << "                    thePhiRangeMin = " << thePhiRangeMin << ", thePhiRangeMax = " << thePhiRangeMax << ", phiDiff = " << phiDiff << std::endl;
00039   */
00040 
00041   
00042   
00043   if ( phiDiff < thePhiRangeMax && phiDiff > thePhiRangeMin && 
00044        zDiff < zrange && zDiff > -zrange) {
00045     
00046     //    std::cout << "      estimator returns 1 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
00047     //    << thePhiRangeMax << " and zDiff " << zDiff << " < " << zrange << std::endl;
00048     // std::cout << " YES " << phiDiff << " " << zDiff << std::endl;
00049     // std::cout << "                  => RECHIT ACCEPTED " << std::endl;
00050     
00051     result.first=true;
00052     result.second=phiDiff;
00053   } else {
00054     
00055     //     std::cout << "      estimator returns NOT ACCEPTED  with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
00056     //<< thePhiRangeMax << " and zDiff " << zDiff << " < " << theZRangeMax+dz << std::endl;
00057     
00058     result.first=false;
00059     result.second=0;
00060     
00061   }
00062   
00063   return result;
00064   
00065 }

MeasurementEstimator::Local2DVector ConversionBarrelEstimator::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 ConversionBarrelEstimator.cc.

00102 {
00103   
00104 
00105   
00106   /* 
00107   if ( ts.hasError() ) {
00108     LocalError le = ts.localError().positionError();
00109     std::cout << "  ConversionBarrelEstimator::maximalLocalDisplacent local error " << sqrt(le.xx()) << " " << sqrt(le.yy()) << " nSigma " << nSigmaCut() << " sqrt(le.xx())*nSigmaCut() " << sqrt(le.xx())*nSigmaCut()  << "  sqrt(le.yy())*nSigmaCut() " <<  sqrt(le.yy())*nSigmaCut() << std::endl;
00110     return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
00111   }
00112 
00113   else return Local2DVector(9999,9999);
00114   */
00115 return Local2DVector(9999,9999);
00116 
00117 }

double ConversionBarrelEstimator::nSigmaCut (  )  const [inline]

Definition at line 48 of file ConversionBarrelEstimator.h.

References theNSigma.

00048 {return theNSigma;}


Member Data Documentation

double ConversionBarrelEstimator::theNSigma [private]

Definition at line 56 of file ConversionBarrelEstimator.h.

Referenced by nSigmaCut().

float ConversionBarrelEstimator::thePhiRangeMax [private]

Definition at line 53 of file ConversionBarrelEstimator.h.

Referenced by estimate().

float ConversionBarrelEstimator::thePhiRangeMin [private]

Definition at line 52 of file ConversionBarrelEstimator.h.

Referenced by estimate().

float ConversionBarrelEstimator::theZRangeMax [private]

Definition at line 55 of file ConversionBarrelEstimator.h.

Referenced by estimate().

float ConversionBarrelEstimator::theZRangeMin [private]

Definition at line 54 of file ConversionBarrelEstimator.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:48 2009 for CMSSW by  doxygen 1.5.4