Int_t* ReadRunList();
void plotAllRuns();
+void plotAllRunsThreshold();
Run** runs;
Int_t numberRuns;
cout << "Found " << numberRuns << " run(s) in 'runlist.txt'." << endl;
for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
{
- runs[runi] = new Run(runList[runi]);
+ runs[runi] = new Run(runList[runi], runi);
if (runi%2)
{
// check if devided matrix is investigated
}
}
runs[runi]->setResultsPath("./results/");
- runs[runi]->setPlotStyle(runi);
runs[runi]->useDynamicalNoise(true);
runs[runi]->analyzeRun(false); // creates or opens .root file, can analyze the RAW data
// gROOT->SetBatch(kTRUE);
-// runs[runi]->plotSeed();
+ // runs[runi]->plotSeed();
+ runs[runi]->plotSeedThreshold();
// runs[runi]->plotSum();
// runs[runi]->plotVeto();
// runs[runi]->plotNoise();
if (!isBatch)
gROOT->SetBatch(kFALSE);
- runs[runi]->plotAllHistograms();
+// runs[runi]->plotAllHistograms();
runs[runi]->plotAllHistogramsThresholdCluster();
- runs[runi]->plotAllHistogramsCalibrated();
+// runs[runi]->plotAllHistogramsCalibrated();
runs[runi]->writeAllHistogramsToFile();
}
plotAllRuns();
+ plotAllRunsThreshold();
}
Int_t* ReadRunList()
}
}
+void plotAllRunsThreshold()
+{
+ if (numberRuns > 1)
+ {
+ Float_t lastbin;
+ TTimeStamp* time = new TTimeStamp();
+
+ TCanvas* canvas = new TCanvas(Form("%d",time->GetNanoSec()), "Summary", 1600, 1000);
+ if (isBatch)
+ canvas->SetCanvasSize(3200,2000);
+
+ canvas->Divide(2,2);
+ Float_t height = numberRuns * 0.04;
+ TLegend* leg1 = new TLegend(0.3,0.89-height,0.89,0.89);//(0.6,0.7,0.89,0.89);
+ TLegend* leg2 = new TLegend(0.6,0.89-height,0.89,0.89);//(0.6,0.7,0.89,0.89);
+ leg1->SetTextSize(0.02);
+ leg2->SetTextSize(0.02);
+ leg1->SetFillColor(0); leg1->SetBorderSize(0);
+ leg2->SetFillColor(0); leg2->SetBorderSize(0);
+ TString legendEntry;
+
+ for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
+ {
+ canvas->cd(1);
+ runs[runi]->histogramthreshold.Seed->Draw("SAME");
+ lastbin = runs[runi]->histogramthreshold.Seed->GetBinCenter(runs[runi]->histogramthreshold.Seed->FindLastBinAbove(2,1));
+ runs[runi]->histogramthreshold.Seed->SetAxisRange(0,lastbin*1.1,"X");
+ gPad->SetLogy(1);
+ legendEntry = Form("%s", runs[runi]->histogramthreshold.Seed->GetTitle());
+ leg1->AddEntry(runs[runi]->histogramthreshold.Veto, legendEntry, "l");
+ leg1->Draw("SAME");
+ canvas->cd(2);
+ runs[runi]->histogramthreshold.Sum->Draw("SAME");
+ lastbin = runs[runi]->histogramthreshold.Sum->GetBinCenter(runs[runi]->histogramthreshold.Sum->FindLastBinAbove(2,1));
+ runs[runi]->histogramthreshold.Sum->SetAxisRange(0,lastbin*1.1,"X");
+ canvas->cd(3);
+ runs[runi]->histogramthreshold.Veto->Draw("SAME");
+ runs[runi]->histogramthreshold.Veto->SetAxisRange(runs[runi]->histogramthreshold.posVeto*0.7,runs[runi]->histogramthreshold.posVeto*1.4,"X");
+ canvas->cd(4);
+ runs[runi]->histogramthreshold.Noise->Draw("SAME");
+ legendEntry = Form("%s, Noise: %.2f", runs[runi]->labbook.matrix.Data(), runs[runi]->histogramthreshold.avgNoise);
+ leg2->AddEntry(runs[runi]->histogramthreshold.Veto, legendEntry, "l");
+ leg2->Draw("SAME");
+ }
+
+ // canvas -> Print( runs[0]->savepathresults + "/" + canvastitle + ".eps");
+ TImageDump *img = new TImageDump(runs[0]->savepathresults + "/" + Form("%s - %s",runs[0]->runcode.Data(), runs[numberRuns-1]->runcode.Data()) + ".png");
+ canvas->Paint();
+ img->Close();
+
+ TFile *f = new TFile(runs[0]->savepathresults + "/" + Form("%s - %s",runs[0]->runcode.Data(),runs[numberRuns-1]->runcode.Data()) + ".root","RECREATE");
+ f->cd();
+ f->Append(canvas);
+ f->Append(img);
+ f->Write();
+ }
+}
#include "Run.h"
using namespace std;
+Run::~Run( void)
+{
+ db->Close();
+ cout << "gelöscht Run" << endl;
+}
+
Run::Run( void )
{
cout << "\033[1;31mError while initializing Run class, please provide a runnumber to the class!\033[0m\n";
exit(EXIT_FAILURE);
}
-Run::~Run( void)
+Run::Run(Int_t runnumber)
{
- db->Close();
- cout << "gelöscht Run" << endl;
+ Run(runnumber, 0);
}
-Run::Run(Int_t runnumber)
+Run::Run(Int_t runnumber, Int_t loopi)
{
+ plotStyle = loopi%13;
labbook.runnumber = runnumber;
random1 = new TRandom;
random1->SetSeed(0);
histogram.Sum->SetLineColor(rootcolors[plotStyle]);
histogram.Veto->SetLineColor(rootcolors[plotStyle]);
histogram.Noise->SetLineColor(rootcolors[plotStyle]);
+
+ histogramCalibrated.Seed->SetLineColor(rootcolors[plotStyle]);
+ histogramCalibrated.Sum->SetLineColor(rootcolors[plotStyle]);
+ histogramCalibrated.Veto->SetLineColor(rootcolors[plotStyle]);
+ histogramCalibrated.Noise->SetLineColor(rootcolors[plotStyle]);
+
+ histogramthreshold.Seed->SetLineColor(rootcolors[plotStyle]);
+ histogramthreshold.Sum->SetLineColor(rootcolors[plotStyle]);
+ histogramthreshold.Veto->SetLineColor(rootcolors[plotStyle]);
+ histogramthreshold.Noise->SetLineColor(rootcolors[plotStyle]);
}
Bool_t Run::plotNoise()
}
+Bool_t Run::plotSeedThreshold()
+{
+ if (!error)
+ {
+ plot1DHistogram(histogramthreshold.Seed, "landau");
+ return 0;
+ }
+ return 1;
+}
+
+
Bool_t Run::plotSum()
{
if (!error)
TString humanreadablestr = Form("%s, %s spectrum, Mi%s, chip %s, %s, T=%.1f",prefix.Data(), labbook.source.Data(), labbook.chipGen.Data(), labbook.chip.Data(), labbook.matrix.Data(), labbook.temp);
histogrampointer=new TH1F(prefix.Data(), humanreadablestr.Data(), systemparamcur.nbins, 0, systemparamcur.maxbin);
histogrampointer->SetLineStyle(rootlinestyle[plotStyle]);
+ cout << "prefix: " << prefix << " rootcolor: " << rootcolors[plotStyle] << endl;
histogrampointer->SetLineColor(rootcolors[plotStyle]);
histogrampointer->SetStats(kTRUE);
histogrampointer->SetStats(111111111);