CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions
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
}
 
typedef
ReferenceCountingPointer
< ReferenceTrajectoryBase
ReferenceTrajectoryPtr
 

Public Member Functions

virtual DualReferenceTrajectoryclone () const
 
 DualReferenceTrajectory (const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, MaterialEffects materialEffects, PropagationDirection propDir, double mass, bool useBeamSpot, const reco::BeamSpot &beamSpot)
 
virtual ~DualReferenceTrajectory ()
 
- Public Member Functions inherited from ReferenceTrajectoryBase
const AlgebraicMatrixderivatives () const
 
bool isValid ()
 
const AlgebraicMatrixlocalToTrajectory () const
 
const AlgebraicSymMatrixmeasurementErrors () const
 
const AlgebraicVectormeasurements () 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::ConstRecHitContainer
recHits () 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, double mass, MaterialEffects materialEffects, const PropagationDirection propDir, const MagneticField *magField, bool useBeamSpot, const reco::BeamSpot &beamSpot)
 
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
 
 DualReferenceTrajectory (unsigned int nPar, unsigned int nHits)
 
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
 

Additional Inherited Members

- Protected Attributes inherited from ReferenceTrajectoryBase
AlgebraicMatrix theDerivatives
 
AlgebraicMatrix theInnerLocalToTrajectory
 
AlgebraicMatrix theInnerTrajectoryToCurvilinear
 
AlgebraicVector theMeasurements
 
AlgebraicSymMatrix theMeasurementsCov
 
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
< TrajectoryStateOnSurface
theTsosVec
 
bool theValidityFlag
 
- Static Protected Attributes inherited from ReferenceTrajectoryBase
static const 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 referenceTsos,
const ConstRecHitContainer forwardRecHits,
const ConstRecHitContainer backwardRecHits,
const MagneticField magField,
MaterialEffects  materialEffects,
PropagationDirection  propDir,
double  mass,
bool  useBeamSpot,
const reco::BeamSpot beamSpot 
)

Definition at line 11 of file DualReferenceTrajectory.cc.

References construct(), and ReferenceTrajectoryBase::theValidityFlag.

Referenced by clone().

21  numberOfUsedRecHits(forwardRecHits) + numberOfUsedRecHits(backwardRecHits) - 1,
22  0, 0)
23 {
24  theValidityFlag = this->construct( referenceTsos, forwardRecHits, backwardRecHits,
25  mass, materialEffects, propDir, magField, useBeamSpot, beamSpot );
26 }
const LocalTrajectoryParameters & localParameters() const
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)
unsigned int numberOfUsedRecHits(const TransientTrackingRecHit::ConstRecHitContainer &recHits) const
AlgebraicVector5 mixedFormatVector() const
tuple mass
Definition: scaleCards.py:27
virtual bool construct(const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, double mass, MaterialEffects materialEffects, const PropagationDirection propDir, const MagneticField *magField, bool useBeamSpot, const reco::BeamSpot &beamSpot)
virtual DualReferenceTrajectory::~DualReferenceTrajectory ( )
inlinevirtual

Definition at line 52 of file DualReferenceTrajectory.h.

52 {}
DualReferenceTrajectory::DualReferenceTrajectory ( unsigned int  nPar,
unsigned int  nHits 
)
protected

Definition at line 30 of file DualReferenceTrajectory.cc.

31  : ReferenceTrajectoryBase(nPar, nHits, 0, 0)
32 {}
ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits, unsigned int nVirtualPar, unsigned int nVirtualMeas)

Member Function Documentation

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

Implements ReferenceTrajectoryBase.

Reimplemented in DualBzeroReferenceTrajectory.

Definition at line 54 of file DualReferenceTrajectory.h.

References DualReferenceTrajectory().

54 { return new DualReferenceTrajectory(*this); }
DualReferenceTrajectory(const TrajectoryStateOnSurface &referenceTsos, const ConstRecHitContainer &forwardRecHits, const ConstRecHitContainer &backwardRecHits, const MagneticField *magField, MaterialEffects materialEffects, PropagationDirection propDir, double mass, bool useBeamSpot, const reco::BeamSpot &beamSpot)
bool DualReferenceTrajectory::construct ( const TrajectoryStateOnSurface referenceTsos,
const ConstRecHitContainer forwardRecHits,
const ConstRecHitContainer backwardRecHits,
double  mass,
MaterialEffects  materialEffects,
const PropagationDirection  propDir,
const MagneticField magField,
bool  useBeamSpot,
const reco::BeamSpot beamSpot 
)
protectedvirtual

internal method to calculate members

Definition at line 35 of file DualReferenceTrajectory.cc.

References ReferenceTrajectoryBase::breakPoints, ReferenceTrajectoryBase::derivatives(), edm::hlt::Exception, extractParameters(), ReferenceTrajectoryBase::isValid(), ReferenceTrajectoryBase::measurementErrors(), ReferenceTrajectoryBase::measurements(), ReferenceTrajectoryBase::nMeasPerHit, ReferenceTrajectoryBase::numberOfHitMeas(), ReferenceTrajectoryBase::numberOfVirtualMeas(), oppositeDirection(), 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::DualBzeroReferenceTrajectory(), and DualReferenceTrajectory().

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

Reimplemented in DualBzeroReferenceTrajectory.

Definition at line 125 of file DualReferenceTrajectory.cc.

References ReferenceTrajectoryBase::breakPoints, and edm::hlt::Exception.

132 {
133  if (materialEffects >= breakPoints) throw cms::Exception("BadConfig")
134  << "[DualReferenceTrajectory::construct] Wrong MaterialEffects: " << materialEffects;
135 
136  return new ReferenceTrajectory(referenceTsos, recHits, false,
137  magField, materialEffects, propDir, mass,
138  useBeamSpot, beamSpot);
139 }
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
tuple mass
Definition: scaleCards.py:27
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