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

Code to plot the 2D histos of the fit parametrs

parent 6b2a356f
void TreeRead(){
int col,row;
double c_toa,t_toa,d_toa,chi2_ndf;
string line;
TFile* par_file = new TFile("par_file.root","recreate");
TTree* par_tree = new TTree("par_tree","parameter tree");
par_tree->Branch("col",&col, "col/I");
par_tree->Branch("row",&row, "row/I");
par_tree->Branch("c_toa",&c_toa, "c_toa/D");
par_tree->Branch("t_toa",&t_toa, "t_toa/D");
par_tree->Branch("d_toa",&d_toa, "d_toa/D");
par_tree->Branch("chi2_ndf",&chi2_ndf, "chi2_ndf/D");
std::ifstream parameters_file("toa_fit_parameters_100_1190.txt");
if(parameters_file.is_open()){
while(getline(parameters_file,line)){
istringstream ss(line);
ss >> col >> row >> c_toa >> t_toa >> d_toa >> chi2_ndf;
par_tree->Fill();
}
}
TCanvas*c = new TCanvas();
c->Divide(2,2);
par_tree->Write();
c->cd(1);
par_tree->Draw("col:row","c_toa","colz");
c->cd(2);
par_tree->Draw("col:row","t_toa","colz");
c->cd(3);
par_tree->Draw("col:row","d_toa","colz");
c->cd(4);
par_tree->Draw("col:row","chi2_ndf","colz");
par_file->Close();
}
Markdown is supported
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