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

#include <BzeroReferenceTrajectoryFactory.h>

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 edm::ParameterSetconfiguration () const
 
MaterialEffects materialEffects (void) 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 14 of file BzeroReferenceTrajectoryFactory.h.

Constructor & Destructor Documentation

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

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

Definition at line 24 of file BzeroReferenceTrajectoryFactory.cc.

References theMass, and theMomentumEstimate.

Referenced by clone().

24  :
25  TrajectoryFactoryBase(config),
26  theMass(config.getParameter<double>("ParticleMass")),
27  theMomentumEstimate(config.getParameter<double>("MomentumEstimate"))
28 {
29  edm::LogInfo("Alignment") << "@SUB=BzeroReferenceTrajectoryFactory"
30  << "mass: " << theMass
31  << "\nmomentum: " << theMomentumEstimate;
32 }
T getParameter(std::string const &) const
TrajectoryFactoryBase(const edm::ParameterSet &config)
BzeroReferenceTrajectoryFactory::~BzeroReferenceTrajectoryFactory ( void  )
virtual

Definition at line 34 of file BzeroReferenceTrajectoryFactory.cc.

34 {}

Member Function Documentation

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

Implements TrajectoryFactoryBase.

Definition at line 30 of file BzeroReferenceTrajectoryFactory.h.

References BzeroReferenceTrajectoryFactory().

30 { 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 39 of file BzeroReferenceTrajectoryFactory.cc.

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

Referenced by trajectories().

42 {
44 
46  setup.get< IdealMagneticFieldRecord >().get( magneticField );
47 
48  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
49 
50  while ( itTracks != tracks.end() )
51  {
52  TrajectoryInput input = this->innermostStateAndRecHits( *itTracks );
53  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
54  if ( input.first.isValid() )
55  {
56  // set the flag for reversing the RecHits to false, since they are already in the correct order.
57  trajectories.push_back(ReferenceTrajectoryPtr(new BzeroReferenceTrajectory(input.first, input.second, false,
58  magneticField.product(),
63  }
64 
65  ++itTracks;
66  }
67 
68  return trajectories;
69 }
MaterialEffects materialEffects(void) const
tuple magneticField
static std::string const input
Definition: EdmProvDump.cc:44
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:56
T const * product() const
Definition: ESHandle.h:86
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 74 of file BzeroReferenceTrajectoryFactory.cc.

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

78 {
80 
81  if ( tracks.size() != external.size() )
82  {
83  edm::LogInfo("ReferenceTrajectories") << "@SUB=BzeroReferenceTrajectoryFactory::trajectories"
84  << "Inconsistent input:\n"
85  << "\tnumber of tracks = " << tracks.size()
86  << "\tnumber of external predictions = " << external.size();
87  return trajectories;
88  }
89 
91  setup.get< IdealMagneticFieldRecord >().get( magneticField );
92 
93  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
94  ExternalPredictionCollection::const_iterator itExternal = external.begin();
95 
96  while ( itTracks != tracks.end() )
97  {
99  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
100  if ( input.first.isValid() )
101  {
102  if ( (*itExternal).isValid() && sameSurface( (*itExternal).surface(), input.first.surface() ) )
103  {
104  // set the flag for reversing the RecHits to false, since they are already in the correct order.
105  ReferenceTrajectoryPtr refTraj( new BzeroReferenceTrajectory( *itExternal, input.second, false,
106  magneticField.product(), materialEffects(),
110 
111  AlgebraicSymMatrix externalParamErrors( asHepMatrix<5>( (*itExternal).localError().matrix() ) );
112  refTraj->setParameterErrors( externalParamErrors.sub( 2, 5 ) );
113 
114  trajectories.push_back( refTraj );
115  }
116  else
117  {
118  trajectories.push_back(ReferenceTrajectoryPtr(new BzeroReferenceTrajectory(input.first, input.second, false,
119  magneticField.product(),
120  materialEffects(),
124  }
125  }
126 
127  ++itTracks;
128  ++itExternal;
129  }
130 
131  return trajectories;
132 }
MaterialEffects materialEffects(void) const
tuple magneticField
static std::string const input
Definition: EdmProvDump.cc:44
bool sameSurface(const Surface &s1, const Surface &s2) const
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:56
T const * product() const
Definition: ESHandle.h:86
PropagationDirection propagationDirection(void) const
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr

Member Data Documentation

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