CMS 3D CMS Logo

SeedFromProtoTrack.cc
Go to the documentation of this file.
2 
5 
9 
12 
15 
18 
20 
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 }
29 
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 }
39 
40 void SeedFromProtoTrack::init(const reco::Track& proto, const edm::EventSetup& es) {
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 }
77 
80 }
SeedFromProtoTrack::direction
PropagationDirection direction() const
Definition: SeedFromProtoTrack.h:30
SeedFromProtoTrack::hits
const RecHitContainer & hits() const
Definition: SeedFromProtoTrack.h:35
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
TrackerGeometry.h
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ESHandle.h
reco::TrackBase::referencePoint
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:667
SeedingHitSet
Definition: SeedingHitSet.h:6
SeedFromProtoTrack::SeedFromProtoTrack
SeedFromProtoTrack(const reco::Track &proto, const edm::EventSetup &)
Definition: SeedFromProtoTrack.cc:30
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
SeedFromProtoTrack::trajectorySeed
TrajectorySeed trajectorySeed() const
Definition: SeedFromProtoTrack.cc:78
Surface
Definition: Surface.h:36
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
rpcPointValidation_cfi.refHit
refHit
Definition: rpcPointValidation_cfi.py:6
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
edm::Ref
Definition: AssociativeIterator.h:58
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
reco::Track::recHitsSize
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits).
Definition: Track.h:97
Track.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:16
reco::Track
Definition: Track.h:27
IdealMagneticFieldRecord.h
edm::ESHandle< TrackerGeometry >
SeedFromProtoTrack::theValid
bool theValid
Definition: SeedFromProtoTrack.h:38
reco::TrackBase::charge
int charge() const
track electric charge
Definition: TrackBase.h:596
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
reco::TrackBase::covariance
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
SeedFromProtoTrack::theHits
RecHitContainer theHits
Definition: SeedFromProtoTrack.h:39
SeedFromProtoTrack::thePTraj
PTrajectoryStateOnDet thePTraj
Definition: SeedFromProtoTrack.h:40
edm::OwnVector::back
reference back()
Definition: OwnVector.h:431
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
funct::true
true
Definition: Factorize.h:173
TrackerDigiGeometryRecord.h
SeedFromProtoTrack.h
PropagatorWithMaterial.h
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
get
#define get
TrackingRecHit::clone
virtual TrackingRecHit * clone() const =0
reco::Track::recHit
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
Definition: Track.h:94
TrackingRecHit
Definition: TrackingRecHit.h:21
reco::TrackBase::Point
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
SeedFromProtoTrack::init
void init(const reco::Track &proto, const edm::EventSetup &es)
Definition: SeedFromProtoTrack.cc:40
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
GeomDet.h
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
TrackingComponentsRecord.h
TrajectorySeed
Definition: TrajectorySeed.h:18
EventSetup.h
TrajectoryStateTransform.h
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
SeedFromProtoTrack::trajectoryState
PTrajectoryStateOnDet const & trajectoryState() const
Definition: SeedFromProtoTrack.h:32
reco::TrackBase::momentum
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
edm::OwnVector::size
size_type size() const
Definition: OwnVector.h:300
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
reco::TrackBase::Vector
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12