49 pset.
get<
std::string>(
"InitialTrackSpacePointsOutputLabel"))
65 mf::LogError(
"ShowerTrackTrajToSpacePoint") <<
"Initial track not set" << std::endl;
73 <<
"Start position not set, returning " << std::endl;
81 <<
"Initial track spacepoints not set" << std::endl;
90 std::vector<art::Ptr<recob::SpacePoint>> intitaltrack_sp;
97 std::vector<art::Ptr<recob::SpacePoint>> new_intitaltrack_sp;
109 if ((TrajPosition - TrajPositionStart).R() == 0) {
continue; }
110 if ((TrajPosition - ShowerStartPosition).R() == 0) {
continue; }
112 float MinDist = 9999;
113 unsigned int index = 999;
114 for (
unsigned int sp = 0; sp < intitaltrack_sp.size(); ++sp) {
117 auto const dist = (spacepoint->
position() - TrajPosition).R();
124 if (index == 999) {
continue; }
126 new_intitaltrack_sp.push_back(intitaltrack_sp[index]);
129 intitaltrack_sp.erase(intitaltrack_sp.begin() + index);
140 std::vector<art::Ptr<recob::Hit>> trackHits;
141 for (
auto const& spacePoint : new_intitaltrack_sp) {
144 trackHits.push_back(hit);
static constexpr Flag_t NoPoint
The trajectory point is not defined.
Declaration of signal hit object.
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)
geo::Point_t position() const
Returns the position of the point in world coordinates [cm].
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool CheckElement(const std::string &Name) const
Provides recob::Track data product.
int GetElement(const std::string &Name, T &Element) const
Detector simulation of raw signals on wires.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
PointFlags_t const & FlagsAtPoint(size_t i) const
Access to i-th TrajectoryPoint or its Flags.
2D representation of charge deposited in the TDC/wire plane
const art::FindOneP< T1 > & GetFindOneP(const art::ValidHandle< std::vector< T2 >> &handle, const art::Event &evt, const art::InputTag &moduleTag)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: