Int_t* ReadRunList();
void plotAllRuns();
void plotAllRuns(TString);
-
+void writeObservableToFile(TString);
Run** runs;
Int_t numberRuns;
Bool_t isBatch = kFALSE;
}
runs[runi]->setResultsPath("./results/");
runs[runi]->useDynamicalNoise(true);
- // runs[runi]->analyzeRun(true); // creates or opens .root file, can analyze the RAW data
- runs[runi]->analyzeFrame(353);
+ runs[runi]->analyzeRun(false); // creates or opens .root file, can analyze the RAW data
+ // runs[runi]->analyzeFrame(353);
// gROOT->SetBatch(kTRUE);
// runs[runi]->plotSeed();
// runs[runi]->plotSeedThreshold();
}
plotAllRuns("");
plotAllRuns("threshold");
+ writeObservableToFile("Seed");
}
Int_t* ReadRunList()
// {
//
// }
-
+void writeObservableToFile(TString observable)
+{
+ TString runnumberListe="Seed_";
+ for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
+ {
+ TString runnumber=Form("%d",runs[runi]->labbook.runnumber);
+
+ runnumberListe+=runnumber+"_";
+ }
+ system("mkdir "+ runs[0]->savepathresults + " -p");
+ TString filename= runs[0]->savepathresults + "/" + runnumberListe + "_histograms.dat";
+ fstream* fout = new fstream(filename,ios::out);
+ TString header;
+ for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
+ {
+ TString runnumber=Form("%d",runs[runi]->labbook.runnumber);
+ header+="Bins\t"+runnumber+"\t";
+ }
+
+ *fout << header << endl;
+ TString headerInfo;
+ for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
+ {
+ headerInfo+="\t"+runs[runi]->runcode+"\t";
+ }
+
+ *fout << headerInfo << endl;
+
+ runs[0]->histogrampointer = &runs[0]->histogramthreshold;
+
+ for(Int_t bin=0;bin<runs[0]->histogrampointer->Seed->GetNbinsX();bin++)//Achtung möglicher Bug, da hier nur die Bins vom ersten Run genommen werden, haben die anderen runs mehr/weniger Bins, kann es crashen, sollte aber normalerweise kein Problem sein, da alle Histogramme mit der gleichen Binzahl erstellt werden
+ {
+ for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
+ {
+ runs[runi]->histogrampointer = &runs[runi]->histogramthreshold;
+ TString outline;
+ outline=Form("%.1f\t%.1f",runs[runi]->histogrampointer->Seed->GetBinCenter(bin),runs[runi]->histogrampointer->Seed->GetBinContent(bin));
+ *fout<<outline<<"\t";
+ }
+ *fout<<endl;
+ }
+ fout->close();
+
+ return;
+
+
+
+}
void plotAllRuns(TString histogramtype)
{
if (histogramtype.Contains("threshold"))
for(Int_t runi=0;runi<numberRuns;runi++) { /* loop over runs read from file */
- runs[runi]->histogrampointer = &runs[runi]->histogramthreshold; }
+ runs[runi]->histogrampointer = &runs[runi]->histogramthreshold;
+ }
else if (histogramtype.Contains("calibrated") || histogramtype.Contains("electron"))
for(Int_t runi=0;runi<numberRuns;runi++) /* loop over runs read from file */ {
runs[runi]->histogrampointer = &runs[runi]->histogramCalibrated; }