6 using namespace SurfaceSideDefinition;
14 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState constructed on cylinder";
17 for (std::vector<TSOS>::const_iterator
i=tsvec.begin();
i!=tsvec.end();
i++) {
19 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState constructed with invalid state";
21 if unlikely(
i->hasError() != tsvec.front().hasError()) {
22 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState mixes states with and without errors";
24 if unlikely( &
i->surface() != &tsvec.front().surface()) {
25 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryState mixes states with different surfaces";
27 if unlikely(
i->surfaceSide() != tsvec.front().surfaceSide()) {
29 <<
"MultiTrajectoryState mixes states defined before and after material";
31 if unlikely(
i->localParameters().pzSign()*tsvec.front().localParameters().pzSign()<0. ) {
33 <<
"MultiTrajectoryState mixes states with different signs of local p_z";
46 edm::LogError(
"BasicMultiTrajectoryState") <<
"Trying to rescale errors of empty MultiTrajectoryState!";
50 for (std::vector<TSOS>::iterator it =
theStates.begin(); it !=
theStates.end(); it++) {
51 it->rescaleError(factor);
58 const std::vector<TrajectoryStateOnSurface>& tsos =
theStates;
62 <<
"Trying to collapse empty set of trajectory states!";
66 double pzSign = tsos.front().localParameters().pzSign();
67 for (std::vector<TrajectoryStateOnSurface>::const_iterator it = tsos.begin();
68 it != tsos.end(); it++) {
69 if unlikely(it->localParameters().pzSign() != pzSign) {
71 <<
"Trying to collapse trajectory states with different signs on p_z!";
78 tsos.front().localError(),
79 tsos.front().surface(),
80 tsos.front().magneticField(),
81 tsos.front().surfaceSide(),
91 for (std::vector<TrajectoryStateOnSurface>::const_iterator it1 = tsos.begin();
92 it1 != tsos.end(); it1++) {
93 double weight = it1->weight();
96 mean += weight * param;
97 covarPart1 += weight * it1->localError().matrix();
98 for (std::vector<TrajectoryStateOnSurface>::const_iterator it2 = it1 + 1;
99 it2 != tsos.end(); it2++) {
102 covarPart2 += (weight * it2->weight()) *
107 double sumwI = 1.0/sumw;
109 covarPart1 *= sumwI; covarPart2 *= (sumwI*sumwI);
114 tsos.front().surface(),
115 tsos.front().magneticField(),
116 tsos.front().surfaceSide(),
128 "BasicMultiTrajectoryState::update(LocalTrajectoryParameters, Surface, ...) called even if canUpdateLocalParameters() is false");
141 "BasicMultiTrajectoryState::update(LocalTrajectoryParameters, LocalTrajectoryError, ...) called even if canUpdateLocalParameters() is false");
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
ROOT::Math::SMatrix< double, 5, 1, ROOT::Math::MatRepStd< double, 5, 1 > > AlgebraicMatrix51
virtual void update(const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
BasicMultiTrajectoryState()
virtual void update(const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side)
void rescaleError(double factor)
ROOT::Math::SVector< double, 5 > AlgebraicVector5
virtual double weight() const
std::vector< TSOS > theStates
ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > AlgebraicSymMatrix11