CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
BzeroReferenceTrajectoryFactory Class Reference
Inheritance diagram for BzeroReferenceTrajectoryFactory:
TrajectoryFactoryBase

Public Member Functions

 BzeroReferenceTrajectoryFactory (const edm::ParameterSet &config)
 
virtual
BzeroReferenceTrajectoryFactory
clone () const
 
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 ~BzeroReferenceTrajectoryFactory ()
 
- Public Member Functions inherited from TrajectoryFactoryBase
const MaterialEffects materialEffects (void) const
 
const PropagationDirection propagationDirection (void) const
 
 TrajectoryFactoryBase (const edm::ParameterSet &config)
 
virtual ~TrajectoryFactoryBase (void)
 

Private Attributes

double theMass
 
double theMomentumEstimate
 

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
 
- Protected Attributes inherited from TrajectoryFactoryBase
bool theUseBeamSpot
 

Detailed Description

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

Definition at line 17 of file BzeroReferenceTrajectoryFactory.cc.

Constructor & Destructor Documentation

BzeroReferenceTrajectoryFactory::BzeroReferenceTrajectoryFactory ( const edm::ParameterSet config)

Definition at line 47 of file BzeroReferenceTrajectoryFactory.cc.

References edm::ParameterSet::getParameter(), theMass, theMomentumEstimate, and TrajectoryFactoryBase::theUseBeamSpot.

Referenced by clone().

47  :
48  TrajectoryFactoryBase( config )
49 {
50  theMass = config.getParameter< double >( "ParticleMass" );
51  theMomentumEstimate = config.getParameter< double >( "MomentumEstimate" );
52  theUseBeamSpot = config.getParameter< bool >( "UseBeamSpot" );
53 }
T getParameter(std::string const &) const
TrajectoryFactoryBase(const edm::ParameterSet &config)
BzeroReferenceTrajectoryFactory::~BzeroReferenceTrajectoryFactory ( void  )
virtual

Definition at line 56 of file BzeroReferenceTrajectoryFactory.cc.

56 {}

Member Function Documentation

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

Implements TrajectoryFactoryBase.

Definition at line 34 of file BzeroReferenceTrajectoryFactory.cc.

References BzeroReferenceTrajectoryFactory().

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

Produce the reference trajectories.

Implements TrajectoryFactoryBase.

Definition at line 60 of file BzeroReferenceTrajectoryFactory.cc.

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

Referenced by trajectories().

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

Implements TrajectoryFactoryBase.

Definition at line 94 of file BzeroReferenceTrajectoryFactory.cc.

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

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

Member Data Documentation

double BzeroReferenceTrajectoryFactory::theMass
private
double BzeroReferenceTrajectoryFactory::theMomentumEstimate
private