Commit b98e07b0 authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Cleaned up the code

parent 599308d3
......@@ -57,19 +57,22 @@ namespace genfind {
double degree = TMath::Pi()/180.0;
double phi_min = 0.0;
double phi_max = 180.0;
// This part is not really needed
TMultiGraph* mg = new TMultiGraph();
//std::vector<TF1*> funcs;
//double avg = 0;
//for(const auto& ahit : hits) {
// TF1 * f = new TF1("f",[&](double*x, double *p){ return p[0]*TMath::Cos(x[0]*degree) + p[1]*TMath::Sin(x[0]*degree); }, phi_min, phi_max, 2);
// f->SetLineColor(1);
// f->SetLineWidth(1);
// f->SetParameter(0, ahit.X());
// f->SetParameter(1, ahit.Y());
// funcs.push_back(f);
// mg->Add(new TGraph(f),"l");
//}
std::vector<TF1*> funcs;
double avg = 0;
for(const auto& ahit : hits) {
TF1 * f = new TF1("f",[&](double*x, double *p){ return p[0]*TMath::Cos(x[0]*degree) + p[1]*TMath::Sin(x[0]*degree); }, phi_min, phi_max, 2);
f->SetLineColor(1);
f->SetLineWidth(1);
f->SetParameter(0, ahit.X());
f->SetParameter(1, ahit.Y());
funcs.push_back(f);
mg->Add(new TGraph(f),"l");
}
// Old method of finding roots
//int n_roots = 0;
//int n_funcs = funcs.size();
//for(int i_func = 0; i_func < n_funcs; i_func++) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment