TrackMomentumCalculator.h
Go to the documentation of this file.
1 /// \file TrackMomentumCalculator.h
2 // \author sowjanyag@phys.ksu.edu
3 
4 #ifndef TrackMomentumCalculator_H
5 #define TrackMomentumCalculator_H
6 
10 
11 #include "TGraph.h"
12 #include "TVector3.h"
13 
14 #include <optional>
15 #include <vector>
16 #include <tuple>
17 
18 class TPolyLine3D;
19 
20 namespace trkf {
21 
23  public:
24  TrackMomentumCalculator(double minLength = 100.0,
25  double maxLength = 1350.0);
26 
27  double GetTrackMomentum(double trkrange, int pdg) const;
30  double GetMuMultiScatterLLHD3(art::Ptr<recob::Track> const& trk, bool dir);
32 
33  private:
34  bool plotRecoTracks_(std::vector<float> const& xxx,
35  std::vector<float> const& yyy,
36  std::vector<float> const& zzz);
37 
38  struct Segments {
39  std::vector<float> x, nx;
40  std::vector<float> y, ny;
41  std::vector<float> z, nz;
42  std::vector<float> L;
43  };
44 
45  std::optional<Segments> getSegTracks_(std::vector<float> const& xxx,
46  std::vector<float> const& yyy,
47  std::vector<float> const& zzz,
48  double seg_size);
49 
50  std::tuple<double, double, double> getDeltaThetaRMS_(Segments const& segments,
51  double thick) const;
52 
53  int getDeltaThetaij_(std::vector<float>& ei,
54  std::vector<float>& ej,
55  std::vector<float>& th,
56  std::vector<float>& ind,
57  Segments const& segments,
58  double thick) const;
59 
60  double my_g(double xx, double Q, double s) const;
61 
62  double my_mcs_llhd(std::vector<float> const& dEi,
63  std::vector<float> const& dEj,
64  std::vector<float> const& dthij,
65  std::vector<float> const& ind,
66  double x0, double x1) const;
67 
68  float seg_stop{-1.};
69  int n_seg{};
70 
71  float x_seg[50000];
72  float y_seg[50000];
73  float z_seg[50000];
74 
75  double find_angle(double vz, double vy) const;
76 
77  float steps_size{10.};
78  int n_steps{6};
79  std::vector<float> steps;
80 
81  double minLength;
82  double maxLength;
83 
84  // The following are objects that are created but not drawn or
85  // saved. This class should consider accepting a "debug"
86  // parameter where if it is specified, then the graphs will be
87  // created; otherwise, their creation is unnecessary and impedes
88  // efficiency.
89  //
90  // N.B. TPolyLine3D objects are owned by ROOT, and we thus refer
91  // to them by pointer. It is important that 'delete' is not
92  // called on the TPolyLine3D pointers during destruction of a
93  // TrackMomentumCalculator object.
94  TPolyLine3D* gr_reco_xyz{nullptr};
95  TGraph gr_reco_xy{};
96  TGraph gr_reco_yz{};
97  TGraph gr_reco_xz{};
98 
99  TPolyLine3D* gr_seg_xyz{nullptr};
100  TGraph gr_seg_xy{};
101  TGraph gr_seg_yz{};
102  TGraph gr_seg_xz{};
103 
104  };
105 
106 } // namespace trkf
107 
108 #endif // TrackMomentumCalculator_H
double my_g(double xx, double Q, double s) const
double GetMomentumMultiScatterChi2(art::Ptr< recob::Track > const &trk)
int getDeltaThetaij_(std::vector< float > &ei, std::vector< float > &ej, std::vector< float > &th, std::vector< float > &ind, Segments const &segments, double thick) const
string dir
std::optional< Segments > getSegTracks_(std::vector< float > const &xxx, std::vector< float > const &yyy, std::vector< float > const &zzz, double seg_size)
double find_angle(double vz, double vy) const
std::tuple< double, double, double > getDeltaThetaRMS_(Segments const &segments, double thick) const
double GetMuMultiScatterLLHD3(art::Ptr< recob::Track > const &trk, bool dir)
TrackMomentumCalculator(double minLength=100.0, double maxLength=1350.0)
double my_mcs_llhd(std::vector< float > const &dEi, std::vector< float > const &dEj, std::vector< float > const &dthij, std::vector< float > const &ind, double x0, double x1) const
TVector3 GetMultiScatterStartingPoint(art::Ptr< recob::Track > const &trk)
Provides recob::Track data product.
double GetMomentumMultiScatterLLHD(art::Ptr< recob::Track > const &trk)
static QCString * s
Definition: config.cpp:1042
double GetTrackMomentum(double trkrange, int pdg) const
bool plotRecoTracks_(std::vector< float > const &xxx, std::vector< float > const &yyy, std::vector< float > const &zzz)