22 bool useRefittedState,
23 bool constructTsosWithErrors )
32 TransientTrackingRecHit::ConstRecHitContainer::const_reverse_iterator itRecHits;
35 fwdRecHits.first.reserve( recHits.first.size() );
36 for ( itRecHits = recHits.first.rbegin(); itRecHits != recHits.first.rend(); ++itRecHits )
38 fwdRecHits.first.push_back( *itRecHits );
41 fwdRecHits.second.reserve( recHits.second.size() );
42 for ( itRecHits = recHits.second.rbegin(); itRecHits != recHits.second.rend(); ++itRecHits )
44 fwdRecHits.second.push_back( *itRecHits );
48 beamSpot, useRefittedState, constructTsosWithErrors );
53 beamSpot, useRefittedState, constructTsosWithErrors );
69 bool useRefittedState,
70 bool constructTsosWithErrors )
82 propDir, mass,
false, beamSpot);
85 if ( !trajectory1.
isValid() )
return false;
87 int nLocal = deriv.first.num_row();
88 int nTbd = deriv.first.num_col();
101 ReferenceTrajectory trajectory2( tsos.second, recHits.second,
false, field, materialEffects,
102 propDir, mass,
false, beamSpot );
104 if ( !trajectory2.
isValid() )
return false;
128 theDerivatives.sub( rowOffset, colOffset, fullDeriv1.sub( 1, nHitMeas1, 1, nTbd ) );
130 theDerivatives.sub( rowOffset, colOffset, trajectory1.
derivatives().sub( 1, nHitMeas1, nLocal + 1, nPar1 + nVirtualPar1 ) );
132 rowOffset += nHitMeas1;
134 theDerivatives.sub( rowOffset, colOffset, fullDeriv2.sub( 1, nHitMeas2, 1, nTbd ) );
135 colOffset += (nPar1 + nVirtualPar1 + nTbd - nLocal);
136 theDerivatives.sub( rowOffset, colOffset, trajectory2.
derivatives().sub( 1, nHitMeas2, nLocal + 1, nPar2 + nVirtualPar2 ) );
138 rowOffset += nHitMeas2;
140 theDerivatives.sub( rowOffset, colOffset, fullDeriv1.sub(nHitMeas1 + 1, nHitMeas1 + nVirtualMeas1, 1, nTbd ) );
142 theDerivatives.sub( rowOffset, colOffset, trajectory1.
derivatives().sub(nHitMeas1 + 1, nHitMeas1 + nVirtualMeas1, nLocal + 1, nPar1 + nVirtualPar1 ) );
144 rowOffset += nVirtualMeas1;
146 theDerivatives.sub( rowOffset, colOffset, fullDeriv2.sub(nHitMeas2 + 1, nHitMeas2 + nVirtualMeas2, 1, nTbd ) );
147 colOffset += (nPar1 + nVirtualPar1 + nTbd - nLocal);
148 theDerivatives.sub( rowOffset, colOffset, trajectory2.
derivatives().sub(nHitMeas2 + 1, nHitMeas2 + nVirtualMeas2, nLocal + 1, nPar2 + nVirtualPar2 ) );
153 theMeasurements.sub( nHitMeas1 + nHitMeas2 + nVirtualMeas1 + 1, trajectory2.
measurements().sub(nHitMeas2 + 1, nHitMeas2 + nVirtualMeas2 ) );
171 rowOffset += nVirtualMeas2;
172 int indMass = rowOffset-1;
177 if ( constructTsosWithErrors )
202 std::vector< TrajectoryStateOnSurface >::const_iterator itTsos;
223 const double coeff = 1
e-2;
230 float dpinv = coeff*( fabs(p.
x()) + fabs(p.
y()) + fabs(p.
z()) )*invP*invP;
231 float dxdir = coeff*( fabs(p.
x()) + fabs(p.
z()) )/p.
z()/p.
z();
232 float dydir = coeff*( fabs(p.
y()) + fabs(p.
z()) )/p.
z()/p.
z();
233 localErrors[0][0] = dpinv*dpinv;
234 localErrors[1][1] = dxdir*dxdir;
235 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.
unsigned int theNumberOfVirtualPars
void constructSingleTsosWithErrors(const TrajectoryStateOnSurface &tsos, int iTsos, const MagneticField *field)
unsigned int numberOfHitMeas() const
double primaryWidth(void) const
unsigned int theNumberOfVirtualMeas
TwoBodyDecayTrajectory(void)
unsigned int numberOfVirtualPar() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
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)
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 numberOfPar() const
void constructTsosVecWithErrors(const ReferenceTrajectory &traj1, const ReferenceTrajectory &traj2, const MagneticField *field)
const AlgebraicSymMatrix & covariance(void) const
Get error matrix.
double primaryMass(void) const
unsigned int numberOfVirtualMeas() const
const AlgebraicVector & measurements() const
const Surface & surface() const
std::vector< TrajectoryStateOnSurface > theTsosVec
const AlgebraicVector & trajectoryPositions() const
unsigned int theNumberOfPars
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