CMS 3D CMS Logo

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, IdealMagneticFieldRecordm_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< 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 15 of file BzeroReferenceTrajectoryFactory.h.

Constructor & Destructor Documentation

◆ BzeroReferenceTrajectoryFactory()

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().

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

◆ ~BzeroReferenceTrajectoryFactory()

BzeroReferenceTrajectoryFactory::~BzeroReferenceTrajectoryFactory ( void  )
override

Definition at line 33 of file BzeroReferenceTrajectoryFactory.cc.

33 {}

Member Function Documentation

◆ clone()

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)

◆ trajectories() [1/2]

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 TrajectoryFactoryBase::allowZeroMaterial_, pwdgSkimBPark_cfi::beamSpot, DMR_cfg::config, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, m_MagFieldToken, HLT_2022v15_cff::magneticField, TrajectoryFactoryBase::materialEffects(), TrajectoryFactoryBase::propagationDirection(), singleTopDQM_cfi::setup, theMass, theMomentumEstimate, tracks, 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;
56  }
57 
58  ++itTracks;
59  }
60 
61  return trajectories;
62 }
dictionary config
Read in AllInOne config in JSON format.
Definition: DMR_cfg.py:21
Definition: config.py:1
MaterialEffects materialEffects(void) const
static std::string const input
Definition: EdmProvDump.cc:50
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
auto const & tracks
cannot be loose
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_MagFieldToken
PropagationDirection propagationDirection(void) const
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection

◆ trajectories() [2/2]

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 TrajectoryFactoryBase::allowZeroMaterial_, pwdgSkimBPark_cfi::beamSpot, DMR_cfg::config, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, m_MagFieldToken, HLT_2022v15_cff::magneticField, TrajectoryFactoryBase::materialEffects(), TrajectoryFactoryBase::propagationDirection(), TrajectoryFactoryBase::sameSurface(), singleTopDQM_cfi::setup, theMass, theMomentumEstimate, tracks, trajectories(), 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;
112  }
113  }
114 
115  ++itTracks;
116  ++itExternal;
117  }
118 
119  return trajectories;
120 }
dictionary config
Read in AllInOne config in JSON format.
Definition: DMR_cfg.py:21
Definition: config.py:1
bool sameSurface(const Surface &s1, const Surface &s2) const
MaterialEffects materialEffects(void) const
static std::string const input
Definition: EdmProvDump.cc:50
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
auto const & tracks
cannot be loose
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_MagFieldToken
CLHEP::HepSymMatrix AlgebraicSymMatrix
PropagationDirection propagationDirection(void) const
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection

Member Data Documentation

◆ m_MagFieldToken

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

Definition at line 31 of file BzeroReferenceTrajectoryFactory.h.

Referenced by trajectories().

◆ theMass

double BzeroReferenceTrajectoryFactory::theMass
private

◆ theMomentumEstimate

double BzeroReferenceTrajectoryFactory::theMomentumEstimate
private