CMS 3D CMS Logo

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

◆ initialFreeState()

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(), submitPVResolutionJobs::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(), TSGForOIFromL2::produce(), OutsideInMuonSeeder::produce(), TSGForOIDNN::produce(), PropagateToMuon::startingState(), MatcherUsingTracksAlgorithm::startingState(), and reco::TrackTransientTrack::TrackTransientTrack().

58  {
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  }
int charge() const
track electric charge
Definition: TrackBase.h:596
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:716
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:676
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664

◆ initialFreeStateL1TTrack()

FreeTrajectoryState trajectoryStateTransform::initialFreeStateL1TTrack ( const TTTrack< Ref_Phase2TrackerDigi_ > &  tk,
const MagneticField field,
bool  withErr = false 
)

Definition at line 70 of file TrajectoryStateTransform.cc.

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

Referenced by SeedGeneratorFromL1TTracksEDProducer::produce().

72  {
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  }
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
GlobalVector momentum() const
Track momentum.
Definition: TTTrack.h:295
double rInv() const
Track curvature.
Definition: TTTrack.h:300
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
GlobalPoint POCA() const
POCA.
Definition: TTTrack.h:335

◆ innerFreeState()

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(), submitPVResolutionJobs::err, reco::Track::extra(), reco::Track::innerMomentum(), and reco::Track::innerPosition().

Referenced by TrackDetectorAssociator::associate(), innerStateOnSurface(), EgammaHLTPixelMatchElectronAlgo::process(), 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  }
int charge() const
track electric charge
Definition: TrackBase.h:596
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ innerStateOnSurface()

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(), relativeConstraints::geom, and innerFreeState().

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(), 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  }
Definition: DetId.h:17
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ outerFreeState()

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(), submitPVResolutionJobs::err, reco::Track::extra(), reco::Track::outerMomentum(), and reco::Track::outerPosition().

Referenced by TrackDetectorAssociator::associate(), ticl::LinkingAlgoByDirectionGeometric::linkTracksters(), ticl::SeedingRegionByTracks::makeRegions(), outerStateOnSurface(), 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 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
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ outerStateOnSurface()

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(), relativeConstraints::geom, and outerFreeState().

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  }
Definition: DetId.h:17
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139

◆ persistentState()

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, dqmdumpme::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(), SeedingOTEDProducer::createSeed(), RPCSeedPattern::createSeed(), InOutConversionSeedFinder::createSeed(), TSGFromPropagation::createSeed(), FastTSGFromPropagation::createSeed(), OutsideInMuonSeeder::doLayer(), SeedGeneratorFromL1TTracksEDProducer::findSeedsOnLayer(), SeedFromProtoTrack::init(), CalibrationTrackSelectorFromDetIdList::makeCandidate(), reco::modules::CosmicTrackSplitter::makeCandidate(), reco::modules::TrackerTrackHitFilter::makeCandidate(), CosmicSeedCreator::makeSeed(), SETSeedFinder::makeSeed(), TSGForOIDNN::makeSeedsFromHitDoublets(), TSGForOIDNN::makeSeedsFromHits(), TSGForOIFromL2::makeSeedsFromHits(), TSGForOIDNN::makeSeedsWithoutHits(), TSGForOIFromL2::makeSeedsWithoutHits(), TrackMerger::merge(), GlobalTrackerMuonAlignment::muonFitter(), MuonReSeeder::produce(), SETMuonSeedProducer::produce(), SeedProducerFromSoA::produce(), TrackCandidateProducer::produce(), TrajectorySeedFromMuonProducer::produce(), L2MuonSeedGeneratorFromL1T::produce(), ConvBremSeedProducer::produce(), L2MuonSeedGeneratorFromL1TkMu::produce(), L2MuonSeedGenerator::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
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const LocalTrajectoryError & localError() const
const LocalTrajectoryParameters & localParameters() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
GlobalVector globalMomentum() const
const AlgebraicSymMatrix55 & matrix() const

◆ transientState()

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, dqmdumpme::k, visualization-live-secondInstance_cfg::m, PTrajectoryStateOnDet::parameters(), and PTrajectoryStateOnDet::surfaceSide().

Referenced by MuonSeedsAnalyzer::analyze(), TrackBuildingAnalyzer::analyze(), TestHits::analyze(), TestSmoothHits::analyze(), SeedMultiplicityAnalyzer::analyze(), TrackerSeedCleaner::clean(), MkFitSeedConverter::convertSeeds(), TrackingNtuple::fillCandidates(), 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 
53  *surface,
54  field,
55  static_cast<SurfaceSide>(ts.surfaceSide()));
56  }
const LocalTrajectoryParameters & parameters() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55