22 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
32 std::vector<SingleGaussianState1D> pxStates;
33 pxStates.reserve(numb);
34 std::vector<SingleGaussianState1D> pyStates;
35 pyStates.reserve(numb);
36 std::vector<SingleGaussianState1D> pzStates;
37 pzStates.reserve(numb);
39 for (std::vector<TrajectoryStateOnSurface>::const_iterator ic =
components.begin(); ic !=
components.end(); ++ic) {
69 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
80 std::vector<SingleGaussianState1D> xStates;
81 xStates.reserve(numb);
82 std::vector<SingleGaussianState1D> yStates;
83 yStates.reserve(numb);
84 std::vector<SingleGaussianState1D> zStates;
85 zStates.reserve(numb);
87 for (std::vector<TrajectoryStateOnSurface>::const_iterator ic =
components.begin(); ic !=
components.end(); ++ic) {
117 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
129 for (
unsigned int iv = 0; iv < 3; ++iv) {
135 if (!
utils.modeIsValid())
158 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
172 qpMode =
utils.mode().mean();
173 if (!
utils.modeIsValid())
174 qpMode =
utils.mean();
176 momentum = 1. / fabs(qpMode);
186 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
194 std::vector<SingleGaussianState1D> states(qpMultiState.
components());
196 for (
unsigned int i = 0;
i < states.size(); ++
i) {
198 double wgt = qpState.
weight();
199 double qp = qpState.
mean();
201 double p = 1. / fabs(qp);
202 double varP =
p *
p *
p *
p * varQp;
208 momentum =
utils.mode().mean();
209 if (!
utils.modeIsValid())
210 momentum =
utils.mean();
221 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
232 for (
unsigned int iv = 3; iv < 5; ++iv) {
238 if (!
utils.modeIsValid())
258 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
268 std::vector<SingleGaussianState1D> pStates;
269 pStates.reserve(numb);
270 std::vector<SingleGaussianState1D> phiStates;
271 phiStates.reserve(numb);
272 std::vector<SingleGaussianState1D> etaStates;
273 etaStates.reserve(numb);
279 for (std::vector<TrajectoryStateOnSurface>::const_iterator ic =
components.begin(); ic !=
components.end(); ++ic) {
285 auto op = 1. / mom.mag();
286 auto opt2 = 1. / mom.perp2();
287 auto phi = mom.phi();
288 auto eta = mom.eta();
290 jacobian(0, 0) =
px * op;
291 jacobian(0, 1) =
py * op;
292 jacobian(0, 2) = pz * op;
293 jacobian(1, 0) =
py * opt2;
294 jacobian(1, 1) = -
px * opt2;
296 jacobian(2, 0) =
px * pz * opt2 * op;
297 jacobian(2, 1) =
py * pz * opt2 * op;
298 jacobian(2, 2) = -op;
302 covPPhiEta = ROOT::Math::Similarity(jacobian, covCart);
324 auto pt =
p * 2 * tanth2 / (1 + tanth2 * tanth2);
325 auto pz =
p * (1 - tanth2 * tanth2) / (1 + tanth2 * tanth2);
336 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
346 if (!
utils.modeIsValid())
349 return result > 0. ? 1 : -1;