Commit 1e3c4ce1 authored by Keerthi Nakkalil's avatar Keerthi Nakkalil
Browse files

Trim dac scan for all 16 values with the legend displayed

parent f89dde2b
......@@ -20,8 +20,8 @@ void trimdac_scan(){
};
std::vector<int>colors={kTeal+3,kPink-3,kOrange+8,kRed+4 ,kCyan+2,kMagenta+1,kGreen-3,kPink-6,kBlue+3,kYellow+3,kPink+2,kBlue-6,kRed-1,kYellow-5,kRed-8,kAzure};
double data;
TCanvas*c1 = new TCanvas();
THStack*hs = new THStack("hs", "Trim dac scan");
TCanvas* c1 = new TCanvas("c1");
for(int ctr=0;ctr<16;ctr++){
std::ifstream datafile(filenames.at(ctr).c_str());
......@@ -37,6 +37,7 @@ void trimdac_scan(){
// cout<<data<<std::endl;
h1->Fill(data);
}
h1->SetStats(0);
h1->SetLineColor(colors.at(ctr));
histo.push_back(h1);
cout<<filenames.at(ctr)<<"histogram is filled..."<<std::endl;
......@@ -51,9 +52,23 @@ void trimdac_scan(){
cout<<"stacking"<< histo.at(i)<<std::endl;
hs->Add(histo.at(i),"sames");
}
hs->Draw("hist nostack");
hs->GetXaxis()->SetTitle("Threshold [LSB]");
hs->GetYaxis()->SetTitle(" #pixels");
hs->GetXaxis()->SetTitle("Threshold[LSB]");
hs->GetYaxis()->SetTitle("# pixels");
hs->GetXaxis()->SetLabelOffset(0.02);
hs->GetXaxis()->SetTitleOffset(1.4);
// hs->GetYaxis()->SetLabelOffset(0.01);
hs->GetYaxis()->SetTitleOffset(1.4);
gPad->Update();
TLegend *leg = new TLegend(0.7,0.7,0.9,0.9);
for (int k=0;k<histo.size();k++){
leg->AddEntry(histo.at(k),filenames.at(k).c_str(),"l");
}
leg->Draw("SAME");
cout<<"Done.."<<std::endl;
}
......@@ -64,3 +79,5 @@ void trimdac_scan(){
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