CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
trajectoryStateTransform Namespace Reference

Functions

FreeTrajectoryState initialFreeState (const reco::Track &tk, const MagneticField *field, bool withErr=true)
 
FreeTrajectoryState initialFreeStateL1TTrack (const TTTrack< Ref_Phase2TrackerDigi_ > &tk, const MagneticField *field, bool withErr=false)
 
FreeTrajectoryState innerFreeState (const reco::Track &tk, const MagneticField *field, bool withErr=true)
 
TrajectoryStateOnSurface innerStateOnSurface (const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
 
FreeTrajectoryState outerFreeState (const reco::Track &tk, const MagneticField *field, bool withErr=true)
 
TrajectoryStateOnSurface outerStateOnSurface (const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
 
PTrajectoryStateOnDet persistentState (const TrajectoryStateOnSurface &ts, unsigned int detid)
 
TrajectoryStateOnSurface transientState (const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
 

Function Documentation

FreeTrajectoryState trajectoryStateTransform::initialFreeState ( const reco::Track tk,
const MagneticField field,
bool  withErr = true 
)

Construct a FreeTrajectoryState from the reco::Track innermost or outermost state, does not require access to tracking geometry

Definition at line 58 of file TrajectoryStateTransform.cc.

References reco::TrackBase::charge(), reco::TrackBase::covariance(), submitPVValidationJobs::err, reco::TrackBase::momentum(), and reco::TrackBase::vertex().

Referenced by TrackDetectorAssociator::associate(), reco::CandidatePtrTransientTrack::CandidatePtrTransientTrack(), TrackAssociatorByPositionImpl::getState(), pat::PATIsolatedTrackProducer::getTrackDetMatchInfo(), reco::GsfTransientTrack::GsfTransientTrack(), TSGForRoadSearch::IPfts(), TSGFromPropagation::outerTkState(), FastTSGFromPropagation::outerTkState(), TSGForOI::produce(), TSGForOIFromL2::produce(), OutsideInMuonSeeder::produce(), TSGForOIDNN::produce(), MuonErrorMatrixAdjuster::produce(), PropagateToMuon::startingState(), hltriggeroffline::PropagateToMuon::startingState(), MatcherUsingTracksAlgorithm::startingState(), and reco::TrackTransientTrack::TrackTransientTrack().

58  {
59  Basic3DVector<float> pos(tk.vertex());
60  GlobalPoint gpos(pos);
62  GlobalVector gmom(mom);
63  GlobalTrajectoryParameters par(gpos, gmom, tk.charge(), field);
64  if (!withErr)
65  return FreeTrajectoryState(par);
67  return FreeTrajectoryState(par, err);
68  }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:676
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
int charge() const
track electric charge
Definition: TrackBase.h:596
FreeTrajectoryState trajectoryStateTransform::initialFreeStateL1TTrack ( const TTTrack< Ref_Phase2TrackerDigi_ > &  tk,
const MagneticField field,
bool  withErr = false 
)

Definition at line 70 of file TrajectoryStateTransform.cc.

References RecoTauCleanerPlugins::charge, alignCSCRings::e, TTTrack< T >::momentum(), TTTrack< T >::POCA(), and TTTrack< T >::rInv().

Referenced by SeedGeneratorFromL1TTracksEDProducer::produce().

72  {
73  Basic3DVector<float> pos(tk.POCA());
74  GlobalPoint gpos(pos);
75  GlobalVector gmom = tk.momentum();
76  int charge = tk.rInv() > 0.f ? 1 : -1;
77 
78  GlobalTrajectoryParameters par(gpos, gmom, charge, field);
79  if (!withErr)
80  return FreeTrajectoryState(par);
82  mat *= 1e-8;
83  return FreeTrajectoryState(par, mat);
84  }
GlobalVector momentum() const
Track momentum.
Definition: TTTrack.h:295
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
GlobalPoint POCA() const
POCA.
Definition: TTTrack.h:335
double rInv() const
Track curvature.
Definition: TTTrack.h:300
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
FreeTrajectoryState trajectoryStateTransform::innerFreeState ( const reco::Track tk,
const MagneticField field,
bool  withErr = true 
)

Definition at line 86 of file TrajectoryStateTransform.cc.

References reco::TrackBase::charge(), submitPVValidationJobs::err, reco::Track::extra(), reco::Track::innerMomentum(), and reco::Track::innerPosition().

Referenced by TrackDetectorAssociator::associate(), innerStateOnSurface(), EgammaHLTPixelMatchElectronAlgo::process(), PropagateToMuon::startingState(), hltriggeroffline::PropagateToMuon::startingState(), and MatcherUsingTracksAlgorithm::startingState().

86  {
88  GlobalPoint gpos(pos);
90  GlobalVector gmom(mom);
91  GlobalTrajectoryParameters par(gpos, gmom, tk.charge(), field);
92  if (!withErr)
93  return FreeTrajectoryState(par);
94  CurvilinearTrajectoryError err(tk.extra()->innerStateCovariance());
95  return FreeTrajectoryState(par, err);
96  }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:139
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
int charge() const
track electric charge
Definition: TrackBase.h:596
TrajectoryStateOnSurface trajectoryStateTransform::innerStateOnSurface ( const reco::Track tk,
const TrackingGeometry geom,
const MagneticField field,
bool  withErr = true 
)

Construct a TrajectoryStateOnSurface from the reco::Track innermost or outermost state, requires access to tracking geometry

Definition at line 110 of file TrajectoryStateTransform.cc.

References reco::Track::extra(), TrackingGeometry::idToDet(), innerFreeState(), and GeomDet::surface().

Referenced by ConversionProducer::checkPhi(), GlobalMuonTrackMatcher::convertToTSOSMuHit(), GlobalMuonTrackMatcher::convertToTSOSTkHit(), OutsideInMuonSeeder::doDebug(), MuonShowerInformationFiller::getCompatibleDets(), NuclearTrackCorrector::getInitialState(), GlobalCosmicMuonTrajectoryBuilder::getTransientRecHits(), GlobalTrajectoryBuilderBase::getTransientRecHits(), ConversionSeedFilter::getTSOS(), reco::CandidatePtrTransientTrack::innermostMeasurementState(), reco::TrackTransientTrack::innermostMeasurementState(), TSGFromPropagation::innerState(), FastTSGFromPropagation::innerState(), CalibrationTrackSelectorFromDetIdList::makeCandidate(), reco::modules::CosmicTrackSplitter::makeCandidate(), reco::modules::TrackerTrackHitFilter::makeCandidate(), GlobalCosmicMuonTrajectoryBuilder::match(), TrackMerger::merge(), TSGForOI::produce(), TSGForOIFromL2::produce(), OutsideInMuonSeeder::produce(), TSGForOIDNN::produce(), TkConvValidator::recalculateMomentumAtFittedVertex(), MatcherUsingTracksAlgorithm::targetState(), and GlobalCosmicMuonTrajectoryBuilder::trajectories().

113  {
114  const Surface& surface = geom.idToDet(DetId(tk.extra()->innerDetId()))->surface();
115  return TrajectoryStateOnSurface(innerFreeState(tk, field, withErr), surface);
116  }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:139
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: DetId.h:17
virtual const GeomDet * idToDet(DetId) const =0
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
FreeTrajectoryState trajectoryStateTransform::outerFreeState ( const reco::Track tk,
const MagneticField field,
bool  withErr = true 
)

Definition at line 98 of file TrajectoryStateTransform.cc.

References reco::TrackBase::charge(), submitPVValidationJobs::err, reco::Track::extra(), reco::Track::outerMomentum(), and reco::Track::outerPosition().

Referenced by TrackDetectorAssociator::associate(), ticl::SeedingRegionByTracks::makeRegions(), outerStateOnSurface(), PropagateToMuon::startingState(), hltriggeroffline::PropagateToMuon::startingState(), and MatcherUsingTracksAlgorithm::startingState().

98  {
100  GlobalPoint gpos(pos);
102  GlobalVector gmom(mom);
103  GlobalTrajectoryParameters par(gpos, gmom, tk.charge(), field);
104  if (!withErr)
105  return FreeTrajectoryState(par);
106  CurvilinearTrajectoryError err(tk.extra()->outerStateCovariance());
107  return FreeTrajectoryState(par, err);
108  }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:139
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
int charge() const
track electric charge
Definition: TrackBase.h:596
TrajectoryStateOnSurface trajectoryStateTransform::outerStateOnSurface ( const reco::Track tk,
const TrackingGeometry geom,
const MagneticField field,
bool  withErr = true 
)

Definition at line 118 of file TrajectoryStateTransform.cc.

References reco::Track::extra(), TrackingGeometry::idToDet(), outerFreeState(), and GeomDet::surface().

Referenced by GlobalMuonTrackMatcher::convertToTSOSMuHit(), GlobalMuonTrackMatcher::convertToTSOSTk(), GlobalMuonTrackMatcher::convertToTSOSTkHit(), MuonShowerInformationFiller::getCompatibleDets(), NuclearTrackCorrector::getInitialState(), ConversionProducer::getTrackImpactPosition(), CalibrationTrackSelectorFromDetIdList::makeCandidate(), reco::modules::CosmicTrackSplitter::makeCandidate(), reco::modules::TrackerTrackHitFilter::makeCandidate(), GlobalCosmicMuonTrajectoryBuilder::match(), TrackMerger::merge(), reco::CandidatePtrTransientTrack::outermostMeasurementState(), reco::TrackTransientTrack::outermostMeasurementState(), HGCalTrackCollectionProducer::produce(), MatcherUsingTracksAlgorithm::targetState(), and GlobalCosmicMuonTrajectoryBuilder::trajectories().

121  {
122  const Surface& surface = geom.idToDet(DetId(tk.extra()->outerDetId()))->surface();
123  return TrajectoryStateOnSurface(outerFreeState(tk, field, withErr), surface);
124  }
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:139
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: DetId.h:17
virtual const GeomDet * idToDet(DetId) const =0
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
PTrajectoryStateOnDet trajectoryStateTransform::persistentState ( const TrajectoryStateOnSurface ts,
unsigned int  detid 
)

should check if corresponds to m

should check if corresponds to m

Definition at line 14 of file TrajectoryStateTransform.cc.

References TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::hasError(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), visualization-live-secondInstance_cfg::m, LocalTrajectoryError::matrix(), PV3DBase< T, PVType, FrameType >::perp(), DiDispStaMuonMonitor_cfi::pt, and TrajectoryStateOnSurface::surfaceSide().

Referenced by SeedFromConsecutiveHitsCreator::buildSeed(), SeedFromGenericPairOrTriplet::buildSeed(), SeedForPhotonConversion1Leg::buildSeed(), SeedForPhotonConversionFromQuadruplets::buildSeed(), SeedFromNuclearInteraction::construct(), MkFitOutputConverter::convertCandidates(), RPCSeedPattern::createFakeSeed(), MuonSeedFromRecHits::createSeed(), MuonSeedCreator::createSeed(), OutInConversionSeedFinder::createSeed(), RPCSeedPattern::createSeed(), SeedingOTEDProducer::createSeed(), InOutConversionSeedFinder::createSeed(), TSGFromPropagation::createSeed(), FastTSGFromPropagation::createSeed(), OutsideInMuonSeeder::doLayer(), SeedGeneratorFromL1TTracksEDProducer::findSeedsOnLayer(), TSGForOI::findSeedsOnLayer(), SeedFromProtoTrack::init(), CalibrationTrackSelectorFromDetIdList::makeCandidate(), reco::modules::CosmicTrackSplitter::makeCandidate(), reco::modules::TrackerTrackHitFilter::makeCandidate(), CosmicSeedCreator::makeSeed(), SETSeedFinder::makeSeed(), TSGForOIDNN::makeSeedsFromHitDoublets(), TSGForOI::makeSeedsFromHits(), TSGForOIFromL2::makeSeedsFromHits(), TSGForOIDNN::makeSeedsFromHits(), TSGForOIFromL2::makeSeedsWithoutHits(), TSGForOIDNN::makeSeedsWithoutHits(), TrackMerger::merge(), GlobalTrackerMuonAlignment::muonFitter(), MuonReSeeder::produce(), SETMuonSeedProducer::produce(), SeedProducerFromSoA::produce(), TrackCandidateProducer::produce(), TrajectorySeedFromMuonProducer::produce(), L2MuonSeedGeneratorFromL1T::produce(), ConvBremSeedProducer::produce(), L2MuonSeedGenerator::produce(), L2MuonSeedGeneratorFromL1TkMu::produce(), TrackerToMuonPropagator::produce(), CSCOverlapsTrackPreparation::produce(), cms::CosmicTrackFinder::produce(), cms::CkfTrackCandidateMakerBase::produceBase(), TSGForRoadSearch::pushTrajectorySeed(), TrackInfoProducerAlgorithm::run(), SeedGeneratorForCRack::seeds(), SeedGeneratorForCosmics::seeds(), SimpleCosmicBONSeeder::seeds(), GlobalTrackerMuonAlignment::trackFitter(), InOutConversionTrackFinder::tracks(), OutInConversionTrackFinder::tracks(), StandAloneMuonTrajectoryBuilder::trajectories(), and CosmicMuonSeedGenerator::tsosToSeed().

14  {
15  int surfaceSide = static_cast<int>(ts.surfaceSide());
16  auto pt = ts.globalMomentum().perp();
17 
18  if (ts.hasError()) {
19  AlgebraicSymMatrix55 const& m = ts.localError().matrix();
20 
21  int dim = 5;
22  float localErrors[15];
23 
24  int k = 0;
25  for (int i = 0; i < dim; i++) {
26  for (int j = 0; j <= i; j++) {
27  localErrors[k++] = m(i, j);
28  }
29  }
30  return PTrajectoryStateOnDet(ts.localParameters(), pt, localErrors, detid, surfaceSide);
31  }
32  return PTrajectoryStateOnDet(ts.localParameters(), pt, detid, surfaceSide);
33  }
T perp() const
Definition: PV3DBase.h:69
const LocalTrajectoryParameters & localParameters() const
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
GlobalVector globalMomentum() const
TrajectoryStateOnSurface trajectoryStateTransform::transientState ( const PTrajectoryStateOnDet ts,
const Surface surface,
const MagneticField field 
)

Definition at line 35 of file TrajectoryStateTransform.cc.

References PTrajectoryStateOnDet::error(), PTrajectoryStateOnDet::hasError(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, visualization-live-secondInstance_cfg::m, PTrajectoryStateOnDet::parameters(), and PTrajectoryStateOnDet::surfaceSide().

Referenced by MuonSeedsAnalyzer::analyze(), TrackBuildingAnalyzer::analyze(), ElectronSeedAnalyzer::analyze(), TestHits::analyze(), TestSmoothHits::analyze(), SeedMultiplicityAnalyzer::analyze(), TrackerSeedCleaner::clean(), MkFitSeedConverter::convertSeeds(), TrackingNtuple::fillSeeds(), MuonCkfTrajectoryBuilder::findCompatibleMeasurements(), BaseCkfTrajectoryBuilder::findStateAndLayers(), MuonSeedTrack::getSeedTSOS(), MuonTrackAnalyzer::getSeedTSOS(), ConversionSeedFilter::getTSOS(), SeedMatcher::matchRecHitCombinations(), CtfSpecialSeedGenerator::postCheck(), TrackProducerWithSCAssociation::produce(), ConversionSeedFilterCharge::produce(), FakeTrackProducer< T >::produce(), TrackCandidateProducer::produce(), TrackFromSeedProducer::produce(), BaseCkfTrajectoryBuilder::seedMeasurements(), MuonSeedCleaner::SeedMomentum(), MuonSeedCleaner::SeedPosition(), SeedTransformer::seedTransientState(), SeedToTrackProducer::seedTransientState(), CosmicTrajectoryBuilder::startingTSOS(), CRackTrajectoryBuilder::startingTSOS(), FastTSGFromPropagation::trackerSeeds(), and CosmicMuonTrajectoryBuilder::trajectories().

37  {
39  bool errInv = true;
40  if (ts.hasError()) {
41  errInv = false;
42  int dim = 5;
43  int k = 0;
44  for (int i = 0; i < dim; i++) {
45  for (int j = 0; j <= i; j++) {
46  m(i, j) = ts.error(k++); // NOTE: here we do a cast float => double.
47  }
48  }
49  }
50 
52  errInv ? LocalTrajectoryError(InvalidError()) : LocalTrajectoryError(m),
53  *surface,
54  field,
55  static_cast<SurfaceSide>(ts.surfaceSide()));
56  }
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const LocalTrajectoryParameters & parameters() const