CMS 3D CMS Logo

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 BzeroReferenceTrajectoryFactoryclone () 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
 
unsigned int tracksPerTrajectory () const
 
 TrajectoryFactoryBase (const edm::ParameterSet &config)
 
 TrajectoryFactoryBase (const edm::ParameterSet &config, unsigned int tracksPerTrajectory)
 
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< TrajectoryStateOnSurfaceExternalPredictionCollection
 
typedef ReferenceTrajectoryBase::MaterialEffects MaterialEffects
 
typedef std::vector< ReferenceTrajectoryPtrReferenceTrajectoryCollection
 
typedef ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
 
typedef std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainerTrajectoryInput
 
- 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 allowZeroMaterial_
 
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.

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 TrajectoryFactories_cff::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 ReferenceTrajectoryBase::Config::allowZeroMaterial, TrajectoryFactoryBase::allowZeroMaterial_, ecalDrivenElectronSeedsParameters_cff::beamSpot, mps_alisetup::config, edm::EventSetup::get(), ReferenceTrajectoryBase::Config::hitsAreReverse, ReferenceTrajectoryBase::Config::includeAPEs, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, DetachedQuadStep_cff::magneticField, TrajectoryFactoryBase::materialEffects(), edm::ESHandle< T >::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  config.allowZeroMaterial = allowZeroMaterial_;
61  // set the flag for reversing the RecHits to false, since they are already in the correct order.
62  config.hitsAreReverse = false;
63  trajectories.push_back(ReferenceTrajectoryPtr(new BzeroReferenceTrajectory(input.first, input.second,
64  magneticField.product(),
65  beamSpot, config)));
66  }
67 
68  ++itTracks;
69  }
70 
71  return trajectories;
72 }
MaterialEffects materialEffects(void) const
Definition: config.py:1
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.
const T & get() const
Definition: EventSetup.h:56
PropagationDirection propagationDirection(void) const
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
T const * product() const
Definition: ESHandle.h:86
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 77 of file BzeroReferenceTrajectoryFactory.cc.

References ReferenceTrajectoryBase::Config::allowZeroMaterial, TrajectoryFactoryBase::allowZeroMaterial_, ecalDrivenElectronSeedsParameters_cff::beamSpot, mps_alisetup::config, DEFINE_EDM_PLUGIN, edm::EventSetup::get(), ReferenceTrajectoryBase::Config::hitsAreReverse, ReferenceTrajectoryBase::Config::includeAPEs, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, DetachedQuadStep_cff::magneticField, TrajectoryFactoryBase::materialEffects(), edm::ESHandle< T >::product(), TrajectoryFactoryBase::propagationDirection(), TrajectoryFactoryBase::sameSurface(), theMass, theMomentumEstimate, trajectories(), ReferenceTrajectoryBase::Config::useBeamSpot, and TrajectoryFactoryBase::useBeamSpot_.

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

Member Data Documentation

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