CMS 3D CMS Logo

cms::HICSeedMeasurementEstimator Class Reference

#include <RecoHIMuon/HiMuSeed/interface/HICSeedMeasurementEstimator.h>

Inheritance diagram for cms::HICSeedMeasurementEstimator:

MeasurementEstimator

List of all members.

Public Member Functions

HICSeedMeasurementEstimatorclone () const
virtual
MeasurementEstimator::SurfaceReturnType 
estimate (const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
 Returns true if the TrajectoryStateOnSurface is compatible with the BoundPlane, false otherwise.
virtual
MeasurementEstimator::HitReturnType 
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.
double getPhi ()
double getZ ()
 HICSeedMeasurementEstimator (bool &trust, int nsig)
virtual
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.
double nSigmaCut () const
void set (double &phi, double &z)

Private Attributes

int theNSigma
double thePhi
double theZ
bool trtrue


Detailed Description

Definition at line 9 of file HICSeedMeasurementEstimator.h.


Constructor & Destructor Documentation

cms::HICSeedMeasurementEstimator::HICSeedMeasurementEstimator ( bool trust,
int  nsig 
) [inline, explicit]

Definition at line 12 of file HICSeedMeasurementEstimator.h.

Referenced by clone().

00012 :trtrue(trust), theNSigma(nsig) {}


Member Function Documentation

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

Implements MeasurementEstimator.

Definition at line 32 of file HICSeedMeasurementEstimator.h.

References HICSeedMeasurementEstimator().

00032                                            {
00033     return new HICSeedMeasurementEstimator(*this);
00034 }

MeasurementEstimator::SurfaceReturnType cms::HICSeedMeasurementEstimator::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 94 of file HICSeedMeasurementEstimator.cc.

References BoundSurface::bounds(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), TrajectoryStateOnSurface::freeTrajectoryState(), Bounds::length(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, GloballyPositioned< T >::position(), GlobalTrajectoryParameters::position(), thePhi, theZ, Bounds::width(), width, and PV3DBase< T, PVType, FrameType >::z().

00096 {
00097 #ifdef DEBUG
00098    std::cout<<"HICSeedMeasurementEstimator::estimate::Det::start::r,phi,z "<<plane.position().perp()<<" "<<plane.position().phi()<<" "<<
00099    plane.position().z()<<std::endl;
00100    std::cout<<"HICSeedMeasurementEstimator::estimate::Track::r,phi,z "<<ts.freeTrajectoryState()->parameters().position().perp()<<" "<<
00101                                                                         ts.freeTrajectoryState()->parameters().position().phi()<<" "<<
00102                                                                         ts.freeTrajectoryState()->parameters().position().z()<<std::endl;
00103 #endif
00104    double length = plane.bounds().length();
00105    double width = plane.bounds().width();
00106    double deltafi = atan2( width , (double)plane.position().perp() );
00107    double phitrack = ts.freeTrajectoryState()->parameters().position().phi();
00108    double phiplane = plane.position().phi();
00109 
00110    if( phitrack < 0. ) phitrack = twopi + phitrack;
00111    if( phiplane < 0. ) phiplane = twopi + phiplane;
00112    
00113    double dphi = fabs(phitrack - phiplane);
00114 
00115    if( dphi > pi ) dphi = twopi - dphi;
00116    if( dphi >  thePhi + deltafi ) {
00117 #ifdef DEBUG
00118    std::cout<<"HICSeedMeasurementEstimator::estimate::Det::phi failed "<<dphi<<" "<<thePhi<<" "<<deltafi<<std::endl;
00119 #endif     
00120      return false;
00121    }
00122    if ( fabs( plane.position().z() ) < 111. )
00123    {
00124      // barrel
00125         if( fabs(ts.freeTrajectoryState()->parameters().position().z() - plane.position().z()) 
00126                                                                        >  theZ+length ) {
00127       
00128 #ifdef DEBUG
00129    double dz = fabs(ts.freeTrajectoryState()->parameters().position().z() - plane.position().z());
00130    std::cout<<"HICSeedMeasurementEstimator::estimate::Det::z failed "<<dz<<" "<<theZ<<" "<<length<<std::endl;
00131 #endif
00132 
00133                                                                        return false;
00134                                                                        }
00135    } 
00136      else
00137      {
00138       // forward
00139         if( fabs(ts.freeTrajectoryState()->parameters().position().perp() - plane.position().perp()) 
00140                                                                                     >  theZ + length ) {
00141 #ifdef DEBUG
00142    double dr = fabs(ts.freeTrajectoryState()->parameters().position().perp() - plane.position().perp());
00143    std::cout<<"HICSeedMeasurementEstimator::estimate::Det::r failed "<<dr<<" "<<theZ<<" "<<length<<std::endl;
00144 #endif
00145 
00146                                                                                     return false;
00147                                                                                     }
00148      }
00149 #ifdef DEBUG
00150      std::cout<<" Good detector "<<std::endl;
00151 #endif
00152    return true;                                  
00153 }

MeasurementEstimator::HitReturnType cms::HICSeedMeasurementEstimator::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 7 of file HICSeedMeasurementEstimator.cc.

References FreeTrajectoryState::charge(), GenMuonPlsPt100GeV_cfg::cout, lat::endl(), PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::freeTrajectoryState(), TransientTrackingRecHit::globalPosition(), TrackingRecHit::isValid(), GlobalTrajectoryParameters::momentum(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), pi, GlobalTrajectoryParameters::position(), thePhi, theZ, and PV3DBase< T, PVType, FrameType >::z().

00009 {
00010   double dfimean = 0.;
00011   double dzmean = 0.;
00012 #ifdef DEBUG
00013    std::cout<<"  HICSeedMeasurementEstimator::estimate::start::eta "<<ts.freeTrajectoryState()->parameters().momentum().eta() <<std::endl;
00014 #endif
00015     
00016 //
00017 // For mixed are 0.8<|eta|<1.6 there is a shift for + and -
00018 //
00019   if( fabs(ts.freeTrajectoryState()->parameters().momentum().eta()) > 0.8 && 
00020       fabs(ts.freeTrajectoryState()->parameters().momentum().eta()) < 1.6 )
00021   {
00022      dfimean = -0.14;
00023      if( ts.freeTrajectoryState()->charge() > 0. ) dfimean = -0.24;
00024      dzmean = -10.;
00025   }
00026   if( fabs(ts.freeTrajectoryState()->parameters().momentum().eta()) > 1.6 )
00027   {
00028      dfimean = -0.02;
00029      if( ts.freeTrajectoryState()->charge() > 0. ) dfimean = -0.1776; 
00030   }
00031 
00032   if( !(hit.isValid()) ) {
00033 #ifdef DEBUG
00034    std::cout<<"  HICSeedMeasurementEstimator::estimate::hit is not valid " <<std::endl;
00035 #endif
00036     return HitReturnType(false,0.);
00037   }   
00038 
00039 #ifdef DEBUG
00040    std::cout<<"  HICSeedMeasurementEstimator::estimate::hit is valid " <<std::endl;
00041 #endif
00042 
00043 
00044   double dfi = fabs( ts.freeTrajectoryState()->parameters().position().phi()-
00045                                              hit.globalPosition().phi() + dfimean );
00046   if(dfi>pi) dfi=twopi-dfi;
00047 
00048   if(dfi>thePhi) {
00049 #ifdef DEBUG
00050    std::cout<<"HICSeedMeasurementEstimator::estimate::failed::phi hit::phi fts::thePhi "<<hit.globalPosition().phi()<<" "<<
00051    ts.freeTrajectoryState()->parameters().position().phi()<<" "<<dfi<<
00052    " "<<thePhi<<std::endl;
00053 #endif
00054 
00055    return HitReturnType(false,0.);
00056   }
00057   if( fabs(hit.globalPosition().z()) > 120.)
00058   {
00059   
00060   if(fabs(hit.globalPosition().perp()-ts.freeTrajectoryState()->parameters().position().perp())
00061                                                                                        >theZ) {
00062 #ifdef DEBUG
00063    std::cout<<"HICSeedMeasurementEstimator::estimate::failed::r hit::r fts::theZ "<<hit.globalPosition().perp()<<" "<<
00064    ts.freeTrajectoryState()->parameters().position().perp()<<
00065    " "<<theZ<<std::endl;
00066 #endif   
00067      return HitReturnType(false,0.);
00068    }
00069   }
00070    else
00071    {
00072    
00073       if(fabs(hit.globalPosition().z()-ts.freeTrajectoryState()->parameters().position().z() + dzmean)
00074                                                                                                     >theZ) {
00075 #ifdef DEBUG
00076    std::cout<<"HICSeedMeasurementEstimator::estimate::failed::z hit::z fts::theZ "<<hit.globalPosition().z()<<" "<<
00077    ts.freeTrajectoryState()->parameters().position().z()<<
00078    " "<<theZ<<std::endl;
00079 #endif
00080 
00081       return HitReturnType(false,0.);
00082      }
00083    }
00084 #ifdef DEBUG
00085    std::cout<<"HICSeedMeasurementEstimator::estimate::accepted::phi::r::z "<<hit.globalPosition().phi()<<" "<<
00086                                                                              hit.globalPosition().perp()<<" "<<
00087                                                                              hit.globalPosition().z()<<
00088    std::endl;
00089 #endif
00090 
00091 return HitReturnType(true,1.);                                       
00092 }

double cms::HICSeedMeasurementEstimator::getPhi (  )  [inline]

Definition at line 30 of file HICSeedMeasurementEstimator.h.

References thePhi.

00030 {return thePhi;}

double cms::HICSeedMeasurementEstimator::getZ (  )  [inline]

Definition at line 28 of file HICSeedMeasurementEstimator.h.

References theZ.

00028 {return theZ;}

MeasurementEstimator::Local2DVector cms::HICSeedMeasurementEstimator::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 156 of file HICSeedMeasurementEstimator.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), TrajectoryStateOnSurface::hasError(), asciidump::le, TrajectoryStateOnSurface::localError(), nSigmaCut(), LocalTrajectoryError::positionError(), funct::sqrt(), LocalError::xx(), and LocalError::yy().

00158 {
00159 #ifdef DEBUG
00160    std::cout<<"HICSeedMeasurementEstimator::malLocalDisplacement::start"
00161    <<ts.hasError()<<std::endl;
00162 #endif
00163 
00164   if ( ts.hasError()) {
00165     LocalError le = ts.localError().positionError();
00166 #ifdef DEBUG
00167    std::cout<<"HICSeedMeasurementEstimator::malLocalDisplacement::localerror::sigma"<<Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut())<<std::endl;
00168 #endif    
00169     return Local2DVector( sqrt(le.xx())*nSigmaCut(), sqrt(le.yy())*nSigmaCut());
00170   }
00171   else return Local2DVector(0,0);
00172 }

double cms::HICSeedMeasurementEstimator::nSigmaCut (  )  const [inline]

Definition at line 24 of file HICSeedMeasurementEstimator.h.

References theNSigma.

Referenced by maximalLocalDisplacement().

00024 {return theNSigma;}

void cms::HICSeedMeasurementEstimator::set ( double &  phi,
double &  z 
) [inline]

Definition at line 26 of file HICSeedMeasurementEstimator.h.

References phi, thePhi, theZ, and z.

00026 {thePhi=phi;theZ=z;}


Member Data Documentation

int cms::HICSeedMeasurementEstimator::theNSigma [private]

Definition at line 41 of file HICSeedMeasurementEstimator.h.

Referenced by nSigmaCut().

double cms::HICSeedMeasurementEstimator::thePhi [private]

Definition at line 38 of file HICSeedMeasurementEstimator.h.

Referenced by estimate(), getPhi(), and set().

double cms::HICSeedMeasurementEstimator::theZ [private]

Definition at line 39 of file HICSeedMeasurementEstimator.h.

Referenced by estimate(), getZ(), and set().

bool cms::HICSeedMeasurementEstimator::trtrue [private]

Definition at line 40 of file HICSeedMeasurementEstimator.h.


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