CMS 3D CMS Logo

SeedFromProtoTrack.cc
Go to the documentation of this file.
2 
6 
10 
13 
16 
19 
21 
23  : trackerToken_(iC.esConsumes()),
24  propagatorToken_(iC.esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))),
25  fieldToken_(iC.esConsumes()) {}
26 
28  const reco::Track& proto,
29  const SeedingHitSet& hits,
30  const edm::EventSetup& es)
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 }
38 
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 }
49 
50 void SeedFromProtoTrack::init(const Config& config, const reco::Track& proto, const edm::EventSetup& es) {
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 }
83 
86 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
reference back()
Definition: OwnVector.h:431
SeedFromProtoTrack(const Config &, const reco::Track &proto, const edm::EventSetup &)
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:97
PTrajectoryStateOnDet thePTraj
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
PTrajectoryStateOnDet const & trajectoryState() const
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:667
Definition: config.py:1
Log< level::Error, false > LogError
TrajectorySeed trajectorySeed() const
const RecHitContainer & hits() const
void push_back(D *&d)
Definition: OwnVector.h:326
int charge() const
track electric charge
Definition: TrackBase.h:596
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
RecHitContainer theHits
Config(edm::ConsumesCollector)
size_type size() const
Definition: OwnVector.h:300
bool getData(T &iHolder) const
Definition: EventSetup.h:122
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
virtual TrackingRecHit * clone() const =0
const PositionType & position() const
DetId geographicalId() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
PropagationDirection direction() const
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
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:94
HLT enums.
Definition: Config.py:1
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
void init(const Config &, const reco::Track &proto, const edm::EventSetup &es)
Global3DVector GlobalVector
Definition: GlobalVector.h:10