CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SeedFromProtoTrack Class Reference

#include <SeedFromProtoTrack.h>

Classes

struct  Config
 

Public Member Functions

bool isValid () const
 
 SeedFromProtoTrack (const Config &, const reco::Track &proto, const edm::EventSetup &)
 
 SeedFromProtoTrack (const Config &, 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 Config &, 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 25 of file SeedFromProtoTrack.h.

Member Typedef Documentation

◆ RecHitContainer

Definition at line 51 of file SeedFromProtoTrack.h.

Constructor & Destructor Documentation

◆ SeedFromProtoTrack() [1/2]

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

Definition at line 39 of file SeedFromProtoTrack.cc.

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

40  : theValid(true) {
41  const TrackingRecHit* hit = nullptr;
42  for (unsigned int iHit = 0, nHits = proto.recHitsSize(); iHit < nHits; ++iHit) {
43  TrackingRecHitRef refHit = proto.recHit(iHit);
44  hit = &(*refHit);
45  theHits.push_back(hit->clone());
46  }
47  init(config, proto, es);
48 }
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:97
Definition: config.py:1
void push_back(D *&d)
Definition: OwnVector.h:326
RecHitContainer theHits
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:94
void init(const Config &, const reco::Track &proto, const edm::EventSetup &es)

◆ SeedFromProtoTrack() [2/2]

SeedFromProtoTrack::SeedFromProtoTrack ( const Config config,
const reco::Track proto,
const SeedingHitSet hits,
const edm::EventSetup es 
)

Definition at line 27 of file SeedFromProtoTrack.cc.

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

31  : theValid(true) {
32  for (unsigned int i = 0, n = hits.size(); i < n; ++i) {
33  const TrackingRecHit* trh = hits[i]->hit();
34  theHits.push_back(trh->clone());
35  }
36  init(config, proto, es);
37 }
Definition: config.py:1
const RecHitContainer & hits() const
void push_back(D *&d)
Definition: OwnVector.h:326
RecHitContainer theHits
size_type size() const
Definition: OwnVector.h:300
virtual TrackingRecHit * clone() const =0
void init(const Config &, const reco::Track &proto, const edm::EventSetup &es)

◆ ~SeedFromProtoTrack()

SeedFromProtoTrack::~SeedFromProtoTrack ( )
inline

Definition at line 38 of file SeedFromProtoTrack.h.

38 {}

Member Function Documentation

◆ direction()

PropagationDirection SeedFromProtoTrack::direction ( ) const
inlineprivate

Definition at line 47 of file SeedFromProtoTrack.h.

References alongMomentum.

Referenced by trajectorySeed().

◆ hits()

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

Definition at line 52 of file SeedFromProtoTrack.h.

References theHits.

Referenced by SeedFromProtoTrack(), and trajectorySeed().

52 { return theHits; }
RecHitContainer theHits

◆ init()

void SeedFromProtoTrack::init ( const Config config,
const reco::Track proto,
const edm::EventSetup es 
)
private

Definition at line 50 of file SeedFromProtoTrack.cc.

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

Referenced by SeedFromProtoTrack().

50  {
51  TrackerGeometry const& tracker = es.getData(config.trackerToken_);
52 
53  const Propagator* propagator = &es.getData(config.propagatorToken_);
54 
55  const MagneticField* field = &es.getData(config.fieldToken_);
56 
57  const reco::TrackBase::Point& vtx = proto.referencePoint();
58  const reco::TrackBase::Vector& mom = proto.momentum();
60  GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(mom.x(), mom.y(), mom.z()), proto.charge(), field);
61 
63 
64  FreeTrajectoryState fts(gtp, err);
65 
66  const TrackingRecHit& lastHit = theHits.back();
67 
68  TrajectoryStateOnSurface outerState =
69  propagator->propagate(fts, tracker.idToDet(lastHit.geographicalId())->surface());
70 
71  if (!outerState.isValid()) {
72  const Surface& surface = tracker.idToDet(lastHit.geographicalId())->surface();
73  edm::LogError("SeedFromProtoTrack") << " was trying to create a seed from:\n"
74  << fts << "\n propagating to: " << std::hex << lastHit.geographicalId().rawId()
75  << std::dec << ' ' << surface.position();
76  theValid = false;
77  return;
78  }
79  theValid = true;
80 
82 }
reference back()
Definition: OwnVector.h:431
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:667
Definition: config.py:1
Log< level::Error, false > LogError
int charge() const
track electric charge
Definition: TrackBase.h:596
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
RecHitContainer theHits
bool getData(T &iHolder) const
Definition: EventSetup.h:122
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
const PositionType & position() const
DetId geographicalId() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ isValid()

bool SeedFromProtoTrack::isValid ( void  ) const
inline

◆ trajectorySeed()

TrajectorySeed SeedFromProtoTrack::trajectorySeed ( ) const

Definition at line 84 of file SeedFromProtoTrack.cc.

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

Referenced by SeedGeneratorFromProtoTracksEDProducer::produce().

84  {
86 }
PTrajectoryStateOnDet const & trajectoryState() const
const RecHitContainer & hits() const
PropagationDirection direction() const

◆ trajectoryState()

PTrajectoryStateOnDet const& SeedFromProtoTrack::trajectoryState ( ) const
inlineprivate

Definition at line 49 of file SeedFromProtoTrack.h.

References thePTraj.

Referenced by trajectorySeed().

49 { return thePTraj; }
PTrajectoryStateOnDet thePTraj

Member Data Documentation

◆ theHits

RecHitContainer SeedFromProtoTrack::theHits
private

Definition at line 56 of file SeedFromProtoTrack.h.

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

◆ thePTraj

PTrajectoryStateOnDet SeedFromProtoTrack::thePTraj
private

Definition at line 57 of file SeedFromProtoTrack.h.

Referenced by init(), and trajectoryState().

◆ theValid

bool SeedFromProtoTrack::theValid
private

Definition at line 55 of file SeedFromProtoTrack.h.

Referenced by init(), and isValid().