CMS 3D CMS Logo

Functions
trajectoryStateTransform Namespace Reference

Functions

FreeTrajectoryState initialFreeState (const reco::Track &tk, const MagneticField *field, bool withErr=true)
 
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 69 of file TrajectoryStateTransform.cc.

References reco::TrackBase::charge(), reco::TrackBase::covariance(), 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(), OutsideInMuonSeeder::produce(), MuonErrorMatrixAdjuster::produce(), PropagateToMuon::startingState(), MatcherUsingTracksAlgorithm::startingState(), and reco::TrackTransientTrack::TrackTransientTrack().

71  {
73  GlobalPoint gpos( pos);
74  Basic3DVector<float> mom( tk.momentum());
75  GlobalVector gmom( mom);
76  GlobalTrajectoryParameters par( gpos, gmom, tk.charge(), field);
77  if (!withErr) return FreeTrajectoryState(par);
79  return FreeTrajectoryState( par, err);
80  }
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:675
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:687
CovarianceMatrix covariance() const
return track covariance matrix
Definition: TrackBase.h:731
int charge() const
track electric charge
Definition: TrackBase.h:567
FreeTrajectoryState trajectoryStateTransform::innerFreeState ( const reco::Track tk,
const MagneticField field,
bool  withErr = true 
)

Definition at line 82 of file TrajectoryStateTransform.cc.

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

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

84  {
86  GlobalPoint gpos( pos);
88  GlobalVector gmom( mom);
89  GlobalTrajectoryParameters par( gpos, gmom, tk.charge(), field);
90  if (!withErr) return FreeTrajectoryState(par);
91  CurvilinearTrajectoryError err( tk.extra()->innerStateCovariance());
92  return FreeTrajectoryState( par, err);
93  }
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:189
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:60
int charge() const
track electric charge
Definition: TrackBase.h:567
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(), reco::modules::CosmicTrackSplitter::makeCandidate(), reco::modules::TrackerTrackHitFilter::makeCandidate(), GlobalCosmicMuonTrajectoryBuilder::match(), TrackMerger::merge(), TSGForOI::produce(), OutsideInMuonSeeder::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 "extra" object
Definition: Track.h:189
virtual const GeomDet * idToDet(DetId) const =0
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
Definition: DetId.h:18
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 96 of file TrajectoryStateTransform.cc.

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

Referenced by TrackDetectorAssociator::associate(), 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) return FreeTrajectoryState(par);
105  CurvilinearTrajectoryError err( tk.extra()->outerStateCovariance());
106  return FreeTrajectoryState( par, err);
107  }
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:189
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:70
int charge() const
track electric charge
Definition: TrackBase.h:567
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(), 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 "extra" object
Definition: Track.h:189
virtual const GeomDet * idToDet(DetId) const =0
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
Definition: DetId.h:18
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 16 of file TrajectoryStateTransform.cc.

References TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::hasError(), mps_fire::i, gen::k, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), funct::m, LocalTrajectoryError::matrix(), PV3DBase< T, PVType, FrameType >::perp(), EnergyCorrector::pt, and TrajectoryStateOnSurface::surfaceSide().

Referenced by SiStripElectronSeedGenerator::altCheckHitsAndTSOS(), SeedFromGenericPairOrTriplet::buildSeed(), SeedForPhotonConversion1Leg::buildSeed(), SeedFromConsecutiveHitsCreator::buildSeed(), SeedForPhotonConversionFromQuadruplets::buildSeed(), SiStripElectronSeedGenerator::checkHitsAndTSOS(), SeedFromNuclearInteraction::construct(), RPCSeedPattern::createFakeSeed(), MuonSeedFromRecHits::createSeed(), MuonSeedCreator::createSeed(), RPCSeedPattern::createSeed(), OutInConversionSeedFinder::createSeed(), TSGFromPropagation::createSeed(), InOutConversionSeedFinder::createSeed(), FastTSGFromPropagation::createSeed(), OutsideInMuonSeeder::doLayer(), SiStripElectronAlgo::findElectron(), TSGForOI::findSeedsOnLayer(), SeedFromProtoTrack::init(), reco::modules::CosmicTrackSplitter::makeCandidate(), reco::modules::TrackerTrackHitFilter::makeCandidate(), CosmicSeedCreator::makeSeed(), SETSeedFinder::makeSeed(), TSGForOI::makeSeedsFromHits(), TrackMerger::merge(), GlobalTrackerMuonAlignment::muonFitter(), ElectronSeedGenerator::prepareElTrackSeed(), MuonReSeeder::produce(), SETMuonSeedProducer::produce(), TrackCandidateProducer::produce(), TrajectorySeedFromMuonProducer::produce(), ConvBremSeedProducer::produce(), L2MuonSeedGeneratorFromL1T::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().

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

Definition at line 44 of file TrajectoryStateTransform.cc.

References PTrajectoryStateOnDet::error(), PTrajectoryStateOnDet::hasError(), mps_fire::i, gen::k, funct::m, PTrajectoryStateOnDet::parameters(), and PTrajectoryStateOnDet::surfaceSide().

Referenced by ElectronSeedAnalyzer::analyze(), MuonSeedsAnalyzer::analyze(), TrackBuildingAnalyzer::analyze(), TestHits::analyze(), TestSmoothHits::analyze(), SeedMultiplicityAnalyzer::analyze(), TrackerSeedCleaner::clean(), 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(), StartingLayerFinder::startingLayers(), CosmicTrajectoryBuilder::startingTSOS(), CRackTrajectoryBuilder::startingTSOS(), FastTSGFromPropagation::trackerSeeds(), and CosmicMuonTrajectoryBuilder::trajectories().

47  {
49  bool errInv=true;
50  if (ts.hasError()) {
51  errInv = false;
52  int dim = 5;
53  int k = 0;
54  for (int i=0; i<dim; i++) {
55  for (int j=0; j<=i; j++) {
56  m(i,j) = ts.error(k++); // NOTE: here we do a cast float => double.
57  }
58  }
59  }
60 
61 
63  errInv ? LocalTrajectoryError(InvalidError()) : LocalTrajectoryError(m),
64  *surface, field,
65  static_cast<SurfaceSide>(ts.surfaceSide()));
66 
67 }
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
int k[5][pyjets_maxn]
const LocalTrajectoryParameters & parameters() const