1 #ifndef SBNCODE_SINGLEPHOTONANALYSIS_HELPER_MATH_H
2 #define SBNCODE_SINGLEPHOTONANALYSIS_HELPER_MATH_H
4 #include "art/Framework/Principal/Handle.h"
5 #include "art/Framework/Services/Registry/ServiceHandle.h"
10 #include "canvas/Utilities/ensurePointer.h"
15 namespace single_photon
22 std::vector<size_t> idx(v.size());
23 std::iota(idx.begin(), idx.end(), 0);
26 std::sort(idx.begin(), idx.end(), [&v](
size_t i1,
size_t i2) {
return v[i1] > v[i2];});
35 std::vector<size_t> idx(v.size());
36 std::iota(idx.begin(), idx.end(), 0);
39 std::sort(idx.begin(), idx.end(), [&v](
size_t i1,
size_t i2) {
return v[i1] < v[i2];});
48 std::sort(v1.begin(), v1.end());
49 std::sort(v2.begin(), v2.end());
62 return wire_dir.Dot(shower_dir);
64 inline double degToRad(
double deg){
return deg * M_PI/180; }
65 inline double radToDeg(
double rad){
return rad * 180/M_PI; }
71 double dist_line_point( std::vector<double>&X1, std::vector<double>& X2, std::vector<double>& point);
76 double implied_invar_mass(
double vx,
double vy,
double vz, art::Ptr<recob::Shower> & s1,
double E1, art::Ptr<recob::Shower> &s2,
double E2);
79 double invar_mass(art::Ptr<recob::Shower> & s1,
double E1, art::Ptr<recob::Shower> &s2,
double E2);
81 double getMedian(std::vector<double> thisvector);
86 double angle_wrt_plane0,
87 double angle_wrt_plane1,
88 double angle_wrt_plane2,
98 double amalgamateddEdx,
100 double median_plane1,
101 double median_plane2,
115 std::vector<std::vector<double>>
buildRectangle(std::vector<double> cluster_start, std::vector<double> cluster_axis,
double width,
double length);
118 #endif // SBNCODE_SINGLEPHOTONANALYSIS_HELPER_MATH_H
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
int getAmalgamateddEdxNHits(double amalgamateddEdx, double median_plane0, double median_plane1, double median_plane2, int plane0_nhits, int plane1_nhits, int plane2_nhits)
std::vector< size_t > sort_indexes(const std::vector< T > &v)
double degToRad(double deg)
double dist_line_point(std::vector< double > &X1, std::vector< double > &X2, std::vector< double > &point)
double calcWire(double Y, double Z, int plane, int fTPC, int fCryostat, geo::GeometryCore const &geo)
double invar_mass(art::Ptr< recob::Shower > &s1, double E1, art::Ptr< recob::Shower > &s2, double E2)
double implied_invar_mass(double vx, double vy, double vz, art::Ptr< recob::Shower > &s1, double E1, art::Ptr< recob::Shower > &s2, double E2)
double radToDeg(double rad)
process_name opflash particleana ie ie y
std::vector< std::vector< double > > buildRectangle(std::vector< double > cluster_start, std::vector< double > cluster_axis, double width, double length)
Calculates the four corners of a rectangle of given length and width around a cluster given the start...
Description of geometry of one entire detector.
double getAmalgamateddEdx(double angle_wrt_plane0, double angle_wrt_plane1, double angle_wrt_plane2, double median_plane0, double median_plane1, double median_plane2, int plane0_nhits, int plane1_nhits, int plane2_nhits)
double getCoswrtWires(TVector3 shower_dir, TVector3 wire_dir)
double impact_paramater_shr(double x, double y, double z, art::Ptr< recob::Shower > &shr)
double getMedian(std::vector< double > thisvector)
std::vector< size_t > sort_indexes_rev(const std::vector< T > &v)
art framework interface to geometry description
bool marks_compare_vec_nonsense(std::vector< T > &v1, std::vector< T > &v2)