Removed unused frame_counter variable and added a check before fitting empty histogram.
This commit is contained in:
@ -291,7 +291,6 @@ int main(int argc, char* argv[]) {
|
|||||||
gain_histos[i] = new TH1I(histogramNameStream2.str().c_str(),"",4,-0.5,3.5);
|
gain_histos[i] = new TH1I(histogramNameStream2.str().c_str(),"",4,-0.5,3.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
int frame_counter = 0;
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int nfiles = 0;
|
int nfiles = 0;
|
||||||
if (module_str == "032") {
|
if (module_str == "032") {
|
||||||
@ -314,12 +313,10 @@ int main(int argc, char* argv[]) {
|
|||||||
if (filei == 0) {
|
if (filei == 0) {
|
||||||
for (int k = 0; k < (640*3); k++) {
|
for (int k = 0; k < (640*3); k++) {
|
||||||
thisfile->readNextFrame();
|
thisfile->readNextFrame();
|
||||||
frame_counter++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (thisfile->readNextFrame()) {
|
while (thisfile->readNextFrame()) {
|
||||||
frame_counter++;
|
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
uint16_t* imagedptr = thisfile->getFrameDataHandle();
|
uint16_t* imagedptr = thisfile->getFrameDataHandle();
|
||||||
@ -546,8 +543,6 @@ int main(int argc, char* argv[]) {
|
|||||||
delete adc_histos_g2[i];
|
delete adc_histos_g2[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "frame_counter " << frame_counter << endl;
|
|
||||||
|
|
||||||
// save histograms
|
// save histograms
|
||||||
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/CS_histos_M%s.root", module_str.c_str(), module_str.c_str());
|
sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/CS_histos_M%s.root", module_str.c_str(), module_str.c_str());
|
||||||
TFile* saved_file = new TFile((const char *)(savename),"RECREATE");
|
TFile* saved_file = new TFile((const char *)(savename),"RECREATE");
|
||||||
@ -1282,23 +1277,25 @@ int main(int argc, char* argv[]) {
|
|||||||
sprintf(savename,"plots/M%s/CurrentSource/g0overg1hist_M%s.png", module_str.c_str(), module_str.c_str());
|
sprintf(savename,"plots/M%s/CurrentSource/g0overg1hist_M%s.png", module_str.c_str(), module_str.c_str());
|
||||||
c1->SaveAs((const char *)(savename));
|
c1->SaveAs((const char *)(savename));
|
||||||
|
|
||||||
g0overg1hist->Fit("gaus");
|
|
||||||
g0overg1hist->Draw();
|
|
||||||
c1->Update();
|
|
||||||
TPaveText *pave2 = new TPaveText(0.6,0.8,0.94,0.94,"blNDC");
|
TPaveText *pave2 = new TPaveText(0.6,0.8,0.94,0.94,"blNDC");
|
||||||
pave2->SetBorderSize(0);
|
pave2->SetBorderSize(0);
|
||||||
pave2->SetFillStyle(0);
|
pave2->SetFillStyle(0);
|
||||||
pave2->SetTextSize(0.04);
|
pave2->SetTextSize(0.04);
|
||||||
pave2->SetTextAlign(32);
|
pave2->SetTextAlign(32);
|
||||||
TF1* g0overg1hist_gaus = g0overg1hist->GetFunction("gaus");
|
if (g0overg1hist->GetEntries() > 0) {
|
||||||
sprintf(savename,"Mean %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(1), g0overg1hist_gaus->GetParError(1));
|
g0overg1hist->Fit("gaus");
|
||||||
pave2->AddText((const char *)(savename));
|
g0overg1hist->Draw();
|
||||||
sprintf(savename,"Sigma %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(2), g0overg1hist_gaus->GetParError(2));
|
c1->Update();
|
||||||
pave2->AddText((const char *)(savename));
|
TF1* g0overg1hist_gaus = g0overg1hist->GetFunction("gaus");
|
||||||
pave2->Draw();
|
sprintf(savename,"Mean %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(1), g0overg1hist_gaus->GetParError(1));
|
||||||
g0overg1hist->SetStats(kFALSE);
|
pave2->AddText((const char *)(savename));
|
||||||
sprintf(savename,"plots/M%s/CurrentSource/g0overg1hist_fit_M%s.png", module_str.c_str(), module_str.c_str());
|
sprintf(savename,"Sigma %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(2), g0overg1hist_gaus->GetParError(2));
|
||||||
c1->SaveAs((const char *)(savename));
|
pave2->AddText((const char *)(savename));
|
||||||
|
pave2->Draw();
|
||||||
|
g0overg1hist->SetStats(kFALSE);
|
||||||
|
sprintf(savename,"plots/M%s/CurrentSource/g0overg1hist_fit_M%s.png", module_str.c_str(), module_str.c_str());
|
||||||
|
c1->SaveAs((const char *)(savename));
|
||||||
|
}
|
||||||
|
|
||||||
g0overg1erhist->GetXaxis()->SetTitle("G0 / G1 uncert");
|
g0overg1erhist->GetXaxis()->SetTitle("G0 / G1 uncert");
|
||||||
g0overg1erhist->GetXaxis()->SetTitleOffset(1.1);
|
g0overg1erhist->GetXaxis()->SetTitleOffset(1.1);
|
||||||
|
Reference in New Issue
Block a user