11 const BoundPlane* bp = dynamic_cast<const BoundPlane*>(&tsvec.begin()->surface());
14 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState constructed on cylinder";
16 for (
auto i = tsvec.begin();
i != tsvec.end();
i++) {
19 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState constructed with invalid state";
22 UNLIKELY(
i->hasError() != tsvec.front().hasError()) {
23 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState mixes states with and without errors";
26 UNLIKELY(&
i->surface() != &tsvec.front().surface()) {
27 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState mixes states with different surfaces";
30 UNLIKELY(
i->surfaceSide() != tsvec.front().surfaceSide()) {
31 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState mixes states defined before and after material";
34 UNLIKELY(
i->localParameters().pzSign() * tsvec.front().localParameters().pzSign() < 0.) {
35 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState mixes states with different signs of local p_z";
45 edm::LogError(
"BasicMultiTrajectoryState") <<
"Trying to rescale errors of empty MultiTrajectoryState!";
55 const std::vector<TrajectoryStateOnSurface>& tsos =
theStates;
59 edm::LogError(
"MultiTrajectoryStateCombiner") <<
"Trying to collapse empty set of trajectory states!";
63 double pzSign = tsos.front().localParameters().pzSign();
64 for (std::vector<TrajectoryStateOnSurface>::const_iterator it = tsos.begin(); it != tsos.end(); it++) {
66 UNLIKELY(it->localParameters().pzSign() != pzSign) {
68 <<
"Trying to collapse trajectory states with different signs on p_z!";
76 tsos.front().localParameters(),
77 tsos.front().localError(),
78 tsos.front().surface(),
79 tsos.front().magneticField(),
80 tsos.front().surfaceSide());
88 for (
auto it1 = tsos.begin(); it1 != tsos.end(); it1++) {
89 auto weight = it1->weight();
90 auto const& param = it1->localParameters().vector();
93 covarPart1 +=
weight * it1->localError().matrix();
94 for (
auto it2 = it1 + 1; it2 != tsos.end(); it2++) {
96 ROOT::Math::AssignSym::Evaluate(covtmp, ROOT::Math::TensorProd(
diff,
diff));
97 covarPart2 += (
weight * it2->weight()) * covtmp;
100 double sumwI = 1.0 / sumw;
103 covarPart2 *= (sumwI * sumwI);
109 tsos.front().surface(),
110 tsos.front().magneticField(),
111 tsos.front().surfaceSide());
119 "BasicMultiTrajectoryState::update(LocalTrajectoryParameters, Surface, ...) called even if "
120 "canUpdateLocalParameters() is false");
130 "BasicMultiTrajectoryState::update(LocalTrajectoryParameters, LocalTrajectoryError, ...) called "
131 "even if canUpdateLocalParameters() is false");