numberRuns=0;
std::vector<int> runList;
- TString analysisis; // what kind of analyse to make, can be more than one
std::vector<Bool_t> runListForceAnalysis;
std::vector<TString> runListCustomTitle;
std::vector<TString> sumuprunList; // not used yet, add runs to each other, combine statistics
#include "SetStyle.c"
- InterpreteUserInput(runnumber, &runList, &runListForceAnalysis, &runListCustomTitle, &sumuprunList, &analysisis);
+ InterpreteUserInput(runnumber, &runList, &runListForceAnalysis, &runListCustomTitle, &sumuprunList, &analysisType);
runs = new Run*[numberRuns];
// set file path and other variables to be set
runs[runi] = new Run(runList[runi], runi);
if (!runs[runi]->error)
{
- runs[runi]->setResultsPath(savepathresults);
+ vector<TH1FO*> CompareHistogramVector;
+ CompareHistogramVector.push_back(runs[runi]->histogram->Seed);
+ FindGoodTitle(&CompareHistogramVector);
+ runs[runi]->setResultsPath(savepathresults + folderadd);
runs[runi]->error=runs[runi]->initRun();
runs[runi]->setDynamicalNoiseMode("simple");
runs[runi]->useDynamicalNoise(true);
//runs[runi]->setNoisethresholdborderE(220);
// runs[runi]->analyzeFrame(680);
// continue;
- runs[runi]->setFixedThresholdValueADU(30);
+// runs[runi]->setFixedThresholdValueADU(30);
// creates or opens .root file, can analyze the RAW data
// use only lower case when matching anaylsis types
- if (analysisis.Contains("clas")) { // classic analysis
+ if (analysisType.Contains("clas")) { // classic analysis
compareHistogramClassVectorClassic.push_back(runs[runi]->histogram->normalized);
if (runi+1 == runnumber)
compareHistogramClassVectorVector.push_back(compareHistogramClassVectorClassic);
}
- if (analysisis.Contains("dynthresh") || analysisis.Contains("dynamicalthresh")) { // fixed threshold analysis
+ if (analysisType.Contains("dynthresh") || analysisType.Contains("dynamicalthresh")) { // fixed threshold analysis
vector<HistogramType*> compareHistogramClassVectorDynamicalThreshold;
compareHistogramClassVectorDynamicalThreshold.push_back(runs[runi]->histogram);
compareHistogramClassVectorDynamicalThreshold.push_back(runs[runi]->histogramdynamicalthreshold);
compareHistogramClassVectorDynamicalThreshold.clear();
}
- if (analysisis.Contains("cali")) { // calibrated analysis
+ if (analysisType.Contains("cali")) { // calibrated analysis
compareHistogramClassVectorCalibrated.push_back(runs[runi]->histogram->calibrated->normalized);
if (runi+1 == runnumber)
compareHistogramClassVectorVector.push_back(compareHistogramClassVectorCalibrated);
}
- if (analysisis.Contains("signal")) { // F0 analysis for some frames, quantitatively
+ if (analysisType.Contains("signal")) { // F0 analysis for some frames, quantitatively
runs[runi]->processed->plotSignal(100,1000);
}
- if (analysisis.Contains("depl")) { // depletion analysis
+ if (analysisType.Contains("depl")) { // depletion analysis
compareHistogramVectorDepletion.push_back(runs[runi]->histogramdynamicalthreshold->normalized->SeedPerc);
datainputPosVeto->itsHistogramType = runs[runi]->histogramdynamicalthreshold;
ntupleVectorDepltetion1.push_back(datainputPosVeto);
ntupleVectorVector.push_back(ntupleVectorDepltetion1);
}
-
+
prop2ndpixelfire->itsHistogramType = runs[runi]->histogramdynamicalthreshold;
prop2ndpixelfire->xaxisTitle = "Voltage";
prop2ndpixelfire->yaxisTitle = "Propability for second pixel to fire";
prop2ndpixelfire->Fill(runs[runi]->labbook.depletionV,runs[runi]->histogramdynamicalthreshold->clustermultiplicity->GetBinContent(2),0,0);
- cout << colorcyan << " Cluster Mult.:" << runs[runi]->histogramdynamicalthreshold->clustermultiplicity << endlr;
if (runi+1 == runnumber) {
ntupleVectorDepltetion2.push_back(prop2ndpixelfire);
ntupleVectorVector.push_back(ntupleVectorDepltetion2);
}
-
Double_t AverageCharge[9];
Double_t TotalHits[9];
for (UInt_t sumi = 0; sumi < 9; sumi++) {
}
}
- if (analysisis.Contains("rts")) { // rts studies
+ if (analysisType.Contains("rts")) { // rts studies
vector<HistogramType*> compareHistogramClassVectorRTS;
compareHistogramClassVectorRTS.push_back(runs[runi]->histogramwoRTS);
compareHistogramClassVectorRTS.push_back(runs[runi]->histogram);
}
}
- if (analysisis.Contains("seedf")) { // seedfit: seed integral anaylsis
+ if (analysisType.Contains("seedf")) { // seedfit: seed integral anaylsis
runs[runi]->plot1DHistogram( runs[runi]->histogram->normalized->Seed, "gaus", true, false, false, runs[runi]->histogram->fixedThresholdValue);
runs[runi]->plot1DHistogram( runs[runi]->histogramdynamicalthreshold->normalized->Seed, "gaus", true, false, false, runs[runi]->histogram->fixedThresholdValue);
}
}
- if (analysisis.Contains("sumf")) { // seedfit: seed integral anaylsis
+ if (analysisType.Contains("sumf")) { // seedfit: seed integral anaylsis
runs[runi]->plot1DHistogram(*(runs[runi]->histogram->normalized->Sum), "gaus", true, false, false, runs[runi]->histogram->fixedThresholdValue);
runs[runi]->plot1DHistogram(*(runs[runi]->histogramdynamicalthreshold->normalized->Sum), "gaus", true, false, false, runs[runi]->histogram->fixedThresholdValue);
}
}
- if (analysisis.Contains("cluster")) { // analyze cluster formation
+ if (analysisType.Contains("cluster")) { // analyze cluster formation
// show cluster multiplicity
compareHistogramVectorClusterMultiplicity.push_back(runs[runi]->histogram->normalized->clustermultiplicity);
// runs[runi]->plot1DHistogram( runs[runi]->histogram->clustermultiplicity);
}
- if (analysisis.Contains("temp")) { // analyze temperatur dependance
+ if (analysisType.Contains("temp")) { // analyze temperatur dependance
compareHistogramClassVectorTemp.push_back(runs[runi]->histogramfixedthreshold->normalized);
Double_t AverageChargeTempSeed = 0;
}
- if (analysisis.Contains("f0")) { // analyze cluster formation
+ if (analysisType.Contains("f0")) { // analyze cluster formation
// Plot F0 signal
vector<TH1FO*> compareHistogramVectorF0;
compareHistogramVectorF0.push_back(runs[runi]->averageF0DistrEnd);
/** @brief A function to setup file path and other variables
*
*/
-void Init();
+void Init(TString);
/** @brief A function to plot ntuplöe data into a canvas
vector< vector<TNtupleO*> > ntupleVectorVector;
TString ownpath = "";
TString savepathresults;
+TString analysisType = "";
void setCustomPath(TString setOwnpath)
{
void Init()
{
- //FindGoodTitle();
+// FindGoodTitle();
TTimeStamp timestamp = TTimeStamp();
- savepathresults = Form("./results/%d%06d", (int)timestamp.GetDate(kFALSE), (int)timestamp.GetTime(kFALSE));
+ savepathresults = Form("./results/%d%06d %s", (int)timestamp.GetDate(kFALSE), (int)timestamp.GetTime(kFALSE), analysisType.Data());
}
{
if (ntuplepvectorpointer->size() > 0) {
TNtupleO* ntuplepointer = ntuplepvectorpointer->at(0);
- system("mkdir "+ savepathresults + folderadd + "/" + " -p");
+ system("mkdir \""+ savepathresults + folderadd + "/\"" + " -p");
TString filename = savepathresults + folderadd + "/" + Form("Observable_%s.dat", ntuplepointer->GetName());
TString header = "";
{
if (ptCompareHistogramClassVector->size() > 0)
{
- system("mkdir "+ savepathresults + folderadd + "/" + " -p");
+ system("mkdir \""+ savepathresults + folderadd + "/\"" + " -p");
TString filename = Form("%s%s/Spectrum_%d_%s", savepathresults.Data(), folderadd.Data(), ptCompareHistogramClassVector->at(0)->labbook->runnumber, ptCompareHistogramClassVector->at(0)->histogramdescription.Data());
{
if (numberRuns>0)
{
- system("mkdir "+ savepathresults + folderadd + "/" + " -p");
+ system("mkdir \""+ savepathresults + folderadd + "/\"" + " -p");
TString filename = savepathresults + folderadd + "/Spectra";
TString header = "";
for (UInt_t histogrami=0; histogrami < ptCompareHistogramClassVector->size(); histogrami++)
folderadd.Append(Form(" %.2fMhz", ptCompareHistogramClassVector->at(histogrami)->labbook->clock));
+ removeForbiddenChar(&folderadd);
+
system("mkdir \""+ savepathresults + folderadd + "/\"" + " -p");
// cout << colorred << savepathresults << folderadd << endlr;
Bool_t Run::setResultsPath(TString path)
{
cout << "Changing save directory to '" << path << "'" << endl;
- if (system("mkdir '"+ path + "' -p"))
+ if (system("mkdir \""+ path + "\" -p"))
{
cout << "\033[1;31mError changing directory, save path is: '\033[1;37m" << savepathresults << "\033[1;31m'\033[0m" << endl;
return 1;
Bool_t Run::writeHistogramToFile(TH1F* onehistogram)
{
- system("mkdir "+ savepathresults + " -p");
+ system("mkdir \""+ savepathresults + "\" -p");
TString filename= savepathresults + "/" + runcode + " " + onehistogram->GetName() + " hist.dat";
fstream* fout = new fstream(filename,ios::out);
Bool_t Run::write2DHistogramToFile(TH2F* onehistogram)
{
- system("mkdir "+ savepathresults + " -p");
+ system("mkdir \""+ savepathresults + "\" -p");
TString filename= savepathresults + "/" + runcode + " " + onehistogram->GetName() + " hist.dat";
fstream* fout = new fstream(filename,ios::out);
Bool_t Run::writeAllHistogramsToFile()
{
- system("mkdir "+ savepathresults + " -p");
+ system("mkdir \""+ savepathresults + "\" -p");
TString filename= savepathresults + "/" + runcode + " histograms.dat";
fstream* fout = new fstream(filename,ios::out);
void Run::MakeGnuplotFile()
{
- system("mkdir "+ savepathresults + " -p");
+ system("mkdir \""+ savepathresults + "\" -p");
TString filename= savepathresults + "/" + runcode+"_gnuplot.plt";
fstream* fout = new fstream(filename,ios::out);