20 bool useRefittedState,
21 bool constructTsosWithErrors )
30 TransientTrackingRecHit::ConstRecHitContainer::const_reverse_iterator itRecHits;
33 fwdRecHits.first.reserve( recHits.first.size() );
34 for ( itRecHits = recHits.first.rbegin(); itRecHits != recHits.first.rend(); ++itRecHits )
36 fwdRecHits.first.push_back( *itRecHits );
39 fwdRecHits.second.reserve( recHits.second.size() );
40 for ( itRecHits = recHits.second.rbegin(); itRecHits != recHits.second.rend(); ++itRecHits )
42 fwdRecHits.second.push_back( *itRecHits );
46 beamSpot, useRefittedState, constructTsosWithErrors );
51 beamSpot, useRefittedState, constructTsosWithErrors );
67 bool useRefittedState,
68 bool constructTsosWithErrors )
80 propDir, mass,
false, beamSpot);
83 if ( !trajectory1.
isValid() )
return false;
85 int nLocal = deriv.first.num_row();
86 int nTbd = deriv.first.num_col();
99 ReferenceTrajectory trajectory2( tsos.second, recHits.second,
false, field, materialEffects,
100 propDir, mass,
false, beamSpot );
102 if ( !trajectory2.
isValid() )
return false;
126 theDerivatives.sub( rowOffset, colOffset, fullDeriv1.sub( 1, nHitMeas1, 1, nTbd ) );
130 rowOffset += nHitMeas1;
132 theDerivatives.sub( rowOffset, colOffset, fullDeriv2.sub( 1, nHitMeas2, 1, nTbd ) );
133 colOffset += (nPar1 + nMsPar1 + nTbd - nLocal);
136 rowOffset += nHitMeas2;
138 theDerivatives.sub( rowOffset, colOffset, fullDeriv1.sub(nHitMeas1 + 1, nHitMeas1 + nMsMeas1, 1, nTbd ) );
140 theDerivatives.sub( rowOffset, colOffset, trajectory1.
derivatives().sub(nHitMeas1 + 1, nHitMeas1 + nMsMeas1, nLocal + 1, nPar1 + nMsPar1 ) );
142 rowOffset += nMsMeas1;
144 theDerivatives.sub( rowOffset, colOffset, fullDeriv2.sub(nHitMeas2 + 1, nHitMeas2 + nMsMeas2, 1, nTbd ) );
145 colOffset += (nPar1 + nMsPar1 + nTbd - nLocal);
146 theDerivatives.sub( rowOffset, colOffset, trajectory2.
derivatives().sub(nHitMeas2 + 1, nHitMeas2 + nMsMeas2, nLocal + 1, nPar2 + nMsPar2 ) );
168 if ( constructTsosWithErrors )
193 std::vector< TrajectoryStateOnSurface >::const_iterator itTsos;
214 const double coeff = 1
e-2;
221 float dpinv = coeff*( fabs(p.
x()) + fabs(p.
y()) + fabs(p.
z()) )*invP*invP;
222 float dxdir = coeff*( fabs(p.
x()) + fabs(p.
z()) )/p.
z()/p.
z();
223 float dydir = coeff*( fabs(p.
y()) + fabs(p.
z()) )/p.
z()/p.
z();
224 localErrors[0][0] = dpinv*dpinv;
225 localErrors[1][1] = dxdir*dxdir;
226 localErrors[2][2] = dydir*dydir;
unsigned int numberOfHits() const
const LocalTrajectoryParameters & localParameters() const
static const unsigned int nMeasPerHit
AlgebraicMatrix theDerivatives
const AlgebraicVector & parameters(void) const
Get decay parameters.
void constructSingleTsosWithErrors(const TrajectoryStateOnSurface &tsos, int iTsos, const MagneticField *field)
unsigned int numberOfHitMeas() const
TwoBodyDecayTrajectory(void)
std::pair< ConstRecHitContainer, ConstRecHitContainer > ConstRecHitCollection
AlgebraicVector theParameters
const TsosContainer & trajectoryStates(bool useRefittedState=true) const
AlgebraicVector theMeasurements
const AlgebraicSymMatrix & measurementErrors() const
U second(std::pair< T, U > const &p)
unsigned int numberOfMsPar() const
AlgebraicSymMatrix theTrajectoryPositionCov
const AlgebraicMatrix & derivatives() const
const Derivatives & derivatives(void) const
CLHEP::HepMatrix AlgebraicMatrix
bool construct(const TwoBodyDecayTrajectoryState &state, const ConstRecHitCollection &recHits, const MagneticField *field, MaterialEffects materialEffects, PropagationDirection propDir, const reco::BeamSpot &beamSpot, bool useRefittedState, bool constructTsosWithErrors)
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > TsosContainer
double particleMass(void) const
unsigned int theNumberOfHits
AlgebraicVector theTrajectoryPositions
LocalVector momentum() const
Momentum vector in the local frame.
std::pair< int, int > theNumberOfRecHits
TransientTrackingRecHit::ConstRecHitContainer theRecHits
const AlgebraicMatrix & localToTrajectory() const
AlgebraicSymMatrix theMeasurementsCov
const TwoBodyDecayParameters & decayParameters(void) const
std::pair< AlgebraicMatrix, AlgebraicMatrix > Derivatives
unsigned int theNumberOfMsMeas
unsigned int numberOfPar() const
unsigned int numberOfMsMeas() const
void constructTsosVecWithErrors(const ReferenceTrajectory &traj1, const ReferenceTrajectory &traj2, const MagneticField *field)
const AlgebraicSymMatrix & covariance(void) const
Get error matrix.
const AlgebraicVector & measurements() const
const Surface & surface() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< TrajectoryStateOnSurface > theTsosVec
const AlgebraicVector & trajectoryPositions() const
unsigned int theNumberOfPars
unsigned int theNumberOfMsPars
uint32_t dimension(pat::CandKinResolution::Parametrization parametrization)
Returns the number of free parameters in a parametrization (3 or 4)
double signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).
tuple size
Write out results.
const std::vector< TrajectoryStateOnSurface > & trajectoryStates() const