35 const std::vector<unsigned int> &forwardRecHitNums,
36 const std::vector<unsigned int> &backwardRecHitNums,
44 forwardRecHitNums.
size() + backwardRecHitNums.
size() - 1, 0, 0)
47 forwardRecHitNums, backwardRecHitNums,
48 mass, materialEffects, propDir, magField,
49 useBeamSpot, beamSpot, residualMethod);
63 const std::vector<unsigned int> &forwardRecHitNums,
64 const std::vector<unsigned int> &backwardRecHitNums,
73 mass, materialEffects,
74 propDir, magField, useBeamSpot, beamSpot);
77 mass, materialEffects,
79 useBeamSpot, beamSpot);
85 if (!fwdTraj->isValid() || !bwdTraj->isValid()) {
107 unsigned int nFwdMeas =
nMeasPerHit * fwdTraj->numberOfHits();
108 unsigned int nBwdMeas =
nMeasPerHit * bwdTraj->numberOfHits();
124 bwdTraj->derivatives().sub(
nMeasPerHit+1, nBwdMeas, 1, nParam));
135 return this->
fillKalmanPart(trajMeasurements, forwardRecHitNums,
true, 0, residualMethod)
136 && this->
fillKalmanPart(trajMeasurements, backwardRecHitNums,
false,
137 forwardRecHitNums.size(), residualMethod);
145 const std::vector<unsigned int> &recHitNums,
153 recHits.reserve(recHitNums.size());
154 for (
unsigned int i = 0;
i < recHitNums.size(); ++
i) {
155 recHits.push_back(trajMeasurements[recHitNums[
i]].recHit());
159 magField, materialEffects, propDir, mass,
160 useBeamSpot, beamSpot);
165 const std::vector<unsigned int> &recHitNums,
166 bool startFirst,
unsigned int iNextHit,
182 for (
unsigned int iMeas = (startFirst ? 0 : 1); iMeas < recHitNums.size(); ++iMeas, ++iNextHit) {
186 switch (residualMethod) {
200 <<
"[DualKalmanTrajectory::fillKalmanPart] expect residualMethod == 0, 1 or 2, not "
201 << residualMethod <<
".";
204 if (!tsos.
isValid())
return false;
231 const LocalPoint localMeasurement(hitPtr->localPosition());
235 const LocalError localMeasurementCov(hitErr.xx() + tsosErr.xx(),
236 hitErr.xy() + tsosErr.xy(),
237 hitErr.yy() + tsosErr.yy());
240 theMeasurements[
nMeasPerHit*iHit+1] = localMeasurement.y();
266 const LocalPoint localMeasurement(hitPtr->localPosition());
272 LocalError localMeasurementCov(hitErr.xx(), hitErr.xy(), hitErr.yy());
276 if (hitErr.xx() < tsosErr.xx() || hitErr.yy() < tsosErr.yy()) {
277 edm::LogError(
"Alignment") <<
"@SUB=DualKalmanTrajectory::fillMeasurementAndError2"
278 <<
"not OK in subdet " << hitPtr->geographicalId().subdetId()
279 <<
"\ns_x " <<
sqrt(hitErr.xx()) <<
" " <<
sqrt(tsosErr.xx())
280 <<
"\ns_xy " << hitErr.xy() <<
" " << tsosErr.xy()
281 <<
"\ns_y " <<
sqrt(hitErr.yy()) <<
" " <<
sqrt(tsosErr.yy());
286 localMeasurementCov =
LocalError(hitErr.xx() - tsosErr.xx(),
287 hitErr.xy() - tsosErr.xy(),
288 hitErr.yy() - tsosErr.yy());
318 if (hitPtr->det() && hitPtr->det()->alignmentPositionError()) {
321 return LocalError(errMat[0][0], errMat[0][1], errMat[1][1]);
323 return hitPtr->localPositionError();
const PropagationDirection oppositeDirection(const PropagationDirection propDir) const
void fillTrajectoryPositions(const AlgebraicMatrix &projection, const TrajectoryStateOnSurface &tsos, unsigned int iHit)
fill trajectoryPositions
TrajectoryStateOnSurface fillMeasurementAndError1(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr, unsigned int iHit, const TrajectoryMeasurement &trajMeasurement)
helper for 'unbiased residual' method (i.e. returns merged fwd/bwd states)
bool fillKalmanPart(const Trajectory::DataContainer &trajMeasurements, const std::vector< unsigned int > &recHitNums, bool startFirst, unsigned int iNextHit, int residualMethod)
Fill that part of data members that is different from DualReferenceTrajectory.
const LocalTrajectoryParameters & localParameters() const
virtual AlgebraicVector extractParameters(const TrajectoryStateOnSurface &referenceTsos) const
TrajectoryStateOnSurface forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
static const unsigned int nMeasPerHit
AlgebraicMatrix theDerivatives
const TransientTrackingRecHit::ConstRecHitContainer & recHits() const
ConstRecHitPointer recHit() const
AlgebraicVector theParameters
AlgebraicVector theMeasurements
TrajectoryStateOnSurface fillMeasurementAndError2(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr, unsigned int iHit, const TrajectoryMeasurement &trajMeasurement, bool doPull)
LocalError positionError() const
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
AlgebraicSymMatrix theTrajectoryPositionCov
std::vector< TrajectoryMeasurement > DataContainer
CLHEP::HepMatrix AlgebraicMatrix
TrajectoryStateOnSurface updatedState() const
const AlgebraicSymMatrix55 & matrix() const
AlgebraicVector theTrajectoryPositions
const LocalTrajectoryError & localError() const
TransientTrackingRecHit::ConstRecHitContainer theRecHits
AlgebraicSymMatrix theMeasurementsCov
LocalError hitErrorWithAPE(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
local error including APE if APE is on
std::vector< ConstRecHitPointer > ConstRecHitContainer
CLHEP::HepVector AlgebraicVector
virtual bool construct(const Trajectory::DataContainer &trajMeasurements, const TrajectoryStateOnSurface &referenceTsos, const std::vector< unsigned int > &forwardRecHitNums, const std::vector< unsigned int > &backwardRecHitNums, double mass, MaterialEffects materialEffects, const PropagationDirection propDir, const MagneticField *magField, bool useBeamSpot, const reco::BeamSpot &beamSpot, int residualMethod)
calculate members
AlgebraicVector5 mixedFormatVector() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< TrajectoryStateOnSurface > theTsosVec
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
tuple size
Write out results.
TrajectoryStateOnSurface backwardPredictedState() const
Access to backward predicted state (from smoother)
DualKalmanTrajectory(const Trajectory::DataContainer &trajMeasurements, const TrajectoryStateOnSurface &referenceTsos, const std::vector< unsigned int > &forwardRecHitNums, const std::vector< unsigned int > &backwardRecHitNums, const MagneticField *magField, MaterialEffects materialEffects, PropagationDirection propDir, double mass, bool useBeamSpot, const reco::BeamSpot &beamSpot, int residualMethod)
static AlgebraicSymMatrix parError(const LocalError &le, const GeomDet &det)