47 pset.
get<
std::
string>(
"InitialTrackSpacePointsOutputLabel"))
71 <<
"Start position not set, returning " <<
std::endl;
79 <<
"Initial track spacepoints not set" <<
std::endl;
84 TVector3 ShowerStartPosition = {-999, -999, -999};
88 std::vector<art::Ptr<recob::SpacePoint>> intitaltrack_sp;
95 std::vector<art::Ptr<recob::SpacePoint>> new_intitaltrack_sp;
104 TVector3 TrajPosition = {TrajPositionPoint.X(), TrajPositionPoint.Y(), TrajPositionPoint.Z()};
107 TVector3 TrajPositionStart = {
108 TrajPositionStartPoint.X(), TrajPositionStartPoint.Y(), TrajPositionStartPoint.Z()};
111 if ((TrajPosition - TrajPositionStart).Mag() == 0) {
continue; }
112 if ((TrajPosition - ShowerStartPosition).Mag() == 0) {
continue; }
114 float MinDist = 9999;
115 unsigned int index = 999;
116 for (
unsigned int sp = 0; sp < intitaltrack_sp.size(); ++sp) {
121 if (pos.Mag() < MinDist && pos.Mag() <
fMaxDist) {
127 if (index == 999) {
continue; }
129 new_intitaltrack_sp.push_back(intitaltrack_sp[index]);
132 intitaltrack_sp.erase(intitaltrack_sp.begin() +
index);
139 const art::FindOneP<recob::Hit>& fohsp =
143 std::vector<art::Ptr<recob::Hit>> trackHits;
144 for (
auto const& spacePoint : new_intitaltrack_sp) {
147 trackHits.push_back(hit);
static constexpr Flag_t NoPoint
The trajectory point is not defined.
Point_t const & LocationAtPoint(size_t i) const
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.
const art::FindOneP< T1 > & GetFindOneP(const art::ValidHandle< std::vector< T2 > > &handle, const art::Event &evt, const art::InputTag &moduleTag)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool CheckElement(const std::string &Name) const
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.
Provides recob::Track data product.
PointFlags_t const & FlagsAtPoint(size_t i) const
2D representation of charge deposited in the TDC/wire plane
auto const & get(AssnsNode< L, R, D > const &r)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
QTextStream & endl(QTextStream &s)
TVector3 SpacePointPosition(art::Ptr< recob::SpacePoint > const &sp) const