18 #include "Math/VectorUtil.h" 20 using ROOT::Math::VectorUtil::Angle;
80 <<
"Initial track not set" << std::endl;
90 <<
"Not Enough trajectory points." << std::endl;
107 <<
"Shower start position not set" << std::endl;
113 StartPosition = InitialTrack.
Start();
131 int nexttraj = traj + 1;
143 int nextnexttraj = nexttraj + 1;
144 auto nextnextflags = InitialTrack.
FlagsAtPoint(nextnexttraj);
151 nextnextflags = InitialTrack.
FlagsAtPoint(nextnexttraj);
157 <<
"Trajectory point not set as rest of the traj points are bogus." << std::endl;
166 NextTrajPosition = InitialTrack.
LocationAtPoint(nexttraj) - StartPosition;
167 NextNextTrajPosition = InitialTrack.
LocationAtPoint(nextnexttraj) - StartPosition;
172 NextNextTrajPosition =
177 if (TrajPosition.R() == 0) {
continue; }
178 if (NextTrajPosition.R() == 0) {
continue; }
179 if (NextNextTrajPosition.R() == 0) {
continue; }
182 if (Angle(TrajPosition, NextTrajPosition) <
fAngleCut &&
183 Angle(TrajPosition, NextNextTrajPosition) <
fAngleCut) {
192 Direction = (TrajPosition - StartPosition).Unit();
226 int prevtraj = traj - 1;
243 int nexttraj = traj + 1;
255 int nextnexttraj = nexttraj + 1;
256 auto nextnextflags = InitialTrack.
FlagsAtPoint(nextnexttraj);
263 nextnextflags = InitialTrack.
FlagsAtPoint(nextnexttraj);
269 <<
"Trajectory point not set as rest of the traj points are bogus." << std::endl;
278 if (TrajDirection.R() == 0) {
continue; }
279 if (NextTrajDirection.R() == 0) {
continue; }
280 if (NextNextTrajDirection.R() == 0) {
continue; }
283 if (Angle(TrajDirection, NextTrajDirection) <
fAngleCut &&
284 Angle(TrajDirection, NextNextTrajDirection) <
fAngleCut) {
294 <<
"Trajectory point not set." << std::endl;
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
static constexpr Flag_t NoPoint
The trajectory point is not defined.
Point_t const & LocationAtPoint(size_t i) const
Access to track position at different points.
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Point_t const & Start() const
Access to track position at different points.
bool CheckElement(const std::string &Name) const
Provides recob::Track data product.
int GetElement(const std::string &Name, T &Element) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
PointFlags_t const & FlagsAtPoint(size_t i) const
Access to i-th TrajectoryPoint or its Flags.
Vector_t DirectionAtPoint(size_t i) const
Access to track direction at different points.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: