CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
ReferenceTrajectoryFactory Class Reference

A factory that produces instances of class ReferenceTrajectory from a given TrajTrackPairCollection. More...

Inheritance diagram for ReferenceTrajectoryFactory:
TrajectoryFactoryBase

Public Member Functions

virtual
ReferenceTrajectoryFactory
clone () const
 
 ReferenceTrajectoryFactory (const edm::ParameterSet &config)
 
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const
 Produce the reference trajectories. More...
 
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const
 
virtual ~ReferenceTrajectoryFactory ()
 
- Public Member Functions inherited from TrajectoryFactoryBase
MaterialEffects materialEffects (void) const
 
PropagationDirection propagationDirection (void) const
 
 TrajectoryFactoryBase (const edm::ParameterSet &config)
 
virtual ~TrajectoryFactoryBase (void)
 

Protected Attributes

double theMass
 
- Protected Attributes inherited from TrajectoryFactoryBase
bool theUseBeamSpot
 

Additional Inherited Members

- Public Types inherited from TrajectoryFactoryBase
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
 
- Protected Member Functions inherited from TrajectoryFactoryBase
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
 

Detailed Description

A factory that produces instances of class ReferenceTrajectory from a given TrajTrackPairCollection.

Definition at line 13 of file ReferenceTrajectoryFactory.cc.

Constructor & Destructor Documentation

ReferenceTrajectoryFactory::ReferenceTrajectoryFactory ( const edm::ParameterSet config)

Definition at line 40 of file ReferenceTrajectoryFactory.cc.

References edm::ParameterSet::getParameter(), and theMass.

Referenced by clone().

40  :
41  TrajectoryFactoryBase( config )
42 {
43  theMass = config.getParameter< double >( "ParticleMass" );
44 }
T getParameter(std::string const &) const
TrajectoryFactoryBase(const edm::ParameterSet &config)
ReferenceTrajectoryFactory::~ReferenceTrajectoryFactory ( void  )
virtual

Definition at line 47 of file ReferenceTrajectoryFactory.cc.

47 {}

Member Function Documentation

virtual ReferenceTrajectoryFactory* ReferenceTrajectoryFactory::clone ( void  ) const
inlinevirtual

Implements TrajectoryFactoryBase.

Definition at line 29 of file ReferenceTrajectoryFactory.cc.

References ReferenceTrajectoryFactory().

29 { return new ReferenceTrajectoryFactory(*this); }
ReferenceTrajectoryFactory(const edm::ParameterSet &config)
const ReferenceTrajectoryFactory::ReferenceTrajectoryCollection ReferenceTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
virtual

Produce the reference trajectories.

Implements TrajectoryFactoryBase.

Definition at line 51 of file ReferenceTrajectoryFactory.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, edm::EventSetup::get(), TrajectoryFactoryBase::innermostStateAndRecHits(), LaserDQM_cfg::input, TrajectoryFactoryBase::materialEffects(), edm::ESHandle< class >::product(), TrajectoryFactoryBase::propagationDirection(), theMass, and TrajectoryFactoryBase::theUseBeamSpot.

Referenced by trajectories().

54 {
56 
57  edm::ESHandle< MagneticField > magneticField;
58  setup.get< IdealMagneticFieldRecord >().get( magneticField );
59 
60  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
61 
62  while ( itTracks != tracks.end() )
63  {
64  TrajectoryInput input = this->innermostStateAndRecHits( *itTracks );
65 
66  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
67  if ( input.first.isValid() )
68  {
69  // set the flag for reversing the RecHits to false, since they are already in the correct order.
70  trajectories.push_back(ReferenceTrajectoryPtr(new ReferenceTrajectory(input.first, input.second, false,
71  magneticField.product(), materialEffects(),
74  }
75 
76  ++itTracks;
77  }
78 
79  return trajectories;
80 }
virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const
Produce the reference trajectories.
MaterialEffects materialEffects(void) const
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
PropagationDirection propagationDirection(void) const
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
const ReferenceTrajectoryFactory::ReferenceTrajectoryCollection ReferenceTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const
virtual

Implements TrajectoryFactoryBase.

Definition at line 84 of file ReferenceTrajectoryFactory.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, edm::EventSetup::get(), TrajectoryFactoryBase::innermostStateAndRecHits(), LaserDQM_cfg::input, TrajectoryFactoryBase::materialEffects(), edm::ESHandle< class >::product(), TrajectoryFactoryBase::propagationDirection(), TrajectoryFactoryBase::sameSurface(), theMass, TrajectoryFactoryBase::theUseBeamSpot, and trajectories().

88 {
90 
91  if ( tracks.size() != external.size() )
92  {
93  edm::LogInfo("ReferenceTrajectories") << "@SUB=ReferenceTrajectoryFactory::trajectories"
94  << "Inconsistent input:\n"
95  << "\tnumber of tracks = " << tracks.size()
96  << "\tnumber of external predictions = " << external.size();
97  return trajectories;
98  }
99 
100  edm::ESHandle< MagneticField > magneticField;
101  setup.get< IdealMagneticFieldRecord >().get( magneticField );
102 
103  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
104  ExternalPredictionCollection::const_iterator itExternal = external.begin();
105 
106  while ( itTracks != tracks.end() )
107  {
109  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
110  if ( input.first.isValid() )
111  {
112  if ( (*itExternal).isValid() && sameSurface( (*itExternal).surface(), input.first.surface() ) )
113  {
114  // set the flag for reversing the RecHits to false, since they are already in the correct order.
115  ReferenceTrajectoryPtr refTraj( new ReferenceTrajectory( *itExternal, input.second, false,
116  magneticField.product(), materialEffects(),
119 
120  AlgebraicSymMatrix externalParamErrors( asHepMatrix<5>( (*itExternal).localError().matrix() ) );
121  refTraj->setParameterErrors( externalParamErrors );
122 
123  trajectories.push_back( refTraj );
124  }
125  else
126  {
127  trajectories.push_back(ReferenceTrajectoryPtr(new ReferenceTrajectory(input.first, input.second, false,
128  magneticField.product(), materialEffects(),
131  }
132  }
133 
134  ++itTracks;
135  ++itExternal;
136  }
137 
138  return trajectories;
139 }
virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const
Produce the reference trajectories.
MaterialEffects materialEffects(void) const
bool sameSurface(const Surface &s1, const Surface &s2) const
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
PropagationDirection propagationDirection(void) const
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr

Member Data Documentation

double ReferenceTrajectoryFactory::theMass
protected