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

virtual DualReferenceTrajectoryclone () const
 
 DualReferenceTrajectory (const TrajectoryStateOnSurface &tsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, const reco::BeamSpot &beamSpot, const ReferenceTrajectoryBase::Config &config)
 
virtual ~DualReferenceTrajectory ()
 
- 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
 
virtual ~ReferenceTrajectoryBase ()
 

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 unsigned int nMeasPerHit {2}
 

Detailed Description

Definition at line 35 of file DualReferenceTrajectory.h.

Member Typedef Documentation

Definition at line 40 of file DualReferenceTrajectory.h.

Constructor & Destructor Documentation

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 construct(), and ReferenceTrajectoryBase::theValidityFlag.

16  :
18  numberOfUsedRecHits(forwardRecHits) + numberOfUsedRecHits(backwardRecHits) - 1,
19  0, 0),
20  mass_(config.mass),
22  propDir_(config.propDir),
24 {
25  theValidityFlag = this->construct(tsos, forwardRecHits, backwardRecHits, magField, beamSpot);
26 }
const LocalTrajectoryParameters & localParameters() const
const PropagationDirection propDir_
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
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_
virtual DualReferenceTrajectory::~DualReferenceTrajectory ( )
inlinevirtual

Definition at line 49 of file DualReferenceTrajectory.h.

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

Definition at line 30 of file DualReferenceTrajectory.cc.

32  : ReferenceTrajectoryBase(nPar, nHits, 0, 0),
33  mass_(config.mass),
35  propDir_(config.propDir),
37 {}
const PropagationDirection propDir_
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
const MaterialEffects materialEffects_

Member Function Documentation

virtual DualReferenceTrajectory* DualReferenceTrajectory::clone ( void  ) const
inlinevirtual

Implements ReferenceTrajectoryBase.

Reimplemented in DualBzeroReferenceTrajectory.

Definition at line 51 of file DualReferenceTrajectory.h.

References ecalDrivenElectronSeedsParameters_cff::beamSpot.

51 { 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)
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 40 of file DualReferenceTrajectory.cc.

References ReferenceTrajectoryBase::breakPoints, ReferenceTrajectoryBase::derivatives(), Exception, extractParameters(), ReferenceTrajectoryBase::isValid(), materialEffects_, ReferenceTrajectoryBase::measurementErrors(), ReferenceTrajectoryBase::measurements(), ReferenceTrajectoryBase::nMeasPerHit, 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 DualBzeroReferenceTrajectory::clone(), and DualReferenceTrajectory().

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

References ReferenceTrajectoryBase::breakPoints, mps_alisetup::config, Exception, ReferenceTrajectoryBase::Config::hitsAreReverse, mass_, materialEffects_, oppositeDirection(), propDir_, ReferenceTrajectoryBase::Config::useBeamSpot, and useBeamSpot_.

129 {
130  if (materialEffects_ >= breakPoints) throw cms::Exception("BadConfig")
131  << "[DualReferenceTrajectory::construct] Wrong MaterialEffects: " << materialEffects_;
132 
134  (revertDirection ? oppositeDirection(propDir_): propDir_),
135  mass_);
136  config.useBeamSpot = useBeamSpot_;
137  config.hitsAreReverse = false;
138  return new ReferenceTrajectory(referenceTsos, recHits, magField, beamSpot, config);
139 }
const PropagationDirection propDir_
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
const PropagationDirection oppositeDirection(const PropagationDirection propDir) const
Definition: config.py:1
const MaterialEffects materialEffects_
AlgebraicVector DualReferenceTrajectory::extractParameters ( const TrajectoryStateOnSurface referenceTsos) const
protectedvirtual

Reimplemented in DualBzeroReferenceTrajectory.

Definition at line 143 of file DualReferenceTrajectory.cc.

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

Referenced by construct().

144 {
145  return asHepVector<5>( referenceTsos.localParameters().mixedFormatVector() );
146 }
const LocalTrajectoryParameters & localParameters() const
AlgebraicVector5 mixedFormatVector() const
const PropagationDirection DualReferenceTrajectory::oppositeDirection ( const PropagationDirection  propDir) const
inlineprotected

Member Data Documentation

const double DualReferenceTrajectory::mass_
private

Definition at line 78 of file DualReferenceTrajectory.h.

Referenced by construct().

const MaterialEffects DualReferenceTrajectory::materialEffects_
private

Definition at line 79 of file DualReferenceTrajectory.h.

Referenced by construct().

const PropagationDirection DualReferenceTrajectory::propDir_
private

Definition at line 80 of file DualReferenceTrajectory.h.

Referenced by construct().

const bool DualReferenceTrajectory::useBeamSpot_
private

Definition at line 81 of file DualReferenceTrajectory.h.

Referenced by construct().