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 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
 
const edm::ParameterSetconfiguration () const
 
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

const edm::ParameterSet theConfig
 
MaterialEffects theMaterialEffects
 
PropagationDirection thePropDir
 
bool theUseInvalidHits
 
bool theUseProjectedHits
 
bool theUseWithoutDet
 

Detailed Description

Definition at line 19 of file TrajectoryFactoryBase.h.

Member Typedef Documentation

Definition at line 26 of file TrajectoryFactoryBase.h.

Definition at line 27 of file TrajectoryFactoryBase.h.

Definition at line 30 of file TrajectoryFactoryBase.h.

Definition at line 25 of file TrajectoryFactoryBase.h.

Definition at line 28 of file TrajectoryFactoryBase.h.

Definition at line 24 of file TrajectoryFactoryBase.h.

Definition at line 29 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(), AlCaHLTBitMon_QueryRunRegistry::string, theMaterialEffects, thePropDir, theUseBeamSpot, theUseInvalidHits, theUseProjectedHits, and theUseWithoutDet.

10  :
11  theConfig(config)
12 {
13  const std::string strMaterialEffects = config.getParameter< std::string >( "MaterialEffects" );
14  theMaterialEffects = this->materialEffects( strMaterialEffects );
15 
16  const std::string strPropagationDirection = config.getParameter< std::string >( "PropagationDirection" );
17  thePropDir = this->propagationDirection( strPropagationDirection );
18 
19  theUseWithoutDet = config.getParameter< bool >( "UseHitWithoutDet" );
20  theUseInvalidHits = config.getParameter< bool >( "UseInvalidHits" );
21  theUseProjectedHits = config.getParameter< bool >( "UseProjectedHits" );
22  theUseBeamSpot = config.getParameter< bool >( "UseBeamSpot" );
23 
24  edm::LogInfo("Alignment") << "@SUB=TrajectoryFactoryBase"
25  << "TrajectoryFactory '" << config.getParameter<std::string>("TrajectoryFactoryName")
26  << "' with following settings:"
27  << "\nmaterial effects: " << strMaterialEffects
28  << "\npropagation: " << strPropagationDirection
29  << "\nuse hits without det: " << (theUseWithoutDet ? "yes" : "no")
30  << "\nuse invalid hits: " << (theUseInvalidHits ? "yes" : "no")
31  << "\nuse projected hits: " << (theUseProjectedHits ? "yes" : "no")
32  << "\nuse beamspot: " << (theUseBeamSpot ? "yes" : "no");
33 }
T getParameter(std::string const &) const
MaterialEffects theMaterialEffects
PropagationDirection thePropDir
MaterialEffects materialEffects(void) const
const edm::ParameterSet theConfig
PropagationDirection propagationDirection(void) const
TrajectoryFactoryBase::~TrajectoryFactoryBase ( void  )
virtual

Definition at line 36 of file TrajectoryFactoryBase.cc.

36 {}

Member Function Documentation

virtual TrajectoryFactoryBase* TrajectoryFactoryBase::clone ( void  ) const
pure virtual
const edm::ParameterSet& TrajectoryFactoryBase::configuration ( ) const
inline

Definition at line 48 of file TrajectoryFactoryBase.h.

References theConfig.

Referenced by ReferenceTrajectoryFactory::bzeroFactory().

48 { return theConfig; }
const edm::ParameterSet theConfig
const TrajectoryFactoryBase::TrajectoryInput TrajectoryFactoryBase::innermostStateAndRecHits ( const ConstTrajTrackPair track) const
protectedvirtual

Definition at line 40 of file TrajectoryFactoryBase.cc.

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

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

41 {
43 
44  // get the trajectory measurements in the correct order, i.e. reverse if needed
45  Trajectory::DataContainer trajectoryMeasurements
46  = this->orderedTrajectoryMeasurements( *track.first );
47  Trajectory::DataContainer::iterator itM = trajectoryMeasurements.begin();
48 
49  // get the innermost valid trajectory state - the corresponding hit must be o.k. as well
50  while ( itM != trajectoryMeasurements.end() )
51  {
52  if ( ( *itM ).updatedState().isValid() && useRecHit( ( *itM ).recHit() ) ) break;
53  ++itM;
54  }
55  if ( itM != trajectoryMeasurements.end() ) result.first = ( *itM ).updatedState();
56 
57  // get the valid RecHits
58  while ( itM != trajectoryMeasurements.end() )
59  {
60  TransientTrackingRecHit::ConstRecHitPointer aRecHit = ( *itM ).recHit();
61  if ( useRecHit( aRecHit ) ) result.second.push_back( aRecHit );
62  ++itM;
63  }
64 
65  return result;
66 }
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory &trajectory) const
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:42
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
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 122 of file TrajectoryFactoryBase.cc.

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

123 {
124  if ( strME == "MultipleScattering" ) return ReferenceTrajectoryBase::multipleScattering;
125  if ( strME == "EnergyLoss" ) return ReferenceTrajectoryBase::energyLoss;
126  if ( strME == "Combined" ) return ReferenceTrajectoryBase::combined;
127  if ( strME == "None" ) return ReferenceTrajectoryBase::none;
128  if ( strME == "BreakPoints" ) return ReferenceTrajectoryBase::breakPoints;
129  if ( strME == "BrokenLines" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
130  if ( strME == "BrokenLinesCoarse" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
131  if ( strME == "BrokenLinesFine" ) return ReferenceTrajectoryBase::brokenLinesFine;
132 
133  throw cms::Exception("BadConfig")
134  << "[TrajectoryFactoryBase::materialEffects] Unknown parameter: " << strME;
135 }
const Trajectory::DataContainer TrajectoryFactoryBase::orderedTrajectoryMeasurements ( const Trajectory trajectory) const
protectedvirtual

Definition at line 70 of file TrajectoryFactoryBase.cc.

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

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

71 {
72  const PropagationDirection dir = trajectory.direction();
73  const bool hitsAreReverse = ( ( dir == thePropDir || thePropDir == anyDirection ) ? false : true );
74 
75  const Trajectory::DataContainer & original = trajectory.measurements();
76 
77  if ( hitsAreReverse )
78  {
79  // Simply use this line instead of the copying by hand?
80  // const Trajectory::DataContainer reordered(original.rbegin(), original.rend());
81  Trajectory::DataContainer reordered;
82  reordered.reserve( original.size() );
83 
84  Trajectory::DataContainer::const_reverse_iterator itM;
85  for ( itM = original.rbegin(); itM != original.rend(); ++itM )
86  {
87  reordered.push_back( *itM );
88  }
89  return reordered;
90  }
91 
92  return original;
93 }
PropagationDirection thePropDir
list original
Definition: definitions.py:57
PropagationDirection
PropagationDirection const & direction() const
Definition: Trajectory.cc:118
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 139 of file TrajectoryFactoryBase.cc.

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

140 {
141  if ( strPD == "oppositeToMomentum" ) return oppositeToMomentum;
142  if ( strPD == "alongMomentum" ) return alongMomentum;
143  if ( strPD == "anyDirection" ) return anyDirection;
144 
145  throw cms::Exception("BadConfig")
146  << "[TrajectoryFactoryBase::propagationDirection] Unknown parameter: " << strPD;
147 }
bool TrajectoryFactoryBase::sameSurface ( const Surface s1,
const Surface s2 
) const
protected

Definition at line 96 of file TrajectoryFactoryBase.cc.

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

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

97 {
98  // - Should use perp2() instead of perp()
99  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
100  return ( s1.eta() == s2.eta() ) && ( s1.phi() == s2.phi() ) && ( s1.position().perp() == s2.position().perp() );
101 }
T perp() const
Definition: PV3DBase.h:72
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 105 of file TrajectoryFactoryBase.cc.

References trackerHitRTTI::isProjected(), theUseInvalidHits, theUseProjectedHits, and theUseWithoutDet.

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

106 {
107  const GeomDet* det = hitPtr->det();
108  if ( !det && !theUseWithoutDet ) return false;
109 
110  if ( !( theUseInvalidHits || hitPtr->isValid() ) ) return false;
111 
112  if ( !theUseProjectedHits )
113  {
114  if(trackerHitRTTI::isProjected(*hitPtr)) return false;
115  }
116 
117  return true;
118 }
bool isProjected(TrackingRecHit const &hit)

Member Data Documentation

const edm::ParameterSet TrajectoryFactoryBase::theConfig
private

Definition at line 64 of file TrajectoryFactoryBase.h.

Referenced by configuration().

MaterialEffects TrajectoryFactoryBase::theMaterialEffects
private

Definition at line 62 of file TrajectoryFactoryBase.h.

Referenced by materialEffects(), and TrajectoryFactoryBase().

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

Definition at line 67 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

bool TrajectoryFactoryBase::theUseProjectedHits
private

Definition at line 68 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

bool TrajectoryFactoryBase::theUseWithoutDet
private

Definition at line 66 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().