CMS 3D CMS Logo

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

#include <DualReferenceTrajectory.h>

Inheritance diagram for DualReferenceTrajectory:
ReferenceTrajectoryBase ReferenceCounted DualBzeroReferenceTrajectory

Public Types

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

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
 
 DualReferenceTrajectory (unsigned int nPar, unsigned int nHits, const ReferenceTrajectoryBase::Config &config)
 
virtual AlgebraicVector extractParameters (const TrajectoryStateOnSurface &referenceTsos) const
 
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
 

Private Attributes

const double mass_
 
const MaterialEffects materialEffects_
 
const PropagationDirection propDir_
 
const bool useBeamSpot_
 

Additional Inherited Members

- 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
 
- Static Protected Attributes inherited from ReferenceTrajectoryBase
static constexpr unsigned int nMeasPerHit {2}
 

Detailed Description

Definition at line 37 of file DualReferenceTrajectory.h.

Member Typedef Documentation

◆ ConstRecHitContainer

Definition at line 39 of file DualReferenceTrajectory.h.

Constructor & Destructor Documentation

◆ DualReferenceTrajectory() [1/2]

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

Definition at line 11 of file DualReferenceTrajectory.cc.

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

Referenced by clone().

18  numberOfUsedRecHits(forwardRecHits) + numberOfUsedRecHits(backwardRecHits) - 1,
19  0,
20  0),
21  mass_(config.mass),
22  materialEffects_(config.materialEffects),
23  propDir_(config.propDir),
24  useBeamSpot_(config.useBeamSpot) {
25  theValidityFlag = this->construct(tsos, forwardRecHits, backwardRecHits, magField, beamSpot);
26 }
const PropagationDirection propDir_
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
const LocalTrajectoryParameters & localParameters() const
Definition: config.py:1
unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const
AlgebraicVector5 mixedFormatVector() const
virtual bool construct(const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot)
const MaterialEffects materialEffects_

◆ ~DualReferenceTrajectory()

DualReferenceTrajectory::~DualReferenceTrajectory ( )
inlineoverride

Definition at line 48 of file DualReferenceTrajectory.h.

48 {}

◆ DualReferenceTrajectory() [2/2]

DualReferenceTrajectory::DualReferenceTrajectory ( unsigned int  nPar,
unsigned int  nHits,
const ReferenceTrajectoryBase::Config config 
)
protected

Definition at line 28 of file DualReferenceTrajectory.cc.

32  mass_(config.mass),
33  materialEffects_(config.materialEffects),
34  propDir_(config.propDir),
35  useBeamSpot_(config.useBeamSpot) {}
const PropagationDirection propDir_
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
Definition: config.py:1
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
const MaterialEffects materialEffects_

Member Function Documentation

◆ clone()

DualReferenceTrajectory* DualReferenceTrajectory::clone ( void  ) const
inlineoverridevirtual

Implements ReferenceTrajectoryBase.

Definition at line 50 of file DualReferenceTrajectory.h.

References DualReferenceTrajectory().

50 { return new DualReferenceTrajectory(*this); }
DualReferenceTrajectory(const TrajectoryStateOnSurface &tsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const ReferenceTrajectoryBase::Config &config)

◆ construct() [1/2]

bool DualReferenceTrajectory::construct ( const TrajectoryStateOnSurface referenceTsos,
const ConstRecHitContainer forwardRecHits,
const ConstRecHitContainer backwardRecHits,
const MagneticField magField,
const reco::BeamSpot beamSpot 
)
protectedvirtual

internal method to calculate members

Definition at line 37 of file DualReferenceTrajectory.cc.

References pwdgSkimBPark_cfi::beamSpot, ReferenceTrajectoryBase::breakPoints, ReferenceTrajectoryBase::derivatives(), Exception, extractParameters(), ReferenceTrajectoryBase::isValid(), materialEffects_, ReferenceTrajectoryBase::measurementErrors(), ReferenceTrajectoryBase::measurements(), ReferenceTrajectoryBase::nMeasPerHit, pfTracksFromL1TracksBarrel_cfi::nParam, ReferenceTrajectoryBase::numberOfHitMeas(), ReferenceTrajectoryBase::numberOfVirtualMeas(), ReferenceTrajectoryBase::recHits(), ReferenceTrajectoryBase::theDerivatives, ReferenceTrajectoryBase::theMeasurements, ReferenceTrajectoryBase::theMeasurementsCov, ReferenceTrajectoryBase::theNumberOfPars, ReferenceTrajectoryBase::theParameters, ReferenceTrajectoryBase::theRecHits, ReferenceTrajectoryBase::theTrajectoryPositionCov, ReferenceTrajectoryBase::theTrajectoryPositions, ReferenceTrajectoryBase::theTsosVec, ReferenceTrajectoryBase::trajectoryPositionErrors(), ReferenceTrajectoryBase::trajectoryPositions(), and ReferenceTrajectoryBase::trajectoryStates().

Referenced by DualReferenceTrajectory().

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 }
const AlgebraicSymMatrix & measurementErrors() const
unsigned int numberOfHitMeas() const
unsigned int numberOfVirtualMeas() const
const AlgebraicVector & measurements() const
const std::vector< TrajectoryStateOnSurface > & trajectoryStates() const
AlgebraicSymMatrix theTrajectoryPositionCov
virtual AlgebraicVector extractParameters(const TrajectoryStateOnSurface &referenceTsos) const
const AlgebraicVector & trajectoryPositions() const
TransientTrackingRecHit::ConstRecHitContainer theRecHits
AlgebraicSymMatrix theMeasurementsCov
static constexpr unsigned int nMeasPerHit
const AlgebraicSymMatrix & trajectoryPositionErrors() const
std::vector< TrajectoryStateOnSurface > theTsosVec
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
virtual bool construct(const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot)
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
const MaterialEffects materialEffects_
const AlgebraicMatrix & derivatives() const

◆ construct() [2/2]

ReferenceTrajectory * DualReferenceTrajectory::construct ( const TrajectoryStateOnSurface referenceTsos,
const ConstRecHitContainer recHits,
const MagneticField magField,
const reco::BeamSpot beamSpot,
const bool  revertDirection = false 
) const
protectedvirtual

Definition at line 122 of file DualReferenceTrajectory.cc.

References pwdgSkimBPark_cfi::beamSpot, ReferenceTrajectoryBase::breakPoints, DiMuonV_cfg::config, Exception, mass_, materialEffects_, oppositeDirection(), propDir_, ReferenceTrajectoryBase::recHits(), and useBeamSpot_.

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 }
const PropagationDirection propDir_
const PropagationDirection oppositeDirection(const PropagationDirection propDir) const
Definition: config.py:1
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:30
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
const MaterialEffects materialEffects_

◆ extractParameters()

AlgebraicVector DualReferenceTrajectory::extractParameters ( const TrajectoryStateOnSurface referenceTsos) const
protectedvirtual

Reimplemented in DualBzeroReferenceTrajectory.

Definition at line 138 of file DualReferenceTrajectory.cc.

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

Referenced by construct().

138  {
139  return asHepVector<5>(referenceTsos.localParameters().mixedFormatVector());
140 }
const LocalTrajectoryParameters & localParameters() const
AlgebraicVector5 mixedFormatVector() const

◆ oppositeDirection()

const PropagationDirection DualReferenceTrajectory::oppositeDirection ( const PropagationDirection  propDir) const
inlineprotected

Member Data Documentation

◆ mass_

const double DualReferenceTrajectory::mass_
private

Definition at line 76 of file DualReferenceTrajectory.h.

Referenced by construct().

◆ materialEffects_

const MaterialEffects DualReferenceTrajectory::materialEffects_
private

Definition at line 77 of file DualReferenceTrajectory.h.

Referenced by construct().

◆ propDir_

const PropagationDirection DualReferenceTrajectory::propDir_
private

Definition at line 78 of file DualReferenceTrajectory.h.

Referenced by construct().

◆ useBeamSpot_

const bool DualReferenceTrajectory::useBeamSpot_
private

Definition at line 79 of file DualReferenceTrajectory.h.

Referenced by construct().