CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BzeroReferenceTrajectory.cc
Go to the documentation of this file.
1 
3 
6 
9 
10 
13  &recHits, bool hitsAreReverse,
14  const MagneticField *magField,
15  MaterialEffects materialEffects,
16  PropagationDirection propDir,
17  double mass, double momentumEstimate,
18  bool useBeamSpot, const reco::BeamSpot &beamSpot) :
19  ReferenceTrajectory( refTsos.localParameters().mixedFormatVector().kSize, recHits.size(), materialEffects),
20  theMomentumEstimate( momentumEstimate )
21 {
22  // no check against magField == 0
23 
24  // No estimate for momentum of cosmics available -> set to default value.
27 
28  LocalTrajectoryParameters locParamWithFixedMomentum( asSVector<5>(theParameters),
29  refTsos.localParameters().pzSign(),
30  refTsos.localParameters().charge() );
31 
32  const TrajectoryStateOnSurface refTsosWithFixedMomentum(locParamWithFixedMomentum, refTsos.localError(),
33  refTsos.surface(), magField,
34  surfaceSide(propDir));
35 
36  if (hitsAreReverse)
37  {
39  fwdRecHits.reserve(recHits.size());
40 
41  for (TransientTrackingRecHit::ConstRecHitContainer::const_reverse_iterator it=recHits.rbegin(); it != recHits.rend(); ++it)
42  fwdRecHits.push_back(*it);
43 
44  theValidityFlag = this->construct(refTsosWithFixedMomentum, fwdRecHits, mass,
45  materialEffects, propDir, magField,
46  useBeamSpot, beamSpot);
47  } else {
48  theValidityFlag = this->construct(refTsosWithFixedMomentum, recHits, mass,
49  materialEffects, propDir, magField,
50  useBeamSpot, beamSpot);
51  }
52 
53  // Exclude momentum from the parameters and also the derivatives of the measurements w.r.t. the momentum.
54  theParameters = theParameters.sub( 2, 5 );
55  theDerivatives = theDerivatives.sub( 1, theDerivatives.num_row(), 2, theDerivatives.num_col() );
56 }
double pzSign() const
Sign of the z-component of the momentum in the local frame.
const LocalTrajectoryParameters & localParameters() const
virtual bool construct(const TrajectoryStateOnSurface &referenceTsos, const TransientTrackingRecHit::ConstRecHitContainer &recHits, double mass, MaterialEffects materialEffects, const PropagationDirection propDir, const MagneticField *magField, bool useBeamSpot, const reco::BeamSpot &beamSpot)
PropagationDirection
SurfaceSide surfaceSide(const PropagationDirection dir) const
BzeroReferenceTrajectory(const TrajectoryStateOnSurface &referenceTsos, const TransientTrackingRecHit::ConstRecHitContainer &recHits, bool hitsAreReverse, const MagneticField *magField, MaterialEffects materialEffects, PropagationDirection propDir, double mass, double momentumEstimate, bool useBeamSpot, const reco::BeamSpot &beamSpot)
const SurfaceType & surface() const
const LocalTrajectoryError & localError() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
AlgebraicVector5 mixedFormatVector() const
TrackCharge charge() const
Charge (-1, 0 or 1)
CLHEP::HepVector asHepVector(const ROOT::Math::SVector< double, N > &v)
Definition: Migration.h:43
tuple size
Write out results.