CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

typedef
TrackingRecHit::ConstRecHitContainer 
ConstRecHitContainer
 
typedef std::vector
< TrajectoryMeasurement
DataContainer
 
typedef ConstRecHitContainer RecHitContainer
 

Public Member Functions

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
 
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
 
DataContainer const & measurements () const
 
DataContainermeasurements ()
 
int ndof (bool bon=true) const
 
signed char nLoops () const
 
void pop ()
 
void push (const TrajectoryMeasurement &tm)
 
void push (const TrajectoryMeasurement &tm, double chi2Increment)
 
void reserve (unsigned int n)
 
void reverse ()
 
TrajectorySeed const & seed () const
 Access to the seed used to reconstruct the Trajectory. More...
 
edm::RefToBase< TrajectorySeedseedRef (void) const
 
void setDPhiCacheForLoopersReconstruction (float dphi)
 
void setNLoops (signed char value)
 
void setSeedRef (const edm::RefToBase< TrajectorySeed > &seedRef)
 
void setSharedSeed (const boost::shared_ptr< const TrajectorySeed > &seed)
 
const boost::shared_ptr< const
TrajectorySeed > & 
sharedSeed () const
 
 Trajectory ()
 
 Trajectory (const TrajectorySeed &seed)
 
 Trajectory (const TrajectorySeed &seed, PropagationDirection dir)
 
 Trajectory (const boost::shared_ptr< const TrajectorySeed > &seed, PropagationDirection dir)
 
 Trajectory (PropagationDirection dir)
 

Static Public Member Functions

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

Private Member Functions

void check () const
 
void pushAux (double chi2Increment)
 

Private Attributes

edm::RefToBase< TrajectorySeedseedRef_
 
float theChiSquared
 
float theChiSquaredBad
 
DataContainer theData
 
PropagationDirection theDirection
 
bool theDirectionValidity
 
float theDPhiCache
 
signed char theNLoops
 
signed short theNumberOfFoundHits
 
signed short theNumberOfLostHits
 
boost::shared_ptr< const
TrajectorySeed
theSeed
 
bool theValid
 

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

Definition at line 47 of file Trajectory.h.

Definition at line 42 of file Trajectory.h.

Definition at line 48 of file Trajectory.h.

Constructor & Destructor Documentation

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 56 of file Trajectory.h.

56  :
57  theSeed(), seedRef_(),
61  {}
float theChiSquaredBad
Definition: Trajectory.h:345
signed short theNumberOfFoundHits
Definition: Trajectory.h:347
bool theDirectionValidity
Definition: Trajectory.h:351
signed short theNumberOfLostHits
Definition: Trajectory.h:348
signed char theNLoops
Definition: Trajectory.h:355
float theDPhiCache
Definition: Trajectory.h:354
bool theValid
Definition: Trajectory.h:352
PropagationDirection theDirection
Definition: Trajectory.h:350
float theChiSquared
Definition: Trajectory.h:344
boost::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:340
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:341
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 70 of file Trajectory.h.

70  :
71  theSeed( new TrajectorySeed(seed) ), seedRef_(),
75  {}
float theChiSquaredBad
Definition: Trajectory.h:345
signed short theNumberOfFoundHits
Definition: Trajectory.h:347
bool theDirectionValidity
Definition: Trajectory.h:351
signed short theNumberOfLostHits
Definition: Trajectory.h:348
signed char theNLoops
Definition: Trajectory.h:355
float theDPhiCache
Definition: Trajectory.h:354
bool theValid
Definition: Trajectory.h:352
PropagationDirection theDirection
Definition: Trajectory.h:350
float theChiSquared
Definition: Trajectory.h:344
boost::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:340
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:341
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 81 of file Trajectory.h.

81  :
82  theSeed( new TrajectorySeed(seed) ), seedRef_(),
86 
87  {}
float theChiSquaredBad
Definition: Trajectory.h:345
signed short theNumberOfFoundHits
Definition: Trajectory.h:347
bool theDirectionValidity
Definition: Trajectory.h:351
signed short theNumberOfLostHits
Definition: Trajectory.h:348
signed char theNLoops
Definition: Trajectory.h:355
float theDPhiCache
Definition: Trajectory.h:354
bool theValid
Definition: Trajectory.h:352
PropagationDirection theDirection
Definition: Trajectory.h:350
float theChiSquared
Definition: Trajectory.h:344
boost::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:340
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:341
dbl *** dir
Definition: mlp_gen.cc:35
Trajectory::Trajectory ( const boost::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 93 of file Trajectory.h.

93  :
94  theSeed( seed ), seedRef_(),
98  {}
float theChiSquaredBad
Definition: Trajectory.h:345
signed short theNumberOfFoundHits
Definition: Trajectory.h:347
bool theDirectionValidity
Definition: Trajectory.h:351
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:275
signed short theNumberOfLostHits
Definition: Trajectory.h:348
signed char theNLoops
Definition: Trajectory.h:355
float theDPhiCache
Definition: Trajectory.h:354
bool theValid
Definition: Trajectory.h:352
PropagationDirection theDirection
Definition: Trajectory.h:350
float theChiSquared
Definition: Trajectory.h:344
boost::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:340
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:341
dbl *** dir
Definition: mlp_gen.cc:35
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 104 of file Trajectory.h.

104  :
105  theSeed(), seedRef_(),
109 
110  {}
float theChiSquaredBad
Definition: Trajectory.h:345
signed short theNumberOfFoundHits
Definition: Trajectory.h:347
bool theDirectionValidity
Definition: Trajectory.h:351
signed short theNumberOfLostHits
Definition: Trajectory.h:348
signed char theNLoops
Definition: Trajectory.h:355
float theDPhiCache
Definition: Trajectory.h:354
bool theValid
Definition: Trajectory.h:352
PropagationDirection theDirection
Definition: Trajectory.h:350
float theChiSquared
Definition: Trajectory.h:344
boost::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:340
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:341
dbl *** dir
Definition: mlp_gen.cc:35

Member Function Documentation

void Trajectory::check ( void  ) const
private

Definition at line 123 of file Trajectory.cc.

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

123  {
124  if ( theData.empty())
125  throw cms::Exception("TrackingTools/PatternTools","Trajectory::check() - information requested from empty Trajectory");
126 }
DataContainer theData
Definition: Trajectory.h:343
float Trajectory::chiSquared ( ) const
inline
TrajectoryMeasurement const & Trajectory::closestMeasurement ( GlobalPoint  point) const

Definition at line 192 of file Trajectory.cc.

References begin, DDVectorGetter::check(), end, and getDQMSummary::iter.

Referenced by ConversionSeedFilter::getTSOS().

192  {
193  check();
194  vector<TrajectoryMeasurement>::const_iterator iter = std::min_element(measurements().begin(), measurements().end(), LessMag(point) );
195 
196  return (*iter);
197 }
void check() const
Definition: Trajectory.cc:123
DataContainer const & measurements() const
Definition: Trajectory.h:203
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
DataContainer const& Trajectory::data ( ) const
inline

obsolete name, use measurements() instead.

Definition at line 207 of file Trajectory.h.

References measurements().

Referenced by cuy.FindIssue::__init__().

207 { return measurements();}
DataContainer const & measurements() const
Definition: Trajectory.h:203
PropagationDirection const & Trajectory::direction ( ) const

Direction of "growing" of the trajectory. Possible values are alongMomentum (outwards) and oppositeToMomentum (inwards).

Definition at line 118 of file Trajectory.cc.

References edm::hlt::Exception.

Referenced by PFTrackTransformer::addPoints(), PFTrackTransformer::addPointsAndBrems(), CkfDebugger::analyseRecHitNotFound(), GroupedCkfTrajectoryBuilder::backwardFit(), FWTrackProxyBuilderFullFramework::buildTrack(), DAFTrackProducerAlgorithm::buildTrack(), MuonTrackLoader::buildTrackExtra(), GlobalTrackerMuonAlignment::debugTrajectory(), KFSplittingFitter::fitOne(), KFFittingSmoother::fitOne(), NuclearTrackCorrector::getNewTrackExtra(), TransientInitialStateEstimator::innerState(), CRackTrajectoryBuilder::innerState(), ConversionHitChecker::nHitsBeforeVtx(), Traj2TrackHits::operator()(), TrajectoryFactoryBase::orderedTrajectoryMeasurements(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), GroupedDAFHitCollector::recHits(), CosmicMuonTrajectoryBuilder::reverseTrajectoryPropagationDirection(), NuclearInteractionFinder::run(), DAFTrackProducerAlgorithm::runWithCandidate(), TrajAnnealing::TrajAnnealing(), CosmicMuonTrajectoryBuilder::trajectories(), GsfTrajectorySmoother::trajectory(), KFTrajectorySmoother::trajectory(), and trajectoryToResiduals().

118  {
120  else throw cms::Exception("TrackingTools/PatternTools","Trajectory::direction() requested but not set");
121 }
bool theDirectionValidity
Definition: Trajectory.h:351
PropagationDirection theDirection
Definition: Trajectory.h:350
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 323 of file Trajectory.h.

References theDPhiCache.

Referenced by GroupedTrajCandLess::score().

323 { return theDPhiCache;}
float theDPhiCache
Definition: Trajectory.h:354
bool Trajectory::empty ( void  ) const
inline
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 194 of file Trajectory.h.

References check(), edm::hlt::Exception, and theData.

Referenced by CosmicTrajectoryBuilder::AddHit(), CkfDebugger::analyseCompatibleMeasurements(), GroupedCkfTrajectoryBuilder::backwardFit(), CosmicMuonTrajectoryBuilder::build(), CosmicMuonTrajectoryBuilder::buildSecondHalf(), DAFTrackProducerAlgorithm::buildTrack(), MuonTrackLoader::buildTrackExtra(), GlobalTrackerMuonAlignment::debugTrajectory(), CosmicMuonTrajectoryBuilder::estimateDirection(), GsfTrajectoryFitter::fitOne(), KFFittingSmoother::fitOne(), KFSplittingFitter::fitOne(), KFTrajectoryFitter::fitOne(), NuclearTrackCorrector::getNewTrackExtra(), CosmicMuonSmoother::initialState(), TransientInitialStateEstimator::innerState(), TrackerToMuonPropagator::produce(), GoodSeedProducer::produce(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), CosmicMuonTrajectoryBuilder::reverseTrajectory(), CRackTrajectoryBuilder::run(), and CosmicMuonTrajectoryBuilder::trajectories().

194  {
195  check();
196  if (theData.front().recHitR().hit()!=0) return theData.front();
197  else if (theData.size()>2) return *(theData.begin()+1);
198  else throw cms::Exception("TrajectoryMeasurement::firstMeasurement - Too few measurements in trajectory");
199  }
DataContainer theData
Definition: Trajectory.h:343
void check() const
Definition: Trajectory.cc:123
int Trajectory::foundHits ( ) const
inline
TrajectoryStateOnSurface Trajectory::geometricalInnermostState ( ) const

Definition at line 155 of file Trajectory.cc.

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

Referenced by MuonTrackLoader::buildTrackAtPCA().

155  {
156 
157  check();
158 
159  //if trajectory is in one half, return the end closer to origin point
160  if ( firstMeasurement().updatedState().globalMomentum().perp() > 1.0
161  && ( firstMeasurement().updatedState().globalPosition().basicVector().dot( firstMeasurement().updatedState().globalMomentum().basicVector() ) *
162  lastMeasurement().updatedState().globalPosition().basicVector().dot( lastMeasurement().updatedState().globalMomentum().basicVector() ) > 0 ) ) {
163  return (firstMeasurement().updatedState().globalPosition().mag() < lastMeasurement().updatedState().globalPosition().mag() ) ?
165  }
166 
167  //more complicated in case of traversing and low-pt trajectories with loops
168  return closestMeasurement(GlobalPoint(0.0,0.0,0.0)).updatedState();
169 
170 }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void check() const
Definition: Trajectory.cc:123
TrajectoryMeasurement const & closestMeasurement(GlobalPoint) const
Definition: Trajectory.cc:192
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:181
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:194
T perp() const
Magnitude of transverse component.
T dot(const Basic3DVector &v) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
TrajectoryStateOnSurface const & updatedState() const
static bool Trajectory::inactive ( )
inlinestatic

Definition of inactive Det from the Trajectory point of view.

Definition at line 280 of file Trajectory.h.

281  {return false;}//FIXME
void Trajectory::incrementLoops ( )
inline

Definition at line 333 of file Trajectory.h.

References theNLoops.

333 {theNLoops++;}
signed char theNLoops
Definition: Trajectory.h:355
void Trajectory::invalidate ( )
inline

Method to invalidate a trajectory. Useful during ambiguity resolution.

Definition at line 272 of file Trajectory.h.

References theValid.

Referenced by TrajectoryCleanerBySharedHits::clean().

272 { theValid = false;}
bool theValid
Definition: Trajectory.h:352
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 144 of file Trajectory.cc.

References TrackingRecHit::bad, TrackingRecHit::geographicalId(), TrackingRecHit::getType(), TrackingRecHit::isValid(), and DetId::rawId().

145 {
146  if ( hit.isValid()) return false;
147  else {
148  if(hit.geographicalId().rawId() == 0) {return false;}
149  else{
150  return hit.getType() == TrackingRecHit::bad;
151  }
152  }
153 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Type getType() const
bool isValid() const
DetId geographicalId() const
bool Trajectory::isLooper ( ) const
inline

Definition at line 329 of file Trajectory.h.

References theNLoops.

329 { return (theNLoops>0);}
signed char theNLoops
Definition: Trajectory.h:355
bool Trajectory::isValid ( void  ) const
inline
const DetLayer* Trajectory::lastLayer ( ) const
inline

Redundant method, returns the layer of lastMeasurement() .

Definition at line 294 of file Trajectory.h.

References check(), edm::hlt::Exception, and theData.

Referenced by CkfDebugger::analyseRecHitNotFound().

294  {
295  check();
296  if (theData.back().recHit()->hit()!=0) return theData.back().layer();
297  else if (theData.size()>2) return (theData.end()-2)->layer();
298  else throw cms::Exception("TrajectoryMeasurement::lastMeasurement - Too few measurements in trajectory");
299  }
DataContainer theData
Definition: Trajectory.h:343
void check() const
Definition: Trajectory.cc:123
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 181 of file Trajectory.h.

References check(), edm::hlt::Exception, and theData.

Referenced by CosmicTrajectoryBuilder::AddHit(), CRackTrajectoryBuilder::AddHit(), BaseCkfTrajectoryBuilder::addToResult(), CkfDebugger::analyseCompatibleMeasurements(), CkfDebugger::analyseRecHitNotFound(), CosmicMuonTrajectoryBuilder::build(), CosmicMuonTrajectoryBuilder::buildSecondHalf(), DAFTrackProducerAlgorithm::buildTrack(), MuonTrackLoader::buildTrackExtra(), GlobalTrackerMuonAlignment::debugTrajectory(), CosmicMuonTrajectoryBuilder::estimateDirection(), KFFittingSmoother::fitOne(), CosmicMuonTrajectoryBuilder::flipTrajectory(), NuclearTrackCorrector::getNewTrackExtra(), CosmicMuonSmoother::initialState(), TransientInitialStateEstimator::innerState(), CkfDebugger::nextCorrectHits(), GoodSeedProducer::produce(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), ThresholdPtTrajectoryFilter::qualityFilter(), MinPtTrajectoryFilter::qualityFilter(), CosmicMuonTrajectoryBuilder::reverseTrajectory(), StandAloneMuonRefitter::singleRefit(), CRackTrajectoryBuilder::SortHits(), ThresholdPtTrajectoryFilter::toBeContinued(), MinPtTrajectoryFilter::toBeContinued(), StandAloneMuonTrajectoryBuilder::trajectories(), and CosmicMuonTrajectoryBuilder::trajectories().

181  {
182  check();
183  if (theData.back().recHitR().hit()!=0) return theData.back();
184  else if (theData.size()>2) return *(theData.end()-2);
185  else throw cms::Exception("TrajectoryMeasurement::lastMeasurement - Too few measurements in trajectory");
186  }
DataContainer theData
Definition: Trajectory.h:343
void check() const
Definition: Trajectory.cc:123
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 128 of file Trajectory.cc.

References TrackingRecHit::geographicalId(), TrackingRecHit::getType(), TrackingRecHit::isValid(), TrackingRecHit::missing, and DetId::rawId().

Referenced by MaxConsecLostHitsTrajectoryFilter::TBC().

129 {
130  if ( hit.isValid()) return false;
131  else {
132  // // A DetLayer is always inactive in this logic.
133  // // The DetLayer is the Det of an invalid RecHit only if no DetUnit
134  // // is compatible with the predicted state, so we don't really expect
135  // // a hit in this case.
136 
137  if(hit.geographicalId().rawId() == 0) {return false;}
138  else{
139  return hit.getType() == TrackingRecHit::missing;
140  }
141  }
142 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Type getType() const
bool isValid() const
DetId geographicalId() const
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 241 of file Trajectory.h.

References theNumberOfLostHits.

Referenced by BaseCkfTrajectoryBuilder::addToResult(), TrajectoryCleanerBySharedHits::clean(), and GroupedTrajCandLess::score().

241 { return theNumberOfLostHits;}
signed short theNumberOfLostHits
Definition: Trajectory.h:348
DataContainer const& Trajectory::measurements ( ) const
inline

Return all measurements in a container.

Definition at line 203 of file Trajectory.h.

References theData.

Referenced by PFTrackTransformer::addPoints(), PFTrackTransformer::addPointsAndBrems(), BaseCkfTrajectoryBuilder::addToResult(), DeDxDiscriminatorLearner::algoAnalyze(), SiStripGainFromData::algoAnalyze(), SiStripGainFromCalibTree::algoAnalyze(), CkfDebugger::analyseCompatibleMeasurements(), analyzer::SiPixelLorentzAngle::analyze(), GroupedCkfTrajectoryBuilder::backwardFit(), FWTrackProxyBuilderFullFramework::buildTrack(), DAFTrackProducerAlgorithm::calculateNdof(), KFFittingSmoother::checkForNans(), DAFTrackProducerAlgorithm::checkHits(), MuonTrackResidualAnalyzer::computeResolution(), StandAloneMuonFilter::createDefaultTrajectory(), data(), AlignmentMonitorTemplate::event(), AlignmentMonitorMuonResiduals::event(), AlignmentMonitorTracksFromTrajectories::event(), TrackerValidationVariables::fillHitQuantities(), MuonKinkFinder::fillTrkKink(), DynamicTruncation::filter(), SiStripFineDelayTLA::findtrackangle(), CosmicMuonSmoother::fit(), KFFittingSmoother::fitOne(), TransientInitialStateEstimator::innerState(), CRackTrajectoryBuilder::innerState(), GlobalTrackQualityProducer::kink(), MuonResidualsFromTrack::MuonResidualsFromTrack(), GlobalTrackQualityProducer::newChi2(), ConversionHitChecker::nHitsBeforeVtx(), Traj2TrackHits::operator()(), TrajectoryFactoryBase::orderedTrajectoryMeasurements(), ShallowTrackClustersProducer::produce(), TkAlCaOverlapTagger::produce(), HLTTrackClusterRemoverNew::produce(), HITrackClusterRemover::produce(), ShallowGainCalibration::produce(), TrackClusterSplitter::produce(), reco::modules::CosmicTrackSplitter::produce(), reco::modules::TrackerTrackHitFilter::produceFromTrajectory(), GsfTrackProducerBase::putInEvt(), StripSubClusterShapeTrajectoryFilter::qualityFilter(), SimpleDAFHitCollector::recHits(), GroupedDAFHitCollector::recHits(), CosmicMuonTrajectoryBuilder::reverseTrajectory(), CosmicMuonTrajectoryBuilder::reverseTrajectoryPropagationDirection(), MuonMillepedeAlgorithm::run(), HIPAlignmentAlgorithm::run(), MuonDTLocalMillepedeAlgorithm::run(), CSCOverlapsAlignmentAlgorithm::run(), NuclearInteractionFinder::run(), GlobalMuonRefitter::selectMuonHits(), CosmicMuonSmoother::smooth(), ClusterShapeTrajectoryFilter::toBeContinued(), TrajAnnealing::TrajAnnealing(), CosmicMuonTrajectoryBuilder::trajectories(), GlobalCosmicMuonTrajectoryBuilder::trajectories(), GsfTrajectorySmoother::trajectory(), KFTrajectorySmoother::trajectory(), trajectoryToResiduals(), and DAFTrackProducerAlgorithm::updateHits().

203 { return theData;}
DataContainer theData
Definition: Trajectory.h:343
DataContainer& Trajectory::measurements ( )
inline

Definition at line 204 of file Trajectory.h.

References theData.

204 { return theData;}
DataContainer theData
Definition: Trajectory.h:343
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 78 of file Trajectory.cc.

References bookConverter::max, DetId::Muon, and HLT_25ns14e33_v3_cff::recHits.

Referenced by analyzer::SiPixelLorentzAngle::analyze(), MuonTrackLoader::buildTrackAtPCA(), GlobalTrackQualityProducer::trackProbability(), and GlobalTrajectoryBuilderBase::trackProbability().

78  {
79  Trajectory::RecHitContainer && transRecHits = recHits();
80 
81  int dof = 0;
82  int dofBad = 0;
83 
84  for(Trajectory::RecHitContainer::const_iterator rechit = transRecHits.begin();
85  rechit != transRecHits.end(); ++rechit) {
86  if((*rechit)->isValid())
87  dof += (*rechit)->dimension();
88  else if( isBad(**rechit) && (*rechit)->geographicalId().det()==DetId::Muon )
89  dofBad += (*rechit)->dimension();
90  }
91 
92  // If dof!=0 (there is at least 1 valid hit),
93  // return ndof=ndof(fit)
94  // If dof=0 (all rec hits are invalid, only for STA trajectories),
95  // return ndof=ndof(invalid hits)
96  if(dof) {
97  int constr = bon ? 5 : 4;
98  return std::max(dof - constr, 0);
99  }
100  else {
101  // A STA can have < 5 (invalid) hits
102  // if this is the case ==> ndof = 1
103  // (to avoid divisions by 0)
104  int constr = bon ? 5 : 4;
105  return std::max(dofBad - constr, 1);
106  }
107 }
ConstRecHitContainer RecHitContainer
Definition: Trajectory.h:48
static bool isBad(const TrackingRecHit &hit)
Definition: Trajectory.cc:144
signed char Trajectory::nLoops ( ) const
inline

Definition at line 330 of file Trajectory.h.

References theNLoops.

Referenced by GroupedCkfTrajectoryBuilder::backwardFit(), and TransientInitialStateEstimator::innerState().

330 {return theNLoops;}
signed char theNLoops
Definition: Trajectory.h:355
void Trajectory::pop ( )

Remove the last measurement from the trajectory.

Definition at line 12 of file Trajectory.cc.

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

Referenced by BaseCkfTrajectoryBuilder::addToResult(), KFFittingSmoother::fitOne(), CosmicMuonTrajectoryBuilder::reverseTrajectoryPropagationDirection(), and CosmicMuonTrajectoryBuilder::trajectories().

12  {
13  if (!empty()) {
14  if(theData.back().recHit()->isValid()) {
16  theChiSquared -= theData.back().estimate();
17  }
18  else if(lost(* (theData.back().recHit()) )) {
20  }
21  else if(isBad(* (theData.back().recHit()) ) && theData.back().recHit()->geographicalId().det()==DetId::Muon ) {
22  theChiSquaredBad -= theData.back().estimate();
23  }
24 
25  theData.pop_back();
26  }
27 }
bool empty() const
True if trajectory has no measurements.
Definition: Trajectory.h:244
float theChiSquaredBad
Definition: Trajectory.h:345
signed short theNumberOfFoundHits
Definition: Trajectory.h:347
signed short theNumberOfLostHits
Definition: Trajectory.h:348
DataContainer theData
Definition: Trajectory.h:343
float theChiSquared
Definition: Trajectory.h:344
static bool isBad(const TrackingRecHit &hit)
Definition: Trajectory.cc:144
static bool lost(const TrackingRecHit &hit)
Definition: Trajectory.cc:128
void Trajectory::push ( const TrajectoryMeasurement tm)
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 41 of file Trajectory.cc.

41  {
42  theData.push_back(tm); pushAux(chi2Increment);
43 }
void pushAux(double chi2Increment)
Definition: Trajectory.cc:50
DataContainer theData
Definition: Trajectory.h:343
void Trajectory::pushAux ( double  chi2Increment)
private

Definition at line 50 of file Trajectory.cc.

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

50  {
51  const TrajectoryMeasurement& tm = theData.back();
52  if ( tm.recHit()->isValid()) {
53  theChiSquared += chi2Increment;
55  }
56  // else if (lost( tm.recHit()) && !inactive(tm.recHit().det())) theNumberOfLostHits++;
57  else if (lost( *(tm.recHit()) ) ) {
59  }
60 
61  else if (isBad( *(tm.recHit()) ) && tm.recHit()->geographicalId().det()==DetId::Muon ) {
62  theChiSquaredBad += chi2Increment;
63  }
64 
65  // in case of a Trajectory constructed without direction,
66  // determine direction from the radii of the first two measurements
67 
68  if ( !theDirectionValidity && theData.size() >= 2) {
69  if (theData[0].updatedState().globalPosition().perp2() <
70  theData.back().updatedState().globalPosition().perp2())
73  theDirectionValidity = true;
74  }
75 }
float theChiSquaredBad
Definition: Trajectory.h:345
signed short theNumberOfFoundHits
Definition: Trajectory.h:347
bool theDirectionValidity
Definition: Trajectory.h:351
ConstRecHitPointer const & recHit() const
signed short theNumberOfLostHits
Definition: Trajectory.h:348
DataContainer theData
Definition: Trajectory.h:343
PropagationDirection theDirection
Definition: Trajectory.h:350
float theChiSquared
Definition: Trajectory.h:344
static bool isBad(const TrackingRecHit &hit)
Definition: Trajectory.cc:144
static bool lost(const TrackingRecHit &hit)
Definition: Trajectory.cc:128
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 155 of file Trajectory.h.

References theData.

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

155 { theData.reserve(n); }
DataContainer theData
Definition: Trajectory.h:343
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 199 of file Trajectory.cc.

References alongMomentum, and oppositeToMomentum.

199  {
200  // reverse the direction (without changing it if it's not along or opposite)
203  // reverse the order of the hits
204  std::reverse(theData.begin(), theData.end());
205 }
DataContainer theData
Definition: Trajectory.h:343
PropagationDirection theDirection
Definition: Trajectory.h:350
TrajectorySeed const& Trajectory::seed ( ) const
inline
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 306 of file Trajectory.h.

References seedRef_.

Referenced by MuonTrackLoader::buildTrackExtra(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), and setSeedRef().

306 { return seedRef_; }
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:341
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 327 of file Trajectory.h.

References theDPhiCache.

327 { theDPhiCache = dphi;}
float theDPhiCache
Definition: Trajectory.h:354
void Trajectory::setNLoops ( signed char  value)
inline
void Trajectory::setSeedRef ( const edm::RefToBase< TrajectorySeed > &  seedRef)
inline

Definition at line 308 of file Trajectory.h.

References seedRef(), and seedRef_.

Referenced by GlobalTrajectoryBuilderBase::build(), and cms::CkfTrackCandidateMakerBase::produceBase().

308 { seedRef_ = seedRef ; }
edm::RefToBase< TrajectorySeed > seedRef(void) const
Definition: Trajectory.h:306
edm::RefToBase< TrajectorySeed > seedRef_
Definition: Trajectory.h:341
void Trajectory::setSharedSeed ( const boost::shared_ptr< const TrajectorySeed > &  seed)
inline

Definition at line 319 of file Trajectory.h.

References seed(), and theSeed.

Referenced by BaseCkfTrajectoryBuilder::addToResult().

319 { theSeed=seed;}
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:275
boost::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:340
const boost::shared_ptr<const TrajectorySeed>& Trajectory::sharedSeed ( ) const
inline

Definition at line 318 of file Trajectory.h.

References theSeed.

318 { return theSeed; }
boost::shared_ptr< const TrajectorySeed > theSeed
Definition: Trajectory.h:340

Member Data Documentation

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

Definition at line 341 of file Trajectory.h.

Referenced by seedRef(), and setSeedRef().

float Trajectory::theChiSquared
private

Definition at line 344 of file Trajectory.h.

Referenced by chiSquared().

float Trajectory::theChiSquaredBad
private

Definition at line 345 of file Trajectory.h.

Referenced by chiSquared().

DataContainer Trajectory::theData
private

Definition at line 343 of file Trajectory.h.

Referenced by empty(), firstMeasurement(), lastLayer(), lastMeasurement(), measurements(), and reserve().

PropagationDirection Trajectory::theDirection
private

Definition at line 350 of file Trajectory.h.

bool Trajectory::theDirectionValidity
private

Definition at line 351 of file Trajectory.h.

float Trajectory::theDPhiCache
private
signed char Trajectory::theNLoops
private

Definition at line 355 of file Trajectory.h.

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

signed short Trajectory::theNumberOfFoundHits
private

Definition at line 347 of file Trajectory.h.

Referenced by chiSquared(), and foundHits().

signed short Trajectory::theNumberOfLostHits
private

Definition at line 348 of file Trajectory.h.

Referenced by lostHits().

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

Definition at line 340 of file Trajectory.h.

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

bool Trajectory::theValid
private

Definition at line 352 of file Trajectory.h.

Referenced by invalidate(), and isValid().