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

Macros

parent a3e01467
void EfficiencyErrors(){
auto c=new TCanvas();
TGraphAsymmErrors* graph_Eff = new TGraphAsymmErrors("bias.txt","%lg %lg %lg %lg","");
graph_Eff->SetTitle( " ;" "Bias Voltage [-V];" "Efficiency (%)");
graph_Eff->SetMarkerStyle(8);
graph_Eff->SetMarkerColor(4);
// graph_Eff->GetYaxis()->SetRangeUser(15.5,17.35);
graph_Eff->Draw("AP");
}
void EfficiencyVsTrackmultiplicity(){
string filename_f1 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6274_1400.root";
string filename_f2 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6275_1340.root";
string filename_f3 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6276_1280.root";
string filename_f4 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6277_1220.root";
string filename_f5 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6278_1160.root";
string filename_f6 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6280_1245.root";
string filename_f7 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6288_1230.root";
string filename_f8 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6289_1215.root";
string filename_f9 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6290_1200.root";
string filename_f10 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6294_1185.root";
string filename_f11 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6295_1170.root";
// string filename_f12 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6274_1400.root";
TFile* f1 = TFile::Open(filename_f1.c_str());
TFile* f2 = TFile::Open(filename_f2.c_str());
TFile* f3 = TFile::Open(filename_f3.c_str());
TFile* f4 = TFile::Open(filename_f4.c_str());
TFile* f5 = TFile::Open(filename_f5.c_str());
TFile* f6 = TFile::Open(filename_f6.c_str());
TFile* f7 = TFile::Open(filename_f7.c_str());
TFile* f8 = TFile::Open(filename_f8.c_str());
TFile* f9 = TFile::Open(filename_f9.c_str());
TFile* f10 = TFile::Open(filename_f10.c_str());
TFile* f11 = TFile::Open(filename_f11.c_str());
string hist1 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist2 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist3 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist4 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist5 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist6 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist7 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist8 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist9 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist10 ="AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist11 ="AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
//string hist12 = "Correlations/MIMOSA26_0/eventTimes";
TH1F* h1 = static_cast<TH1F*>(f1->Get(hist1.c_str()));
TH1F* h2 = static_cast<TH1F*>(f2->Get(hist2.c_str()));
TH1F* h3 = static_cast<TH1F*>(f3->Get(hist3.c_str()));
TH1F* h4 = static_cast<TH1F*>(f4->Get(hist4.c_str()));
TH1F* h5 = static_cast<TH1F*>(f5->Get(hist5.c_str()));
TH1F* h6 = static_cast<TH1F*>(f6->Get(hist6.c_str()));
TH1F* h7 = static_cast<TH1F*>(f7->Get(hist7.c_str()));
TH1F* h8 = static_cast<TH1F*>(f8->Get(hist8.c_str()));
TH1F* h9 = static_cast<TH1F*>(f9->Get(hist9.c_str()));
TH1F* h10 = static_cast<TH1F*>(f10->Get(hist10.c_str()));
TH1F* h11 = static_cast<TH1F*>(f11->Get(hist11.c_str()));
// TH1F* h12 = static_cast<TH1F*>(f12->Get(hist12.c_str()));
TCanvas* c1 = new TCanvas("c1","c1",1000,600);
c1->Divide(6,2);
c1->cd(1);
h1->SetTitle("Run6274, Thr: 1400");
h1->SetMarkerStyle(23);
h1->Draw();
c1->cd(2);
h2->SetTitle("Run6275, Thr: 1340");
h2->SetMarkerStyle(23);
h2->Draw();
c1->cd(3);
h3->SetTitle("Run6276, Thr: 1280");
h3->SetMarkerStyle(23);
h3->Draw();
c1->cd(4);
h4->SetTitle("Run6277, Thr: 1280");
h4->SetMarkerStyle(23);
h4->Draw();
c1->cd(5);
h5->SetTitle("Run6278, Thr: 1160");
h5->SetMarkerStyle(23);
h5->Draw();
c1->cd(6);
h6->SetTitle("Run6280, Thr: 1245");
h6->SetMarkerStyle(23);
h6->Draw();
c1->cd(7);
h7->SetTitle("Run6288, Thr: 1230");
h7->SetMarkerStyle(23);
h7->Draw();
c1->cd(8);
h8->SetTitle("Run6289, Thr: 1215");
h8->SetMarkerStyle(23);
h8->Draw();
c1->cd(9);
h9->SetTitle("Run6290, Thr: 1200");
h9->SetMarkerStyle(23);
h9->Draw();
c1->cd(10);
h10->SetTitle("Run6294, Thr: 1185");
h10->SetMarkerStyle(23);
h10->Draw();
c1->cd(11);
h11->SetTitle("Run6295, Thr: 1170");
h11->SetMarkerStyle(23);
h11->Draw();
// c1->SaveAs("../plots/Efficiency/Mimosa0_eventTimes.pdf");
}
void EfficiencyVstime(){
string filename_f1 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6274_1400.root";
string filename_f2 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6275_1340.root";
string filename_f3 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6276_1280.root";
string filename_f4 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6277_1220.root";
string filename_f5 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6278_1160.root";
string filename_f6 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6280_1245.root";
string filename_f7 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6288_1230.root";
string filename_f8 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6289_1215.root";
string filename_f9 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6290_1200.root";
string filename_f10 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6294_1185.root";
string filename_f11 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6295_1170.root";
// string filename_f12 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6274_1400.root";
TFile* f1 = TFile::Open(filename_f1.c_str());
TFile* f2 = TFile::Open(filename_f2.c_str());
TFile* f3 = TFile::Open(filename_f3.c_str());
TFile* f4 = TFile::Open(filename_f4.c_str());
TFile* f5 = TFile::Open(filename_f5.c_str());
TFile* f6 = TFile::Open(filename_f6.c_str());
TFile* f7 = TFile::Open(filename_f7.c_str());
TFile* f8 = TFile::Open(filename_f8.c_str());
TFile* f9 = TFile::Open(filename_f9.c_str());
TFile* f10 = TFile::Open(filename_f10.c_str());
TFile* f11 = TFile::Open(filename_f11.c_str());
string hist1 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist2 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist3 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist4 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist5 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist6 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist7 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist8 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist9 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist10 ="AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist11 ="AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
//string hist12 = "Correlations/MIMOSA26_0/eventTimes";
TH1F* h1 = static_cast<TH1F*>(f1->Get(hist1.c_str()));
TH1F* h2 = static_cast<TH1F*>(f2->Get(hist2.c_str()));
TH1F* h3 = static_cast<TH1F*>(f3->Get(hist3.c_str()));
TH1F* h4 = static_cast<TH1F*>(f4->Get(hist4.c_str()));
TH1F* h5 = static_cast<TH1F*>(f5->Get(hist5.c_str()));
TH1F* h6 = static_cast<TH1F*>(f6->Get(hist6.c_str()));
TH1F* h7 = static_cast<TH1F*>(f7->Get(hist7.c_str()));
TH1F* h8 = static_cast<TH1F*>(f8->Get(hist8.c_str()));
TH1F* h9 = static_cast<TH1F*>(f9->Get(hist9.c_str()));
TH1F* h10 = static_cast<TH1F*>(f10->Get(hist10.c_str()));
TH1F* h11 = static_cast<TH1F*>(f11->Get(hist11.c_str()));
// TH1F* h12 = static_cast<TH1F*>(f12->Get(hist12.c_str()));
TCanvas* c1 = new TCanvas("c1","c1",1000,600);
c1->Divide(6,2);
c1->cd(1);
h1->SetTitle("Run6274, Thr: 1400");
h1->GetYaxis()->SetRangeUser(80,110);
h1->Draw("HIST");
c1->cd(2);
h2->SetTitle("Run6275, Thr: 1340");
h2->GetYaxis()->SetRangeUser(80,110);
h2->Draw("HIST");
c1->cd(3);
h3->SetTitle("Run6276, Thr: 1280");
h3->GetYaxis()->SetRangeUser(80,110);
h3->Draw("HIST");
c1->cd(4);
h4->SetTitle("Run6277, Thr: 1280");
h4->GetYaxis()->SetRangeUser(80,110);
h4->Draw("HIST");
c1->cd(5);
h5->SetTitle("Run6278, Thr: 1160");
h5->GetYaxis()->SetRangeUser(80,110);
h5->Draw("HIST");
c1->cd(6);
h6->SetTitle("Run6280, Thr: 1245");
h6->GetYaxis()->SetRangeUser(80,110);
h6->Draw("HIST");
c1->cd(7);
h7->SetTitle("Run6288, Thr: 1230");
h7->GetYaxis()->SetRangeUser(80,110);
h7->Draw("HIST");
c1->cd(8);
h8->SetTitle("Run6289, Thr: 1215");
h8->GetYaxis()->SetRangeUser(80,110);
h8->Draw("HIST");
c1->cd(9);
h9->SetTitle("Run6290, Thr: 1200");
h9->GetYaxis()->SetRangeUser(80,110);
h9->Draw("HIST");
c1->cd(10);
h10->SetTitle("Run6294, Thr: 1185");
h10->GetYaxis()->SetRangeUser(80,110);
h10->Draw("HIST");
c1->cd(11);
h11->SetTitle("Run6295, Thr: 1170");
h11->GetYaxis()->SetRangeUser(80,110);
h11->Draw("HIST");
// c1->SaveAs("../plots/Efficiency/Mimosa0_eventTimes.pdf");
}
void Mimosa_eventTimes() {
string filename_f1 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6274_1400.root";
string filename_f2 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6275_1340.root";
string filename_f3 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6276_1280.root";
string filename_f4 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6277_1220.root";
string filename_f5 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6278_1160.root";
string filename_f6 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6280_1245.root";
string filename_f7 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6288_1230.root";
string filename_f8 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6289_1215.root";
string filename_f9 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6290_1200.root";
string filename_f10 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6294_1185.root";
string filename_f11 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6295_1170.root";
// string filename_f12 = "../efficiency_thr/Efficiency_analysis_W5_E2_analysis_run6274_1400.root";
TFile* f1 = TFile::Open(filename_f1.c_str());
TFile* f2 = TFile::Open(filename_f2.c_str());
TFile* f3 = TFile::Open(filename_f3.c_str());
TFile* f4 = TFile::Open(filename_f4.c_str());
TFile* f5 = TFile::Open(filename_f5.c_str());
TFile* f6 = TFile::Open(filename_f6.c_str());
TFile* f7 = TFile::Open(filename_f7.c_str());
TFile* f8 = TFile::Open(filename_f8.c_str());
TFile* f9 = TFile::Open(filename_f9.c_str());
TFile* f10 = TFile::Open(filename_f10.c_str());
TFile* f11 = TFile::Open(filename_f11.c_str());
string hist1 = "Correlations/MIMOSA26_0/eventTimes";
string hist2 = "Correlations/MIMOSA26_0/eventTimes";
string hist3 = "Correlations/MIMOSA26_0/eventTimes";
string hist4 = "Correlations/MIMOSA26_0/eventTimes";
string hist5 = "Correlations/MIMOSA26_0/eventTimes";
string hist6 = "Correlations/MIMOSA26_0/eventTimes";
string hist7 = "Correlations/MIMOSA26_0/eventTimes";
string hist8 = "Correlations/MIMOSA26_0/eventTimes";
string hist9 = "Correlations/MIMOSA26_0/eventTimes";
string hist10 = "Correlations/MIMOSA26_0/eventTimes";
string hist11 = "Correlations/MIMOSA26_0/eventTimes";
//string hist12 = "Correlations/MIMOSA26_0/eventTimes";
TH1F* h1 = static_cast<TH1F*>(f1->Get(hist1.c_str()));
TH1F* h2 = static_cast<TH1F*>(f2->Get(hist2.c_str()));
TH1F* h3 = static_cast<TH1F*>(f3->Get(hist3.c_str()));
TH1F* h4 = static_cast<TH1F*>(f4->Get(hist4.c_str()));
TH1F* h5 = static_cast<TH1F*>(f5->Get(hist5.c_str()));
TH1F* h6 = static_cast<TH1F*>(f6->Get(hist6.c_str()));
TH1F* h7 = static_cast<TH1F*>(f7->Get(hist7.c_str()));
TH1F* h8 = static_cast<TH1F*>(f8->Get(hist8.c_str()));
TH1F* h9 = static_cast<TH1F*>(f9->Get(hist9.c_str()));
TH1F* h10 = static_cast<TH1F*>(f10->Get(hist10.c_str()));
TH1F* h11 = static_cast<TH1F*>(f11->Get(hist11.c_str()));
// TH1F* h12 = static_cast<TH1F*>(f12->Get(hist12.c_str()));
TCanvas* c1 = new TCanvas("c1","c1",1000,600);
c1->Divide(6,2);
c1->cd(1);
h1->SetTitle("Run6274, Thr: 1400");
h1->Draw();
c1->cd(2);
h2->SetTitle("Run6275, Thr: 1340");
h2->Draw();
c1->cd(3);
h3->SetTitle("Run6276, Thr: 1280");
h3->Draw();
c1->cd(4);
h4->SetTitle("Run6277, Thr: 1280");
h4->Draw();
c1->cd(5);
h5->SetTitle("Run6278, Thr: 1160");
h5->Draw();
c1->cd(6);
h6->SetTitle("Run6280, Thr: 1245");
h6->Draw();
c1->cd(7);
h7->SetTitle("Run6288, Thr: 1230");
h7->Draw();
c1->cd(8);
h8->SetTitle("Run6289, Thr: 1215");
h8->Draw();
c1->cd(9);
h9->SetTitle("Run6290, Thr: 1200");
h9->Draw();
c1->cd(10);
h10->SetTitle("Run6294, Thr: 1185");
h10->Draw();
c1->cd(11);
h11->SetTitle("Run6295, Thr: 1170");
h11->Draw();
// c1->SaveAs("../plots/Efficiency/Mimosa0_eventTimes.pdf");
}
void TEfficiency(){
TEfficiency* pEff = new TEfficiency("eff","my efficiency;x;#epsilon",10,1150,1440);
void efficiency_v_thr(){
TGraph* gr = new TGraph("meanclustersize_v_thr.txt");
gr->SetMarkerStyle(21);
gr->SetMarkerColor(4);
gr->GetXaxis()->SetTitle("Threshold [DAC]");
gr->GetXaxis()->CenterTitle(true);
gr->GetYaxis()->SetTitle("Mean cluster size associated");
gr->GetYaxis()->CenterTitle(true);
gr->GetYaxis()->SetRangeUser(1,1.3);
gr->SetTitle(" ");
gr->Draw("AP");
}
void etacorrection(){
string filename_f1 = "../W5_E2_featureEfficiencyErrorBars/W5_E2_analysis_run6290_1200.root";
string filename_f2 = "../W5_E2_featureEfficiencyErrorBars/6290_complete_analysis_etaCorrection.root";
TFile* f1 = TFile::Open(filename_f1.c_str());
TFile* f2 = TFile::Open(filename_f2.c_str());
string hist1 = "AnalysisDUT/Timepix3_0/residualsX";
string hist2 = "AnalysisDUT/Timepix3_0/residualsX";
TH1F* h1 = static_cast<TH1F*>(f1->Get(hist1.c_str()));
TH1F* h2 = static_cast<TH1F*>(f2->Get(hist2.c_str()));
TCanvas* c1 = new TCanvas("c1","c1",1000,600);
h1->SetLineColor(kBlue);
h1->SetStats(1);
h1->Draw();
gPad->Update();
auto stat1 = dynamic_cast<TPaveStats*>(h1->FindObject("stats"));
if (stat1)
{
stat1->SetTextColor(h1->GetLineColor());
stat1->SetX1NDC(0.1);
stat1->SetX2NDC(0.3);
stat1->Draw();
}
else
{
cerr << "No stats box found!\n";
}
h2->SetLineColor(kRed);
h2->SetStats(1);
h2->Draw("sames");
gPad->Update();
auto stat2 = dynamic_cast<TPaveStats*>(h2->FindObject("stats"));
if (stat2)
{
stat2->SetTextColor(h2->GetLineColor());
stat2->SetX1NDC(0.1);
stat2->SetX2NDC(0.3);
stat2->Draw();
}
else
{
cerr << "No stats box found!\n";
}
/* c1->Modified();
c1->Update(); // make sure it’s really (re)drawn
TPaveStats st = ((TPaveStats)(h1->GetListOfFunctions()->FindObject(“stats”)));
if (st) {
st->SetTextColor(h1->GetLineColor());
st->SetX1NDC(0.64); st->SetX2NDC(0.99);
st->SetY1NDC(0.4); st->SetY2NDC(0.6);
}
st = ((TPaveStats*)(h2->GetListOfFunctions()->FindObject(“stats”)));
if (st) {
st->SetTextColor(h2->GetLineColor());
st->SetX1NDC(0.64); st->SetX2NDC(0.99);
st->SetY1NDC(0.15); st->SetY2NDC(0.35);
}
c1->Modified();
c1->Update(); // make sure it’s really (re)drawn*/
TLegend* leg1 = new TLegend(0.6,0.7,0.9,0.9);
leg1->AddEntry(h1,"before eta correction");
leg1->AddEntry(h2,"after eta correction");
leg1->Draw();
// c1->SaveAs("../PDFs/chi2_ndof.pdf");
}
void analysis(){
string filename_f1 = "../6290_complete_analysis.root";
TFile* f1 = TFile::Open(filename_f1.c_str());
string hist1 = "Correlations/MIMOSA26_0/eventTimes";
string hist2 = "Tracking4D/tracksPerEvent";
string hist3 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist4 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist5 = "AnalysisEfficiency/Timepix3_0/efficiencyColumns";
string hist6 = "AnalysisEfficiency/Timepix3_0/efficiencyRows";
TH1F* h1 = static_cast<TH1F*>(f1->Get(hist1.c_str()));
TH1F* h2 = static_cast<TH1F*>(f1->Get(hist2.c_str()));
TH1F* h3 = static_cast<TH1F*>(f1->Get(hist3.c_str()));
TH1F* h4 = static_cast<TH1F*>(f1->Get(hist4.c_str()));
TH1F* h5 = static_cast<TH1F*>(f1->Get(hist5.c_str()));
TH1F* h6 = static_cast<TH1F*>(f1->Get(hist6.c_str()));
TCanvas* c1 = new TCanvas("c1","Analysis_6290",1000,600);
c1->Divide(2,3);
c1->cd(1);
h1->Draw();
c1->cd(2);
h2->GetXaxis()->SetRangeUser(0,10);
h2->Draw();
c1->cd(3);
h3->GetYaxis()->SetRangeUser(80,110);
h3->Draw("HIST");
c1->cd(4);
h4->SetMarkerStyle(23);
// h4->GetYaxis()->SetRangeUser(0,100);
h4->Draw();
c1->cd(5);
h5->Draw();
c1->cd(6);
h6->Draw();
}
void analysis(){
string filename_f1 = "../6274_complete_analysis.root";
TFile* f1 = TFile::Open(filename_f1.c_str());
string hist1 = "Correlations/MIMOSA26_0/eventTimes";
string hist2 = "Tracking4D/tracksPerEvent";
string hist3 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsTime";
string hist4 = "AnalysisEfficiency/Timepix3_0/hEfficiencyVsMultiplicity";
string hist5 = "AnalysisEfficiency/Timepix3_0/efficiencyColumns";
string hist6 = "AnalysisEfficiency/Timepix3_0/efficiencyRows";
TH1F* h1 = static_cast<TH1F*>(f1->Get(hist1.c_str()));
TH1F* h2 = static_cast<TH1F*>(f1->Get(hist2.c_str()));
TH1F* h3 = static_cast<TH1F*>(f1->Get(hist3.c_str()));
TH1F* h4 = static_cast<TH1F*>(f1->Get(hist4.c_str()));
TH1F* h5 = static_cast<TH1F*>(f1->Get(hist5.c_str()));
TH1F* h6 = static_cast<TH1F*>(f1->Get(hist6.c_str()));
TCanvas* c1 = new TCanvas("c1","Analysis_6274",1000,600);
c1->Divide(2,3);
c1->cd(1);
h1->Draw();
c1->cd(2);
h2->GetXaxis()->SetRangeUser(0,10);
h2->Draw();
c1->cd(3);
h3->Draw("HIST");
c1->cd(4);
h4->SetMarkerStyle(23);
h4->Draw();
c1->cd(5);
h5->Draw();
c1->cd(6);
h6->Draw();
}
void chi2_ndof() {
string filename_f1 = "06_tracking_6275_after_prealignment_max.root";
string filename_f2 = "W5_E2_analysis_run6275_1340.root";
TFile* f1 = TFile::Open(filename_f1.c_str());
TFile* f2 = TFile::Open(filename_f2.c_str());
string hist1 = "Tracking4D/trackChi2ndof";
string hist2 = "Tracking4D/trackChi2ndof";
TH1F* h1 = static_cast<TH1F*>(f1->Get(hist1.c_str()));
TH1F* h2 = static_cast<TH1F*>(f2->Get(hist2.c_str()));
// TCanvas* c1 = new TCanvas("c1","c1",1000,600);
//gStyle->SetOptStat(0);
h2->SetTitle("");
// h1->GetXaxis()->SetTitle("chi2/ndof");
h2->GetYaxis()->SetTitle("Normalized entries");
// h1->GetYaxis()->SetRangeUser(0,1);
h2->GetXaxis()->SetRangeUser(0,20);
h2->SetLineColor(kBlack);
h2->DrawNormalized();
/* h2->SetLineColor(kRed);
// h2->GetYaxis()->SetRangeUser(0,1);
h2->GetXaxis()->SetRangeUser(0,20);
h2->DrawNormalized("same");*/
/* TLegend* leg1 = new TLegend(0.6,0.7,0.9,0.9);
leg1->AddEntry(h1,"After pre-alignment");
leg1->AddEntry(h2,"After precise alignmnet");
leg1->Draw();*/
// c1->SaveAs("../PDFs/chi2_ndof.pdf");
}