CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
MuonRoadTrajectoryBuilder.cc File Reference
#include <RecoMuon/L3TrackFinder/interface/MuonRoadTrajectoryBuilder.h>
#include <FWCore/MessageLogger/interface/MessageLogger.h>
#include <DataFormats/GeometrySurface/interface/TkRotation.h>
#include <DataFormats/GeometryCommonDetAlgo/interface/ErrorFrameTransformer.h>
#include <DataFormats/GeometryVector/interface/LocalPoint.h>
#include <DataFormats/GeometryVector/interface/LocalVector.h>
#include <DataFormats/GeometrySurface/interface/BoundPlane.h>
#include <DataFormats/GeometrySurface/interface/OpenBounds.h>
#include <DataFormats/GeometrySurface/interface/SimpleDiskBounds.h>
#include <DataFormats/TrajectoryState/interface/PTrajectoryStateOnDet.h>
#include <DataFormats/DetId/interface/DetId.h>
#include <TrackingTools/TransientTrackingRecHit/interface/GenericTransientTrackingRecHit.h>
#include <TrackingTools/MeasurementDet/interface/MeasurementDet.h>
#include <TrackingTools/KalmanUpdators/interface/KFUpdator.h>
#include <TrackingTools/TrackFitters/interface/KFTrajectorySmoother.h>
#include <RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h>
#include <RecoTracker/Record/interface/CkfComponentsRecord.h>
#include <DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h>
#include <DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h>

Go to the source code of this file.

Functions

void sortTrajectoryMeasurements (Trajectory &traj)
 
bool trajectorymeasurementInverseOrder (const TrajectoryMeasurement &meas_1, const TrajectoryMeasurement &meas_2)
 
bool trajectorymeasurementOrder (const TrajectoryMeasurement &meas_1, const TrajectoryMeasurement &meas_2)
 
bool trajectoryOrder (const MuonRoadTrajectoryBuilder::trajectory &traj1, const MuonRoadTrajectoryBuilder::trajectory &traj2)
 

Function Documentation

void sortTrajectoryMeasurements ( Trajectory traj)

Definition at line 421 of file MuonRoadTrajectoryBuilder.cc.

References Trajectory::direction(), Trajectory::measurements(), oppositeToMomentum, Trajectory::push(), Trajectory::seed(), python.multivaluedict::sort(), trajectorymeasurementInverseOrder(), and trajectorymeasurementOrder().

Referenced by MuonRoadTrajectoryBuilder::smooth().

421  {
423 
424  // edm::LogInfo(theCategory)<<"sorting ("<< meas.size() <<") measurements.";
425  //sort the measurements
426  if (traj.direction() == oppositeToMomentum)
427  {std::sort(meas.begin(),meas.end(),trajectorymeasurementInverseOrder);}
428  else
429  {std::sort(meas.begin(),meas.end(),trajectorymeasurementOrder);}
430 
431  //create a new one
432  Trajectory newTraj(traj.seed(),traj.direction());
433  for (Trajectory::DataContainer::iterator mit=meas.begin();mit!=meas.end();++mit)
434  {newTraj.push(*mit);}
435 
436  //exchange now.
437  traj = newTraj;
438  }
bool trajectorymeasurementInverseOrder(const TrajectoryMeasurement &meas_1, const TrajectoryMeasurement &meas_2)
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:277
PropagationDirection const & direction() const
Definition: Trajectory.cc:196
DataContainer const & measurements() const
Definition: Trajectory.h:215
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:42
bool trajectorymeasurementOrder(const TrajectoryMeasurement &meas_1, const TrajectoryMeasurement &meas_2)
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:35
bool trajectorymeasurementInverseOrder ( const TrajectoryMeasurement meas_1,
const TrajectoryMeasurement meas_2 
)

Definition at line 389 of file MuonRoadTrajectoryBuilder.cc.

References trajectorymeasurementOrder().

Referenced by sortTrajectoryMeasurements().

390  {return trajectorymeasurementOrder(meas_2,meas_1);}
bool trajectorymeasurementOrder(const TrajectoryMeasurement &meas_1, const TrajectoryMeasurement &meas_2)
bool trajectorymeasurementOrder ( const TrajectoryMeasurement meas_1,
const TrajectoryMeasurement meas_2 
)

Definition at line 379 of file MuonRoadTrajectoryBuilder.cc.

References Vector3DBase< T, FrameTag >::dot(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), TrajectoryMeasurement::predictedState(), csvLumiCalc::unit, and Vector3DBase< T, FrameTag >::unit().

Referenced by sortTrajectoryMeasurements(), and trajectorymeasurementInverseOrder().

380  {
381  // GlobalVector d= (meas_2.recHit()->globalPosition () - meas_1.recHit()->globalPosition ()).unit();
383 
384  GlobalVector u1= meas_1.predictedState().globalDirection().unit(); //was using only that before
386  GlobalVector u =(u1+u2)/2.; //the average momentum to be sure that the relation is symetrical.
387  return d.dot(u) > 0;
388  }
TrajectoryStateOnSurface const & predictedState() const
GlobalPoint globalPosition() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
string unit
Definition: csvLumiCalc.py:46
Vector3DBase unit() const
Definition: Vector3DBase.h:57
GlobalVector globalDirection() const
bool trajectoryOrder ( const MuonRoadTrajectoryBuilder::trajectory traj1,
const MuonRoadTrajectoryBuilder::trajectory traj2 
)

Definition at line 108 of file MuonRoadTrajectoryBuilder.cc.

References MuonRoadTrajectoryBuilder::trajectory::chi2, MuonRoadTrajectoryBuilder::trajectory::measurements, and indexGen::s2.

Referenced by MuonRoadTrajectoryBuilder::checkStep(), and MuonRoadTrajectoryBuilder::makeTrajectories_0().

109 { //order so that first element of the list have
110  //most hits, if equal smallest chi2
111  unsigned int s1=traj1.measurements.size();
112  unsigned int s2=traj2.measurements.size();
113  if (s1>s2) return true; //decreasing order of measurements.size()
114  else {
115  if (s1==s2) return (traj1.chi2<traj2.chi2); //increase order of chi2
116  else return false; }}
tuple s2
Definition: indexGen.py:106
std::list< TrajectoryMeasurement > measurements