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)
 
BzeroReferenceTrajectoryFactoryclone () const override
 
const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
 Produce the reference trajectories. More...
 
const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const override
 
 ~BzeroReferenceTrajectoryFactory () override
 
- 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 23 of file BzeroReferenceTrajectoryFactory.cc.

References theMass, and theMomentumEstimate.

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

Definition at line 31 of file BzeroReferenceTrajectoryFactory.cc.

31 {}

Member Function Documentation

BzeroReferenceTrajectoryFactory* BzeroReferenceTrajectoryFactory::clone ( void  ) const
inlineoverridevirtual
const BzeroReferenceTrajectoryFactory::ReferenceTrajectoryCollection BzeroReferenceTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
overridevirtual

Produce the reference trajectories.

Implements TrajectoryFactoryBase.

Definition at line 34 of file BzeroReferenceTrajectoryFactory.cc.

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

Referenced by trajectories().

35  {
37 
39  setup.get<IdealMagneticFieldRecord>().get(magneticField);
40 
41  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
42 
43  while (itTracks != tracks.end()) {
45  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
46  if (input.first.isValid()) {
48  config.useBeamSpot = useBeamSpot_;
49  config.includeAPEs = includeAPEs_;
50  config.allowZeroMaterial = allowZeroMaterial_;
51  // set the flag for reversing the RecHits to false, since they are already in the correct order.
52  config.hitsAreReverse = false;
53  trajectories.push_back(ReferenceTrajectoryPtr(
54  new BzeroReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
55  }
56 
57  ++itTracks;
58  }
59 
60  return trajectories;
61 }
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
MaterialEffects materialEffects(void) const
Definition: config.py:1
static std::string const input
Definition: EdmProvDump.cc:48
config
Definition: looper.py:291
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
T get() const
Definition: EventSetup.h:71
PropagationDirection propagationDirection(void) const
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
T const * product() const
Definition: ESHandle.h:86
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
const BzeroReferenceTrajectoryFactory::ReferenceTrajectoryCollection BzeroReferenceTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const
overridevirtual

Implements TrajectoryFactoryBase.

Definition at line 64 of file BzeroReferenceTrajectoryFactory.cc.

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

68  {
70 
71  if (tracks.size() != external.size()) {
72  edm::LogInfo("ReferenceTrajectories")
73  << "@SUB=BzeroReferenceTrajectoryFactory::trajectories"
74  << "Inconsistent input:\n"
75  << "\tnumber of tracks = " << tracks.size() << "\tnumber of external predictions = " << external.size();
76  return trajectories;
77  }
78 
80  setup.get<IdealMagneticFieldRecord>().get(magneticField);
81 
82  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
83  ExternalPredictionCollection::const_iterator itExternal = external.begin();
84 
85  while (itTracks != tracks.end()) {
87  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
88  if (input.first.isValid()) {
89  if ((*itExternal).isValid() && sameSurface((*itExternal).surface(), input.first.surface())) {
91  config.useBeamSpot = useBeamSpot_;
92  config.includeAPEs = includeAPEs_;
93  config.allowZeroMaterial = allowZeroMaterial_;
94  // set the flag for reversing the RecHits to false, since they are already in the correct order.
95  config.hitsAreReverse = false;
96  ReferenceTrajectoryPtr refTraj(
97  new BzeroReferenceTrajectory(*itExternal, input.second, magneticField.product(), beamSpot, config));
98 
99  AlgebraicSymMatrix externalParamErrors(asHepMatrix<5>((*itExternal).localError().matrix()));
100  refTraj->setParameterErrors(externalParamErrors.sub(2, 5));
101 
102  trajectories.push_back(refTraj);
103  } else {
105  config.useBeamSpot = useBeamSpot_;
106  config.includeAPEs = includeAPEs_;
107  config.allowZeroMaterial = allowZeroMaterial_;
108  // set the flag for reversing the RecHits to false, since they are already in the correct order.
109  config.hitsAreReverse = false;
110  trajectories.push_back(ReferenceTrajectoryPtr(
111  new BzeroReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
112  }
113  }
114 
115  ++itTracks;
116  ++itExternal;
117  }
118 
119  return trajectories;
120 }
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
MaterialEffects materialEffects(void) const
Definition: config.py:1
static std::string const input
Definition: EdmProvDump.cc:48
config
Definition: looper.py:291
bool sameSurface(const Surface &s1, const Surface &s2) const
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
T get() const
Definition: EventSetup.h:71
PropagationDirection propagationDirection(void) const
CLHEP::HepSymMatrix AlgebraicSymMatrix
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
T const * product() const
Definition: ESHandle.h:86
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection

Member Data Documentation

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