LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
TrackMomentumCalculator.h
Go to the documentation of this file.
1 // \author sowjanyag@phys.ksu.edu
3 
4 #ifndef TrackMomentumCalculator_H
5 #define TrackMomentumCalculator_H
6 
7 #include "iostream"
8 #include "vector"
9 #include "TMath.h"
11 #include "TGraph.h"
12 #include "TGraphErrors.h"
13 #include "TAxis.h"
14 #include "TPolyLine3D.h"
15 #include "TSpline.h"
18 #include "fhiclcpp/ParameterSet.h"
23 #include "Minuit2/MnUserParameterState.h"
24 #include "Minuit2/Minuit2Minimizer.h"
25 #include "Minuit2/FunctionMinimum.h"
26 #include "Minuit2/MnMigrad.h"
27 #include "Minuit2/MnUserParameters.h"
28 #include "Minuit2/MnPrint.h"
29 #include "Minuit2/FCNBase.h"
30 #include "Math/Minimizer.h"
31 #include "Math/Factory.h"
33 #include "TMatrixDSym.h"
34 #include "TMatrixDSymEigen.h"
35 #include "TVector3.h"
36 #include <math.h>
37 #include <cmath>
38 
39 using namespace std;
40 
41 // Global variables/input
42 
43 // A. ---> for the TMinuit2 chi^2 minimization !
44 
45 Double_t xmeas[30]; Double_t ymeas[30]; Double_t eymeas[30]; Int_t nmeas;
46 
47 // B. ---> For the LLHD raster scan !
48 
49 // ..
50 
51 namespace trkf{
52 
54  {
55  Int_t n;
56 
57  Double_t x[50000]; Double_t y[50000]; Double_t z[50000];
58 
59  Int_t n_reco;
60 
61  Float_t x_reco[50000]; Float_t y_reco[50000]; Float_t z_reco[50000];
62 
63  Float_t seg_size; Float_t seg_stop; Int_t n_seg;
64 
65  Float_t x_seg[50000]; Float_t y_seg[50000]; Float_t z_seg[50000];
66 
67  TVector3 basex; TVector3 basey; TVector3 basez;
68 
69  std::vector<Float_t> segx; std::vector<Float_t> segy; std::vector<Float_t> segz;
70 
71  std::vector<Float_t> segnx; std::vector<Float_t> segny; std::vector<Float_t> segnz;
72 
73  std::vector<Float_t> segL;
74 
75  std::vector<Float_t> azx0; std::vector<Float_t> azy0;
76 
77  Double_t find_angle( Double_t vz, Double_t vy );
78 
79  Float_t steps_size; Int_t n_steps; std::vector<Float_t> steps;
80 
81  Float_t steps_size2;
82 
83  Float_t kcal;
84 
85  std::vector<Float_t> dthij; std::vector<Float_t> dEi; std::vector<Float_t> dEj; std::vector<Float_t> ind;
86 
87  Double_t minLength;
88 
89  Double_t maxLength;
90 
91  public:
92 
93  // Constructor and destructor //
94 
96 
97  virtual ~TrackMomentumCalculator();
98 
99  double GetTrackMomentum(double trkrange, int pdg);
100 
101  TPolyLine3D *gr_xyz=0; TGraph *gr_xy=0; TGraph *gr_yz=0; TGraph *gr_xz=0;
102 
103  Int_t GetTracks( const std::vector<Float_t> &xxx, const std::vector<Float_t> &yyy, const std::vector<Float_t> &zzz );
104 
105  TPolyLine3D *gr_reco_xyz; TGraph *gr_reco_xy; TGraph *gr_reco_yz; TGraph *gr_reco_xz;
106 
107  Int_t GetRecoTracks( const std::vector<Float_t> &xxx, const std::vector<Float_t> &yyy, const std::vector<Float_t> &zzz );
108 
109  TPolyLine3D *gr_seg_xyz; TGraph *gr_seg_xy; TGraph *gr_seg_yz; TGraph *gr_seg_xz;
110 
111  Int_t GetSegTracks( const std::vector<Float_t> &xxx, const std::vector<Float_t> &yyy, const std::vector<Float_t> &zzz );
112 
113  Int_t GetSegTracks2( const std::vector<Float_t> &xxx, const std::vector<Float_t> &yyy, const std::vector<Float_t> &zzz );
114 
115  void GetDeltaThetaRMS( Double_t &mean, Double_t &rms, Double_t &rmse, Double_t thick );
116 
117  TGraphErrors *gr_meas = 0;
118 
119  TGraph *KEvsR;
120 
121  TSpline3 *KEvsR_spline3;
122 
123  Double_t GetMomentumMultiScatterChi2( const art::Ptr<recob::Track> &trk );
124 
125  Double_t p_mcs; Double_t p_mcs_e; Double_t chi2;
126 
127  Int_t GetDeltaThetaij( std::vector<Float_t> &ei, std::vector<Float_t> &ej, std::vector<Float_t> &th, Double_t thick, std::vector<Float_t> &ind );
128 
129  Double_t my_g( Double_t xx, Double_t Q, Double_t s );
130 
131  Double_t my_mcs_llhd( Double_t x0, Double_t x1 );
132 
133  Double_t GetMomentumMultiScatterLLHD( const art::Ptr<recob::Track> &trk );
134 
135  Double_t p_mcs_2; Double_t LLbf;
136 
137  // Double_t GetMuMultiScatterLLHD( const art::Ptr<recob::Track> &trk );
138 
139  // Double_t GetMuMultiScatterLLHD2( const recob::Track &trk );
140 
141  Double_t GetMuMultiScatterLLHD3( const art::Ptr<recob::Track> &trk, bool dir );
142 
143  TVector3 GetMultiScatterStartingPoint( const art::Ptr<recob::Track> &trk );
144 
145  void SetMinLength(double minLen) {minLength = minLen;}
146 
147  void SetMaxLength(double maxLen) {maxLength = maxLen;}
148 
149  };
150 
151 
152 } //namespace trkf
153 
154 #endif // TrackMomentumCalculator_H
Float_t x
Definition: compare.C:6
Float_t s
Definition: plot.C:23
Double_t xx
Definition: macro.C:12
Double_t eymeas[30]
Float_t x1[n_points_granero]
Definition: compare.C:5
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
STL namespace.
Int_t nmeas
Double_t ymeas[30]
Double_t xmeas[30]
Provides recob::Track data product.
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:15
TDirectory * dir
Definition: macro.C:5