diff --git a/CuFluo_analysis_sc.cpp b/CuFluo_analysis_sc.cpp index 2f07844..0247ba6 100644 --- a/CuFluo_analysis_sc.cpp +++ b/CuFluo_analysis_sc.cpp @@ -69,14 +69,18 @@ int main(int argc, char* argv[]) { string data_file = argv[5]; string anadata_loc = argv[6]; //uncomment for VH 210906 + bool save_to_afs = false; + int createHistoFile = 1; //char histoname[128]; //char savename[128]; char histoname[256]; // VH 210902 char savename[256]; // VH 210902 - int filen = 352; - int pedefilen = 5; + char plotfolder[256]; + char rootdatafolder[256]; + int filen = 1; + int pedefilen = 2; // create necessary directories with permissions drwxrwxr-x // data/Mxxx @@ -99,6 +103,40 @@ int main(int argc, char* argv[]) { sprintf(savename,"%s", anadata_loc.c_str()); //uncomment for VH 210906 mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + cout << "I am writing stuff..." << endl; + + if ( save_to_afs ) { + + cout << "Saving to afs." << endl; + + snprintf( plotfolder, 256, "plots/M%s/CuFluo/%s", module_str.c_str(), gain_str.c_str() ); + snprintf( rootdatafolder, 256, "data/M%s", module_str.c_str() ); + + } else { + + cout << "Not saving to afs." << endl; + + // data/Mxxx + sprintf( savename,"%s/data", anadata_loc.c_str() ); + mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + // plots/Mxxx + sprintf( savename,"%s/plots", anadata_loc.c_str() ); + mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + // plots/Mxxx/CuFluo + sprintf( savename,"%s/plots/CuFluo", anadata_loc.c_str() ); + mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + // plots/Mxxx/CuFluo/G0 + sprintf( savename,"%s/plots/CuFluo/G0", anadata_loc.c_str() ); + mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + // plots/Mxxx/CuFluo/HG0 + sprintf( savename,"%s/plots/CuFluo/HG0", anadata_loc.c_str() ); + mkdir(savename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + + snprintf( plotfolder, 256, "%s/plots/CuFluo/%s", anadata_loc.c_str(), gain_str.c_str() ); + snprintf( rootdatafolder, 256, "%s/data", anadata_loc.c_str() ); + + } + jungfrauPixelMask *pixelMaskObject = new jungfrauPixelMask(); bool pixel_mask [NCH]; pixelMaskObject->initialisePixelMask(pixel_mask); @@ -180,7 +218,8 @@ int main(int argc, char* argv[]) { //pedestalObject[sci]->pedestalClear(); //I don't need to clear if I only calculate pedestal once. } - sprintf( savename, "plots/M%s/CuFluo/%s/pixelmask_%s_M%s.png", module_str.c_str(), gain_str.c_str(), gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/pixelmask_%s_M%s.png", plotfolder, gain_str.c_str(), module_str.c_str() ); + cout << savename << endl; pixelMaskObject->plotPixelMask( pixel_mask, savename ); cout << "after chip mask, n masked pixels is " << pixelMaskObject->getNMasked(pixel_mask) << endl; @@ -192,7 +231,7 @@ int main(int argc, char* argv[]) { pedestalsG0[sci]->GetYaxis()->SetTitle("Row"); pedestalsG0[sci]->GetYaxis()->SetTitleOffset(0.7); pedestalsG0[sci]->Draw("colz"); - sprintf(savename,"plots/M%s/CuFluo/%s/pedeG0_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str()); + sprintf(savename,"%s/pedeG0_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str()); mapcanvas->SaveAs((const char *)(savename)); pedestalsG0[sci]->Delete(); //not needed hereafter (try to save memory) @@ -202,7 +241,7 @@ int main(int argc, char* argv[]) { pedeRMSG0[sci]->GetYaxis()->SetTitleOffset(0.7); pedeRMSG0[sci]->GetZaxis()->SetRangeUser(0,30); pedeRMSG0[sci]->Draw("colz"); - sprintf(savename,"plots/M%s/CuFluo/%s/pedeRMSG0_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str()); + sprintf(savename,"%s/pedeRMSG0_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str()); mapcanvas->SaveAs((const char *)(savename)); pedeRMSG0[sci]->Delete(); //not needed hereafter (try to save memory) @@ -341,7 +380,7 @@ int main(int argc, char* argv[]) { adcpc_spec[sci]->GetXaxis()->SetTitle("Pedestal corrected ADC [ADU]"); adcpc_spec[sci]->Draw(); mapcanvas->SetLogy(); - sprintf(savename,"plots/M%s/CuFluo/%s/adcpc_spec_sc%d_slice%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, ( filei/16 ), gain_str.c_str(), module_str.c_str()); + sprintf(savename,"%s/adcpc_spec_sc%d_slice%d_%s_M%s.png", plotfolder, sci, ( filei/16 ), gain_str.c_str(), module_str.c_str()); mapcanvas->SaveAs((const char *)(savename)); mapcanvas->SetLogy(0); adcpc_spec[sci]->Reset(); @@ -359,7 +398,7 @@ int main(int argc, char* argv[]) { pede_updates[sci]->GetYaxis()->SetTitleOffset(0.7); pede_updates[sci]->GetZaxis()->SetRangeUser(0,10000); pede_updates[sci]->Draw("colz"); - sprintf(savename,"plots/M%s/CuFluo/%s/pede_updates_sc%d_slice%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, ( filei/16 ), gain_str.c_str(), module_str.c_str()); + sprintf(savename,"%s/pede_updates_sc%d_slice%d_%s_M%s.png", plotfolder, sci, ( filei/16 ), gain_str.c_str(), module_str.c_str()); mapcanvas->SaveAs((const char *)(savename)); pede_diff[sci]->GetXaxis()->SetTitle("Column"); @@ -367,7 +406,7 @@ int main(int argc, char* argv[]) { pede_diff[sci]->GetYaxis()->SetTitleOffset(0.7); pede_diff[sci]->GetZaxis()->SetRangeUser(-40,40); pede_diff[sci]->Draw("colz"); - sprintf(savename,"plots/M%s/CuFluo/%s/pede_diff_sc%d_slice%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, ( filei/16 ), gain_str.c_str(), module_str.c_str()); + sprintf(savename,"%s/pede_diff_sc%d_slice%d_%s_M%s.png", plotfolder, sci, ( filei/16 ), gain_str.c_str(), module_str.c_str()); mapcanvas->SaveAs((const char *)(savename)); pedestalObject_SC[sci]->pedestalResetUpdates(); @@ -716,7 +755,7 @@ int main(int argc, char* argv[]) { st0->SetY2NDC(0.94); st0->SetBorderSize(0); st0->SetTextSize(0.04); - sprintf( savename, "plots/M%s/CuFluo/%s/noise_%s_sc%d_%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), pixel_type.c_str(), sci, i, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/noise_%s_sc%d_%d_%s_M%s.png", plotfolder, pixel_type.c_str(), sci, i, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); TF1 *gaus_Ka = new TF1( "gaus_Ka", "gaus", proj->GetBinLowEdge(low_bin_peak), proj->GetBinLowEdge(high_bin_peak+1) ); @@ -751,7 +790,7 @@ int main(int argc, char* argv[]) { st->SetY2NDC(0.94); st->SetBorderSize(0); st->SetTextSize(0.04); - sprintf( savename, "plots/M%s/CuFluo/%s/peak_%s_sc%d_%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), pixel_type.c_str(), sci, i, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/peak_%s_sc%d_%d_%s_M%s.png", plotfolder, pixel_type.c_str(), sci, i, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); } @@ -795,7 +834,7 @@ int main(int argc, char* argv[]) { } // end for loop sensor slices (j) - sprintf( savename, "plots/M%s/CuFluo/%s/pixelmask_afterfit_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/pixelmask_afterfit_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); pixelMaskObject->plotPixelMask( pixel_mask, savename ); TPaveText *pave = new TPaveText( 0.86, 0.95, 0.91, 0.98, "blNDC" ); @@ -811,7 +850,7 @@ int main(int argc, char* argv[]) { fit_par3_2d[sci]->GetYaxis()->SetTitleOffset(0.7); fit_par3_2d[sci]->Draw("colz"); fit_par3_2d[sci]->GetZaxis()->SetRangeUser(0,50); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par3_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par3_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); fit_par3_2d[sci]->Delete(); @@ -821,7 +860,7 @@ int main(int argc, char* argv[]) { fit_par4_2d[sci]->GetYaxis()->SetTitleOffset(0.7); fit_par4_2d[sci]->Draw("colz"); fit_par4_2d[sci]->GetZaxis()->SetRangeUser(0,500); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par4_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par4_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); fit_par4_2d[sci]->Delete(); @@ -831,7 +870,7 @@ int main(int argc, char* argv[]) { fit_par5_2d[sci]->GetYaxis()->SetTitleOffset(0.7); fit_par5_2d[sci]->Draw("colz"); fit_par5_2d[sci]->GetZaxis()->SetRangeUser(0,0.5); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par5_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par5_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); fit_par5_2d[sci]->Delete(); @@ -841,7 +880,7 @@ int main(int argc, char* argv[]) { fit_par6_2d[sci]->GetYaxis()->SetTitleOffset(0.7); fit_par6_2d[sci]->Draw("colz"); fit_par6_2d[sci]->GetZaxis()->SetRangeUser(1.0,1.3); //was (1.0,1.25) - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par6_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par6_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); fit_par6_2d[sci]->Delete(); @@ -851,7 +890,7 @@ int main(int argc, char* argv[]) { fit_par7_2d[sci]->GetYaxis()->SetTitleOffset(0.7); fit_par7_2d[sci]->Draw("colz"); fit_par7_2d[sci]->GetZaxis()->SetRangeUser(0.,0.4); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par7_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par7_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); peak_fit_pos_2d[sci]->GetXaxis()->SetTitle("Column"); @@ -859,7 +898,7 @@ int main(int argc, char* argv[]) { peak_fit_pos_2d[sci]->GetYaxis()->SetTitleOffset(0.7); peak_fit_pos_2d[sci]->Draw("colz"); peak_fit_pos_2d[sci]->GetZaxis()->SetRangeUser( low_ADU_peak, high_ADU_peak ); - sprintf( savename, "plots/M%s/CuFluo/%s/peak_fit_pos_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/peak_fit_pos_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); peak_fit_pos_2d[sci]->Delete(); @@ -869,7 +908,7 @@ int main(int argc, char* argv[]) { peak_fit_poserr_2d[sci]->GetYaxis()->SetTitleOffset(0.7); peak_fit_poserr_2d[sci]->Draw("colz"); peak_fit_poserr_2d[sci]->GetZaxis()->SetRangeUser(0,2); - sprintf( savename, "plots/M%s/CuFluo/%s/peak_fit_poserr_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/peak_fit_poserr_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); peak_fit_poserr_2d[sci]->Delete(); @@ -879,7 +918,7 @@ int main(int argc, char* argv[]) { noise_fit_pos_2d[sci]->GetYaxis()->SetTitleOffset(0.7); noise_fit_pos_2d[sci]->Draw("colz"); noise_fit_pos_2d[sci]->GetZaxis()->SetRangeUser(-5,5); - sprintf( savename, "plots/M%s/CuFluo/%s/noise_fit_pos_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/noise_fit_pos_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); noise_fit_pos_2d[sci]->Delete(); @@ -893,7 +932,7 @@ int main(int argc, char* argv[]) { } else if (gain_str == "G0") { noise_fit_poserr_2d[sci]->GetZaxis()->SetRangeUser(0,0.1); // was 0,0.05 } - sprintf( savename, "plots/M%s/CuFluo/%s/noise_fit_poserr_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/noise_fit_poserr_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); noise_fit_poserr_2d[sci]->Delete(); @@ -906,7 +945,7 @@ int main(int argc, char* argv[]) { pave->AddText( (const char *)(savename) ); pave->Draw(); gain_fit_2d[sci]->GetZaxis()->SetRangeUser( low_ADU_peak, high_ADU_peak ); - sprintf( savename, "plots/M%s/CuFluo/%s/gain_fit_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gain_fit_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); gain_fit_2d[sci]->Delete(); @@ -916,7 +955,7 @@ int main(int argc, char* argv[]) { gain_fiterr_2d[sci]->GetYaxis()->SetTitleOffset(0.7); gain_fiterr_2d[sci]->Draw("colz"); gain_fiterr_2d[sci]->GetZaxis()->SetRangeUser(0,2); - sprintf( savename, "plots/M%s/CuFluo/%s/gain_fiterr_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gain_fiterr_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); gain_fiterr_2d[sci]->Delete(); @@ -930,7 +969,7 @@ int main(int argc, char* argv[]) { } else if (gain_str == "G0") { gain_ADUper1keV_2d[sci]->GetZaxis()->SetRangeUser(25,45); //was 35,50 } - sprintf( savename, "plots/M%s/CuFluo/%s/gain_ADUper1keV_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gain_ADUper1keV_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); //gain_ADUper1keV_2d[sci]->Delete(); @@ -944,7 +983,7 @@ int main(int argc, char* argv[]) { } else if (gain_str == "G0") { gainerr_ADUper1keV_2d[sci]->GetZaxis()->SetRangeUser(0,0.25); } - sprintf( savename, "plots/M%s/CuFluo/%s/gainerr_ADUper1keV_2d_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gainerr_ADUper1keV_2d_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); mapcanvas->SaveAs( (const char *)(savename) ); //gainerr_ADUper1keV_2d[sci]->Delete(); @@ -953,61 +992,61 @@ int main(int argc, char* argv[]) { fit_par3[sci]->GetXaxis()->SetTitle("Fit par 3"); fit_par3[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par3_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par3_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); fit_par3[sci]->Delete(); fit_par4[sci]->GetXaxis()->SetTitle("Fit par 4"); fit_par4[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par4_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par4_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); fit_par4[sci]->Delete(); fit_par5[sci]->GetXaxis()->SetTitle("Fit par 5"); fit_par5[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par5_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par5_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); fit_par5[sci]->Delete(); fit_par6[sci]->GetXaxis()->SetTitle("Fit par 6"); fit_par6[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par6_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par6_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); fit_par6[sci]->Delete(); fit_par7[sci]->GetXaxis()->SetTitle("Fit par 7"); fit_par7[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/fit_par7_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/fit_par7_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); peak_fit_pos[sci]->GetXaxis()->SetTitle("Peak position [ADU]"); peak_fit_pos[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/peak_fit_pos_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/peak_fit_pos_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); peak_fit_pos[sci]->Delete(); peak_fit_poserr[sci]->GetXaxis()->SetTitle("Peak position uncert [ADU]"); peak_fit_poserr[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/peak_fit_poserr_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/peak_fit_poserr_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); peak_fit_poserr[sci]->Delete(); noise_fit_pos[sci]->GetXaxis()->SetTitle("Noise position [ADU]"); noise_fit_pos[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/noise_fit_pos_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/noise_fit_pos_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); noise_fit_pos[sci]->Delete(); noise_fit_poserr[sci]->GetXaxis()->SetTitle("Noise position uncert [ADU]"); noise_fit_poserr[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/noise_fit_poserr_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/noise_fit_poserr_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); noise_fit_poserr[sci]->Delete(); @@ -1015,7 +1054,7 @@ int main(int argc, char* argv[]) { sprintf( savename, "Gain %s [ADU / 8 keV]", gain_str.c_str() ); gain_fit[sci]->GetXaxis()->SetTitle( (const char *)(savename) ); gain_fit[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/gain_fit_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gain_fit_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); //gain_fit[sci]->Delete(); @@ -1036,14 +1075,14 @@ int main(int argc, char* argv[]) { pave2->AddText( (const char *)(savename) ); pave2->Draw(); gain_fit[sci]->SetStats(kFALSE); - sprintf( savename, "plots/M%s/CuFluo/%s/gain_fit_fit_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gain_fit_fit_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); gain_fit[sci]->Delete(); gain_fiterr[sci]->GetXaxis()->SetTitle("Gain uncert [ADU / 8 keV]"); gain_fiterr[sci]->Draw(); - sprintf( savename, "plots/M%s/CuFluo/%s/gain_fiterr_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gain_fiterr_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); gain_fiterr[sci]->Delete(); @@ -1080,7 +1119,7 @@ int main(int argc, char* argv[]) { gain_fit_isNextToDouble[sci]->Draw("same"); gain_fit_isBulk[sci]->Draw("same"); leg->Draw("same"); - sprintf( savename, "plots/M%s/CuFluo/%s/gain_fit_perType_sc%d_%s_M%s.png", module_str.c_str(), gain_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/gain_fit_perType_sc%d_%s_M%s.png", plotfolder, sci, gain_str.c_str(), module_str.c_str() ); c1->SaveAs( (const char *)(savename) ); gain_fit_isDouble[sci]->Delete(); @@ -1089,7 +1128,7 @@ int main(int argc, char* argv[]) { gain_fit_isNextToDouble[sci]->Delete(); gain_fit_isBulk[sci]->Delete(); - sprintf( savename, "data/M%s/CuFluo_gain_sc%d_%s_M%s.root", module_str.c_str(), sci, gain_str.c_str(), module_str.c_str() ); + sprintf( savename, "%s/CuFluo_gain_sc%d_%s_M%s.root", rootdatafolder, sci, gain_str.c_str(), module_str.c_str() ); TFile* saved_file = new TFile( (const char *)(savename), "RECREATE" ); gain_ADUper1keV_2d[sci]->Write(); gainerr_ADUper1keV_2d[sci]->Write();