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 | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
TrajectoryFactoryBase Class Referenceabstract

#include <TrajectoryFactoryBase.h>

Inheritance diagram for TrajectoryFactoryBase:
BzeroReferenceTrajectoryFactory CombinedTrajectoryFactory DualBzeroTrajectoryFactory DualKalmanFactory DualTrajectoryFactory ReferenceTrajectoryFactory TwoBodyDecayTrajectoryFactory

Public Types

typedef
AlignmentAlgorithmBase::ConstTrajTrackPair 
ConstTrajTrackPair
 
typedef
AlignmentAlgorithmBase::ConstTrajTrackPairCollection 
ConstTrajTrackPairCollection
 
typedef std::vector
< TrajectoryStateOnSurface
ExternalPredictionCollection
 
typedef
ReferenceTrajectoryBase::MaterialEffects 
MaterialEffects
 
typedef std::vector
< ReferenceTrajectoryPtr
ReferenceTrajectoryCollection
 
typedef
ReferenceTrajectoryBase::ReferenceTrajectoryPtr 
ReferenceTrajectoryPtr
 
typedef std::pair
< TrajectoryStateOnSurface,
TransientTrackingRecHit::ConstRecHitContainer
TrajectoryInput
 

Public Member Functions

virtual TrajectoryFactoryBaseclone (void) const =0
 
MaterialEffects materialEffects (void) const
 
PropagationDirection propagationDirection (void) const
 
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const =0
 
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const =0
 
 TrajectoryFactoryBase (const edm::ParameterSet &config)
 
virtual ~TrajectoryFactoryBase (void)
 

Protected Member Functions

virtual const TrajectoryInput innermostStateAndRecHits (const ConstTrajTrackPair &track) const
 
virtual const
Trajectory::DataContainer 
orderedTrajectoryMeasurements (const Trajectory &trajectory) const
 
bool sameSurface (const Surface &s1, const Surface &s2) const
 
bool useRecHit (const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
 

Protected Attributes

bool theUseBeamSpot
 

Private Member Functions

MaterialEffects materialEffects (const std::string &strME) const
 
PropagationDirection propagationDirection (const std::string &strPD) const
 

Private Attributes

MaterialEffects theMaterialEffects
 
PropagationDirection thePropDir
 
bool theUseInvalidHits
 
bool theUseProjectedHits
 
bool theUseWithoutDet
 

Detailed Description

Definition at line 17 of file TrajectoryFactoryBase.h.

Member Typedef Documentation

Definition at line 24 of file TrajectoryFactoryBase.h.

Definition at line 25 of file TrajectoryFactoryBase.h.

Definition at line 28 of file TrajectoryFactoryBase.h.

Definition at line 23 of file TrajectoryFactoryBase.h.

Definition at line 26 of file TrajectoryFactoryBase.h.

Definition at line 22 of file TrajectoryFactoryBase.h.

Definition at line 27 of file TrajectoryFactoryBase.h.

Constructor & Destructor Documentation

TrajectoryFactoryBase::TrajectoryFactoryBase ( const edm::ParameterSet config)

Definition at line 10 of file TrajectoryFactoryBase.cc.

References edm::ParameterSet::getParameter(), materialEffects(), propagationDirection(), theMaterialEffects, thePropDir, theUseBeamSpot, theUseInvalidHits, theUseProjectedHits, and theUseWithoutDet.

11 {
12  const std::string strMaterialEffects = config.getParameter< std::string >( "MaterialEffects" );
13  theMaterialEffects = this->materialEffects( strMaterialEffects );
14 
15  const std::string strPropagationDirection = config.getParameter< std::string >( "PropagationDirection" );
16  thePropDir = this->propagationDirection( strPropagationDirection );
17 
18  theUseWithoutDet = config.getParameter< bool >( "UseHitWithoutDet" );
19  theUseInvalidHits = config.getParameter< bool >( "UseInvalidHits" );
20  theUseProjectedHits = config.getParameter< bool >( "UseProjectedHits" );
21  theUseBeamSpot = config.getParameter< bool >( "UseBeamSpot" );
22 }
T getParameter(std::string const &) const
MaterialEffects theMaterialEffects
PropagationDirection thePropDir
MaterialEffects materialEffects(void) const
PropagationDirection propagationDirection(void) const
TrajectoryFactoryBase::~TrajectoryFactoryBase ( void  )
virtual

Definition at line 25 of file TrajectoryFactoryBase.cc.

25 {}

Member Function Documentation

virtual TrajectoryFactoryBase* TrajectoryFactoryBase::clone ( void  ) const
pure virtual
const TrajectoryFactoryBase::TrajectoryInput TrajectoryFactoryBase::innermostStateAndRecHits ( const ConstTrajTrackPair track) const
protectedvirtual

Definition at line 29 of file TrajectoryFactoryBase.cc.

References orderedTrajectoryMeasurements(), query::result, and useRecHit().

Referenced by TwoBodyDecayTrajectoryFactory::constructTrajectories(), ReferenceTrajectoryFactory::trajectories(), and BzeroReferenceTrajectoryFactory::trajectories().

30 {
32 
33  // get the trajectory measurements in the correct order, i.e. reverse if needed
34  Trajectory::DataContainer trajectoryMeasurements
35  = this->orderedTrajectoryMeasurements( *track.first );
36  Trajectory::DataContainer::iterator itM = trajectoryMeasurements.begin();
37 
38  // get the innermost valid trajectory state - the corresponding hit must be o.k. as well
39  while ( itM != trajectoryMeasurements.end() )
40  {
41  if ( ( *itM ).updatedState().isValid() && useRecHit( ( *itM ).recHit() ) ) break;
42  ++itM;
43  }
44  if ( itM != trajectoryMeasurements.end() ) result.first = ( *itM ).updatedState();
45 
46  // get the valid RecHits
47  while ( itM != trajectoryMeasurements.end() )
48  {
49  TransientTrackingRecHit::ConstRecHitPointer aRecHit = ( *itM ).recHit();
50  if ( useRecHit( aRecHit ) ) result.second.push_back( aRecHit );
51  ++itM;
52  }
53 
54  return result;
55 }
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory &trajectory) const
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:42
tuple result
Definition: query.py:137
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
MaterialEffects TrajectoryFactoryBase::materialEffects ( void  ) const
inline
TrajectoryFactoryBase::MaterialEffects TrajectoryFactoryBase::materialEffects ( const std::string &  strME) const
private

Definition at line 112 of file TrajectoryFactoryBase.cc.

References ReferenceTrajectoryBase::breakPoints, ReferenceTrajectoryBase::brokenLinesCoarse, ReferenceTrajectoryBase::brokenLinesFine, ReferenceTrajectoryBase::combined, ReferenceTrajectoryBase::energyLoss, edm::hlt::Exception, ReferenceTrajectoryBase::multipleScattering, and ReferenceTrajectoryBase::none.

113 {
114  if ( strME == "MultipleScattering" ) return ReferenceTrajectoryBase::multipleScattering;
115  if ( strME == "EnergyLoss" ) return ReferenceTrajectoryBase::energyLoss;
116  if ( strME == "Combined" ) return ReferenceTrajectoryBase::combined;
117  if ( strME == "None" ) return ReferenceTrajectoryBase::none;
118  if ( strME == "BreakPoints" ) return ReferenceTrajectoryBase::breakPoints;
119  if ( strME == "BrokenLines" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
120  if ( strME == "BrokenLinesCoarse" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
121  if ( strME == "BrokenLinesFine" ) return ReferenceTrajectoryBase::brokenLinesFine;
122 
123  throw cms::Exception("BadConfig")
124  << "[TrajectoryFactoryBase::materialEffects] Unknown parameter: " << strME;
125 }
const Trajectory::DataContainer TrajectoryFactoryBase::orderedTrajectoryMeasurements ( const Trajectory trajectory) const
protectedvirtual

Definition at line 59 of file TrajectoryFactoryBase.cc.

References anyDirection, dir, Trajectory::direction(), Trajectory::measurements(), definitions::original, and thePropDir.

Referenced by innermostStateAndRecHits(), DualTrajectoryFactory::referenceStateAndRecHits(), DualBzeroTrajectoryFactory::referenceStateAndRecHits(), and DualKalmanFactory::referenceStateAndRecHits().

60 {
61  const PropagationDirection dir = trajectory.direction();
62  const bool hitsAreReverse = ( ( dir == thePropDir || thePropDir == anyDirection ) ? false : true );
63 
64  const Trajectory::DataContainer & original = trajectory.measurements();
65 
66  if ( hitsAreReverse )
67  {
68  // Simply use this line instead of the copying by hand?
69  // const Trajectory::DataContainer reordered(original.rbegin(), original.rend());
70  Trajectory::DataContainer reordered;
71  reordered.reserve( original.size() );
72 
73  Trajectory::DataContainer::const_reverse_iterator itM;
74  for ( itM = original.rbegin(); itM != original.rend(); ++itM )
75  {
76  reordered.push_back( *itM );
77  }
78  return reordered;
79  }
80 
81  return original;
82 }
PropagationDirection thePropDir
list original
Definition: definitions.py:60
PropagationDirection
PropagationDirection const & direction() const
Definition: Trajectory.cc:195
DataContainer const & measurements() const
Definition: Trajectory.h:203
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:42
dbl *** dir
Definition: mlp_gen.cc:35
PropagationDirection TrajectoryFactoryBase::propagationDirection ( void  ) const
inline
PropagationDirection TrajectoryFactoryBase::propagationDirection ( const std::string &  strPD) const
private

Definition at line 129 of file TrajectoryFactoryBase.cc.

References alongMomentum, anyDirection, edm::hlt::Exception, and oppositeToMomentum.

130 {
131  if ( strPD == "oppositeToMomentum" ) return oppositeToMomentum;
132  if ( strPD == "alongMomentum" ) return alongMomentum;
133  if ( strPD == "anyDirection" ) return anyDirection;
134 
135  throw cms::Exception("BadConfig")
136  << "[TrajectoryFactoryBase::propagationDirection] Unknown parameter: " << strPD;
137 }
bool TrajectoryFactoryBase::sameSurface ( const Surface s1,
const Surface s2 
) const
protected

Definition at line 85 of file TrajectoryFactoryBase.cc.

References GloballyPositioned< T >::eta(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::phi(), and GloballyPositioned< T >::position().

Referenced by ReferenceTrajectoryFactory::trajectories(), and BzeroReferenceTrajectoryFactory::trajectories().

86 {
87  // - Should use perp2() instead of perp()
88  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
89  return ( s1.eta() == s2.eta() ) && ( s1.phi() == s2.phi() ) && ( s1.position().perp() == s2.position().perp() );
90 }
T perp() const
Definition: PV3DBase.h:71
const PositionType & position() const
virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
pure virtual
virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const
pure virtual
bool TrajectoryFactoryBase::useRecHit ( const TransientTrackingRecHit::ConstRecHitPointer hitPtr) const
protected

Definition at line 94 of file TrajectoryFactoryBase.cc.

References theUseInvalidHits, theUseProjectedHits, and theUseWithoutDet.

Referenced by innermostStateAndRecHits(), DualTrajectoryFactory::referenceStateAndRecHits(), DualBzeroTrajectoryFactory::referenceStateAndRecHits(), and DualKalmanFactory::referenceStateAndRecHits().

95 {
96  const GeomDet* det = hitPtr->det();
97  if ( !det && !theUseWithoutDet ) return false;
98 
99  if ( !( theUseInvalidHits || hitPtr->isValid() ) ) return false;
100 
101  if ( !theUseProjectedHits )
102  {
103  const ProjectedRecHit2D* projectedHit = dynamic_cast< const ProjectedRecHit2D* >( hitPtr.get() );
104  if ( projectedHit != 0 ) return false;
105  }
106 
107  return true;
108 }

Member Data Documentation

MaterialEffects TrajectoryFactoryBase::theMaterialEffects
private

Definition at line 59 of file TrajectoryFactoryBase.h.

Referenced by materialEffects(), and TrajectoryFactoryBase().

PropagationDirection TrajectoryFactoryBase::thePropDir
private
bool TrajectoryFactoryBase::theUseBeamSpot
protected
bool TrajectoryFactoryBase::theUseInvalidHits
private

Definition at line 63 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

bool TrajectoryFactoryBase::theUseProjectedHits
private

Definition at line 64 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

bool TrajectoryFactoryBase::theUseWithoutDet
private

Definition at line 62 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().