92 mf::LogError(
"ShowerPandoraSlidingFitTrackFinder")
93 <<
"Start position not set, returning " << std::endl;
98 mf::LogError(
"ShowerPandoraSlidingFitTrackFinder")
99 <<
"Direction not set, returning " << std::endl;
104 mf::LogError(
"ShowerPandoraSlidingFitTrackFinder")
105 <<
"Initial Spacepoints not set, returning " << std::endl;
109 TVector3 ShowerStartPosition = {-999, -999, -999};
112 TVector3 ShowerDirection = {-999, -999, -999};
115 std::vector<art::Ptr<recob::SpacePoint>> spacepoints;
122 mf::LogWarning(
"ShowerPandoraSlidingFitTrackFinder")
123 <<
"Insufficient space points points to build track: " << spacepoints.size();
128 const float wirePitchW(detType->WirePitchW());
130 const pandora::CartesianVector vertexPosition(
131 ShowerStartPosition.X(), ShowerStartPosition.Y(), ShowerStartPosition.Z());
133 pandora::CartesianPointVector cartesianPointVector;
134 for (
const art::Ptr<recob::SpacePoint> spacePoint : spacepoints)
135 cartesianPointVector.emplace_back(
136 pandora::CartesianVector(spacePoint->XYZ()[0], spacePoint->XYZ()[1], spacePoint->XYZ()[2]));
148 catch (
const pandora::StatusCodeException&) {
150 mf::LogWarning(
"ShowerPandoraSlidingFitTrackFinder")
151 <<
"Unable to extract sliding fit trajectory" << std::endl;
156 mf::LogWarning(
"ShowerPandoraSlidingFitTrackFinder")
157 <<
"Insufficient input trajectory points to build track: " << trackStateVector.size();
161 if (trackStateVector.empty())
162 throw cet::exception(
"ShowerPandoraSlidingFitTrackFinder")
163 <<
"BuildTrack - No input trajectory points provided " << std::endl;
171 trackState.GetPosition().GetY(),
172 trackState.GetPosition().GetZ()));
174 trackState.GetDirection().GetY(),
175 trackState.GetDirection().GetZ()));
178 if (std::fabs(trackState.GetPosition().GetX() -
util::kBogusF) <
179 std::numeric_limits<float>::epsilon() &&
181 std::numeric_limits<float>::epsilon() &&
183 std::numeric_limits<float>::epsilon()) {
204 TVector3 Start = {InitialTrack.
Start().X(), InitialTrack.
Start().Y(), InitialTrack.
Start().Z()};
205 TVector3 End = {InitialTrack.
End().X(), InitialTrack.
End().Y(), InitialTrack.
End().Z()};
206 float tracklength = (Start - End).Mag();
static constexpr Flag_t NoPoint
The trajectory point is not defined.
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 > > SMatrixSym55
Empty interface to map pandora to specifics in the LArSoft geometry.
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
static void GetSlidingFitTrajectory(const pandora::CartesianPointVector &pointVector, const pandora::CartesianVector &vertexPosition, const unsigned int layerWindow, const float layerPitch, LArTrackStateVector &trackStateVector, pandora::IntVector *const pIndexVector=nullptr)
Apply 3D sliding fit to a set of 3D points and return track trajectory.
constexpr int kBogusI
obviously bogus integer value
std::vector< int > IntVector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
Point_t const & Start() const
Access to track position at different points.
A trajectory in space reconstructed from hits.
bool CheckElement(const std::string &Name) const
std::vector< Vector_t > Momenta_t
Type of momentum list.
std::vector< PointFlags_t > Flags_t
Type of point flag list.
int GetElement(const std::string &Name, T &Element) const
static constexpr HitIndex_t InvalidHitIndex
Value marking an invalid hit index.
std::vector< Point_t > Positions_t
Type of trajectory point list.
LArPandoraDetectorType * GetDetectorType()
Factory class that returns the correct detector type interface.
constexpr float kBogusF
obviously bogus float value
Point_t const & End() const
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
std::vector< LArTrackState > LArTrackStateVector
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
Set of flags pertaining a point of the track.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: