Commit ba1d9068 authored by Keerthi Nakkalil's avatar Keerthi Nakkalil
Browse files

Looping over irow and icol and not TTree for fitting and plotting, Correct...

Looping over irow and icol and not TTree for fitting and plotting, Correct values are coutted, but still print s255,255 for col, row in the fitparametrs.txt file
parent 326c4040
......@@ -121,16 +121,16 @@ void timewalkfit(){
TPtree->SetBranchAddress("toa_var",&toa_var);
for(int i = 0; i < TPtree->GetEntries(); i++){
for(int icol = 0; icol < 256; icol++){
for (int irow = 0; irow <256; irow++){
TPtree->GetEntry(i);
std::cout << col << " " << row << std::endl; //Correct values of col and row printed
std::cout <<icol << " " << irow << std::endl;
auto N = TPtree->Draw("voltage:toa:sqrt(toa_var)",Form("col==(%i) && row==(%i) && toa>0 && toa<toa_cut", col, row),"goff");
auto N = TPtree->Draw("voltage:toa:sqrt(toa_var)",Form("col==(%i) && row==(%i) && toa>0 && toa<toa_cut", icol, irow),"goff");
// cout << N <<std::endl;
TGraphErrors *graph = new TGraphErrors(N,TPtree->GetV1(),TPtree->GetV2(),0,TPtree->GetV3());
// std::cout << col << " " << row << std::endl; // Always printing 255 255
std::cout << icol << " " << irow << std::endl; //Correct values printed here..but text file still prints 255_255
auto fitmin = TMath::MinElement(graph->GetN(),graph->GetX());
// std::cout << "fitmin" << fitmin << std::endl;
......@@ -167,12 +167,13 @@ void timewalkfit(){
graph->SetMarkerStyle(7);*/
// graph->Draw("AP");
/* std::ofstream fitpars;
std::ofstream fitpars;
fitpars.open("fit_parameters.txt",std::ofstream::app);
fitpars << col << "\t" << row << "\t" << fitfuncTOA->GetParameter(2)
<< setw(10) << fitfuncTOA->GetParameter(0) << setw(10) << fitfuncTOA->GetParameter(1) << std::endl;*/ //NO chi2/ndf for the time-being!
<< setw(10) << fitfuncTOA->GetParameter(0) << setw(10) << fitfuncTOA->GetParameter(1) << std::endl; //NO chi2/ndf for the time-being! Prints always 255 255 for col,row
}
}
TPfile->Close();
}
......
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