CMS 3D CMS Logo

SeedFromConsecutiveHits Class Reference

Seed constructed from the outer and inner RecHit (order important) and the vertex constraints. More...

#include <RecoPixelVertexing/PixelLowPtUtilities/interface/SeedFromConsecutiveHits.h>

List of all members.

Public Types

typedef edm::OwnVector
< TrackingRecHit
recHitContainer
typedef edm::OwnVector
< TrackingRecHit
recHitContainer

Public Member Functions

PropagationDirection direction ()
PropagationDirection direction ()
recHitContainer hits ()
recHitContainer hits ()
bool isValid ()
bool isValid ()
 SeedFromConsecutiveHits (const SeedingHitSet &hits, const GlobalPoint &vertexPos, const GlobalError &vertexErr, const edm::EventSetup &es, double theBOFFMomentum=-1.0)
 SeedFromConsecutiveHits (const TrackingRecHit *outerHit, const TrackingRecHit *innerHit, const GlobalPoint &vertexPos, const GlobalError &vertexErr, const edm::EventSetup &iSetup, const edm::ParameterSet &p)
 SeedFromConsecutiveHits (const std::vector< const TrackingRecHit * > &hits, const GlobalPoint &vertexPos, const GlobalError &vertexErr, const edm::EventSetup &es, const edm::ParameterSet &ps)
PTrajectoryStateOnDet trajectoryState ()
PTrajectoryStateOnDet trajectoryState ()
TrajectorySeed TrajSeed ()
TrajectorySeed TrajSeed ()
virtual ~SeedFromConsecutiveHits ()
virtual ~SeedFromConsecutiveHits ()

Private Member Functions

bool construct (const TrackingRecHit *outerHit, const TrackingRecHit *innerHit, const GlobalPoint &vertexPos, const GlobalError &vertexErr, const edm::EventSetup &iSetup, const edm::ParameterSet &p)
CurvilinearTrajectoryError initialError (const GlobalPoint &vertexPos, const GlobalError &vertexErr, float sinTheta)
CurvilinearTrajectoryError initialError (const GlobalPoint &vertexPos, const GlobalError &vertexErr, float sinTheta)

Private Attributes

PropagationDirection _dir
recHitContainer _hits
TransientTrackingRecHit::ConstRecHitPointer intrhit
bool isValid_
TransientTrackingRecHit::ConstRecHitPointer outrhit
boost::shared_ptr
< PTrajectoryStateOnDet
PTraj
boost::shared_ptr
< PTrajectoryStateOnDet
PTraj
TrajectoryStateTransform transformer


Detailed Description

Seed constructed from the outer and inner RecHit (order important) and the vertex constraints.

Definition at line 27 of file SeedFromConsecutiveHits.h.


Member Typedef Documentation

typedef edm::OwnVector<TrackingRecHit> SeedFromConsecutiveHits::recHitContainer

Definition at line 28 of file SeedFromConsecutiveHits.h.

typedef edm::OwnVector<TrackingRecHit> SeedFromConsecutiveHits::recHitContainer

Definition at line 29 of file SeedFromConsecutiveHits.h.


Constructor & Destructor Documentation

SeedFromConsecutiveHits::SeedFromConsecutiveHits ( const std::vector< const TrackingRecHit * > &  hits,
const GlobalPoint vertexPos,
const GlobalError vertexErr,
const edm::EventSetup es,
const edm::ParameterSet ps 
)

virtual SeedFromConsecutiveHits::~SeedFromConsecutiveHits (  )  [inline, virtual]

Definition at line 37 of file SeedFromConsecutiveHits.h.

00037 {};

SeedFromConsecutiveHits::SeedFromConsecutiveHits ( const TrackingRecHit outerHit,
const TrackingRecHit innerHit,
const GlobalPoint vertexPos,
const GlobalError vertexErr,
const edm::EventSetup iSetup,
const edm::ParameterSet p 
)

Definition at line 18 of file SeedFromConsecutiveHits.cc.

References construct(), and isValid_.

00023                                                   {
00024 
00025   isValid_ = construct( outerHit,  innerHit, vertexPos, vertexErr,iSetup,p) ;
00026 }

SeedFromConsecutiveHits::SeedFromConsecutiveHits ( const SeedingHitSet hits,
const GlobalPoint vertexPos,
const GlobalError vertexErr,
const edm::EventSetup es,
double  theBOFFMomentum = -1.0 
)

Definition at line 28 of file SeedFromConsecutiveHits.cc.

References _hits, funct::abs(), e, TrackingRecHit::geographicalId(), edm::EventSetup::get(), hits(), SeedingHitSet::hits(), initialError(), TrajectoryStateOnSurface::isValid(), isValid_, TrajectoryStateTransform::persistentState(), Propagator::propagate(), PTraj, edm::OwnVector< T, P >::push_back(), DetId::rawId(), funct::sin(), state, transformer, and KFUpdator::update().

00034   : isValid_(false)
00035 {
00036   const SeedingHitSet::Hits & hits = ordered.hits(); 
00037   if ( hits.size() < 2) return;
00038 
00039   edm::ESHandle<MagneticField> bfield;
00040   es.get<IdealMagneticFieldRecord>().get(bfield);
00041   bool isBOFF = ( std::abs(bfield->inTesla(GlobalPoint(0,0,0)).z()) < 1e-3 );
00042 
00043   // build initial helix and FTS
00044   const TransientTrackingRecHit::ConstRecHitPointer& tth1 = hits[0];
00045   const TransientTrackingRecHit::ConstRecHitPointer& tth2 = hits[1];
00046   FastHelix helix(tth2->globalPosition(), tth1->globalPosition(), vertexPos, es);
00047   GlobalTrajectoryParameters kine = helix.stateAtVertex().parameters();
00048 
00049   if (isBOFF && (theBOFFMomentum > 0)) {
00050     kine = GlobalTrajectoryParameters(kine.position(),
00051                                       kine.momentum().unit() * theBOFFMomentum,
00052                                       kine.charge(),
00053                                       &*bfield);
00054   }
00055 
00056   float sinTheta = sin( kine.momentum().theta() );
00057   FreeTrajectoryState fts( kine, initialError( vertexPos, vertexErr, sinTheta));
00058 
00059   // get tracker
00060   edm::ESHandle<TrackerGeometry> tracker;
00061   es.get<TrackerDigiGeometryRecord>().get(tracker);
00062   
00063   // get propagator
00064   edm::ESHandle<Propagator>  thePropagatorHandle;
00065   es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",thePropagatorHandle);
00066   const Propagator*  thePropagator = &(*thePropagatorHandle);
00067 
00068   // get updator
00069   KFUpdator     theUpdator;
00070 
00071   TrajectoryStateOnSurface updatedState;
00072   const TrackingRecHit* hit = 0;
00073   for ( unsigned int iHit = 0; iHit < hits.size(); iHit++) {
00074     hit = hits[iHit];
00075     TrajectoryStateOnSurface state = (iHit==0) ? 
00076         thePropagator->propagate(fts,tracker->idToDet(hit->geographicalId())->surface())
00077       : thePropagator->propagate(updatedState, tracker->idToDet(hit->geographicalId())->surface());
00078     if (!state.isValid()) return;
00079 
00080     const TransientTrackingRecHit::ConstRecHitPointer& tth = hits[iHit]; 
00081     
00082     TransientTrackingRecHit::RecHitPointer newtth = tth->clone(state);
00083     updatedState =  theUpdator.update(state, *newtth);
00084 
00085     _hits.push_back(newtth->hit()->clone());
00086   } 
00087   PTraj = boost::shared_ptr<PTrajectoryStateOnDet>(
00088     transformer.persistentState(updatedState, hit->geographicalId().rawId()) );
00089 
00090   isValid_ = true;
00091 }

virtual SeedFromConsecutiveHits::~SeedFromConsecutiveHits (  )  [inline, virtual]

Definition at line 45 of file SeedFromConsecutiveHits.h.

00045 {};


Member Function Documentation

bool SeedFromConsecutiveHits::construct ( const TrackingRecHit outerHit,
const TrackingRecHit innerHit,
const GlobalPoint vertexPos,
const GlobalError vertexErr,
const edm::EventSetup iSetup,
const edm::ParameterSet p 
) [private]

Definition at line 97 of file SeedFromConsecutiveHits.cc.

References _hits, TransientTrackingRecHitBuilder::build(), TrackingRecHit::clone(), TrackingRecHit::geographicalId(), edm::EventSetup::get(), edm::ParameterSet::getParameter(), initialError(), SurfaceOrientation::inner, intrhit, TrajectoryStateOnSurface::isValid(), TrackingRecHit::localPosition(), GlobalTrajectoryParameters::momentum(), SurfaceOrientation::outer, outrhit, FreeTrajectoryState::parameters(), TrajectoryStateTransform::persistentState(), edm::ESHandle< T >::product(), Propagator::propagate(), PTraj, edm::OwnVector< T, P >::push_back(), DetId::rawId(), funct::sin(), FastHelix::stateAtVertex(), PV3DBase< T, PVType, FrameType >::theta(), transformer, and KFUpdator::update().

Referenced by SeedFromConsecutiveHits().

00103 {
00104   typedef TrajectoryStateOnSurface     TSOS;
00105   typedef TrajectoryMeasurement        TM;
00106 
00107 
00108   // get tracker geometry
00109   edm::ESHandle<TrackerGeometry> tracker;
00110   iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
00111 
00112   GlobalPoint inner = 
00113       tracker->idToDet(innerHit->geographicalId())->surface().toGlobal(innerHit->localPosition());
00114   GlobalPoint outer = 
00115       tracker->idToDet(outerHit->geographicalId())->surface().toGlobal(outerHit->localPosition());
00116 
00117   FastHelix helix(outer, inner, vertexPos,iSetup);
00118   
00119   GlobalTrajectoryParameters kine = helix.stateAtVertex().parameters();
00120   float sinTheta = sin( kine.momentum().theta() );
00121   FreeTrajectoryState fts( kine, initialError( vertexPos, vertexErr, sinTheta));
00122 
00123   edm::ESHandle<Propagator>  thePropagatorHandle;
00124   iSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",thePropagatorHandle);
00125   const Propagator*  thePropagator = &(*thePropagatorHandle);
00126 
00127 
00128 
00129   KFUpdator     theUpdator;
00130 
00131   const TSOS innerState = 
00132       thePropagator->propagate(fts,tracker->idToDet(innerHit->geographicalId())->surface());
00133   if ( !innerState.isValid()) return false;
00134 
00135 
00136   //
00137   // get the transient builder
00138   //
00139   edm::ESHandle<TransientTrackingRecHitBuilder> theBuilder;
00140   std::string builderName = p.getParameter<std::string>("TTRHBuilder");  
00141   iSetup.get<TransientRecHitRecord>().get(builderName,theBuilder);
00142 
00143 
00144   intrhit=theBuilder.product()->build(innerHit);
00145 
00146   const TSOS innerUpdated= theUpdator.update( innerState,*intrhit);                           
00147 
00148   TSOS outerState = thePropagator->propagate( innerUpdated,
00149       tracker->idToDet(outerHit->geographicalId())->surface());
00150  
00151   if ( !outerState.isValid()) return false;
00152   
00153   outrhit=theBuilder.product()->build(outerHit);
00154 
00155   TSOS outerUpdated = theUpdator.update( outerState, *outrhit);
00156  
00157   _hits.push_back(innerHit->clone());
00158   _hits.push_back(outerHit->clone());
00159 
00160   PTraj = boost::shared_ptr<PTrajectoryStateOnDet>( 
00161       transformer.persistentState(outerUpdated, outerHit->geographicalId().rawId()) );
00162 
00163   return true;
00164 }

PropagationDirection SeedFromConsecutiveHits::direction ( void   )  [inline]

Definition at line 49 of file SeedFromConsecutiveHits.h.

References alongMomentum.

00049                                   {
00050     //as in ORCA
00051     return alongMomentum;};

PropagationDirection SeedFromConsecutiveHits::direction ( void   )  [inline]

Definition at line 41 of file SeedFromConsecutiveHits.h.

References alongMomentum.

Referenced by TrajSeed().

00041                                   {
00042     //as in ORCA
00043     return alongMomentum;};

recHitContainer SeedFromConsecutiveHits::hits (  )  [inline]

Definition at line 53 of file SeedFromConsecutiveHits.h.

References _hits.

00053 { return _hits; };

recHitContainer SeedFromConsecutiveHits::hits (  )  [inline]

Definition at line 45 of file SeedFromConsecutiveHits.h.

References _hits.

Referenced by SeedFromConsecutiveHits(), and TrajSeed().

00045 { return _hits; };

CurvilinearTrajectoryError SeedFromConsecutiveHits::initialError ( const GlobalPoint vertexPos,
const GlobalError vertexErr,
float  sinTheta 
) [private]

CurvilinearTrajectoryError SeedFromConsecutiveHits::initialError ( const GlobalPoint vertexPos,
const GlobalError vertexErr,
float  sinTheta 
) [private]

Definition at line 106 of file SeedFromConsecutiveHits.cc.

References funct::C, GlobalErrorBase< T, ErrorWeightType >::cxx(), and GlobalErrorBase< T, ErrorWeightType >::czz().

Referenced by construct(), and SeedFromConsecutiveHits().

00107 {
00108   AlgebraicSymMatrix C(5,1);
00109 
00110   float zErr = vertexErr.czz(); 
00111   float transverseErr = vertexErr.cxx(); // assume equal cxx cyy 
00112   C[3][3] = transverseErr;
00113   C[4][4] = zErr*sinTheta;
00114   
00115   return CurvilinearTrajectoryError(C);
00116 }

bool SeedFromConsecutiveHits::isValid ( void   )  [inline]

Definition at line 47 of file SeedFromConsecutiveHits.h.

References isValid_.

00047 {return isValid_;}

bool SeedFromConsecutiveHits::isValid ( void   )  [inline]

Definition at line 39 of file SeedFromConsecutiveHits.h.

References isValid_.

Referenced by SeedGenerator::seed().

00039 {return isValid_;}

PTrajectoryStateOnDet SeedFromConsecutiveHits::trajectoryState (  )  [inline]

Definition at line 55 of file SeedFromConsecutiveHits.h.

References PTraj.

00055 {return *PTraj;};

PTrajectoryStateOnDet SeedFromConsecutiveHits::trajectoryState (  )  [inline]

Definition at line 47 of file SeedFromConsecutiveHits.h.

References PTraj.

Referenced by TrajSeed().

00047 {return *PTraj;};

TrajectorySeed SeedFromConsecutiveHits::TrajSeed (  )  [inline]

Definition at line 56 of file SeedFromConsecutiveHits.h.

References direction(), hits(), and trajectoryState().

00056 {return TrajectorySeed(trajectoryState(),hits(),direction());};

TrajectorySeed SeedFromConsecutiveHits::TrajSeed (  )  [inline]

Definition at line 48 of file SeedFromConsecutiveHits.h.

References direction(), hits(), and trajectoryState().

Referenced by SeedGenerator::seed().

00048 {return TrajectorySeed(trajectoryState(),hits(),direction());};


Member Data Documentation

PropagationDirection SeedFromConsecutiveHits::_dir [private]

Definition at line 56 of file SeedFromConsecutiveHits.h.

recHitContainer SeedFromConsecutiveHits::_hits [private]

Definition at line 58 of file SeedFromConsecutiveHits.h.

Referenced by construct(), hits(), and SeedFromConsecutiveHits().

TransientTrackingRecHit::ConstRecHitPointer SeedFromConsecutiveHits::intrhit [private]

Definition at line 55 of file SeedFromConsecutiveHits.h.

Referenced by construct().

bool SeedFromConsecutiveHits::isValid_ [private]

Definition at line 59 of file SeedFromConsecutiveHits.h.

Referenced by isValid(), and SeedFromConsecutiveHits().

TransientTrackingRecHit::ConstRecHitPointer SeedFromConsecutiveHits::outrhit [private]

Definition at line 54 of file SeedFromConsecutiveHits.h.

Referenced by construct().

boost::shared_ptr<PTrajectoryStateOnDet> SeedFromConsecutiveHits::PTraj [private]

Definition at line 74 of file SeedFromConsecutiveHits.h.

boost::shared_ptr<PTrajectoryStateOnDet> SeedFromConsecutiveHits::PTraj [private]

Definition at line 57 of file SeedFromConsecutiveHits.h.

Referenced by construct(), SeedFromConsecutiveHits(), and trajectoryState().

TrajectoryStateTransform SeedFromConsecutiveHits::transformer [private]

Definition at line 53 of file SeedFromConsecutiveHits.h.

Referenced by construct(), and SeedFromConsecutiveHits().


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