CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SeedFromProtoTrack Class Reference

#include <SeedFromProtoTrack.h>

Public Member Functions

bool isValid () const
 
 SeedFromProtoTrack (const reco::Track &proto, const edm::EventSetup &)
 
 SeedFromProtoTrack (const reco::Track &proto, const SeedingHitSet &hits, const edm::EventSetup &es)
 
TrajectorySeed trajectorySeed () const
 
 ~SeedFromProtoTrack ()
 

Private Types

typedef edm::OwnVector
< TrackingRecHit
RecHitContainer
 

Private Member Functions

PropagationDirection direction () const
 
const RecHitContainerhits () const
 
void init (const reco::Track &proto, const edm::EventSetup &es)
 
PTrajectoryStateOnDet const & trajectoryState () const
 

Private Attributes

RecHitContainer theHits
 
PTrajectoryStateOnDet thePTraj
 
bool theValid
 

Detailed Description

Definition at line 13 of file SeedFromProtoTrack.h.

Member Typedef Documentation

Definition at line 36 of file SeedFromProtoTrack.h.

Constructor & Destructor Documentation

SeedFromProtoTrack::SeedFromProtoTrack ( const reco::Track proto,
const edm::EventSetup es 
)

Definition at line 32 of file SeedFromProtoTrack.cc.

References TrackingRecHit::clone(), init(), edm::OwnVector< T, P >::push_back(), reco::Track::recHit(), reco::Track::recHitsSize(), and theHits.

33  : theValid(true)
34 {
35  const TrackingRecHit* hit = 0;
36  for (unsigned int iHit = 0, nHits = proto.recHitsSize(); iHit < nHits; ++iHit) {
37  TrackingRecHitRef refHit = proto.recHit(iHit);
38  hit = &(*refHit);
39  theHits.push_back( hit->clone() );
40  }
41  init(proto,es);
42 }
void init(const reco::Track &proto, const edm::EventSetup &es)
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:69
void push_back(D *&d)
Definition: OwnVector.h:273
RecHitContainer theHits
virtual TrackingRecHit * clone() const =0
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:67
SeedFromProtoTrack::SeedFromProtoTrack ( const reco::Track proto,
const SeedingHitSet hits,
const edm::EventSetup es 
)

Definition at line 21 of file SeedFromProtoTrack.cc.

References TrackingRecHit::clone(), i, init(), n, edm::OwnVector< T, P >::push_back(), SeedingHitSet::size(), and theHits.

23  : theValid(true)
24 {
25  for (unsigned int i= 0, n = hits.size(); i< n; ++i) {
26  const TrackingRecHit * trh = hits[i]->hit();
27  theHits.push_back( trh->clone() );
28  }
29  init(proto, es);
30 }
int i
Definition: DBlmapReader.cc:9
void init(const reco::Track &proto, const edm::EventSetup &es)
void push_back(D *&d)
Definition: OwnVector.h:273
RecHitContainer theHits
virtual TrackingRecHit * clone() const =0
unsigned int size() const
Definition: SeedingHitSet.h:31
SeedFromProtoTrack::~SeedFromProtoTrack ( )
inline

Definition at line 21 of file SeedFromProtoTrack.h.

21 {}

Member Function Documentation

PropagationDirection SeedFromProtoTrack::direction ( ) const
inlineprivate

Definition at line 31 of file SeedFromProtoTrack.h.

References alongMomentum.

Referenced by trajectorySeed().

const RecHitContainer& SeedFromProtoTrack::hits ( ) const
inlineprivate

Definition at line 37 of file SeedFromProtoTrack.h.

References theHits.

Referenced by trajectorySeed().

37 { return theHits; }
RecHitContainer theHits
void SeedFromProtoTrack::init ( const reco::Track proto,
const edm::EventSetup es 
)
private

Definition at line 45 of file SeedFromProtoTrack.cc.

References edm::OwnVector< T, P >::back(), reco::TrackBase::charge(), reco::TrackBase::covariance(), TrackingRecHit::geographicalId(), edm::EventSetup::get(), TrajectoryStateOnSurface::isValid(), reco::TrackBase::momentum(), trajectoryStateTransform::persistentState(), GloballyPositioned< T >::position(), Propagator::propagate(), LargeD0_PixelPairStep_cff::propagator, DetId::rawId(), reco::TrackBase::referencePoint(), hitfit::return, theHits, thePTraj, theValid, and patCandidatesForDimuonsSequences_cff::tracker.

Referenced by SeedFromProtoTrack().

46 {
48  es.get<TrackerDigiGeometryRecord>().get(tracker);
49 
50  edm::ESHandle<Propagator> propagatorHandle;
51  es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",propagatorHandle);
52  const Propagator* propagator = &(*propagatorHandle);
53 
55  es.get<IdealMagneticFieldRecord>().get(field);
56 
58  reco::TrackBase::Vector mom = proto.momentum();
60  GlobalPoint(vtx.x(),vtx.y(),vtx.z()),
61  GlobalVector(mom.x(),mom.y(),mom.z()),
62  proto.charge(), &(*field) );
63 
65 
66  FreeTrajectoryState fts( gtp, err);
67 
68  const TrackingRecHit & lastHit = theHits.back();
69 
70  TrajectoryStateOnSurface outerState =
71  propagator->propagate(fts, tracker->idToDet(lastHit.geographicalId())->surface());
72 
73  if (!outerState.isValid()){
74  const Surface & surface = tracker->idToDet(lastHit.geographicalId())->surface();
75  edm::LogError("SeedFromProtoTrack")<<" was trying to create a seed from:\n"<<fts<<"\n propagating to: "<<lastHit.geographicalId()<<surface.position();
76  theValid = false;
77  return ;
78  }
79  theValid = true;
80 
82 
83 
84 }
reference back()
Definition: OwnVector.h:320
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:150
PTrajectoryStateOnDet thePTraj
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:153
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:182
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
RecHitContainer theHits
math::XYZPoint Point
point in the space
Definition: TrackBase.h:76
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:12
const T & get() const
Definition: EventSetup.h:55
int charge() const
track electric charge
Definition: TrackBase.h:113
DetId geographicalId() const
const PositionType & position() const
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:74
Global3DVector GlobalVector
Definition: GlobalVector.h:10
bool SeedFromProtoTrack::isValid ( void  ) const
inline

Definition at line 25 of file SeedFromProtoTrack.h.

References theValid.

Referenced by SeedGeneratorFromProtoTracksEDProducer::produce(), and TSGFromL1Muon::produce().

25 { return theValid; }
TrajectorySeed SeedFromProtoTrack::trajectorySeed ( ) const

Definition at line 86 of file SeedFromProtoTrack.cc.

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

Referenced by SeedGeneratorFromProtoTracksEDProducer::produce(), and TSGFromL1Muon::produce().

87 {
89 }
PTrajectoryStateOnDet const & trajectoryState() const
const RecHitContainer & hits() const
PropagationDirection direction() const
PTrajectoryStateOnDet const& SeedFromProtoTrack::trajectoryState ( ) const
inlineprivate

Definition at line 33 of file SeedFromProtoTrack.h.

References thePTraj.

Referenced by trajectorySeed().

33 { return thePTraj; }
PTrajectoryStateOnDet thePTraj

Member Data Documentation

RecHitContainer SeedFromProtoTrack::theHits
private

Definition at line 42 of file SeedFromProtoTrack.h.

Referenced by hits(), init(), and SeedFromProtoTrack().

PTrajectoryStateOnDet SeedFromProtoTrack::thePTraj
private

Definition at line 43 of file SeedFromProtoTrack.h.

Referenced by init(), and trajectoryState().

bool SeedFromProtoTrack::theValid
private

Definition at line 41 of file SeedFromProtoTrack.h.

Referenced by init(), and isValid().