CMS 3D CMS Logo

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

#include <BzeroReferenceTrajectoryFactory.h>

Inheritance diagram for BzeroReferenceTrajectoryFactory:
TrajectoryFactoryBase

Public Member Functions

 BzeroReferenceTrajectoryFactory (const edm::ParameterSet &config, edm::ConsumesCollector &iC)
 
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, const edm::ConsumesCollector &iC)
 
 TrajectoryFactoryBase (const edm::ParameterSet &config, unsigned int tracksPerTrajectory, const edm::ConsumesCollector &iC)
 
virtual ~TrajectoryFactoryBase (void)
 

Public Attributes

const edm::ESGetToken
< MagneticField,
IdealMagneticFieldRecord
m_MagFieldToken
 

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

Detailed Description

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

Definition at line 15 of file BzeroReferenceTrajectoryFactory.h.

Constructor & Destructor Documentation

BzeroReferenceTrajectoryFactory::BzeroReferenceTrajectoryFactory ( const edm::ParameterSet config,
edm::ConsumesCollector iC 
)

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

Definition at line 23 of file BzeroReferenceTrajectoryFactory.cc.

References theMass, and theMomentumEstimate.

Referenced by clone().

25  : TrajectoryFactoryBase(config, iC),
27  theMass(config.getParameter<double>("ParticleMass")),
28  theMomentumEstimate(config.getParameter<double>("MomentumEstimate")) {
29  edm::LogInfo("Alignment") << "@SUB=BzeroReferenceTrajectoryFactory"
30  << "mass: " << theMass << "\nmomentum: " << theMomentumEstimate;
31 }
Log< level::Info, false > LogInfo
TrajectoryFactoryBase(const edm::ParameterSet &config, const edm::ConsumesCollector &iC)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_MagFieldToken
BzeroReferenceTrajectoryFactory::~BzeroReferenceTrajectoryFactory ( void  )
override

Definition at line 33 of file BzeroReferenceTrajectoryFactory.cc.

33 {}

Member Function Documentation

BzeroReferenceTrajectoryFactory* BzeroReferenceTrajectoryFactory::clone ( void  ) const
inlineoverridevirtual

Implements TrajectoryFactoryBase.

Definition at line 29 of file BzeroReferenceTrajectoryFactory.h.

References BzeroReferenceTrajectoryFactory().

29 { return new BzeroReferenceTrajectoryFactory(*this); }
BzeroReferenceTrajectoryFactory(const edm::ParameterSet &config, edm::ConsumesCollector &iC)
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 36 of file BzeroReferenceTrajectoryFactory.cc.

References ReferenceTrajectoryBase::Config::allowZeroMaterial, TrajectoryFactoryBase::allowZeroMaterial_, submitPVResolutionJobs::config, edm::EventSetup::getData(), ReferenceTrajectoryBase::Config::hitsAreReverse, ReferenceTrajectoryBase::Config::includeAPEs, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, m_MagFieldToken, HLT_FULL_cff::magneticField, TrajectoryFactoryBase::materialEffects(), TrajectoryFactoryBase::propagationDirection(), theMass, theMomentumEstimate, ReferenceTrajectoryBase::Config::useBeamSpot, and TrajectoryFactoryBase::useBeamSpot_.

Referenced by trajectories().

37  {
39 
41 
42  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
43 
44  while (itTracks != tracks.end()) {
46  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
47  if (input.first.isValid()) {
49  config.useBeamSpot = useBeamSpot_;
50  config.includeAPEs = includeAPEs_;
51  config.allowZeroMaterial = allowZeroMaterial_;
52  // set the flag for reversing the RecHits to false, since they are already in the correct order.
53  config.hitsAreReverse = false;
54  trajectories.push_back(ReferenceTrajectoryPtr(
55  new BzeroReferenceTrajectory(input.first, input.second, magneticField, beamSpot, config)));
56  }
57 
58  ++itTracks;
59  }
60 
61  return trajectories;
62 }
MaterialEffects materialEffects(void) const
tuple magneticField
auto const & tracks
cannot be loose
static std::string const input
Definition: EdmProvDump.cc:47
bool getData(T &iHolder) const
Definition: EventSetup.h:128
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_MagFieldToken
tuple config
parse the configuration file
PropagationDirection propagationDirection(void) const
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
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 65 of file BzeroReferenceTrajectoryFactory.cc.

References ReferenceTrajectoryBase::Config::allowZeroMaterial, TrajectoryFactoryBase::allowZeroMaterial_, submitPVResolutionJobs::config, edm::EventSetup::getData(), ReferenceTrajectoryBase::Config::hitsAreReverse, ReferenceTrajectoryBase::Config::includeAPEs, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, m_MagFieldToken, HLT_FULL_cff::magneticField, TrajectoryFactoryBase::materialEffects(), TrajectoryFactoryBase::propagationDirection(), TrajectoryFactoryBase::sameSurface(), theMass, theMomentumEstimate, trajectories(), ReferenceTrajectoryBase::Config::useBeamSpot, and TrajectoryFactoryBase::useBeamSpot_.

69  {
71 
72  if (tracks.size() != external.size()) {
73  edm::LogInfo("ReferenceTrajectories")
74  << "@SUB=BzeroReferenceTrajectoryFactory::trajectories"
75  << "Inconsistent input:\n"
76  << "\tnumber of tracks = " << tracks.size() << "\tnumber of external predictions = " << external.size();
77  return trajectories;
78  }
79 
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, 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, beamSpot, config)));
112  }
113  }
114 
115  ++itTracks;
116  ++itExternal;
117  }
118 
119  return trajectories;
120 }
MaterialEffects materialEffects(void) const
tuple magneticField
auto const & tracks
cannot be loose
static std::string const input
Definition: EdmProvDump.cc:47
bool getData(T &iHolder) const
Definition: EventSetup.h:128
bool sameSurface(const Surface &s1, const Surface &s2) const
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
Log< level::Info, false > LogInfo
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_MagFieldToken
tuple config
parse the configuration file
PropagationDirection propagationDirection(void) const
CLHEP::HepSymMatrix AlgebraicSymMatrix
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection

Member Data Documentation

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> BzeroReferenceTrajectoryFactory::m_MagFieldToken

Definition at line 31 of file BzeroReferenceTrajectoryFactory.h.

Referenced by trajectories().

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