52 throw VertexException(
"KinematicConstrainedVertexFitter::input states are less than 2");
56 std::pair<std::vector<RefCountedKinematicParticle>, std::vector<FreeTrajectoryState> >
input = iSort.
sort(
part);
57 const std::vector<RefCountedKinematicParticle> &
particles =
input.first;
58 const std::vector<FreeTrajectoryState> &fStates =
input.second;
81 std::vector<KinematicState> inStates;
82 for (std::vector<RefCountedKinematicParticle>::const_iterator
i =
particles.begin();
i !=
particles.end();
i++) {
85 LogDebug(
"KinematicConstrainedVertexFitter") <<
"State is invalid at point: " << linPoint << std::endl;
89 for (
int j = 1;
j < 8;
j++) {
90 inPar(3 + 7 * nSt +
j) = prPar(
j);
93 inCov.sub(4 + 7 * nSt, 4 + 7 * nSt, l_cov);
94 inStates.push_back(state);
105 inPar(1) = linPoint.
x();
106 inPar(2) = linPoint.
y();
107 inPar(3) = linPoint.
z();
115 std::vector<KinematicState> lStates = inStates;
121 bool convergence =
false;
129 const std::vector<KinematicState> &newStates = lRes.first.first;
131 if (
particles.size() != newStates.size()) {
132 LogDebug(
"KinematicConstrainedVertexFitter") <<
"updator failure\n";
138 double newchisq = rVtx->chiSquared();
141 LogDebug(
"KinematicConstrainedVertexFitter") <<
"bad chisq and insufficient improvement, bailing\n";
151 deltapos[0] = newPoint.
x() - lPoint.
x();
152 deltapos[1] = newPoint.
y() - lPoint.
y();
153 deltapos[2] = newPoint.
z() - lPoint.
z();
154 for (
int i = 0;
i < 3; ++
i) {
155 double delta = deltapos[
i] * deltapos[
i] / rVtx->error().matrix()(
i,
i);
160 for (std::vector<KinematicState>::const_iterator itold = lStates.begin(), itnew = newStates.begin();
161 itnew != newStates.end();
163 for (
int i = 0;
i < 7; ++
i) {
164 double deltapar = itnew->kinematicParameters()(
i) - itold->kinematicParameters()(
i);
165 double delta = deltapar * deltapar / itnew->kinematicParametersError().matrix()(
i,
i);
174 refCCov = lRes.first.second;