CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
tuple propagator
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:667
reference back()
Definition: OwnVector.h:431
SeedFromProtoTrack(const Config &, const reco::Track &proto, const edm::EventSetup &)
PTrajectoryStateOnDet thePTraj
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
Definition: Track.h:97
PTrajectoryStateOnDet const & trajectoryState() const
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:664
Log< level::Error, false > LogError
TrajectorySeed trajectorySeed() const
bool getData(T &iHolder) const
Definition: EventSetup.h:128
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerToken_
void push_back(D *&d)
Definition: OwnVector.h:326
RecHitContainer theHits
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
Config(edm::ConsumesCollector)
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
const TrackerGeomDet * idToDet(DetId) const override
virtual TrackingRecHit * clone() const =0
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > fieldToken_
const RecHitContainer & hits() const
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
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
tuple config
parse the configuration file
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:94
unsigned int size() const
Definition: SeedingHitSet.h:41
int charge() const
track electric charge
Definition: TrackBase.h:596
DetId geographicalId() const
const PositionType & position() const
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
void init(const Config &, const reco::Track &proto, const edm::EventSetup &es)
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Global3DVector GlobalVector
Definition: GlobalVector.h:10