Commit 387f13ed authored by Keerthi Nakkalil's avatar Keerthi Nakkalil
Browse files

The noise edge positions for each trim dac setting is plotted in a separate pad

parent 1e3c4ce1
void trimdacs(){
std::vector<std::string>filenames={
std::string("dacs0x0_bl_thr.dat"),
std::string("dacs0x1_bl_thr.dat"),
std::string("dacs0x2_bl_thr.dat"),
std::string("dacs0x3_bl_thr.dat"),
std::string("dacs0x4_bl_thr.dat"),
std::string("dacs0x5_bl_thr.dat"),
std::string("dacs0x6_bl_thr.dat"),
std::string("dacs0x7_bl_thr.dat"),
std::string("dacs0x8_bl_thr.dat"),
std::string("dacs0x9_bl_thr.dat"),
std::string("dacs0xA_bl_thr.dat"),
std::string("dacs0xB_bl_thr.dat"),
std::string("dacs0xC_bl_thr.dat"),
std::string("dacs0xD_bl_thr.dat"),
std::string("dacs0xE_bl_thr.dat"),
std::string("dacs0xF_bl_thr.dat")
};
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};
std::vector<TH1D*>histo;
for(int ctr=0;ctr<16;ctr++){
std::ifstream datafile(filenames.at(ctr).c_str());
std::string histo_name = "h"+ filenames.at(ctr);
TH1D* h1= new TH1D(histo_name.c_str(),filenames.at(ctr).c_str(), 175,950,1300);
if(datafile.is_open()){
cout<<" The data file "<<filenames.at(ctr) << " is opened ..."<<std::endl;
while(!datafile.eof()){
double data;
datafile>>data;
h1->Fill(data);
}
gStyle->SetOptStat(1100); //mean and std dev displayed
h1->SetLineColor(colors.at(ctr));
histo.push_back(h1);
cout<<filenames.at(ctr)<<"histogram is filled..."<<std::endl;
}
}
cout<<"size of the histo vector is "<<histo.size()<<std::endl;
TCanvas*c1 = new TCanvas("c1", " ", 1000,1000);
c1->Divide(4,4);
// TLegend *leg = new TLegend(0.7,0.7,0.9,0.9);
for(int i=0;i<histo.size();i++){
c1->cd(i+1);
histo.at(i)->GetXaxis()->SetTitle("Threshold[LSB]");
histo.at(i)->GetYaxis()->SetTitle("# pixels");
histo.at(i)->GetXaxis()->SetLabelOffset(0.02);
histo.at(i)->GetXaxis()->SetTitleOffset(1.4);
// hs->GetYaxis()->SetLabelOffset(0.01);
histo.at(i)->GetYaxis()->SetTitleOffset(1.4);
gPad->Update();
histo.at(i)->Draw();
// leg->AddEntry(histo.at(i),filenames.at(i).c_str(),"l");
// leg->Draw();
}
cout<<"Done..."<<std::endl;
}
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