CMS 3D CMS Logo

Public Member Functions | Private Attributes

ConversionBarrelEstimator Class Reference

#include <ConversionBarrelEstimator.h>

Inheritance diagram for ConversionBarrelEstimator:
MeasurementEstimator

List of all members.

Public Member Functions

virtual ConversionBarrelEstimatorclone () const
 ConversionBarrelEstimator ()
 ConversionBarrelEstimator (float phiRangeMin, float phiRangeMax, float zRangeMin, float zRangeMax, double nSigma=3.)
virtual bool estimate (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
virtual std::pair< bool, double > estimate (const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const
virtual Local2DVector maximalLocalDisplacement (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
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:
2012/05/29 08:23:53
Revision:
1.5
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().

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

Definition at line 25 of file ConversionBarrelEstimator.h.

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

Member Function Documentation

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

Implements MeasurementEstimator.

Definition at line 37 of file ConversionBarrelEstimator.h.

References ConversionBarrelEstimator().

                                                   {
    return new ConversionBarrelEstimator(*this);
  } 
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 68 of file ConversionBarrelEstimator.cc.

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

                                                                                      {
  
  typedef     std::pair<float,float>   Range;
  //  std::cout << "  ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane) " << std::endl;

  GlobalPoint trajPos(ts.globalParameters().position());
  GlobalDetRangeZPhi detRange(plane);
  Range trajZRange(trajPos.z() - 2.*theZRangeMax, trajPos.z() + 2.*theZRangeMax);
  Range trajPhiRange(trajPos.phi() + thePhiRangeMin, trajPos.phi() + thePhiRangeMax);


   if(rangesIntersect(trajZRange, detRange.zRange()) &&
      rangesIntersect(trajPhiRange, detRange.phiRange(), PhiLess())) {
     //     std::cout << "   ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane)  IN RANGE " << std::endl;  
    return true;   



  } else {

    //    std::cout << "   ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const BoundPlane& plane) NOT IN RANGE " << std::endl;  
    return false;

  }


}
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 12 of file ConversionBarrelEstimator.cc.

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

                                                                                                      {
  std::pair<bool,double> result;
  
  //std::cout << "  ConversionBarrelEstimator::estimate( const TrajectoryStateOnSurface& ts, const TransientTrackingRecHit& hit) " << std::endl;
 
  float tsPhi = ts.globalParameters().position().phi();
  GlobalPoint gp = hit.globalPosition();
  float rhPhi = gp.phi();
  
  // allow a z fudge of 2 sigma
  float dz = 2. * sqrt(hit.localPositionError().yy()) ;
  float zDiff = ts.globalParameters().position().z() - gp.z(); 
  float phiDiff = tsPhi - rhPhi;
  if (phiDiff > pi) phiDiff -= twopi;
  if (phiDiff < -pi) phiDiff += twopi; 
  
  // add the errors on the window and the point in quadrature
  float zrange = sqrt(theZRangeMax*theZRangeMax + dz*dz);
  
  /*
  std::cout << "  BarrelEstimator ts local error " <<ts.localError().positionError()  << " hit local error " << hit.localPositionError() << std::endl; 
  std::cout << "  BarrelEstimator:  RecHit at " << gp << " phi " << rhPhi << " eta " << gp.eta() <<  std::endl;
  std::cout << "  BarrelEstimator:  ts at " << ts.globalParameters().position() << " phi " <<ts.globalParameters().position().phi() << " eta " << ts.globalParameters().position().eta()<<  std::endl;
  std::cout << "                    zrange = +/-" << zrange << ", zDiff = " << zDiff << std::endl;
  std::cout << "                    thePhiRangeMin = " << thePhiRangeMin << ", thePhiRangeMax = " << thePhiRangeMax << ", phiDiff = " << phiDiff << std::endl;
  */

  
  
  if ( phiDiff < thePhiRangeMax && phiDiff > thePhiRangeMin && 
       zDiff < zrange && zDiff > -zrange) {
    
    //    std::cout << "      estimator returns 1 with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
    //    << thePhiRangeMax << " and zDiff " << zDiff << " < " << zrange << std::endl;
    // std::cout << " YES " << phiDiff << " " << zDiff << std::endl;
    // std::cout << "                  => RECHIT ACCEPTED " << std::endl;
    
    result.first=true;
    result.second=phiDiff;
  } else {
    
    //     std::cout << "      estimator returns NOT ACCEPTED  with phiDiff " << thePhiRangeMin << " < " << phiDiff << " < "
    //<< thePhiRangeMax << " and zDiff " << zDiff << " < " << theZRangeMax+dz << std::endl;
    
    result.first=false;
    result.second=0;
    
  }
  
  return result;
  
}
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 99 of file ConversionBarrelEstimator.cc.

{
  

  
  /* 
  if ( ts.hasError() ) {
    LocalError le = ts.localError().positionError();
    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;
    return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
  }

  else return Local2DVector(9999,9999);
  */
return Local2DVector(9999,9999);

}
double ConversionBarrelEstimator::nSigmaCut ( ) const [inline]

Definition at line 48 of file ConversionBarrelEstimator.h.

References theNSigma.

{return theNSigma;}

Member Data Documentation

Definition at line 56 of file ConversionBarrelEstimator.h.

Referenced by nSigmaCut().

Definition at line 53 of file ConversionBarrelEstimator.h.

Referenced by estimate().

Definition at line 52 of file ConversionBarrelEstimator.h.

Referenced by estimate().

Definition at line 55 of file ConversionBarrelEstimator.h.

Referenced by estimate().

Definition at line 54 of file ConversionBarrelEstimator.h.