CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
DualBzeroReferenceTrajectory Class Reference

#include <DualBzeroReferenceTrajectory.h>

Inheritance diagram for DualBzeroReferenceTrajectory:
DualReferenceTrajectory ReferenceTrajectoryBase ReferenceCounted

Public Types

typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
 
- Public Types inherited from DualReferenceTrajectory
typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
 
- Public Types inherited from ReferenceTrajectoryBase
enum  MaterialEffects {
  none, multipleScattering, energyLoss, combined,
  breakPoints, brokenLinesCoarse, brokenLinesFine, localGBL,
  curvlinGBL
}
 
typedef ReferenceCountingPointer< ReferenceTrajectoryBaseReferenceTrajectoryPtr
 

Public Member Functions

DualBzeroReferenceTrajectoryclone () const override
 
 DualBzeroReferenceTrajectory (const TrajectoryStateOnSurface &tsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const ReferenceTrajectoryBase::Config &config)
 
 ~DualBzeroReferenceTrajectory () override
 
- Public Member Functions inherited from DualReferenceTrajectory
DualReferenceTrajectoryclone () const override
 
 DualReferenceTrajectory (const TrajectoryStateOnSurface &tsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const ReferenceTrajectoryBase::Config &config)
 
 ~DualReferenceTrajectory () override
 
- Public Member Functions inherited from ReferenceTrajectoryBase
const AlgebraicMatrixderivatives () const
 
const Eigen::MatrixXd & gblExtDerivatives () const
 
const Eigen::VectorXd & gblExtMeasurements () const
 
const Eigen::VectorXd & gblExtPrecisions () const
 
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > & gblInput ()
 
bool isValid ()
 
const AlgebraicMatrixlocalToTrajectory () const
 
const AlgebraicSymMatrixmeasurementErrors () const
 
const AlgebraicVectormeasurements () const
 
int nominalField () const
 
unsigned int numberOfHitMeas () const
 
unsigned int numberOfHits () const
 
unsigned int numberOfPar () const
 
unsigned int numberOfVirtualMeas () const
 
unsigned int numberOfVirtualPar () const
 
const AlgebraicSymMatrixparameterErrors () const
 
bool parameterErrorsAvailable () const
 
const AlgebraicVectorparameters () const
 
const TransientTrackingRecHit::ConstRecHitContainerrecHits () const
 
void setParameterErrors (const AlgebraicSymMatrix &error)
 
const AlgebraicSymMatrixtrajectoryPositionErrors () const
 
const AlgebraicVectortrajectoryPositions () const
 
const std::vector< TrajectoryStateOnSurface > & trajectoryStates () const
 
const AlgebraicMatrixtrajectoryToCurv () const
 
 ~ReferenceTrajectoryBase () override
 

Protected Member Functions

virtual bool construct (const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot)
 
virtual ReferenceTrajectoryconstruct (const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &recHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const bool revertDirection=false) const
 
virtual ReferenceTrajectoryconstruct (const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &recHits, double mass, MaterialEffects materialEffects, const PropagationDirection propDir, const MagneticField *magField, bool useBeamSpot, const reco::BeamSpot &beamSpot) const
 
AlgebraicVector extractParameters (const TrajectoryStateOnSurface &referenceTsos) const override
 
- Protected Member Functions inherited from DualReferenceTrajectory
virtual bool construct (const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot)
 
virtual ReferenceTrajectoryconstruct (const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &recHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const bool revertDirection=false) const
 
 DualReferenceTrajectory (unsigned int nPar, unsigned int nHits, const ReferenceTrajectoryBase::Config &config)
 
const PropagationDirection oppositeDirection (const PropagationDirection propDir) const
 
- Protected Member Functions inherited from ReferenceTrajectoryBase
unsigned int numberOfUsedRecHits (const TransientTrackingRecHit::ConstRecHitContainer &recHits) const
 
 ReferenceTrajectoryBase (unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
 
bool useRecHit (const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
 

Protected Attributes

double theMomentumEstimate
 
- Protected Attributes inherited from ReferenceTrajectoryBase
AlgebraicMatrix theDerivatives
 
Eigen::MatrixXd theGblExtDerivatives
 
Eigen::VectorXd theGblExtMeasurements
 
Eigen::VectorXd theGblExtPrecisions
 
std::vector< std::pair< std::vector< gbl::GblPoint >, Eigen::MatrixXd > > theGblInput
 
AlgebraicMatrix theInnerLocalToTrajectory
 
AlgebraicMatrix theInnerTrajectoryToCurvilinear
 
AlgebraicVector theMeasurements
 
AlgebraicSymMatrix theMeasurementsCov
 
int theNomField
 
unsigned int theNumberOfHits
 
unsigned int theNumberOfPars
 
unsigned int theNumberOfVirtualMeas
 
unsigned int theNumberOfVirtualPars
 
bool theParamCovFlag
 
AlgebraicSymMatrix theParameterCov
 
AlgebraicVector theParameters
 
TransientTrackingRecHit::ConstRecHitContainer theRecHits
 
AlgebraicSymMatrix theTrajectoryPositionCov
 
AlgebraicVector theTrajectoryPositions
 
std::vector< TrajectoryStateOnSurfacetheTsosVec
 
bool theValidityFlag
 

Additional Inherited Members

- Static Protected Attributes inherited from ReferenceTrajectoryBase
static constexpr unsigned int nMeasPerHit {2}
 

Detailed Description

Definition at line 37 of file DualBzeroReferenceTrajectory.h.

Member Typedef Documentation

◆ ConstRecHitContainer

Definition at line 39 of file DualBzeroReferenceTrajectory.h.

Constructor & Destructor Documentation

◆ DualBzeroReferenceTrajectory()

DualBzeroReferenceTrajectory::DualBzeroReferenceTrajectory ( const TrajectoryStateOnSurface tsos,
const ConstRecHitContainer forwardRecHits,
const ConstRecHitContainer backwardRecHits,
const MagneticField magField,
const reco::BeamSpot beamSpot,
const ReferenceTrajectoryBase::Config config 
)

Definition at line 12 of file DualBzeroReferenceTrajectory.cc.

19  numberOfUsedRecHits(forwardRecHits) + numberOfUsedRecHits(backwardRecHits) - 1,
20  config),
21  theMomentumEstimate(config.momentumEstimate) {
22  theValidityFlag = construct(tsos, forwardRecHits, backwardRecHits, magField, beamSpot);
23 }

References pwdgSkimBPark_cfi::beamSpot, construct(), and ReferenceTrajectoryBase::theValidityFlag.

Referenced by clone().

◆ ~DualBzeroReferenceTrajectory()

DualBzeroReferenceTrajectory::~DualBzeroReferenceTrajectory ( )
inlineoverride

Definition at line 48 of file DualBzeroReferenceTrajectory.h.

48 {}

Member Function Documentation

◆ clone()

DualBzeroReferenceTrajectory* DualBzeroReferenceTrajectory::clone ( void  ) const
inlineoverridevirtual

Implements ReferenceTrajectoryBase.

Definition at line 50 of file DualBzeroReferenceTrajectory.h.

50 { return new DualBzeroReferenceTrajectory(*this); }

References DualBzeroReferenceTrajectory().

◆ construct() [1/3]

bool DualReferenceTrajectory::construct
protected

internal method to calculate members

Definition at line 37 of file DualReferenceTrajectory.cc.

41  {
43  throw cms::Exception("BadConfig") << "[DualReferenceTrajectory::construct] Wrong MaterialEffects: "
45 
46  ReferenceTrajectoryBase* fwdTraj = construct(refTsos, forwardRecHits, magField, beamSpot);
47 
48  // set flag for opposite direction to true
49  ReferenceTrajectoryBase* bwdTraj = construct(refTsos, backwardRecHits, magField, beamSpot, true);
50 
51  if (!(fwdTraj->isValid() && bwdTraj->isValid())) {
52  delete fwdTraj;
53  delete bwdTraj;
54  return false;
55  }
56 
57  //
58  // Combine both reference trajactories to a dual reference trajectory
59  //
60 
61  const std::vector<TrajectoryStateOnSurface>& fwdTsosVec = fwdTraj->trajectoryStates();
62  const std::vector<TrajectoryStateOnSurface>& bwdTsosVec = bwdTraj->trajectoryStates();
63  theTsosVec.insert(theTsosVec.end(), fwdTsosVec.begin(), fwdTsosVec.end());
64  theTsosVec.insert(theTsosVec.end(), ++bwdTsosVec.begin(), bwdTsosVec.end());
65 
66  const ConstRecHitContainer& fwdRecHits = fwdTraj->recHits();
67  const ConstRecHitContainer& bwdRecHits = bwdTraj->recHits();
68  theRecHits.insert(theRecHits.end(), fwdRecHits.begin(), fwdRecHits.end());
69  theRecHits.insert(theRecHits.end(), ++bwdRecHits.begin(), bwdRecHits.end());
70 
72 
73  unsigned int nParam = theNumberOfPars;
74  unsigned int nFwdMeas = fwdTraj->numberOfHitMeas();
75  unsigned int nBwdMeas = bwdTraj->numberOfHitMeas();
76  unsigned int nFwdBP = fwdTraj->numberOfVirtualMeas();
77  unsigned int nBwdBP = bwdTraj->numberOfVirtualMeas();
78  unsigned int nMeas = nFwdMeas + nBwdMeas - nMeasPerHit;
79 
80  theMeasurements.sub(1, fwdTraj->measurements().sub(1, nFwdMeas));
81  theMeasurements.sub(nFwdMeas + 1, bwdTraj->measurements().sub(nMeasPerHit + 1, nBwdMeas));
82 
83  theMeasurementsCov.sub(1, fwdTraj->measurementErrors().sub(1, nFwdMeas));
84  theMeasurementsCov.sub(nFwdMeas + 1, bwdTraj->measurementErrors().sub(nMeasPerHit + 1, nBwdMeas));
85 
87  theTrajectoryPositions.sub(nFwdMeas + 1, bwdTraj->trajectoryPositions().sub(nMeasPerHit + 1, nBwdMeas));
88 
90  theTrajectoryPositionCov.sub(nFwdMeas + 1, bwdTraj->trajectoryPositionErrors().sub(nMeasPerHit + 1, nBwdMeas));
91 
92  theDerivatives.sub(1, 1, fwdTraj->derivatives().sub(1, nFwdMeas, 1, nParam));
93  theDerivatives.sub(nFwdMeas + 1, 1, bwdTraj->derivatives().sub(nMeasPerHit + 1, nBwdMeas, 1, nParam));
94 
95  // for the break points
96  // DUAL with break points makes no sense: (MS) correlations between the two parts are lost !
97  if (nFwdBP > 0) {
98  theMeasurements.sub(nMeas + 1, fwdTraj->measurements().sub(nFwdMeas + 1, nFwdMeas + nFwdBP));
99  theMeasurementsCov.sub(nMeas + 1, fwdTraj->measurementErrors().sub(nFwdMeas + 1, nFwdMeas + nFwdBP));
100  theDerivatives.sub(1, nParam + 1, fwdTraj->derivatives().sub(1, nFwdMeas, nParam + 1, nParam + nFwdBP));
101  theDerivatives.sub(nMeas + 1,
102  nParam + 1,
103  fwdTraj->derivatives().sub(nFwdMeas + 1, nFwdMeas + nFwdBP, nParam + 1, nParam + nFwdBP));
104  }
105  if (nBwdBP > 0) {
106  theMeasurements.sub(nMeas + nFwdBP + 1, bwdTraj->measurements().sub(nBwdMeas + 1, nBwdMeas + nBwdBP));
107  theMeasurementsCov.sub(nMeas + nFwdBP + 1, bwdTraj->measurementErrors().sub(nBwdMeas + 1, nBwdMeas + nBwdBP));
108  theDerivatives.sub(nFwdMeas + 1,
109  nParam + nFwdBP + 1,
110  bwdTraj->derivatives().sub(nMeasPerHit + 1, nBwdMeas, nParam + 1, nParam + nBwdBP));
111  theDerivatives.sub(nMeas + nFwdBP + 1,
112  nParam + nFwdBP + 1,
113  bwdTraj->derivatives().sub(nBwdMeas + 1, nBwdMeas + nBwdBP, nParam + 1, nParam + nBwdBP));
114  }
115 
116  delete fwdTraj;
117  delete bwdTraj;
118 
119  return true;
120 }

◆ construct() [2/3]

ReferenceTrajectory * DualReferenceTrajectory::construct
protected

Definition at line 122 of file DualReferenceTrajectory.cc.

126  {
128  throw cms::Exception("BadConfig") << "[DualReferenceTrajectory::construct] Wrong MaterialEffects: "
129  << materialEffects_;
130 
132  materialEffects_, (revertDirection ? oppositeDirection(propDir_) : propDir_), mass_);
133  config.useBeamSpot = useBeamSpot_;
134  config.hitsAreReverse = false;
135  return new ReferenceTrajectory(referenceTsos, recHits, magField, beamSpot, config);
136 }

◆ construct() [3/3]

ReferenceTrajectory * DualBzeroReferenceTrajectory::construct ( const TrajectoryStateOnSurface referenceTsos,
const ConstRecHitContainer recHits,
double  mass,
MaterialEffects  materialEffects,
const PropagationDirection  propDir,
const MagneticField magField,
bool  useBeamSpot,
const reco::BeamSpot beamSpot 
) const
protectedvirtual

Definition at line 25 of file DualBzeroReferenceTrajectory.cc.

32  {
33  if (materialEffects >= breakPoints)
34  throw cms::Exception("BadConfig") << "[DualBzeroReferenceTrajectory::construct] Wrong MaterialEffects: "
35  << materialEffects;
36 
38  config.useBeamSpot = useBeamSpot;
39  config.hitsAreReverse = false;
40  return new BzeroReferenceTrajectory(referenceTsos, recHits, magField, beamSpot, config);
41 }

References pwdgSkimBPark_cfi::beamSpot, ReferenceTrajectoryBase::breakPoints, submitPVResolutionJobs::config, Exception, EgHLTOffHistBins_cfi::mass, ReferenceTrajectoryBase::recHits(), theMomentumEstimate, and HLT_FULL_cff::useBeamSpot.

Referenced by DualBzeroReferenceTrajectory().

◆ extractParameters()

AlgebraicVector DualBzeroReferenceTrajectory::extractParameters ( const TrajectoryStateOnSurface referenceTsos) const
overrideprotectedvirtual

Reimplemented from DualReferenceTrajectory.

Definition at line 43 of file DualBzeroReferenceTrajectory.cc.

43  {
44  AlgebraicVector param = asHepVector<5>(referenceTsos.localParameters().mixedFormatVector());
45  return param.sub(2, 5);
46 }

References TrajectoryStateOnSurface::localParameters(), and LocalTrajectoryParameters::mixedFormatVector().

Member Data Documentation

◆ theMomentumEstimate

double DualBzeroReferenceTrajectory::theMomentumEstimate
protected

Definition at line 66 of file DualBzeroReferenceTrajectory.h.

Referenced by construct().

ReferenceTrajectoryBase::recHits
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
Definition: ReferenceTrajectoryBase.h:215
ReferenceTrajectoryBase::derivatives
const AlgebraicMatrix & derivatives() const
Definition: ReferenceTrajectoryBase.h:164
pfTracksFromL1Tracks_cfi.nParam
nParam
Definition: pfTracksFromL1Tracks_cfi.py:5
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
DualReferenceTrajectory::materialEffects_
const MaterialEffects materialEffects_
Definition: DualReferenceTrajectory.h:77
ReferenceTrajectoryBase::measurementErrors
const AlgebraicSymMatrix & measurementErrors() const
Definition: ReferenceTrajectoryBase.h:150
ReferenceTrajectoryBase
Definition: ReferenceTrajectoryBase.h:105
DualReferenceTrajectory::useBeamSpot_
const bool useBeamSpot_
Definition: DualReferenceTrajectory.h:79
ReferenceTrajectoryBase::theDerivatives
AlgebraicMatrix theDerivatives
Definition: ReferenceTrajectoryBase.h:255
ReferenceTrajectoryBase::Config
Definition: ReferenceTrajectoryBase.h:121
ReferenceTrajectoryBase::theTrajectoryPositionCov
AlgebraicSymMatrix theTrajectoryPositionCov
Definition: ReferenceTrajectoryBase.h:250
DualReferenceTrajectory::oppositeDirection
const PropagationDirection oppositeDirection(const PropagationDirection propDir) const
Definition: DualReferenceTrajectory.h:71
ReferenceTrajectoryBase::numberOfHitMeas
unsigned int numberOfHitMeas() const
Definition: ReferenceTrajectoryBase.h:221
ReferenceTrajectoryBase::numberOfVirtualMeas
unsigned int numberOfVirtualMeas() const
Definition: ReferenceTrajectoryBase.h:219
ReferenceTrajectoryBase::theMeasurements
AlgebraicVector theMeasurements
Definition: ReferenceTrajectoryBase.h:246
DualBzeroReferenceTrajectory::theMomentumEstimate
double theMomentumEstimate
Definition: DualBzeroReferenceTrajectory.h:66
ReferenceTrajectoryBase::measurements
const AlgebraicVector & measurements() const
Definition: ReferenceTrajectoryBase.h:146
ReferenceTrajectoryBase::trajectoryStates
const std::vector< TrajectoryStateOnSurface > & trajectoryStates() const
Definition: ReferenceTrajectoryBase.h:210
config
Definition: config.py:1
ReferenceTrajectoryBase::theParameters
AlgebraicVector theParameters
Definition: ReferenceTrajectoryBase.h:252
ReferenceTrajectoryBase::numberOfUsedRecHits
unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const
Definition: ReferenceTrajectoryBase.cc:28
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
submitPVResolutionJobs.config
config
parse the configuration file
Definition: submitPVResolutionJobs.py:281
DualReferenceTrajectory::DualReferenceTrajectory
DualReferenceTrajectory(const TrajectoryStateOnSurface &tsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const ReferenceTrajectoryBase::Config &config)
Definition: DualReferenceTrajectory.cc:11
ReferenceTrajectoryBase::theMeasurementsCov
AlgebraicSymMatrix theMeasurementsCov
Definition: ReferenceTrajectoryBase.h:247
ReferenceTrajectoryBase::theTrajectoryPositions
AlgebraicVector theTrajectoryPositions
Definition: ReferenceTrajectoryBase.h:249
ReferenceTrajectoryBase::trajectoryPositions
const AlgebraicVector & trajectoryPositions() const
Definition: ReferenceTrajectoryBase.h:155
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
DualBzeroReferenceTrajectory::construct
virtual ReferenceTrajectory * construct(const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &recHits, double mass, MaterialEffects materialEffects, const PropagationDirection propDir, const MagneticField *magField, bool useBeamSpot, const reco::BeamSpot &beamSpot) const
Definition: DualBzeroReferenceTrajectory.cc:25
ReferenceTrajectoryBase::nMeasPerHit
static constexpr unsigned int nMeasPerHit
Definition: ReferenceTrajectoryBase.h:269
ReferenceTrajectoryBase::theRecHits
TransientTrackingRecHit::ConstRecHitContainer theRecHits
Definition: ReferenceTrajectoryBase.h:244
ReferenceTrajectoryBase::breakPoints
Definition: ReferenceTrajectoryBase.h:114
ReferenceTrajectoryBase::trajectoryPositionErrors
const AlgebraicSymMatrix & trajectoryPositionErrors() const
Definition: ReferenceTrajectoryBase.h:159
LocalTrajectoryParameters::mixedFormatVector
AlgebraicVector5 mixedFormatVector() const
Definition: LocalTrajectoryParameters.h:135
DualBzeroReferenceTrajectory::DualBzeroReferenceTrajectory
DualBzeroReferenceTrajectory(const TrajectoryStateOnSurface &tsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const ReferenceTrajectoryBase::Config &config)
Definition: DualBzeroReferenceTrajectory.cc:12
ConstRecHitContainer
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
Definition: MillePedeAlignmentAlgorithm.cc:69
HLT_FULL_cff.useBeamSpot
useBeamSpot
Definition: HLT_FULL_cff.py:26535
ReferenceTrajectory
Definition: ReferenceTrajectory.h:55
Exception
Definition: hltDiff.cc:245
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
DualReferenceTrajectory::mass_
const double mass_
Definition: DualReferenceTrajectory.h:76
ReferenceTrajectoryBase::theNumberOfPars
unsigned int theNumberOfPars
Definition: ReferenceTrajectoryBase.h:239
ReferenceTrajectoryBase::theTsosVec
std::vector< TrajectoryStateOnSurface > theTsosVec
Definition: ReferenceTrajectoryBase.h:243
BzeroReferenceTrajectory
Definition: BzeroReferenceTrajectory.h:35
DualBzeroReferenceTrajectory::extractParameters
AlgebraicVector extractParameters(const TrajectoryStateOnSurface &referenceTsos) const override
Definition: DualBzeroReferenceTrajectory.cc:43
ReferenceTrajectoryBase::isValid
bool isValid()
Definition: ReferenceTrajectoryBase.h:142
DualReferenceTrajectory::propDir_
const PropagationDirection propDir_
Definition: DualReferenceTrajectory.h:78
ReferenceTrajectoryBase::theValidityFlag
bool theValidityFlag
Definition: ReferenceTrajectoryBase.h:235