Added date to gainmaps and plots, to start maintaining a history.

This commit is contained in:
redford_s
2019-02-13 17:50:35 +01:00
parent 6501cded3f
commit ca364fdc79

View File

@ -40,6 +40,14 @@ int main(int argc, char* argv[]) {
char savename[128];
// today's date
time_t rawtime;
tm* timeinfo;
char date[80];
time(&rawtime);
timeinfo = localtime(&rawtime);
strftime(date,80,"%Y-%m-%d",timeinfo);
// CuFluo HG0 dataset
sprintf(savename,"data/M%s/CuFluo_gain_HG0_M%s.root", module_str.c_str(), module_str.c_str());
TFile* FL_HG0_file = new TFile((char*)savename,"READ");
@ -156,7 +164,7 @@ int main(int argc, char* argv[]) {
TH2F* missingvalmap_g1 = new TH2F("missingvalmap_g1","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
TH2F* missingvalmap_g2 = new TH2F("missingvalmap_g2","",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5);
sprintf(savename,"data/M%s/gainMaps_M%s.bin", module_str.c_str(), module_str.c_str());
sprintf(savename,"data/M%s/gainMaps_M%s_%s.bin", module_str.c_str(), module_str.c_str(), date);
fstream outfile;
outfile.open(savename, ios::binary | ios::out);
@ -346,7 +354,7 @@ int main(int argc, char* argv[]) {
pave->AddText("HG0 [ADU/keV]");
pave->Draw();
hg0mapall->GetZaxis()->SetRangeUser(90,110);
sprintf(savename,"plots/M%s/hgain0_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/hgain0_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
hg0fermapall->GetXaxis()->SetTitle("Column");
@ -354,7 +362,7 @@ int main(int argc, char* argv[]) {
hg0fermapall->GetYaxis()->SetTitleOffset(0.7);
hg0fermapall->Draw("colz");
hg0fermapall->GetZaxis()->SetRangeUser(0.,0.005);
sprintf(savename,"plots/M%s/hgain0fer_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/hgain0fer_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g0mapall->GetXaxis()->SetTitle("Column");
@ -365,7 +373,7 @@ int main(int argc, char* argv[]) {
pave->AddText("G0 [ADU/keV]");
pave->Draw();
g0mapall->GetZaxis()->SetRangeUser(38,46);
sprintf(savename,"plots/M%s/gain0_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain0_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g0fermapall->GetXaxis()->SetTitle("Column");
@ -373,7 +381,7 @@ int main(int argc, char* argv[]) {
g0fermapall->GetYaxis()->SetTitleOffset(0.7);
g0fermapall->Draw("colz");
g0fermapall->GetZaxis()->SetRangeUser(0.,0.005);
sprintf(savename,"plots/M%s/gain0fer_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain0fer_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g1mapall->GetXaxis()->SetTitle("Column");
@ -384,7 +392,7 @@ int main(int argc, char* argv[]) {
pave->AddText("G1 [ADU/keV]");
pave->Draw();
g1mapall->GetZaxis()->SetRangeUser(-1.56,-1.36);
sprintf(savename,"plots/M%s/gain1_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain1_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g1fermapall->GetXaxis()->SetTitle("Column");
@ -392,7 +400,7 @@ int main(int argc, char* argv[]) {
g1fermapall->GetYaxis()->SetTitleOffset(0.7);
g1fermapall->Draw("colz");
g1fermapall->GetZaxis()->SetRangeUser(0,0.005);
sprintf(savename,"plots/M%s/gain1fer_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain1fer_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g2mapall->GetXaxis()->SetTitle("Column");
@ -403,7 +411,7 @@ int main(int argc, char* argv[]) {
pave->AddText("G2 [ADU/keV]");
pave->Draw();
g2mapall->GetZaxis()->SetRangeUser(-0.122,-0.108);
sprintf(savename,"plots/M%s/gain2_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain2_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g2fermapall->GetXaxis()->SetTitle("Column");
@ -411,7 +419,7 @@ int main(int argc, char* argv[]) {
g2fermapall->GetYaxis()->SetTitleOffset(0.7);
g2fermapall->Draw("colz");
g2fermapall->GetZaxis()->SetRangeUser(0,0.1);
sprintf(savename,"plots/M%s/gain2fer_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain2fer_all_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
hg0mapcut->GetXaxis()->SetTitle("Column");
@ -422,7 +430,7 @@ int main(int argc, char* argv[]) {
pave->AddText("HG0 [ADU/keV]");
pave->Draw();
hg0mapcut->GetZaxis()->SetRangeUser(90,110);
sprintf(savename,"plots/M%s/hgain0_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/hgain0_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g0mapcut->GetXaxis()->SetTitle("Column");
@ -433,7 +441,7 @@ int main(int argc, char* argv[]) {
pave->AddText("G0 [ADU/keV]");
pave->Draw();
g0mapcut->GetZaxis()->SetRangeUser(38,46);
sprintf(savename,"plots/M%s/gain0_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain0_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g1mapcut->GetXaxis()->SetTitle("Column");
@ -444,7 +452,7 @@ int main(int argc, char* argv[]) {
pave->AddText("G1 [ADU/keV]");
pave->Draw();
g1mapcut->GetZaxis()->SetRangeUser(-1.56,-1.36);
sprintf(savename,"plots/M%s/gain1_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain1_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
g2mapcut->GetXaxis()->SetTitle("Column");
@ -455,7 +463,7 @@ int main(int argc, char* argv[]) {
pave->AddText("G2 [ADU/keV]");
pave->Draw();
g2mapcut->GetZaxis()->SetRangeUser(-0.122,-0.108);
sprintf(savename,"plots/M%s/gain2_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/gain2_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
defaultvalmap_hg0->GetXaxis()->SetTitle("Column");
@ -467,7 +475,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
defaultvalmap_hg0->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/defaultvalmap_hg0_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/defaultvalmap_hg0_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
defaultvalmap_g0->GetXaxis()->SetTitle("Column");
@ -479,7 +487,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
defaultvalmap_g0->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/defaultvalmap_g0_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/defaultvalmap_g0_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
defaultvalmap_g1->GetXaxis()->SetTitle("Column");
@ -491,7 +499,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
defaultvalmap_g1->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/defaultvalmap_g1_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/defaultvalmap_g1_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
defaultvalmap_g2->GetXaxis()->SetTitle("Column");
@ -503,7 +511,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
defaultvalmap_g2->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/defaultvalmap_g2_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/defaultvalmap_g2_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
missingvalmap_hg0->GetXaxis()->SetTitle("Column");
@ -515,7 +523,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
missingvalmap_hg0->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/missingvalmap_hg0_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/missingvalmap_hg0_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
missingvalmap_g0->GetXaxis()->SetTitle("Column");
@ -527,7 +535,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
missingvalmap_g0->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/missingvalmap_g0_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/missingvalmap_g0_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
missingvalmap_g1->GetXaxis()->SetTitle("Column");
@ -539,7 +547,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
missingvalmap_g1->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/missingvalmap_g1_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/missingvalmap_g1_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
missingvalmap_g2->GetXaxis()->SetTitle("Column");
@ -551,7 +559,7 @@ int main(int argc, char* argv[]) {
pave->AddText(savename);
pave->Draw();
missingvalmap_g2->GetZaxis()->SetRangeUser(0,1);
sprintf(savename,"plots/M%s/missingvalmap_g2_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/missingvalmap_g2_M%s.png", module_str.c_str(), date, module_str.c_str());
mapcanvas->SaveAs((const char *)(savename));
TCanvas* c1 = new TCanvas("c1","");
@ -563,93 +571,93 @@ int main(int argc, char* argv[]) {
hg0histall->GetXaxis()->SetTitle("Gain HG0 [ADU / keV]");
hg0histall->Draw();
sprintf(savename,"plots/M%s/hg0hist_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/hg0hist_all_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
hg0histcut->GetXaxis()->SetTitle("Gain HG0 [ADU / keV]");
hg0histcut->Draw();
sprintf(savename,"plots/M%s/hg0hist_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/hg0hist_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
hg0histcut->Draw();
hg0histall->Draw("same");
sprintf(savename,"plots/M%s/hg0hist_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/hg0hist_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy();
sprintf(savename,"plots/M%s/hg0hist_log_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/hg0hist_log_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy(0);
g0histall->GetXaxis()->SetTitle("Gain G0 [ADU / keV]");
g0histall->Draw();
sprintf(savename,"plots/M%s/g0hist_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g0hist_all_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g0histcut->GetXaxis()->SetTitle("Gain G0 [ADU / keV]");
g0histcut->Draw();
sprintf(savename,"plots/M%s/g0hist_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g0hist_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g0histcut->Draw();
g0histall->Draw("same");
sprintf(savename,"plots/M%s/g0hist_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g0hist_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy();
sprintf(savename,"plots/M%s/g0hist_log_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g0hist_log_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy(0);
g1histall->GetXaxis()->SetTitle("Gain G1 [ADU / keV]");
g1histall->Draw();
sprintf(savename,"plots/M%s/g1hist_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g1hist_all_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g1histcut->GetXaxis()->SetTitle("Gain G1 [ADU / keV]");
g1histcut->Draw();
sprintf(savename,"plots/M%s/g1hist_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g1hist_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g1histcut->Draw();
g1histall->Draw("same");
sprintf(savename,"plots/M%s/g1hist_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g1hist_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy();
sprintf(savename,"plots/M%s/g1hist_log_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g1hist_log_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy(0);
g2histall->GetXaxis()->SetTitle("Gain G2 [ADU / keV]");
g2histall->Draw();
sprintf(savename,"plots/M%s/g2hist_all_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g2hist_all_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g2histcut->GetXaxis()->SetTitle("Gain G2 [ADU / keV]");
g2histcut->Draw();
sprintf(savename,"plots/M%s/g2hist_cut_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g2hist_cut_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g2histcut->Draw();
g2histall->Draw("same");
sprintf(savename,"plots/M%s/g2hist_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g2hist_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy();
sprintf(savename,"plots/M%s/g2hist_log_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g2hist_log_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
c1->SetLogy(0);
g0ferhistall->GetXaxis()->SetTitle("Gain G0 frac uncert");
g0ferhistall->Draw();
sprintf(savename,"plots/M%s/g0ferhist_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g0ferhist_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g1ferhistall->GetXaxis()->SetTitle("Gain G1 frac uncert");
g1ferhistall->Draw();
sprintf(savename,"plots/M%s/g1ferhist_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g1ferhist_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
g2ferhistall->GetXaxis()->SetTitle("Gain G2 frac uncert");
g2ferhistall->Draw();
sprintf(savename,"plots/M%s/g2ferhist_M%s.png", module_str.c_str(), module_str.c_str());
sprintf(savename,"plots/M%s/Calib_%s/g2ferhist_M%s.png", module_str.c_str(), date, module_str.c_str());
c1->SaveAs((const char *)(savename));
}