// runs[runi]->setSubMatrixBorders(100,120,100,120);
//runs[runi]->setFixedThresholdValueElectrons(1440);
//runs[runi]->setNoisethresholdborderADU(30);
+ //runs[runi]->setNoisethresholdborderE(220);
// runs[runi]->analyzeFrame(6384);
// runs[runi]->analyzeFrame(6605);
gROOT->SetBatch(kFALSE);
// Uncomment below to do classical analysis withour RTS
-// compareHistogramClassVector.push_back(runs[runi]->histogramwoRTS->normalized);
+// compareHistogramClassVector.push_back(runs[runi]->histogramwoRTS->normalized);
// compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTS);
- compareHistogramClassVector.push_back(runs[runi]->histogram->normalized);
+// compareHistogramClassVector.push_back(runs[runi]->histogram->normalized);
compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTS->normalized);
- runs[runi]->plot1DHistogram(runs[runi]->histogram, runs[runi]->histogramwoRTS->pixeltimefired, "", 0);
+ compareHistogramClassVector.push_back(runs[runi]->histogram->normalized);
+// runs[runi]->plot1DHistogram(runs[runi]->histogram, runs[runi]->histogramwoRTS->pixeltimefired, "", 0);
//compareHistogramClassVector.push_back(runs[runi]->histogramwoRTS);
// compareHistogramClassVector2.push_back(runs[runi]->histogramthreshold);
//compareHistogramVector.push_back(runs[runi]->histogram->normalized->calibrated->Seed);
//compareHistogramVector2.push_back(runs[runi]->histogram->normalized->Seed);
// runs[runi]->plot1DHistogram(runs[runi]->histogram->normalized->calibrated, runs[runi]->processed->fNoiseInfo.fPedestals, "", 1);
- runs[runi]->plot1DHistogram(runs[runi]->histogram->normalized->calibrated, runs[runi]->histogram->normalized->calibrated->Seed, "landau", 1);
- runs[runi]->plot1DHistogram(runs[runi]->histogram, runs[runi]->histogramwoRTS->pixeltimefiredsorted, "", 0);
+// runs[runi]->plot1DHistogram(runs[runi]->histogram->normalized, runs[runi]->histogramwoRTS->normalized->calibrated->Seed, "landau", 1, 1, 0, 200);
+// runs[runi]->plot1DHistogram(runs[runi]->histogram, runs[runi]->histogramwoRTS->pixeltimefiredsorted, "", 0);
// runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->normalized->calibrated, runs[runi]->histogramwoRTS->normalized->calibrated->Seed, "landau", true);
// runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->normalized->calibrated, runs[runi]->histogramwoRTS->normalized->calibrated->Sum, "gaus", true);
hs->Add(curhistogramclone);
legendEntry = Form("%s", curhistogramclone->GetTitle());
if (legendStringsVector.size() > 0)
+ {
legendEntry = Form("%s", legendStringsVector.at(histogrami).Data());
+ cout << colorcyan << legendEntry << endlr;
+ }
leg2->AddEntry(curhistogramclone, legendEntry, "l");
leg2->Draw("SAME");
// hs->Add(leg1);
// same_System = kFALSE;
}
- // construct header stringรถ
+ // construct header string
TString title1 = "";
if (same_Source)
title1.Append(Form(", %s", firstlabbook.source.Data()));
title1.Append(Form(", %.1f*10^{13} n_{eq}/cm^{2}", firstlabbook.radDoseNonIon));
if (same_Clock)
title1.Append(Form(", %.2f Mhz", firstlabbook.clock));
- if (same_Depletion && firstlabbook.depletionV > 0)
+ if (same_Depletion && firstlabbook.depletionV >= 0)
title1.Append(Form(", U_{dep}=%.1f V", firstlabbook.depletionV));
headerStringsVector.push_back(title1);
legendstr.Append(Form("%.1f*10^{13} n_{eq}/cm^{2}", curlabbook.radDoseNonIon)); }
if (!same_Clock) { if (legendstr.Length()) legendstr.Append(", ");
legendstr.Append(Form("%.2f Mhz", curlabbook.clock)); }
- if (!same_Depletion && curlabbook.depletionV > 0) { if (legendstr.Length()) legendstr.Append(", ");
+ if (!same_Depletion && curlabbook.depletionV >= 0) { if (legendstr.Length()) legendstr.Append(", ");
legendstr.Append(Form("U_{dep}=%.1f V", curlabbook.depletionV)); }
legendStringsVector.push_back(legendstr);
}
if (!same_Clock)
for (UInt_t histogrami=0; histogrami < ptCompareHistogramClassVector->size(); histogrami++)
folderadd.Append(Form(" %.2f Mhz", ptCompareHistogramClassVector->at(histogrami)->labbook->clock));
- if (!same_Depletion && curlabbook.depletionV > 0)
+ if (!same_Depletion && curlabbook.depletionV >= 0)
for (UInt_t histogrami=0; histogrami < ptCompareHistogramClassVector->size(); histogrami++)
folderadd.Append(Form(" %.1fV", ptCompareHistogramClassVector->at(histogrami)->labbook->depletionV));
normalized->avgNoise = avgNoise;
normalized->avgNoisePlus = avgNoisePlus;
normalized->avgNoiseMinus = avgNoiseMinus;
- normalized->sr90IntegralVal = sr90IntegralVal/frames_found*pow10(6);
+ normalized->sr90IntegralVal = sr90IntegralVal;
normalized->StoN = StoN;
normalized->CCE_in_Perc_1 = CCE_in_Perc_1;
normalized->CCE_in_Perc_25 = CCE_in_Perc_25;
Bool_t HistogramType::FindNoisethresholdborder(TH1F* histogrampointer, Bool_t overwrite, Bool_t verbose) {
if (overwrite || noisethresholdborder == -1)
{
+// cout << colorcyan << "Find border" << endl;
Float_t posMaxValHist = histogrampointer->GetXaxis()->GetXmax();
TH1F* smoothedcurce = (TH1F*)histogrampointer->Clone();
if (thresholdborder < 0)
{
if (noisethresholdborder < 0) {
+// cout << "noisethresholdborder is not set, searching" << endl;
FindNoisethresholdborder(histogrampointer, true, verbose);
}
thresholdbincurcandidate = histogrampointer->GetXaxis()->FindBin(noisethresholdborder);
+// cout << colorcyan << "noisethresholdborder: " << noisethresholdborder << endl;
+// cout << colorcyan << "thresholdbincurcandidate: " << thresholdbincurcandidate << endl;
}
else
{
}
}
}
- sr90IntegralVal = histogrampointer->IntegralAndError(thresholdbincurcandidate,histogrampointer->GetNbinsX(), sr90IntegralErr);
+// sr90IntegralVal = histogrampointer->integral(thresholdbincurcandidate,histogrampointer->GetNbinsX(), sr90IntegralErr);
+ sr90IntegralVal = histogrampointer->Integral(thresholdbincurcandidate,histogrampointer->GetNbinsX());
+// histogrampointer->Integral(min+fittries*min/20, histogrampointer->GetXaxis()->FindBin(posMaxValHist));
+// for (
// cout << "Integrate from bin " << thresholdbincurcandidate << " to " << histogrampointer->GetNbinsX() << endl;
- sr90IntegralErr /= sr90IntegralVal/100;
+// sr90IntegralErr /= sr90IntegralVal/100;
// cout << " Unscaled integral is " << Form("%e",sr90IntegralVal) << ", error " << sr90IntegralErr << "%" << endl;
// cout << " ";
if (verbose)
if (frames_found>0)
{
sr90IntegralVal/=frames_found;
+ cout << "Integral is " << colorgreen << Form("%e",sr90IntegralVal) << colorreset << endl;
if (verbose)
cout << "Scaled ";
}
- if (verbose)
- cout << "Integral is " << colorgreen << Form("%e",sr90IntegralVal) << colorreset << ", error " << sr90IntegralErr << "%" << endl;
+ if (verbose) {
+// cout << "Integral is " << colorgreen << Form("%e",sr90IntegralVal) << colorreset << ", error " << sr90IntegralErr << "%" << endl;
+ cout << "Integral is " << colorgreen << Form("%e",sr90IntegralVal) << endlr;
+ }
return 0;
}
// canvasFrame->SetName(cm1->GetName());
cm1->Update();
cout<<"\rPIXELMATRIX plotted! "<<endl;
+
+ TString canvastitle = Form("%s %s", "F0", "F0");
+ TString canvasname = Form("%s %s", "F0", "F0");
+ TCanvas* canvas = new TCanvas(canvasname, canvastitle, 900, 700);
+ h4->Draw();
+
+
cout<<"-------------------"<<endl;
}
}
//####################################################################
#endif
-
\ No newline at end of file
+
systemparam systemparamPXI (800*16,800,75,150,150);
systemparam systemparamFSBB (2800,2800/4,25,10,100);
systemparam systemparamUSBMi19 (400/*maxbin*/,400/1/*nbins*/, 25/*vetothreshold*/, 10/*maxbinnoise*/, 100/*nbinsnoise*/);
- systemparam systemparamPipper2 (500,500,15,10,100);
+ systemparam systemparamPipper2 (1000,250,15,10,100);
if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("Mi34") )
cursystemparam = systemparamUSB;
else if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("FSBB") )
(*curHistogramClass)->noisethresholdborder = noisethresholdborderADU;
if (noisethresholdborderE > -1) {
if (labbook.gainDB > 0) {
- (*curHistogramClass)->noisethresholdborder = noisethresholdborderE / labbook.gainDB;
+ (*curHistogramClass)->noisethresholdborder = noisethresholdborderE / labbook.gainDB;
+ cout << colorcyan << "Set noisethresholdborder to : " << (*curHistogramClass)->noisethresholdborder << " (" << noisethresholdborderE << " e)" << endlr;
} else {
cout << colorred << "Could not set noise threshold border in units of electrons to " << noisethresholdborderE << "e, no calibration done yet. Please rerun after first analysis." <<endlr;
}
Bool_t Run::setNoisethresholdborderE(Float_t noisethresholdborder)
{
- noisethresholdborderADU = noisethresholdborder;
+ noisethresholdborderE = noisethresholdborder;
cout << " Noise threshold border: " << colorwhite << noisethresholdborder << " e"<< colorreset << " <-- only used if GAIN is allready saved in database, rerun after first analysis to make sure" << endl;
return 0;
}
}
}
if (histogramthreshold->normalized->calibrated != 0)
-// if (histogramfixedthreshold != 0)
+ if (labbook.source.Contains("Sr") && histogramthreshold->normalized->calibrated->sr90IntegralVal > 0)
constructUpdateString(&sqlupdatequery, "Sr90IntegralVal", histogramthreshold->normalized->calibrated->sr90IntegralVal,1000000000);
if (sqlupdatequery.length()>0)