test
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
const bool includeAPEs_
 
const bool useBeamSpot_
 

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, mps_alisetup::config, edm::EventSetup::get(), ReferenceTrajectoryBase::Config::hitsAreReverse, ReferenceTrajectoryBase::Config::includeAPEs, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, HLT_25ns10e33_v2_cff::magneticField, TrajectoryFactoryBase::materialEffects(), edm::ESHandle< class >::product(), TrajectoryFactoryBase::propagationDirection(), theMass, theMomentumEstimate, ReferenceTrajectoryBase::Config::useBeamSpot, and TrajectoryFactoryBase::useBeamSpot_.

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  {
58  config.useBeamSpot = useBeamSpot_;
59  config.includeAPEs = includeAPEs_;
60  // set the flag for reversing the RecHits to false, since they are already in the correct order.
61  config.hitsAreReverse = false;
62  trajectories.push_back(ReferenceTrajectoryPtr(new BzeroReferenceTrajectory(input.first, input.second,
63  magneticField.product(),
64  beamSpot, config)));
65  }
66 
67  ++itTracks;
68  }
69 
70  return trajectories;
71 }
MaterialEffects materialEffects(void) const
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 76 of file BzeroReferenceTrajectoryFactory.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, mps_alisetup::config, edm::EventSetup::get(), ReferenceTrajectoryBase::Config::hitsAreReverse, ReferenceTrajectoryBase::Config::includeAPEs, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, HLT_25ns10e33_v2_cff::magneticField, TrajectoryFactoryBase::materialEffects(), edm::ESHandle< class >::product(), TrajectoryFactoryBase::propagationDirection(), TrajectoryFactoryBase::sameSurface(), theMass, theMomentumEstimate, trajectories(), ReferenceTrajectoryBase::Config::useBeamSpot, and TrajectoryFactoryBase::useBeamSpot_.

80 {
82 
83  if ( tracks.size() != external.size() )
84  {
85  edm::LogInfo("ReferenceTrajectories") << "@SUB=BzeroReferenceTrajectoryFactory::trajectories"
86  << "Inconsistent input:\n"
87  << "\tnumber of tracks = " << tracks.size()
88  << "\tnumber of external predictions = " << external.size();
89  return trajectories;
90  }
91 
93  setup.get< IdealMagneticFieldRecord >().get( magneticField );
94 
95  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
96  ExternalPredictionCollection::const_iterator itExternal = external.begin();
97 
98  while ( itTracks != tracks.end() )
99  {
101  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
102  if ( input.first.isValid() )
103  {
104  if ( (*itExternal).isValid() && sameSurface( (*itExternal).surface(), input.first.surface() ) )
105  {
108  config.useBeamSpot = useBeamSpot_;
109  config.includeAPEs = includeAPEs_;
110  // set the flag for reversing the RecHits to false, since they are already in the correct order.
111  config.hitsAreReverse = false;
112  ReferenceTrajectoryPtr refTraj (new BzeroReferenceTrajectory(*itExternal, input.second,
113  magneticField.product(),
114  beamSpot, config));
115 
116  AlgebraicSymMatrix externalParamErrors( asHepMatrix<5>( (*itExternal).localError().matrix() ) );
117  refTraj->setParameterErrors( externalParamErrors.sub( 2, 5 ) );
118 
119  trajectories.push_back( refTraj );
120  }
121  else
122  {
125  config.useBeamSpot = useBeamSpot_;
126  config.includeAPEs = includeAPEs_;
127  // set the flag for reversing the RecHits to false, since they are already in the correct order.
128  config.hitsAreReverse = false;
129  trajectories.push_back(ReferenceTrajectoryPtr(new BzeroReferenceTrajectory(input.first, input.second,
130  magneticField.product(),
131  beamSpot, config)));
132  }
133  }
134 
135  ++itTracks;
136  ++itExternal;
137  }
138 
139  return trajectories;
140 }
MaterialEffects materialEffects(void) const
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