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

25  theMass(config.getParameter<double>("ParticleMass")),
26  theMomentumEstimate(config.getParameter<double>("MomentumEstimate")) {
27  edm::LogInfo("Alignment") << "@SUB=BzeroReferenceTrajectoryFactory"
28  << "mass: " << theMass << "\nmomentum: " << theMomentumEstimate;
29 }

References theMass, and theMomentumEstimate.

Referenced by clone().

◆ ~BzeroReferenceTrajectoryFactory()

BzeroReferenceTrajectoryFactory::~BzeroReferenceTrajectoryFactory ( void  )
override

Definition at line 31 of file BzeroReferenceTrajectoryFactory.cc.

31 {}

Member Function Documentation

◆ clone()

BzeroReferenceTrajectoryFactory* BzeroReferenceTrajectoryFactory::clone ( void  ) const
inlineoverridevirtual

Implements TrajectoryFactoryBase.

Definition at line 29 of file BzeroReferenceTrajectoryFactory.h.

29 { return new BzeroReferenceTrajectoryFactory(*this); }

References BzeroReferenceTrajectoryFactory().

◆ trajectories() [1/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 64 of file BzeroReferenceTrajectoryFactory.cc.

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 
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;
111  new BzeroReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
112  }
113  }
114 
115  ++itTracks;
116  ++itExternal;
117  }
118 
119  return trajectories;
120 }

References TrajectoryFactoryBase::allowZeroMaterial_, pwdgSkimBPark_cfi::beamSpot, submitPVResolutionJobs::config, get, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, HLT_FULL_cff::magneticField, TrajectoryFactoryBase::materialEffects(), TrajectoryFactoryBase::propagationDirection(), TrajectoryFactoryBase::sameSurface(), singleTopDQM_cfi::setup, theMass, theMomentumEstimate, tracks, trajectories(), and TrajectoryFactoryBase::useBeamSpot_.

◆ trajectories() [2/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 34 of file BzeroReferenceTrajectoryFactory.cc.

35  {
37 
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;
54  new BzeroReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
55  }
56 
57  ++itTracks;
58  }
59 
60  return trajectories;
61 }

References TrajectoryFactoryBase::allowZeroMaterial_, pwdgSkimBPark_cfi::beamSpot, submitPVResolutionJobs::config, get, TrajectoryFactoryBase::includeAPEs_, TrajectoryFactoryBase::innermostStateAndRecHits(), input, HLT_FULL_cff::magneticField, TrajectoryFactoryBase::materialEffects(), TrajectoryFactoryBase::propagationDirection(), singleTopDQM_cfi::setup, theMass, theMomentumEstimate, tracks, and TrajectoryFactoryBase::useBeamSpot_.

Referenced by trajectories().

Member Data Documentation

◆ theMass

double BzeroReferenceTrajectoryFactory::theMass
private

◆ theMomentumEstimate

double BzeroReferenceTrajectoryFactory::theMomentumEstimate
private
BzeroReferenceTrajectoryFactory::theMomentumEstimate
double theMomentumEstimate
Definition: BzeroReferenceTrajectoryFactory.h:33
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
input
static const std::string input
Definition: EdmProvDump.cc:48
TrajectoryFactoryBase::includeAPEs_
const bool includeAPEs_
Definition: TrajectoryFactoryBase.h:71
ReferenceTrajectoryBase::Config
Definition: ReferenceTrajectoryBase.h:121
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
BzeroReferenceTrajectoryFactory::trajectories
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
Definition: BzeroReferenceTrajectoryFactory.cc:34
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
config
Definition: config.py:1
external
Definition: HEPTopTaggerV2.h:20
TrajectoryFactoryBase::sameSurface
bool sameSurface(const Surface &s1, const Surface &s2) const
Definition: TrajectoryFactoryBase.cc:88
submitPVResolutionJobs.config
config
parse the configuration file
Definition: submitPVResolutionJobs.py:281
TrajectoryFactoryBase::ReferenceTrajectoryPtr
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
Definition: TrajectoryFactoryBase.h:22
TrajectoryFactoryBase::useBeamSpot_
const bool useBeamSpot_
Definition: TrajectoryFactoryBase.h:70
edm::ESHandle< MagneticField >
TrajectoryFactoryBase::propagationDirection
PropagationDirection propagationDirection(void) const
Definition: TrajectoryFactoryBase.h:46
TrajectoryFactoryBase::ReferenceTrajectoryCollection
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
Definition: TrajectoryFactoryBase.h:26
TrajectoryFactoryBase::innermostStateAndRecHits
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
Definition: TrajectoryFactoryBase.cc:37
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
TrajectoryFactoryBase::TrajectoryInput
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
Definition: TrajectoryFactoryBase.h:27
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
TrajectoryFactoryBase::materialEffects
MaterialEffects materialEffects(void) const
Definition: TrajectoryFactoryBase.h:45
BzeroReferenceTrajectoryFactory::theMass
double theMass
Definition: BzeroReferenceTrajectoryFactory.h:32
get
#define get
TrajectoryFactoryBase::allowZeroMaterial_
const bool allowZeroMaterial_
Definition: TrajectoryFactoryBase.h:72
BzeroReferenceTrajectoryFactory::BzeroReferenceTrajectoryFactory
BzeroReferenceTrajectoryFactory(const edm::ParameterSet &config)
Definition: BzeroReferenceTrajectoryFactory.cc:23
BzeroReferenceTrajectory
Definition: BzeroReferenceTrajectory.h:35
TrajectoryFactoryBase::TrajectoryFactoryBase
TrajectoryFactoryBase(const edm::ParameterSet &config)
Definition: TrajectoryFactoryBase.cc:9