CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Trajectory Class Reference

#include <Trajectory.h>

Public Types

using ConstRecHitContainer = TrackingRecHit::ConstRecHitContainer
 
typedef std::vector< TrajectoryMeasurementDataContainer
 
using RecHitContainer = ConstRecHitContainer
 

Public Member Functions

int cccBadHits () const
 
float cccThreshold () const
 
float chiSquared () const
 
TrajectoryMeasurement const & closestMeasurement (GlobalPoint) const
 
DataContainer const & data () const
 obsolete name, use measurements() instead. More...
 
PropagationDirection const & direction () const
 
float dPhiCacheForLoopersReconstruction () const
 
bool empty () const
 True if trajectory has no measurements. More...
 
TrajectoryMeasurement const & firstMeasurement () const
 
int foundHits () const
 
int foundPixelHits () const
 
TrajectoryStateOnSurface geometricalInnermostState () const
 
void incrementLoops ()
 
void invalidate ()
 Method to invalidate a trajectory. Useful during ambiguity resolution. More...
 
bool isLooper () const
 
bool isValid () const
 
const DetLayerlastLayer () const
 Redundant method, returns the layer of lastMeasurement() . More...
 
TrajectoryMeasurement const & lastMeasurement () const
 
int lostHits () const
 
DataContainermeasurements ()
 
DataContainer const & measurements () const
 
int ndof (bool bon=true) const
 
signed char nLoops () const
 
int numberOfCCCBadHits (float ccc_threshold)
 
Trajectoryoperator= (Trajectory &&rh)
 
Trajectoryoperator= (Trajectory const &rh)=default
 
void pop ()
 
void push (const TrajectoryMeasurement &tm)
 
void push (const TrajectoryMeasurement &tm, double chi2Increment)
 
void push (TrajectoryMeasurement &&tm)
 
void push (TrajectoryMeasurement &&tm, double chi2Increment)
 
ConstRecHitContainer recHits () const
 
void reserve (unsigned int n)
 
void reverse ()
 
TrajectorySeed const & seed () const
 Access to the seed used to reconstruct the Trajectory. More...
 
unsigned int seedNHits () const
 
edm::RefToBase< TrajectorySeedseedRef (void) const
 
void setDPhiCacheForLoopersReconstruction (float dphi)
 
void setNLoops (signed char value)
 
void setSeedRef (const edm::RefToBase< TrajectorySeed > &seedRef)
 
void setSharedSeed (const std::shared_ptr< const TrajectorySeed > &seed)
 
void setStopReason (StopReason s)
 
const std::shared_ptr< const TrajectorySeed > & sharedSeed () const
 
StopReason stopReason () const
 
int trailingFoundHits () const
 
 Trajectory ()
 
 Trajectory (const std::shared_ptr< const TrajectorySeed > &seed, PropagationDirection dir)
 
 Trajectory (const TrajectorySeed &seed)
 
 Trajectory (const TrajectorySeed &seed, PropagationDirection dir)
 
 Trajectory (PropagationDirection dir)
 
 Trajectory (Trajectory &&rh)
 
 Trajectory (Trajectory const &rh)=default
 
void validRecHits (ConstRecHitContainer &cont) const
 

Static Public Member Functions

static bool inactive ()
 
static bool isBad (const TrackingRecHit &hit)
 
static bool lost (const TrackingRecHit &hit)
 
static bool pixel (const TrackingRecHit &hit)
 

Private Member Functions

bool badForCCC (const TrajectoryMeasurement &tm)
 
void check () const
 
void pushAux (double chi2Increment)
 
void updateBadForCCC (float ccc_threshold)
 

Private Attributes

edm::RefToBase< TrajectorySeedseedRef_
 
StopReason stopReason_ = StopReason::UNINITIALIZED
 
float theCCCThreshold_ = std::numeric_limits<float>::max()
 
float theChiSquared = 0
 
float theChiSquaredBad = 0
 
DataContainer theData
 
PropagationDirection theDirection = anyDirection
 
bool theDirectionValidity = false
 
float theDPhiCache = 0
 
signed char theNLoops = 0
 
signed short theNumberOfCCCBadHits_ = 0
 
signed short theNumberOfFoundHits = 0
 
signed short theNumberOfFoundPixelHits = 0
 
signed short theNumberOfLostHits = 0
 
signed short theNumberOfTrailingFoundHits = 0
 
std::shared_ptr< const TrajectorySeedtheSeed
 
bool theValid = false
 

Detailed Description

A class for detailed particle trajectory representation. It is used during trajectory building to "grow" a trajectory. The trajectory is represented as an ordered sequence of TrajectoryMeasurement objects with a stack-like interface. The measurements are added to the Trajectory in the order of increasing precision: each new TrajectoryMeasurement is assumed to improve the precision of the last one, normally by adding a constraint from a new RecHit. However the Trajectory class does not have the means to verify that measurements are added in the correct order, and thus cannot guarantee the order, which is the responsibility of the TrajectoryBuilder. The Trajectory provides some security by allowing to add or remove measurements only on one of it's ends, with push(TM) and pop() methods. The last measurement in a Trajectory can thus be either the innermost (closest to the interaction point) or the outermost, depending on the way the Trajectory was built. The direction of building is represented as a PropagationDirection, which has two possible values: alongMomentum (outwards) and oppositeToMomentum (inwards), and is accessed with the direction() method.

Definition at line 38 of file Trajectory.h.

Member Typedef Documentation

◆ ConstRecHitContainer

Definition at line 41 of file Trajectory.h.

◆ DataContainer

Definition at line 40 of file Trajectory.h.

◆ RecHitContainer

Definition at line 42 of file Trajectory.h.

Constructor & Destructor Documentation

◆ Trajectory() [1/7]

Trajectory::Trajectory ( )
inline

Default constructor of an empty trajectory with undefined seed and undefined direction. This constructor is necessary in order to transiently copy vector<Trajectory> in the edm::Event

Definition at line 49 of file Trajectory.h.

49 {}

◆ Trajectory() [2/7]

Trajectory::Trajectory ( const TrajectorySeed seed)
inlineexplicit

Constructor of an empty trajectory with undefined direction. The direction will be defined at the moment of the push of a second measurement, from the relative radii of the first and second measurements.

Definition at line 57 of file Trajectory.h.

57 : theSeed(new TrajectorySeed(seed)), theValid(true) {}

◆ Trajectory() [3/7]

Trajectory::Trajectory ( const TrajectorySeed seed,
PropagationDirection  dir 
)
inline

Constructor of an empty trajectory with defined direction. No check is made in the push method that measurements are added in the correct direction.

Definition at line 63 of file Trajectory.h.

◆ Trajectory() [4/7]

Trajectory::Trajectory ( const std::shared_ptr< const TrajectorySeed > &  seed,
PropagationDirection  dir 
)
inline

Constructor of an empty trajectory with defined direction. No check is made in the push method that measurements are added in the correct direction.

Definition at line 70 of file Trajectory.h.

◆ Trajectory() [5/7]

Trajectory::Trajectory ( PropagationDirection  dir)
inlineexplicit

Constructor of an empty trajectory with defined direction. No check is made in the push method that measurements are added in the correct direction.

Definition at line 77 of file Trajectory.h.

◆ Trajectory() [6/7]

Trajectory::Trajectory ( Trajectory const &  rh)
default

◆ Trajectory() [7/7]

Trajectory::Trajectory ( Trajectory &&  rh)
inline

Member Function Documentation

◆ badForCCC()

bool Trajectory::badForCCC ( const TrajectoryMeasurement tm)
private

Definition at line 182 of file Trajectory.cc.

182  {
183  if (!trackerHitRTTI::isFromDet(*tm.recHit()))
184  return false;
185  auto const* thit = static_cast<const BaseTrackerRecHit*>(tm.recHit()->hit());
186  if (!thit)
187  return false;
188  if (thit->isPixel() || thit->isPhase2())
189  return false;
190  if (!tm.updatedState().isValid())
191  return false;
192  return siStripClusterTools::chargePerCM(thit->rawId(),
193  thit->firstClusterRef().stripCluster(),
195 }

References siStripClusterTools::chargePerCM(), trackerHitRTTI::isFromDet(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localParameters(), TrajectoryMeasurement::recHit(), and TrajectoryMeasurement::updatedState().

◆ cccBadHits()

int Trajectory::cccBadHits ( ) const
inline

Number of hits that are not compatible with the CCC used during patter recognition. Used mainly as a criteria for abandoning a trajectory candidate during trajectory building.

Definition at line 227 of file Trajectory.h.

227 { return theNumberOfCCCBadHits_; }

References theNumberOfCCCBadHits_.

◆ cccThreshold()

float Trajectory::cccThreshold ( ) const
inline

Definition at line 322 of file Trajectory.h.

322 { return theCCCThreshold_; }

References theCCCThreshold_.

◆ check()

void Trajectory::check ( void  ) const
private

Definition at line 140 of file Trajectory.cc.

140  {
141  if (theData.empty())
142  throw cms::Exception("TrackingTools/PatternTools",
143  "Trajectory::check() - information requested from empty Trajectory");
144 }

Referenced by firstMeasurement(), lastLayer(), and lastMeasurement().

◆ chiSquared()

float Trajectory::chiSquared ( ) const
inline

◆ closestMeasurement()

TrajectoryMeasurement const & Trajectory::closestMeasurement ( GlobalPoint  point) const

Definition at line 256 of file Trajectory.cc.

256  {
257  check();
258  vector<TrajectoryMeasurement>::const_iterator iter =
259  std::min_element(measurements().begin(), measurements().end(), LessMag(point));
260 
261  return (*iter);
262 }

References RPCNoise_example::check, mps_fire::end, and point.

Referenced by ConversionSeedFilter::getTSOS().

◆ data()

DataContainer const& Trajectory::data ( ) const
inline

obsolete name, use measurements() instead.

Definition at line 182 of file Trajectory.h.

182 { return measurements(); }

References measurements().

◆ direction()

PropagationDirection const & Trajectory::direction ( ) const

◆ dPhiCacheForLoopersReconstruction()

float Trajectory::dPhiCacheForLoopersReconstruction ( ) const
inline

accessor to the delta phi angle betweem the directions of the two measurements on the last two layers crossed by the trajectory

Definition at line 320 of file Trajectory.h.

320 { return theDPhiCache; }

References theDPhiCache.

◆ empty()

bool Trajectory::empty ( void  ) const
inline

◆ firstMeasurement()

TrajectoryMeasurement const& Trajectory::firstMeasurement ( ) const
inline

Access to the first measurement. It is the least precise one in a trajectory before smoothing. It is precise in a smoothed trajectory. It's the innermost measurement if direction() == alongMomentum, the outermost one if direction() == oppositeToMomentum.

Definition at line 166 of file Trajectory.h.

166  {
167  check();
168  if (theData.front().recHitR().hit() != nullptr)
169  return theData.front();
170  else if (theData.size() > 2)
171  return *(theData.begin() + 1);
172  else
173  throw cms::Exception("TrajectoryMeasurement::firstMeasurement - Too few measurements in trajectory");
174  }

References check(), Exception, and theData.

Referenced by CosmicTrajectoryBuilder::AddHit(), CkfDebugger::analyseCompatibleMeasurements(), CosmicMuonTrajectoryBuilder::build(), CosmicMuonTrajectoryBuilder::buildSecondHalf(), DAFTrackProducerAlgorithm::buildTrack(), MuonTrackLoader::buildTrackExtra(), TrackExtenderWithMTDT< TrackCollection >::buildTrackExtra(), GlobalTrackerMuonAlignment::debugTrajectory(), CosmicMuonTrajectoryBuilder::estimateDirection(), GsfTrajectoryFitter::fitOne(), KFSplittingFitter::fitOne(), KFTrajectoryFitter::fitOne(), NuclearTrackCorrector::getNewTrackExtra(), TransientInitialStateEstimator::innerState(), LowPtGsfElectronSeedProducer::lightGsfTracking(), TrackerToMuonPropagator::produce(), GoodSeedProducer::produce(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), CosmicMuonTrajectoryBuilder::reverseTrajectory(), CRackTrajectoryBuilder::run(), and CosmicMuonTrajectoryBuilder::trajectories().

◆ foundHits()

int Trajectory::foundHits ( ) const
inline

◆ foundPixelHits()

int Trajectory::foundPixelHits ( ) const
inline

Number of valid pixel RecHits used to determine the trajectory.

Definition at line 210 of file Trajectory.h.

210 { return theNumberOfFoundPixelHits; }

References theNumberOfFoundPixelHits.

◆ geometricalInnermostState()

TrajectoryStateOnSurface Trajectory::geometricalInnermostState ( ) const

Definition at line 217 of file Trajectory.cc.

217  {
218  check();
219 
220  //if trajectory is in one half, return the end closer to origin point
221  if (firstMeasurement().updatedState().globalMomentum().perp() > 1.0 &&
222  (firstMeasurement().updatedState().globalPosition().basicVector().dot(
223  firstMeasurement().updatedState().globalMomentum().basicVector()) *
224  lastMeasurement().updatedState().globalPosition().basicVector().dot(
225  lastMeasurement().updatedState().globalMomentum().basicVector()) >
226  0)) {
227  return (firstMeasurement().updatedState().globalPosition().mag() <
228  lastMeasurement().updatedState().globalPosition().mag())
231  }
232 
233  //more complicated in case of traversing and low-pt trajectories with loops
234  return closestMeasurement(GlobalPoint(0.0, 0.0, 0.0)).updatedState();
235 }

References RPCNoise_example::check, dot(), mag(), and perp().

Referenced by MuonTrackLoader::buildTrackAtPCA().

◆ inactive()

static bool Trajectory::inactive ( )
inlinestatic

Definition of inactive Det from the Trajectory point of view.

Definition at line 267 of file Trajectory.h.

268  {
269  return false;
270  } //FIXME

◆ incrementLoops()

void Trajectory::incrementLoops ( )
inline

Definition at line 332 of file Trajectory.h.

332 { theNLoops++; }

References theNLoops.

◆ invalidate()

void Trajectory::invalidate ( )
inline

Method to invalidate a trajectory. Useful during ambiguity resolution.

Definition at line 260 of file Trajectory.h.

260 { theValid = false; }

References theValid.

Referenced by TrajectoryCleanerBySharedHits::clean().

◆ isBad()

bool Trajectory::isBad ( const TrackingRecHit hit)
static

Returns true if the hit type is TrackingRecHit::bad Used in stand-alone trajectory construction

Definition at line 163 of file Trajectory.cc.

163  {
164  if (hit.isValid())
165  return false;
166  else {
167  if (hit.geographicalId().rawId() == 0) {
168  return false;
169  } else {
170  return hit.getType() == TrackingRecHit::bad;
171  }
172  }
173 }

References TrackingRecHit::bad.

◆ isLooper()

bool Trajectory::isLooper ( ) const
inline

Definition at line 328 of file Trajectory.h.

328 { return (theNLoops > 0); }

References theNLoops.

◆ isValid()

bool Trajectory::isValid ( void  ) const
inline

◆ lastLayer()

const DetLayer* Trajectory::lastLayer ( ) const
inline

Redundant method, returns the layer of lastMeasurement() .

Definition at line 288 of file Trajectory.h.

288  {
289  check();
290  if (theData.back().recHit()->hit() != nullptr)
291  return theData.back().layer();
292  else if (theData.size() > 2)
293  return (theData.end() - 2)->layer();
294  else
295  throw cms::Exception("TrajectoryMeasurement::lastMeasurement - Too few measurements in trajectory");
296  }

References check(), Exception, and theData.

Referenced by CkfDebugger::analyseRecHitNotFound().

◆ lastMeasurement()

TrajectoryMeasurement const& Trajectory::lastMeasurement ( ) const
inline

Access to the last measurement. It's the most precise one in a trajectory before smoothing. It's the outermost measurement if direction() == alongMomentum, the innermost one if direction() == oppositeToMomentum.

Definition at line 150 of file Trajectory.h.

150  {
151  check();
152  if (theData.back().recHitR().hit() != nullptr)
153  return theData.back();
154  else if (theData.size() > 2)
155  return *(theData.end() - 2);
156  else
157  throw cms::Exception("TrajectoryMeasurement::lastMeasurement - Too few measurements in trajectory");
158  }

References check(), Exception, and theData.

Referenced by CosmicTrajectoryBuilder::AddHit(), CRackTrajectoryBuilder::AddHit(), BaseCkfTrajectoryBuilder::addToResult(), CkfDebugger::analyseCompatibleMeasurements(), CkfDebugger::analyseRecHitNotFound(), MkFitOutputConverter::backwardFit(), CosmicMuonTrajectoryBuilder::build(), CosmicMuonTrajectoryBuilder::buildSecondHalf(), DAFTrackProducerAlgorithm::buildTrack(), MuonTrackLoader::buildTrackExtra(), TrackExtenderWithMTDT< TrackCollection >::buildTrackExtra(), GlobalTrackerMuonAlignment::debugTrajectory(), CosmicMuonTrajectoryBuilder::estimateDirection(), CosmicMuonTrajectoryBuilder::flipTrajectory(), NuclearTrackCorrector::getNewTrackExtra(), TransientInitialStateEstimator::innerState(), LowPtGsfElectronSeedProducer::lightGsfTracking(), CkfDebugger::nextCorrectHits(), GoodSeedProducer::produce(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), ThresholdPtTrajectoryFilter::qualityFilter(), MinPtTrajectoryFilter::qualityFilter(), CosmicMuonTrajectoryBuilder::reverseTrajectory(), StandAloneMuonRefitter::singleRefit(), CRackTrajectoryBuilder::SortHits(), ThresholdPtTrajectoryFilter::toBeContinued(), MinPtTrajectoryFilter::toBeContinued(), StandAloneMuonTrajectoryBuilder::trajectories(), and CosmicMuonTrajectoryBuilder::trajectories().

◆ lost()

bool Trajectory::lost ( const TrackingRecHit hit)
static

Definition of what it means for a hit to be "lost". This definition is also used by the TrajectoryBuilder.

Definition at line 146 of file Trajectory.cc.

146  {
147  if (hit.isValid())
148  return false;
149  else {
150  // // A DetLayer is always inactive in this logic.
151  // // The DetLayer is the Det of an invalid RecHit only if no DetUnit
152  // // is compatible with the predicted state, so we don't really expect
153  // // a hit in this case.
154 
155  if (hit.geographicalId().rawId() == 0) {
156  return false;
157  } else {
158  return hit.getType() == TrackingRecHit::missing;
159  }
160  }
161 }

References TrackingRecHit::missing.

Referenced by MaxConsecLostHitsTrajectoryFilter::TBC().

◆ lostHits()

int Trajectory::lostHits ( ) const
inline

Number of detector layers crossed without valid RecHits. Used mainly as a criteria for abandoning a trajectory candidate during trajectory building.

Definition at line 217 of file Trajectory.h.

217 { return theNumberOfLostHits; }

References theNumberOfLostHits.

Referenced by BaseCkfTrajectoryBuilder::addToResult(), and OverlapValidation::analyze().

◆ measurements() [1/2]

DataContainer& Trajectory::measurements ( )
inline

Definition at line 179 of file Trajectory.h.

179 { return theData; }

References theData.

◆ measurements() [2/2]

DataContainer const& Trajectory::measurements ( ) const
inline

Return all measurements in a container.

Definition at line 178 of file Trajectory.h.

178 { return theData; }

References theData.

Referenced by PFTrackTransformer::addPoints(), PFTrackTransformer::addPointsAndBrems(), BaseCkfTrajectoryBuilder::addToResult(), DeDxDiscriminatorLearner::algoAnalyze(), SiStripGainFromData::algoAnalyze(), CkfDebugger::analyseCompatibleMeasurements(), analyzer::SiPixelLorentzAngle::analyze(), OverlapValidation::analyze(), FWTrackProxyBuilderFullFramework::buildTrack(), TrackExtenderWithMTDT< TrackCollection >::buildTrack(), DAFTrackProducerAlgorithm::calculateNdof(), DAFTrackProducerAlgorithm::checkHits(), MuonTrackResidualAnalyzer::computeResolution(), DAFTrackProducerAlgorithm::countingGoodHits(), StandAloneMuonFilter::createDefaultTrajectory(), data(), AlignmentMonitorTemplate::event(), AlignmentMonitorMuonResiduals::event(), AlignmentMonitorTracksFromTrajectories::event(), TrackerValidationVariables::fillHitQuantities(), ApeEstimator::fillTrackVariables(), MuonKinkFinder::fillTrkKink(), DynamicTruncation::filter(), SiStripFineDelayTLA::findtrackangle(), CosmicMuonSmoother::fit(), TransientInitialStateEstimator::innerState(), CRackTrajectoryBuilder::innerState(), MuonResidualsFromTrack::MuonResidualsFromTrack(), Traj2TrackHits::operator()(), TrajectoryFactoryBase::orderedTrajectoryMeasurements(), ShallowTrackClustersProducer::produce(), TkAlCaOverlapTagger::produce(), HLTTrackClusterRemoverNew::produce(), ShallowGainCalibration::produce(), reco::modules::CosmicTrackSplitter::produce(), reco::modules::TrackerTrackHitFilter::produceFromTrajectory(), GsfTrackProducerBase::putInEvt(), StripSubClusterShapeTrajectoryFilter::qualityFilter(), GroupedDAFHitCollector::recHits(), SimpleDAFHitCollector::recHits(), CosmicMuonTrajectoryBuilder::reverseTrajectory(), CosmicMuonTrajectoryBuilder::reverseTrajectoryPropagationDirection(), MuonMillepedeAlgorithm::run(), MuonDTLocalMillepedeAlgorithm::run(), HIPAlignmentAlgorithm::run(), CSCOverlapsAlignmentAlgorithm::run(), NuclearInteractionFinder::run(), GlobalMuonRefitter::selectMuonHits(), ClusterShapeTrajectoryFilter::toBeContinued(), TrajAnnealing::TrajAnnealing(), CosmicMuonTrajectoryBuilder::trajectories(), GsfTrajectorySmoother::trajectory(), KFTrajectorySmoother::trajectory(), trajectoryToResiduals(), and DAFTrackProducerAlgorithm::updateHits().

◆ ndof()

int Trajectory::ndof ( bool  bon = true) const

Number of dof of the trajectory. The method accepts a bool in order to properly take into account the presence of magnetic field in the dof computation. By default the MF is considered ON.

Definition at line 97 of file Trajectory.cc.

97  {
98  Trajectory::RecHitContainer&& transRecHits = recHits();
99 
100  int dof = 0;
101  int dofBad = 0;
102 
103  for (auto& rechit : transRecHits) {
104  if ((rechit)->isValid())
105  dof += (rechit)->dimension();
106  else if (isBad(*rechit) && (rechit)->geographicalId().det() == DetId::Muon)
107  dofBad += (rechit)->dimension();
108  }
109 
110  // If dof!=0 (there is at least 1 valid hit),
111  // return ndof=ndof(fit)
112  // If dof=0 (all rec hits are invalid, only for STA trajectories),
113  // return ndof=ndof(invalid hits)
114  if (dof) {
115  int constr = bon ? 5 : 4;
116  return std::max(dof - constr, 0);
117  } else {
118  // A STA can have < 5 (invalid) hits
119  // if this is the case ==> ndof = 1
120  // (to avoid divisions by 0)
121  int constr = bon ? 5 : 4;
122  return std::max(dofBad - constr, 1);
123  }
124 }

References pat::helper::ParametrizationHelper::dimension(), SiStripPI::max, DetId::Muon, and FastTrackerRecHitMaskProducer_cfi::recHits.

Referenced by analyzer::SiPixelLorentzAngle::analyze(), OverlapValidation::analyze(), TrackExtenderWithMTDT< TrackCollection >::buildTrack(), and MuonTrackLoader::buildTrackAtPCA().

◆ nLoops()

signed char Trajectory::nLoops ( ) const
inline

Definition at line 329 of file Trajectory.h.

329 { return theNLoops; }

References theNLoops.

Referenced by TransientInitialStateEstimator::innerState().

◆ numberOfCCCBadHits()

int Trajectory::numberOfCCCBadHits ( float  ccc_threshold)

Definition at line 212 of file Trajectory.cc.

212  {
213  updateBadForCCC(ccc_threshold);
214  return theNumberOfCCCBadHits_;
215 }

Referenced by TempTrajectory::toTrajectory().

◆ operator=() [1/2]

Trajectory& Trajectory::operator= ( Trajectory &&  rh)
inline

◆ operator=() [2/2]

Trajectory& Trajectory::operator= ( Trajectory const &  rh)
default

◆ pixel()

bool Trajectory::pixel ( const TrackingRecHit hit)
static

Returns true if the hit type is TrackingRecHit::bad Used in trajectory filtering

Definition at line 175 of file Trajectory.cc.

175  {
177  return false;
178  auto const* thit = static_cast<const BaseTrackerRecHit*>(hit.hit());
179  return thit->isPixel();
180 }

References trackerHitRTTI::isFromDetOrFast().

Referenced by SeedExtensionTrajectoryFilter::looseTBC(), TempTrajectory::pop(), and TempTrajectory::pushAux().

◆ pop()

void Trajectory::pop ( )

Remove the last measurement from the trajectory.

Definition at line 30 of file Trajectory.cc.

30  {
31  if (!empty()) {
32  if (theData.back().recHit()->isValid()) {
34  theChiSquared -= theData.back().estimate();
35  if (badForCCC(theData.back()))
37  if (pixel(*(theData.back().recHit())))
39  } else if (lost(*(theData.back().recHit()))) {
41  } else if (isBad(*(theData.back().recHit())) && theData.back().recHit()->geographicalId().det() == DetId::Muon) {
42  theChiSquaredBad -= theData.back().estimate();
43  }
44 
45  theData.pop_back();
46  theNumberOfTrailingFoundHits = countTrailingValidHits(theData);
47  }
48 }

References relativeConstraints::empty, DetId::Muon, and muonClassificationByHits_cfi::pixel.

Referenced by BaseCkfTrajectoryBuilder::addToResult(), cms::CkfTrackCandidateMakerBase::produceBase(), CosmicMuonTrajectoryBuilder::reverseTrajectoryPropagationDirection(), and CosmicMuonTrajectoryBuilder::trajectories().

◆ push() [1/4]

void Trajectory::push ( const TrajectoryMeasurement tm)

◆ push() [2/4]

void Trajectory::push ( const TrajectoryMeasurement tm,
double  chi2Increment 
)

same as the one-argument push, but the trajectory Chi2 is incremented by chi2Increment. Useful e.g. in trajectory smoothing.

Definition at line 54 of file Trajectory.cc.

54  {
55  theData.push_back(tm);
56  pushAux(chi2Increment);
57 }

◆ push() [3/4]

void Trajectory::push ( TrajectoryMeasurement &&  tm)

Definition at line 52 of file Trajectory.cc.

52 { push(tm, tm.estimate()); }

◆ push() [4/4]

void Trajectory::push ( TrajectoryMeasurement &&  tm,
double  chi2Increment 
)

Definition at line 59 of file Trajectory.cc.

59  {
60  theData.push_back(tm);
61  pushAux(chi2Increment);
62 }

◆ pushAux()

void Trajectory::pushAux ( double  chi2Increment)
private

Definition at line 64 of file Trajectory.cc.

64  {
65  const TrajectoryMeasurement& tm = theData.back();
66  if (tm.recHit()->isValid()) {
67  theChiSquared += chi2Increment;
70  if (badForCCC(tm))
72  if (pixel(*(tm.recHit())))
74  }
75  // else if (lost( tm.recHit()) && !inactive(tm.recHit().det())) theNumberOfLostHits++;
76  else if (lost(*(tm.recHit()))) {
79  }
80 
81  else if (isBad(*(tm.recHit())) && tm.recHit()->geographicalId().det() == DetId::Muon) {
82  theChiSquaredBad += chi2Increment;
83  }
84 
85  // in case of a Trajectory constructed without direction,
86  // determine direction from the radii of the first two measurements
87 
88  if (!theDirectionValidity && theData.size() >= 2) {
89  if (theData[0].updatedState().globalPosition().perp2() < theData.back().updatedState().globalPosition().perp2())
91  else
93  theDirectionValidity = true;
94  }
95 }

References alongMomentum, DetId::Muon, oppositeToMomentum, muonClassificationByHits_cfi::pixel, and TrajectoryMeasurement::recHit().

◆ recHits()

ConstRecHitContainer Trajectory::recHits ( void  ) const
inline

◆ reserve()

void Trajectory::reserve ( unsigned int  n)
inline

Reserves space in the vector to avoid lots of allocations when push_back-ing measurements

Definition at line 126 of file Trajectory.h.

126 { theData.reserve(n); }

References dqmiodumpmetadata::n, and theData.

Referenced by StandAloneMuonFilter::createDefaultTrajectory(), and TempTrajectory::toTrajectory().

◆ reverse()

void Trajectory::reverse ( )

Reverse the propagation direction and the order of the trajectory measurements. It doesn't reverse the forward and backward predicted states within each trajectory measurement

Definition at line 264 of file Trajectory.cc.

264  {
265  // reverse the direction (without changing it if it's not along or opposite)
268  else if (theDirection == oppositeToMomentum)
270  // reverse the order of the hits
271  std::reverse(theData.begin(), theData.end());
272 }

References alongMomentum, oppositeToMomentum, and groupFilesInBlocks::reverse.

◆ seed()

TrajectorySeed const& Trajectory::seed ( ) const
inline

◆ seedNHits()

unsigned int Trajectory::seedNHits ( ) const
inline

Definition at line 230 of file Trajectory.h.

230 { return seed().nHits(); }

References TrajectorySeed::nHits(), and seed().

◆ seedRef()

edm::RefToBase<TrajectorySeed> Trajectory::seedRef ( void  ) const
inline

return the Reference to the trajectory seed in the original seeds collection. If the collection has been dropped from the Event, the reference may be invalid. Its validity should be tested, before the reference is actually used.

Definition at line 303 of file Trajectory.h.

303 { return seedRef_; }

References seedRef_.

Referenced by MuonTrackLoader::buildTrackExtra(), TrackExtenderWithMTDT< TrackCollection >::buildTrackExtra(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), and setSeedRef().

◆ setDPhiCacheForLoopersReconstruction()

void Trajectory::setDPhiCacheForLoopersReconstruction ( float  dphi)
inline

method to set the delta phi angle betweem the directions of the two measurements on the last two layers crossed by the trajectory

Definition at line 326 of file Trajectory.h.

326 { theDPhiCache = dphi; }

References theDPhiCache.

◆ setNLoops()

void Trajectory::setNLoops ( signed char  value)
inline

◆ setSeedRef()

void Trajectory::setSeedRef ( const edm::RefToBase< TrajectorySeed > &  seedRef)
inline

Definition at line 305 of file Trajectory.h.

305 { seedRef_ = seedRef; }

References seedRef(), and seedRef_.

◆ setSharedSeed()

void Trajectory::setSharedSeed ( const std::shared_ptr< const TrajectorySeed > &  seed)
inline

Definition at line 316 of file Trajectory.h.

316 { theSeed = seed; }

References seed(), and theSeed.

Referenced by BaseCkfTrajectoryBuilder::addToResult().

◆ setStopReason()

void Trajectory::setStopReason ( StopReason  s)
inline

Definition at line 334 of file Trajectory.h.

334 { stopReason_ = s; }

References alignCSCRings::s, and stopReason_.

Referenced by MinPtTrajectoryFilter::toBeContinued(), and TempTrajectory::toTrajectory().

◆ sharedSeed()

const std::shared_ptr<const TrajectorySeed>& Trajectory::sharedSeed ( ) const
inline

Definition at line 315 of file Trajectory.h.

315 { return theSeed; }

References theSeed.

◆ stopReason()

StopReason Trajectory::stopReason ( ) const
inline

Definition at line 335 of file Trajectory.h.

335 { return stopReason_; }

References stopReason_.

◆ trailingFoundHits()

int Trajectory::trailingFoundHits ( ) const
inline

Number of valid RecHits at the end of the trajectory after last lost hit.

Definition at line 221 of file Trajectory.h.

References theNumberOfTrailingFoundHits.

◆ updateBadForCCC()

void Trajectory::updateBadForCCC ( float  ccc_threshold)
private

Definition at line 197 of file Trajectory.cc.

197  {
198  // If the supplied threshold is the same as the currently cached
199  // one, then return the current number of bad hits for CCC,
200  // otherwise do a new full rescan.
201  if (ccc_threshold == theCCCThreshold_)
202  return;
203 
204  theCCCThreshold_ = ccc_threshold;
206  for (auto const& h : theData) {
207  if (badForCCC(h))
209  }
210 }

◆ validRecHits()

void Trajectory::validRecHits ( ConstRecHitContainer cont) const

Just valid hits..

Definition at line 126 of file Trajectory.cc.

126  {
127  hits.reserve(foundHits());
128  for (auto const& tm : theData)
129  if (tm.recHit()->isValid())
130  hits.push_back(tm.recHit());
131 }

References hfClusterShapes_cfi::hits.

Referenced by NuclearTrackCorrector::getTrackFromTrajectory().

Member Data Documentation

◆ seedRef_

edm::RefToBase<TrajectorySeed> Trajectory::seedRef_
private

Definition at line 345 of file Trajectory.h.

Referenced by operator=(), seedRef(), and setSeedRef().

◆ stopReason_

StopReason Trajectory::stopReason_ = StopReason::UNINITIALIZED
private

Definition at line 364 of file Trajectory.h.

Referenced by operator=(), setStopReason(), and stopReason().

◆ theCCCThreshold_

float Trajectory::theCCCThreshold_ = std::numeric_limits<float>::max()
private

Definition at line 362 of file Trajectory.h.

Referenced by cccThreshold(), and operator=().

◆ theChiSquared

float Trajectory::theChiSquared = 0
private

Definition at line 348 of file Trajectory.h.

Referenced by chiSquared(), and operator=().

◆ theChiSquaredBad

float Trajectory::theChiSquaredBad = 0
private

Definition at line 349 of file Trajectory.h.

Referenced by chiSquared(), and operator=().

◆ theData

DataContainer Trajectory::theData
private

◆ theDirection

PropagationDirection Trajectory::theDirection = anyDirection
private

Definition at line 357 of file Trajectory.h.

Referenced by operator=().

◆ theDirectionValidity

bool Trajectory::theDirectionValidity = false
private

Definition at line 358 of file Trajectory.h.

Referenced by operator=().

◆ theDPhiCache

float Trajectory::theDPhiCache = 0
private

◆ theNLoops

signed char Trajectory::theNLoops = 0
private

Definition at line 363 of file Trajectory.h.

Referenced by incrementLoops(), isLooper(), nLoops(), operator=(), and setNLoops().

◆ theNumberOfCCCBadHits_

signed short Trajectory::theNumberOfCCCBadHits_ = 0
private

Definition at line 355 of file Trajectory.h.

Referenced by cccBadHits(), and operator=().

◆ theNumberOfFoundHits

signed short Trajectory::theNumberOfFoundHits = 0
private

Definition at line 351 of file Trajectory.h.

Referenced by chiSquared(), foundHits(), and operator=().

◆ theNumberOfFoundPixelHits

signed short Trajectory::theNumberOfFoundPixelHits = 0
private

Definition at line 352 of file Trajectory.h.

Referenced by foundPixelHits(), and operator=().

◆ theNumberOfLostHits

signed short Trajectory::theNumberOfLostHits = 0
private

Definition at line 353 of file Trajectory.h.

Referenced by lostHits(), and operator=().

◆ theNumberOfTrailingFoundHits

signed short Trajectory::theNumberOfTrailingFoundHits = 0
private

Definition at line 354 of file Trajectory.h.

Referenced by operator=(), and trailingFoundHits().

◆ theSeed

std::shared_ptr<const TrajectorySeed> Trajectory::theSeed
private

Definition at line 344 of file Trajectory.h.

Referenced by operator=(), seed(), setSharedSeed(), and sharedSeed().

◆ theValid

bool Trajectory::theValid = false
private

Definition at line 359 of file Trajectory.h.

Referenced by invalidate(), isValid(), and operator=().

dot
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
Definition: Basic3DVectorLD.h:212
Trajectory::pushAux
void pushAux(double chi2Increment)
Definition: Trajectory.cc:64
pat::helper::ParametrizationHelper::dimension
uint32_t dimension(pat::CandKinResolution::Parametrization parametrization)
Returns the number of free parameters in a parametrization (3 or 4)
Definition: ParametrizationHelper.h:12
Trajectory::theNLoops
signed char theNLoops
Definition: Trajectory.h:363
Trajectory::theCCCThreshold_
float theCCCThreshold_
Definition: Trajectory.h:362
Trajectory::updateBadForCCC
void updateBadForCCC(float ccc_threshold)
Definition: Trajectory.cc:197
DOFs::dof
dof
Definition: AlignPCLThresholdsWriter.cc:37
trackerHitRTTI::isFromDetOrFast
bool isFromDetOrFast(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:38
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
Trajectory::lost
static bool lost(const TrackingRecHit &hit)
Definition: Trajectory.cc:146
Trajectory::seedRef
edm::RefToBase< TrajectorySeed > seedRef(void) const
Definition: Trajectory.h:303
TrajectorySeed::nHits
unsigned int nHits() const
Definition: TrajectorySeed.h:53
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
siStripClusterTools::chargePerCM
float chargePerCM(DetId detid, Iter a, Iter b)
Definition: SiStripClusterTools.h:29
oppositeToMomentum
Definition: PropagationDirection.h:4
TrajectoryMeasurement::updatedState
TrajectoryStateOnSurface const & updatedState() const
Definition: TrajectoryMeasurement.h:184
Trajectory::foundHits
int foundHits() const
Definition: Trajectory.h:206
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
Trajectory::theChiSquaredBad
float theChiSquaredBad
Definition: Trajectory.h:349
groupFilesInBlocks.reverse
reverse
Definition: groupFilesInBlocks.py:131
Trajectory::theNumberOfFoundHits
signed short theNumberOfFoundHits
Definition: Trajectory.h:351
Trajectory::theDPhiCache
float theDPhiCache
Definition: Trajectory.h:361
alignCSCRings.s
s
Definition: alignCSCRings.py:92
h
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
Trajectory::theNumberOfLostHits
signed short theNumberOfLostHits
Definition: Trajectory.h:353
Trajectory::seedRef_
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:345
mps_fire.end
end
Definition: mps_fire.py:242
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
TrackingRecHit::bad
Definition: TrackingRecHit.h:49
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
Trajectory::RecHitContainer
ConstRecHitContainer RecHitContainer
Definition: Trajectory.h:42
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
Trajectory::lastMeasurement
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:150
TrackingRecHit::missing
Definition: TrackingRecHit.h:47
Trajectory::check
void check() const
Definition: Trajectory.cc:140
Trajectory::badForCCC
bool badForCCC(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:182
trackerHitRTTI::isFromDet
bool isFromDet(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:36
Trajectory::theSeed
std::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:344
Trajectory::push
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
Trajectory::theValid
bool theValid
Definition: Trajectory.h:359
Trajectory::theNumberOfCCCBadHits_
signed short theNumberOfCCCBadHits_
Definition: Trajectory.h:355
TrajectoryMeasurement::recHit
ConstRecHitPointer const & recHit() const
Definition: TrajectoryMeasurement.h:190
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
Trajectory::recHits
ConstRecHitContainer recHits() const
Definition: Trajectory.h:186
eostools.move
def move(src, dest)
Definition: eostools.py:511
Trajectory::firstMeasurement
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:166
ConstRecHitContainer
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: MillePedeAlignmentAlgorithm.cc:74
TrajectoryMeasurement::estimate
float estimate() const
Definition: TrajectoryMeasurement.h:192
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
Trajectory::theDirectionValidity
bool theDirectionValidity
Definition: Trajectory.h:358
Trajectory::seed
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:263
TrajectorySeed
Definition: TrajectorySeed.h:18
Trajectory::closestMeasurement
TrajectoryMeasurement const & closestMeasurement(GlobalPoint) const
Definition: Trajectory.cc:256
Trajectory::isBad
static bool isBad(const TrackingRecHit &hit)
Definition: Trajectory.cc:163
Trajectory::theNumberOfFoundPixelHits
signed short theNumberOfFoundPixelHits
Definition: Trajectory.h:352
Trajectory::stopReason_
StopReason stopReason_
Definition: Trajectory.h:364
cms::Exception
Definition: Exception.h:70
DetId::Muon
Definition: DetId.h:26
Trajectory::pixel
static bool pixel(const TrackingRecHit &hit)
Definition: Trajectory.cc:175
Trajectory::theData
DataContainer theData
Definition: Trajectory.h:347
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
alongMomentum
Definition: PropagationDirection.h:4
Trajectory::theDirection
PropagationDirection theDirection
Definition: Trajectory.h:357
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
Trajectory::isValid
bool isValid() const
Definition: Trajectory.h:257
hit
Definition: SiStripHitEffFromCalibTree.cc:88
Trajectory::theNumberOfTrailingFoundHits
signed short theNumberOfTrailingFoundHits
Definition: Trajectory.h:354
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
Trajectory::theChiSquared
float theChiSquared
Definition: Trajectory.h:348
Trajectory::empty
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:233