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;
float pzSign() const
Sign of the z-component of the momentum in the local frame.
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
bool positionFromModeLocal(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
int chargeFromMode(TrajectoryStateOnSurface const &tsos)
bool momentumFromModeP(TrajectoryStateOnSurface const &tsos, double &momentum)
const LocalTrajectoryParameters & localParameters() const
const SurfaceType & surface() const
double mean(unsigned int i) const
mean value of a component
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
Cos< T >::type cos(const T &t)
bool modeIsValid() const
mode status
const SingleGaussianState1D & mode() const
double mean() const
parameter vector
double weight() const
weight
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Log< level::Info, false > LogInfo
const SingleState1dContainer & components() const
access to components
bool momentumFromModeLocal(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
bool momentumFromModePPhiEta(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
static int position[264][3]
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
bool momentumFromModeQP(TrajectoryStateOnSurface const &tsos, double &momentum)
double variance() const
variance
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
Global3DVector GlobalVector