CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
ReferenceTrajectoryFactory Class Reference
Inheritance diagram for ReferenceTrajectoryFactory:
TrajectoryFactoryBase

Public Member Functions

ReferenceTrajectoryFactoryclone () const override
 
 ReferenceTrajectoryFactory (const edm::ParameterSet &config)
 
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...
 
 ~ReferenceTrajectoryFactory () 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)
 

Protected Member Functions

const TrajectoryFactoryBasebzeroFactory () const
 
 ReferenceTrajectoryFactory (const ReferenceTrajectoryFactory &other)
 
- 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

const TrajectoryFactoryBasetheBzeroFactory
 
double theMass
 
bool theUseBzeroIfFieldOff
 
- Protected Attributes inherited from TrajectoryFactoryBase
const bool allowZeroMaterial_
 
const bool includeAPEs_
 
const bool useBeamSpot_
 

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
 

Detailed Description

A factory that produces instances of class ReferenceTrajectory from a given TrajTrackPairCollection. If |B| = 0 T and configuration parameter UseBzeroIfFieldOff is True, hand-over to the BzeroReferenceTrajectoryFactory.

Definition at line 20 of file ReferenceTrajectoryFactory.cc.

Constructor & Destructor Documentation

◆ ReferenceTrajectoryFactory() [1/2]

ReferenceTrajectoryFactory::ReferenceTrajectoryFactory ( const edm::ParameterSet config)

Definition at line 50 of file ReferenceTrajectoryFactory.cc.

52  theMass(config.getParameter<double>("ParticleMass")),
53  theUseBzeroIfFieldOff(config.getParameter<bool>("UseBzeroIfFieldOff")),
54  theBzeroFactory(nullptr) {
55  edm::LogInfo("Alignment") << "@SUB=ReferenceTrajectoryFactory"
56  << "mass: " << theMass
57  << "\nusing Bzero if |B| = 0: " << (theUseBzeroIfFieldOff ? "yes" : "no");
58 }

References theMass, and theUseBzeroIfFieldOff.

Referenced by clone().

◆ ~ReferenceTrajectoryFactory()

ReferenceTrajectoryFactory::~ReferenceTrajectoryFactory ( void  )
override

Definition at line 67 of file ReferenceTrajectoryFactory.cc.

67 { delete theBzeroFactory; }

References theBzeroFactory.

◆ ReferenceTrajectoryFactory() [2/2]

ReferenceTrajectoryFactory::ReferenceTrajectoryFactory ( const ReferenceTrajectoryFactory other)
protected

Definition at line 60 of file ReferenceTrajectoryFactory.cc.

62  theMass(other.theMass),
63  theUseBzeroIfFieldOff(other.theUseBzeroIfFieldOff),
64  theBzeroFactory(nullptr) // copy data members, but no double pointing to same Bzero factory...
65 {}

Member Function Documentation

◆ bzeroFactory()

const TrajectoryFactoryBase * ReferenceTrajectoryFactory::bzeroFactory ( ) const
protected

Definition at line 161 of file ReferenceTrajectoryFactory.cc.

161  {
162  if (!theBzeroFactory) {
163  const edm::ParameterSet &myPset = this->configuration();
164  edm::LogInfo("Alignment") << "@SUB=ReferenceTrajectoryFactory::bzeroFactory"
165  << "Using BzeroReferenceTrajectoryFactory for some (all?) events.";
166  // We take the config of this factory, copy it, replace its name and add
167  // the momentum parameter as expected by BzeroReferenceTrajectoryFactory and create it:
169  pset.copyForModify(myPset);
170  // next two lines not needed, but may help to better understand log file:
171  pset.eraseSimpleParameter("TrajectoryFactoryName");
172  pset.addParameter("TrajectoryFactoryName", std::string("BzeroReferenceTrajectoryFactory"));
173  pset.addParameter("MomentumEstimate", myPset.getParameter<double>("MomentumEstimateFieldOff"));
175  }
176  return theBzeroFactory;
177 }

References TrajectoryFactories_cff::BzeroReferenceTrajectoryFactory, TrajectoryFactoryBase::configuration(), edm::ParameterSet::getParameter(), muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, and theBzeroFactory.

Referenced by trajectories().

◆ clone()

ReferenceTrajectoryFactory* ReferenceTrajectoryFactory::clone ( void  ) const
inlineoverridevirtual

Implements TrajectoryFactoryBase.

Definition at line 35 of file ReferenceTrajectoryFactory.cc.

35 { return new ReferenceTrajectoryFactory(*this); }

References ReferenceTrajectoryFactory().

◆ trajectories() [1/2]

const ReferenceTrajectoryFactory::ReferenceTrajectoryCollection ReferenceTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const
overridevirtual

Implements TrajectoryFactoryBase.

Definition at line 102 of file ReferenceTrajectoryFactory.cc.

106  {
108 
109  if (tracks.size() != external.size()) {
110  edm::LogInfo("ReferenceTrajectories")
111  << "@SUB=ReferenceTrajectoryFactory::trajectories"
112  << "Inconsistent input:\n"
113  << "\tnumber of tracks = " << tracks.size() << "\tnumber of external predictions = " << external.size();
114  return trajectories;
115  }
116 
119  if (theUseBzeroIfFieldOff && magneticField->inTesla(GlobalPoint(0., 0., 0.)).mag2() < 1.e-6) {
120  return this->bzeroFactory()->trajectories(setup, tracks, external, beamSpot);
121  }
122 
123  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
124  ExternalPredictionCollection::const_iterator itExternal = external.begin();
125 
126  while (itTracks != tracks.end()) {
128  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
129  if (input.first.isValid()) {
130  if ((*itExternal).isValid() && sameSurface((*itExternal).surface(), input.first.surface())) {
132  config.useBeamSpot = useBeamSpot_;
133  config.includeAPEs = includeAPEs_;
134  config.allowZeroMaterial = allowZeroMaterial_;
135  // set the flag for reversing the RecHits to false, since they are already in the correct order.
136  config.hitsAreReverse = false;
137  ReferenceTrajectoryPtr refTraj(
138  new ReferenceTrajectory(*itExternal, input.second, magneticField.product(), beamSpot, config));
139 
140  AlgebraicSymMatrix externalParamErrors(asHepMatrix<5>((*itExternal).localError().matrix()));
141  refTraj->setParameterErrors(externalParamErrors);
142  trajectories.push_back(refTraj);
143  } else {
145  config.useBeamSpot = useBeamSpot_;
146  config.includeAPEs = includeAPEs_;
147  config.allowZeroMaterial = allowZeroMaterial_;
148  config.hitsAreReverse = false;
150  new ReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
151  }
152  }
153 
154  ++itTracks;
155  ++itExternal;
156  }
157 
158  return trajectories;
159 }

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

◆ trajectories() [2/2]

const ReferenceTrajectoryFactory::ReferenceTrajectoryCollection ReferenceTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
overridevirtual

Produce the reference trajectories.

Implements TrajectoryFactoryBase.

Definition at line 69 of file ReferenceTrajectoryFactory.cc.

70  {
73  if (theUseBzeroIfFieldOff && magneticField->inTesla(GlobalPoint(0., 0., 0.)).mag2() < 1.e-6) {
74  return this->bzeroFactory()->trajectories(setup, tracks, beamSpot);
75  }
76 
78 
79  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
80 
81  while (itTracks != tracks.end()) {
83 
84  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
85  if (input.first.isValid()) {
87  config.useBeamSpot = useBeamSpot_;
88  config.includeAPEs = includeAPEs_;
89  config.allowZeroMaterial = allowZeroMaterial_;
90  // set the flag for reversing the RecHits to false, since they are already in the correct order.
91  config.hitsAreReverse = false;
93  new ReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
94  }
95 
96  ++itTracks;
97  }
98 
99  return trajectories;
100 }

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

Referenced by trajectories().

Member Data Documentation

◆ theBzeroFactory

const TrajectoryFactoryBase* ReferenceTrajectoryFactory::theBzeroFactory
mutableprotected

Definition at line 43 of file ReferenceTrajectoryFactory.cc.

Referenced by bzeroFactory(), and ~ReferenceTrajectoryFactory().

◆ theMass

double ReferenceTrajectoryFactory::theMass
protected

Definition at line 41 of file ReferenceTrajectoryFactory.cc.

Referenced by ReferenceTrajectoryFactory(), and trajectories().

◆ theUseBzeroIfFieldOff

bool ReferenceTrajectoryFactory::theUseBzeroIfFieldOff
protected

Definition at line 42 of file ReferenceTrajectoryFactory.cc.

Referenced by ReferenceTrajectoryFactory(), and trajectories().

pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
input
static const std::string input
Definition: EdmProvDump.cc:48
TrajectoryFactories_cff.BzeroReferenceTrajectoryFactory
BzeroReferenceTrajectoryFactory
BzeroReferenceTrajectoryFactory.
Definition: TrajectoryFactories_cff.py:50
ReferenceTrajectoryFactory::theUseBzeroIfFieldOff
bool theUseBzeroIfFieldOff
Definition: ReferenceTrajectoryFactory.cc:42
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
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::configuration
const edm::ParameterSet & configuration() const
Definition: TrajectoryFactoryBase.h:47
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 >
ReferenceTrajectoryFactory::ReferenceTrajectoryFactory
ReferenceTrajectoryFactory(const edm::ParameterSet &config)
Definition: ReferenceTrajectoryFactory.cc:50
trackingPlots.other
other
Definition: trackingPlots.py:1464
TrajectoryFactoryBase::propagationDirection
PropagationDirection propagationDirection(void) const
Definition: TrajectoryFactoryBase.h:46
Point3DBase< float, GlobalTag >
ReferenceTrajectoryFactory::bzeroFactory
const TrajectoryFactoryBase * bzeroFactory() const
Definition: ReferenceTrajectoryFactory.cc:161
ReferenceTrajectoryFactory::trajectories
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
Definition: ReferenceTrajectoryFactory.cc:69
TrajectoryFactoryBase::ReferenceTrajectoryCollection
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
Definition: TrajectoryFactoryBase.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
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
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrajectoryFactoryBase::allowZeroMaterial_
const bool allowZeroMaterial_
Definition: TrajectoryFactoryBase.h:72
TrajectoryFactoryBase::trajectories
virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const =0
ReferenceTrajectoryFactory::theMass
double theMass
Definition: ReferenceTrajectoryFactory.cc:41
ReferenceTrajectory
Definition: ReferenceTrajectory.h:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ReferenceTrajectoryFactory::theBzeroFactory
const TrajectoryFactoryBase * theBzeroFactory
Definition: ReferenceTrajectoryFactory.cc:43
TrajectoryFactoryBase::TrajectoryFactoryBase
TrajectoryFactoryBase(const edm::ParameterSet &config)
Definition: TrajectoryFactoryBase.cc:9
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27