39 double crossTime = -99999;
42 double minDist = 99999;
43 double startX = track.
Vertex().X();
44 double endX = track.
End().X();
52 if(tpc == 0 && endX < startX) point = track.
End();
55 if(tpc == 1 && endX > startX) point = track.
End();
58 if(tpc == -1)
return std::make_pair(minDist, crossTime);
61 for(
auto const&
t0 : t0List){
64 double shiftedX = point.X();
66 if(tpc == 0) shiftedX = point.X() -
shift;
67 if(tpc == 1) shiftedX = point.X() +
shift;
79 return std::make_pair(minDist, crossTime);
89 std::pair<double, double> min =
MinApaDistance(detProp, track, t0List, tpc);
101 std::vector<double> t0List {t0};
105 std::pair<double, double> min =
MinApaDistance(detProp, track, t0List, tpc);
123 return std::make_pair(-99999, -99999);
137 double crossTimeThrough =
T0FromApaCross(detProp, track, t0Tpc0, tpc);
139 if(crossTimeThrough != -99999 && (crossTimeThrough < fBeamTimeMin || crossTimeThrough >
fBeamTimeMax))
return true;
142 double crossTimeThrough =
T0FromApaCross(detProp, track, t0Tpc1, tpc);
143 if(crossTimeThrough != -99999 && (crossTimeThrough < fBeamTimeMin || crossTimeThrough >
fBeamTimeMax))
return true;
fhicl::Atom< double > DistanceLimit
process_name use argoneut_mc_hitfinder track
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
double ApaDistance(detinfo::DetectorPropertiesData const &detProp, recob::Track track, double t0, std::vector< art::Ptr< recob::Hit >> hits)
void reconfigure(const Config &config)
Point_t const & Vertex() const
ApaCrossCosmicIdAlg(const Config &config)
std::pair< double, double > MinApaDistance(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< double > t0List, int tpc)
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
int DetectedInTPC(std::vector< art::Ptr< recob::Hit >> hits)
fhicl::Table< BeamTime > BeamTimeLimits
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
Point_t const & End() const
bool ApaCrossCosmicId(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< art::Ptr< recob::Hit >> hits, std::vector< double > t0Tpc0, std::vector< double > t0Tpc1)
stream1 can override from command line with o or output services user sbnd
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
fhicl::Atom< double > MaxApaDistance
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
double T0FromApaCross(detinfo::DetectorPropertiesData const &detProp, recob::Track track, std::vector< double > t0List, int tpc)