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

Bin numbers, z=scale range properly assigned. Some strange...

Bin numbers, z=scale range properly assigned. Some strange pixels(dead/masked?) with AVR and RMS values = -1 is excluded in the histogram plotting. The strange pixel's addresses are also identified. Correct 2d histos plotted.
parent 0676fe4a
......@@ -2,24 +2,24 @@ void noise2(){
double row, col;
TCanvas* c1 = new TCanvas();
// std::string hist_name = "h" + std::to_string(row) + "_" + std::to_string(col);
TH2D* histo = new TH2D("histo", "Noise distribution",200,0.,255.,200,0.,255.);
TH2D* histo = new TH2D("histo", "Noise distribution",256,0.,256.,256,0.,256.);
for (row = 0; row < 256; row++){
for(col = 0; col < 256; col++){
stringstream foldername, filename;
foldername << std::setw(3) << std::setfill('0') << row;
std::cout << " Foldername : " << foldername.str()<< std::endl;
// std::cout << " Foldername : " << foldername.str()<< std::endl;
filename << std::setw(3) << std::setfill('0') << row << "_"
<< std::setw(3) << std::setfill('0') << col << ".dat";
cout << "Filename : " << filename.str() << std::endl;
//cout << "Filename : " << filename.str() << std::endl;
std::ifstream infile(foldername.str()+"/"+filename.str());
if(infile.is_open()){
std::cout<<"The data file is opened..."<<std::endl;
// std::cout<<"The data file is opened..."<<std::endl;
std::string line;
double avr=0.,rms=0.;
......@@ -61,18 +61,43 @@ void noise2(){
rms = arr[1];
}
cout << " avr : " << avr << " " << " rms : " << rms << std::endl;
histo->Fill(row,col,rms);
// cout << " avr : " << avr << " " << " rms : " << rms << std::endl;
if(rms >= 0){
histo->Fill(row,col,rms);
}
else{
cout<< " filename : " << filename.str() << " avr : " << avr << " rms : " << rms << std::endl;
}
}
else{
cout<<"Error..."<<std::endl;
}
}
}
histo->SetStats(0);
// gStyle->SetOptStat(111100);
histo->Draw("COLZ");
histo->GetXaxis()->SetTitle("Row");
histo->GetYaxis()->SetTitle("Column");
histo->GetZaxis()->SetTitle("Baseline");
histo->GetZaxis()->SetRangeUser(5,25);
histo->Draw("colz");
/* histo->Draw("COLZ");
gPad->Update();
auto stat = dynamic_cast<TPaveStats*>(histo->FindObject("stats"));
if (stat)
{
stat->SetX1NDC(0.4);
stat->SetX2NDC(0.6);
stat->Draw();
}
else
{
cerr << "No stats box found!\n";
}*/
}
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