CMS 3D CMS Logo

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< TrackingRecHitRecHitContainer
 

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 16 of file SeedFromProtoTrack.h.

Member Typedef Documentation

Definition at line 34 of file SeedFromProtoTrack.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file SeedFromProtoTrack.cc.

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

30  : theValid(true) {
31  const TrackingRecHit* hit = nullptr;
32  for (unsigned int iHit = 0, nHits = proto.recHitsSize(); iHit < nHits; ++iHit) {
33  TrackingRecHitRef refHit = proto.recHit(iHit);
34  hit = &(*refHit);
35  theHits.push_back(hit->clone());
36  }
37  init(proto, es);
38 }
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:97
void push_back(D *&d)
Definition: OwnVector.h:326
RecHitContainer theHits
virtual TrackingRecHit * clone() const =0
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:94
SeedFromProtoTrack::SeedFromProtoTrack ( const reco::Track proto,
const SeedingHitSet hits,
const edm::EventSetup es 
)

Definition at line 21 of file SeedFromProtoTrack.cc.

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

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

Definition at line 21 of file SeedFromProtoTrack.h.

21 {}

Member Function Documentation

PropagationDirection SeedFromProtoTrack::direction ( ) const
inlineprivate

Definition at line 30 of file SeedFromProtoTrack.h.

References alongMomentum.

Referenced by trajectorySeed().

const RecHitContainer& SeedFromProtoTrack::hits ( void  ) const
inlineprivate

Definition at line 35 of file SeedFromProtoTrack.h.

References bscTrigger_cfi::theHits.

Referenced by trajectorySeed().

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

Definition at line 40 of file SeedFromProtoTrack.cc.

References edm::OwnVector< T, P >::back(), reco::TrackBase::charge(), reco::TrackBase::covariance(), TauDecayModes::dec, runTheMatrix::err, TrackingRecHit::geographicalId(), edm::EventSetup::get(), TrackerGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), reco::TrackBase::momentum(), trajectoryStateTransform::persistentState(), GloballyPositioned< T >::position(), Propagator::propagate(), TrackCandidateProducer_cfi::propagator, DetId::rawId(), reco::TrackBase::referencePoint(), theHits, thePTraj, theValid, PbPb_ZMuSkimMuonDPG_cff::tracker, and badGlobalMuonTaggersAOD_cff::vtx.

Referenced by SeedFromProtoTrack().

40  {
42  es.get<TrackerDigiGeometryRecord>().get(tracker);
43 
44  edm::ESHandle<Propagator> propagatorHandle;
45  es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", propagatorHandle);
46  const Propagator* propagator = &(*propagatorHandle);
47 
49  es.get<IdealMagneticFieldRecord>().get(field); //fixme
50 
51  const reco::TrackBase::Point& vtx = proto.referencePoint();
52  const reco::TrackBase::Vector& mom = proto.momentum();
54  GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(mom.x(), mom.y(), mom.z()), proto.charge(), &(*field));
55 
57 
58  FreeTrajectoryState fts(gtp, err);
59 
60  const TrackingRecHit& lastHit = theHits.back();
61 
62  TrajectoryStateOnSurface outerState =
63  propagator->propagate(fts, tracker->idToDet(lastHit.geographicalId())->surface());
64 
65  if (!outerState.isValid()) {
66  const Surface& surface = tracker->idToDet(lastHit.geographicalId())->surface();
67  edm::LogError("SeedFromProtoTrack") << " was trying to create a seed from:\n"
68  << fts << "\n propagating to: " << std::hex << lastHit.geographicalId().rawId()
69  << std::dec << ' ' << surface.position();
70  theValid = false;
71  return;
72  }
73  theValid = true;
74 
76 }
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:632
reference back()
Definition: OwnVector.h:431
PTrajectoryStateOnDet thePTraj
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:629
RecHitContainer theHits
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:677
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
T get() const
Definition: EventSetup.h:73
const TrackerGeomDet * idToDet(DetId) const override
int charge() const
track electric charge
Definition: TrackBase.h:575
DetId geographicalId() const
const PositionType & position() const
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
Global3DVector GlobalVector
Definition: GlobalVector.h:10
bool SeedFromProtoTrack::isValid ( void  ) const
inline
TrajectorySeed SeedFromProtoTrack::trajectorySeed ( ) const

Definition at line 78 of file SeedFromProtoTrack.cc.

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

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

78  {
80 }
PTrajectoryStateOnDet const & trajectoryState() const
const RecHitContainer & hits() const
PropagationDirection direction() const
PTrajectoryStateOnDet const& SeedFromProtoTrack::trajectoryState ( ) const
inlineprivate

Definition at line 32 of file SeedFromProtoTrack.h.

Referenced by trajectorySeed().

32 { return thePTraj; }
PTrajectoryStateOnDet thePTraj

Member Data Documentation

RecHitContainer SeedFromProtoTrack::theHits
private

Definition at line 39 of file SeedFromProtoTrack.h.

Referenced by init(), and SeedFromProtoTrack().

PTrajectoryStateOnDet SeedFromProtoTrack::thePTraj
private

Definition at line 40 of file SeedFromProtoTrack.h.

Referenced by init().

bool SeedFromProtoTrack::theValid
private

Definition at line 38 of file SeedFromProtoTrack.h.

Referenced by init().