14 namespace multiTrajectoryStateMode {
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) {
136 result = utils.
mean();
158 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
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;
210 momentum = utils.
mean();
221 edm::LogInfo(
"multiTrajectoryStateMode") <<
"Cannot calculate mode from invalid TSOS";
232 for (
unsigned int iv = 3;
iv < 5; ++
iv) {
239 result = utils.
mean();
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";
347 result = utils.
mean();
349 return result > 0. ? 1 : -1;
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
const LocalTrajectoryParameters & localParameters() const
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)
Exp< T >::type exp(const T &t)
const SurfaceType & surface() const
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
double mean() const
parameter vector
double variance() const
variance
Cos< T >::type cos(const T &t)
const SingleGaussianState1D & mode() const
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Log< level::Info, false > LogInfo
double weight() const
weight
double mean(unsigned int i) const
mean value of a component
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)
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
float pzSign() const
Sign of the z-component of the momentum in the local frame.
bool modeIsValid() const
mode status
Global3DVector GlobalVector