if (analysisType.Contains("leak")) { // analyze cluster formation
+ if (analysisType.Contains("rts")) {
+ vector<TH1FO*> compareHistogramVectorLeakage;
+ compareHistogramVectorLeakage.push_back(runs[runi]->histogramwoRTS->LeakageCurrentDistrib);
+ compareHistogramVectorLeakage.push_back(runs[runi]->histogram->LeakageCurrentDistrib);
+ // plot and clear compareHistogramClassVectorRTS vector,
+ CompareHistograms(&compareHistogramVectorLeakage);
+ compareHistogramVectorLeakage.clear();
+ }
+
// Plot leakage current
- compareHistogramLeakageCurrent.push_back(runs[runi]->histogram->LeakageCurrentDistrib);
+ compareHistogramLeakageCurrent.push_back(HistogramTypeDefaultPt->LeakageCurrentDistrib);
if (runi+1 == numberRuns) {
compareHistogramVectorVector.push_back(compareHistogramLeakageCurrent);
}
-
- runs[runi]->plot1DHistogram(runs[runi]->histogramdynamicalthreshold->Veto, "GaussTail", true);
- runs[runi]->plot1DHistogram(runs[runi]->histogram->LeakageCurrentInPixelSorted, "", false, true);
+ if (runs[runi]->labbook.chipGen.EqualTo("Pipper2")) {
+ runs[runi]->plot1DHistogram(runs[runi]->histogramdynamicalthreshold->Veto, "GaussTail", true);
+ } else {
+ runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->Veto, "GaussTail", true);
+ }
+ runs[runi]->plot1DHistogram(HistogramTypeDefaultPt->LeakageCurrentInPixelSorted, "", false, true);
}
if (analysisType.Contains("seedf")) { // seedfit: seed integral anaylsis
initHistogramCustom(pixeltimefiredDistrib, "Fire counter" + histogramdescription, color, style, 0, labbook->frames_foundDB/100, labbook->frames_foundDB/100, "times fired", "Counts");
initHistogramCustom(LeakageCurrentInPixel, "Leakage current per pixel" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
initHistogramCustom(LeakageCurrentInPixelSorted, "Leakage current per pixel sorted" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Average CDS");
- initHistogramCustom(LeakageCurrentDistrib, "Average Leakage current per pixel" + histogramdescription, color, style, 0, 20, 200, "Average CDS", "Count");
+ initHistogramCustom(LeakageCurrentDistrib, "Average Leakage current per pixel" + histogramdescription, color, style, -100, 400, 1000, "Average CDS", "Count");
// initHistogram(LeakageCurrentInPixelSorted, "Leakage current" + histogramdescription, color, style);
initHistogramCustom(pixelHadGoodVeto, "Number of times pixel had good veto" + histogramdescription, color, style, 0, cursensorinfo->columns*cursensorinfo->rows, cursensorinfo->columns*cursensorinfo->rows, "Pixel index", "Counter good veto");
cout << "---------- 1. loop over all classes --------" << endl;
for (vector<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++) {
cout << "Processing histograms in class: <" << colorwhite << (*curHistogramClass)->histogramdescription << colorreset << " >" << endlr;
+ BinFiringRates(*curHistogramClass);
if ((*curHistogramClass)->maskRTSpixel) {
// if (labbook.chipGen=="Mi19") {
cout << colorwhite << " FindRTSPixelToMask():" << endlr;
return 1;
}
-Bool_t Run::FindRTSPixelToMask(HistogramType* HistogramTypepointer, Bool_t verbose)
-{
-
- Double_t meanpixeltimesfired = 0;
- Double_t RTSpixelHits = 0;
- Double_t totalHits = 0;
- Double_t stdeviation = 0;
- numberofactivepixel = 0;
-
- labbook.numberofRTSpixel = 0;
-
+
+Bool_t Run::BinFiringRates(HistogramType* HistogramTypepointer, Bool_t verbose)
+{
// first run, bin number of times pixel fired, sort by pixelindex
uint pixelnumber = 0;
uint binnumber = 0;
for(Int_t hiti=0; (unsigned int)hiti<processed->fFrameInfo.hits;hiti++) { // loop over hits in a frame
pixelnumber = processed->fFrameInfo.pixel[hiti];
binnumber = HistogramTypepointer->pixeltimefired->Fill(pixelnumber);
- // cout << "binnumber: " << binnumber; // Pixel #10 will be saved in bin number 11 (!)
- // cout << colorcyan << " Pixel " << pixelnumber << " fired in frame " << framei << " hiti " << hiti << endlr;
}
}
for (Int_t pixeli=1; pixeli <= HistogramTypepointer->pixeltimefired->GetNbinsX(); pixeli++) {
if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0) {
HistogramTypepointer->pixeltimefiredDistrib->Fill(HistogramTypepointer->pixeltimefired->GetBinContent(pixeli));
+ }
+ }
+ return 0;
+}
+
+
+Bool_t Run::FindRTSPixelToMask(HistogramType* HistogramTypepointer, Bool_t verbose)
+{
+
+ Double_t meanpixeltimesfired = 0;
+ Double_t RTSpixelHits = 0;
+ Double_t totalHits = 0;
+ Double_t stdeviation = 0;
+ numberofactivepixel = 0;
+
+ labbook.numberofRTSpixel = 0;
+
+ // calculate the mean firing times and bin fireing times in a propability histogram, first approach
+ for (Int_t pixeli=1; pixeli <= HistogramTypepointer->pixeltimefired->GetNbinsX(); pixeli++) {
+ if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0) {
meanpixeltimesfired += HistogramTypepointer->pixeltimefired->GetBinContent(pixeli);
numberofactivepixel++;
- // HistogramTypepointer->pixeltimefiredsorted->Fill(2000);
}
}
meanpixeltimesfired /= numberofactivepixel; // Very rough estimate of a mean firing time
// vrey rough estimate on standard deviation
for (Int_t pixeli=1; pixeli <= HistogramTypepointer->pixeltimefired->GetNbinsX(); pixeli++) {
- if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0)
+ if (HistogramTypepointer->pixeltimefired->GetBinContent(pixeli) > 0) {
stdeviation += pow(HistogramTypepointer->pixeltimefired->GetBinContent(pixeli)-meanpixeltimesfired,2);
+ }
}
stdeviation /= numberofactivepixel;
stdeviation = sqrt(stdeviation);
oneHistogramClass->medianLeakageCurrentMinus = oneHistogramClass->LeakageCurrentInPixelSorted->GetBinContent(lastbinabovezero*probabilities[0]);
oneHistogramClass->medianLeakageCurrentMinus = oneHistogramClass->medianLeakageCurrentMinus - oneHistogramClass->medianLeakageCurrent;
- // TCanvas *c1 = new TCanvas("c1","c1",600,400);
- // oneHistogramClass->LeakageCurrentInPixelSorted->Draw("");
- // c1->Update();
- // TCanvas *c2 = new TCanvas("c2","c2",600,400);
- // oneHistogramClass->LeakageCurrentDistrib->Draw("");
- // c2->Update();
- // cout << "medianLeakageCurrent: " << oneHistogramClass->medianLeakageCurrent << endl;
- // cout << "medianLeakageCurrentPlus: " << oneHistogramClass->medianLeakageCurrentPlus << endl;
- // cout << "medianLeakageCurrentMinus: " << oneHistogramClass->medianLeakageCurrentMinus << endl;
- //
+// TCanvas *c1 = new TCanvas("c1","c1",600,400);
+// oneHistogramClass->LeakageCurrentInPixelSorted->Draw("");
+// c1->Update();
+// TCanvas *c2 = new TCanvas(oneHistogramClass->histogramdescription,oneHistogramClass->histogramdescription,600,400);
+// oneHistogramClass->LeakageCurrentDistrib->Draw("");
+// c2->Update();
+// cout << "medianLeakageCurrent: " << oneHistogramClass->medianLeakageCurrent << endl;
+// cout << "medianLeakageCurrentPlus: " << oneHistogramClass->medianLeakageCurrentPlus << endl;
+// cout << "medianLeakageCurrentMinus: " << oneHistogramClass->medianLeakageCurrentMinus << endl;
+// //
//
// oneHistogramClass->medianLeakageCurrent = leakagequantiles[1];
// oneHistogramClass->medianLeakageCurrentPlus = leakagequantiles[2];