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);
|
||||
}
|
||||
|
||||
int frame_counter = 0;
|
||||
int j = 0;
|
||||
int nfiles = 0;
|
||||
if (module_str == "032") {
|
||||
@ -314,12 +313,10 @@ int main(int argc, char* argv[]) {
|
||||
if (filei == 0) {
|
||||
for (int k = 0; k < (640*3); k++) {
|
||||
thisfile->readNextFrame();
|
||||
frame_counter++;
|
||||
}
|
||||
}
|
||||
|
||||
while (thisfile->readNextFrame()) {
|
||||
frame_counter++;
|
||||
j++;
|
||||
|
||||
uint16_t* imagedptr = thisfile->getFrameDataHandle();
|
||||
@ -546,8 +543,6 @@ int main(int argc, char* argv[]) {
|
||||
delete adc_histos_g2[i];
|
||||
}
|
||||
|
||||
cout << "frame_counter " << frame_counter << endl;
|
||||
|
||||
// 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());
|
||||
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());
|
||||
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");
|
||||
pave2->SetBorderSize(0);
|
||||
pave2->SetFillStyle(0);
|
||||
pave2->SetTextSize(0.04);
|
||||
pave2->SetTextAlign(32);
|
||||
TF1* g0overg1hist_gaus = g0overg1hist->GetFunction("gaus");
|
||||
sprintf(savename,"Mean %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(1), g0overg1hist_gaus->GetParError(1));
|
||||
pave2->AddText((const char *)(savename));
|
||||
sprintf(savename,"Sigma %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(2), g0overg1hist_gaus->GetParError(2));
|
||||
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));
|
||||
if (g0overg1hist->GetEntries() > 0) {
|
||||
g0overg1hist->Fit("gaus");
|
||||
g0overg1hist->Draw();
|
||||
c1->Update();
|
||||
TF1* g0overg1hist_gaus = g0overg1hist->GetFunction("gaus");
|
||||
sprintf(savename,"Mean %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(1), g0overg1hist_gaus->GetParError(1));
|
||||
pave2->AddText((const char *)(savename));
|
||||
sprintf(savename,"Sigma %0.4f #pm %0.4f", g0overg1hist_gaus->GetParameter(2), g0overg1hist_gaus->GetParError(2));
|
||||
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()->SetTitleOffset(1.1);
|
||||
|
Reference in New Issue
Block a user