From 8cb6d2db199f86c1addf8c6083ef66218caab273 Mon Sep 17 00:00:00 2001 From: Benjamin Linnik Date: Tue, 20 Dec 2016 16:14:53 +0100 Subject: [PATCH] Analyzer: More piyels for anaylsis in Pipper2, Bugfix RTS --- MABS_run_analyzer/ChargeSpektrum.c | 6 ++++-- MABS_run_analyzer/ChargeSpektrumFunctions.c | 3 --- MABS_run_analyzer/MAPS.c | 20 +++++++++++--------- MABS_run_analyzer/Run.c | 11 ++++++----- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/MABS_run_analyzer/ChargeSpektrum.c b/MABS_run_analyzer/ChargeSpektrum.c index fbfb76f..70f31f7 100644 --- a/MABS_run_analyzer/ChargeSpektrum.c +++ b/MABS_run_analyzer/ChargeSpektrum.c @@ -63,7 +63,7 @@ void ChargeSpektrum(TString runnumber = "") //runs[runi]->setNoisethresholdborderADU(30); // runs[runi]->analyzeFrame(6384); -// runs[runi]->analyzeFrame(6604); +// runs[runi]->analyzeFrame(6605); // runs[runi]->analyzeFrame(675); // runs[runi]->analyzeFrame(680); // runs[runi]->analyzeFrame(685); @@ -104,13 +104,15 @@ void ChargeSpektrum(TString runnumber = "") // compareHistogramClassVector.push_back(runs[runi]->histogramwoRTS->normalized); // compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTS); 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]->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]->histogram->normalized->calibrated->Seed, "landau", 1); // runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->normalized->calibrated, runs[runi]->histogramwoRTS->normalized->calibrated->Seed, "landau", true); - runs[runi]->plot1DHistogram(runs[runi]->histogram->normalized, runs[runi]->histogram->normalized->Seed, "gaus", true); +// runs[runi]->plot1DHistogram(runs[runi]->histogramwoRTS->normalized->calibrated, runs[runi]->histogramwoRTS->normalized->calibrated->Sum, "gaus", true); // // Uncomment below to do analysis without RTS pixel // compareHistogramClassVector2.push_back(runs[runi]->histogramwoRTSthreshold); diff --git a/MABS_run_analyzer/ChargeSpektrumFunctions.c b/MABS_run_analyzer/ChargeSpektrumFunctions.c index 1999399..5a283b6 100644 --- a/MABS_run_analyzer/ChargeSpektrumFunctions.c +++ b/MABS_run_analyzer/ChargeSpektrumFunctions.c @@ -705,10 +705,8 @@ Bool_t plotAllRuns(vector* ptCompareHistogramClassVector) gPad->SetGridy(1); owntitle->Clear(); if (headerStringsVector.size() > 0) { - cout << colorred << "Hallo1" << endlr; owntitle->AddText(Form("%s, %s",trimRunnumberAtBegin(curhistogramclone->GetName()).Data(), headerStringsVector.at(1).Data())); owntitle->AddText(headerStringsVector.at(2)); - cout << colorred << "Hallo2" << endlr; } owntitle->Draw("SAME"); @@ -879,7 +877,6 @@ Bool_t FindGoodTitle(vector* ptCompareHistogramClassVector) { same_ChipGen = kFALSE; if (!curlabbook.matrix.EqualTo(firstlabbook.matrix)) { same_Matrix = kFALSE; - cout << colorred << "Not same matrix: " << curlabbook.matrix << " != " << firstlabbook.matrix << endlr; } if (firstlabbook.tempSens > 0) { // allow 10 % difference if (curlabbook.tempSens > firstlabbook.tempSens*1.1 || curlabbook.tempSens < firstlabbook.tempSens*0.9) diff --git a/MABS_run_analyzer/MAPS.c b/MABS_run_analyzer/MAPS.c index abe296d..7cca3ae 100644 --- a/MABS_run_analyzer/MAPS.c +++ b/MABS_run_analyzer/MAPS.c @@ -1508,22 +1508,24 @@ void MAPS::hitana() { } } -// if ( B < 10) CHANCE=0; // TODO remove me, buggy column 3 in Mi19, triing to ommit dirty? - - - //Begin: loop evaluate true seeds: if(CHANCE==100) { if(fOrderCode=="FSBB") + { + if (B < 2 || B > fColumns-3 || A < 1 || A > fRows-2) + bordercluster = true; + else + bordercluster = false; + } else if(fOrderCode=="Pipper2") // collects very efficient in one seed { if (B < 2 || B > fColumns-3 || A < 1 || A > fRows-2) bordercluster = true; else bordercluster = false; } - else //if not FSBB + else //if not FSBB or Pipper2 { if (B < 2 || B > fColumns-3 || A < 2 || A > fRows-3) bordercluster = true; @@ -1534,9 +1536,9 @@ void MAPS::hitana() { { for(Int_t column=0; column<5; column++) { - if ( (row==0) && (A<2) ) { } - else if ( (row==1) && (A<1) ) { } - else if ( (row==3) && (A>= (fRows-1)) ) { } + if ( (row==0) && (A<2) ) { } // A is the global position of the HIT on the sensor + else if ( (row==1) && (A<1) ) { } // this procedure is to make sure, that cluster elements which are NOT part of the whole sensor + else if ( (row==3) && (A>= (fRows-1)) ) { } // will not crash the program, as these areas DO NOT exist (physically). else if ( (row==4) && (A>= (fRows-2)) ) { } else { @@ -1557,7 +1559,7 @@ void MAPS::hitana() { if (bordercluster) fHittedPixel[Hitlist[hit]] = -2; - else + else // the hit was NOT on the border of the sensor { fHittedPixel[Hitlist[hit]] = 2; diff --git a/MABS_run_analyzer/Run.c b/MABS_run_analyzer/Run.c index 6e2380c..714d5ee 100644 --- a/MABS_run_analyzer/Run.c +++ b/MABS_run_analyzer/Run.c @@ -446,10 +446,10 @@ Bool_t Run::analyzeRun(Bool_t force) for (vector::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++) { cout << "Processing histograms in class: <" << colorwhite << (*curHistogramClass)->histogramdescription << colorreset << " >" << endlr; if ((*curHistogramClass)->maskRTSpixel) { - if (labbook.chipGen=="Mi19") { +// if (labbook.chipGen=="Mi19") { cout << colorwhite << " FindRTSPixelToMask():" << endlr; FindRTSPixelToMask(*curHistogramClass); - } +// } } } cout << "--------------------------------------------" << endl; @@ -535,7 +535,7 @@ Bool_t Run::FindRTSPixelToMask(HistogramType* HistogramTypepointer) // HistogramTypepointer->pixeltimefiredsorted->Fill(2000); } } - TH1F* pixeltimefiredWithOverflow = ShowOverflow(HistogramTypepointer->pixeltimefiredsorted); +// TH1F* pixeltimefiredWithOverflow = ShowOverflow(HistogramTypepointer->pixeltimefiredsorted); // Double_t const probabilities[] = {1-erf(HistogramTypepointer->RTSthreshold/sqrt(2)), 0.5, erf(HistogramTypepointer->RTSthreshold/sqrt(2))}; // sigma/2 from gaus to the left and to the right //{0.17, 0.5, 1-0.17}; // HistogramTypepointer->pixeltimefiredsorted->GetQuantiles( 3, leakagequantiles, probabilities); @@ -975,8 +975,8 @@ void Run::updateDatabase() { if (histogramthreshold->normalized->calibrated != 0) // if (histogramthreshold->normalized->calibrated->avgNoiseMinus < 100) constructUpdateString(&sqlupdatequery, "Avg.Noise-", histogramthreshold->normalized->calibrated->avgNoiseMinus, 2); - constructUpdateString(&sqlupdatequery, "CCE_1", histogram->normalized->CCE_in_Perc_1); // because histogramthreshold didn't work well with Pipper2.... why?' - constructUpdateString(&sqlupdatequery, "CCE_25", histogram->normalized->CCE_in_Perc_25); + constructUpdateString(&sqlupdatequery, "CCE_1", histogramthreshold->normalized->CCE_in_Perc_1); + constructUpdateString(&sqlupdatequery, "CCE_25", histogramthreshold->normalized->CCE_in_Perc_25); constructUpdateString(&sqlupdatequery, "StoN", histogramthreshold->normalized->StoN, 3); // if (histogramthreshold->normalized->avgNoise < 100) constructUpdateString(&sqlupdatequery, "Avg.NoiseADC", histogramthreshold->normalized->avgNoise); @@ -2110,6 +2110,7 @@ TCanvas* Run::plot1DHistogram(HistogramType* HistogramTypepointer, TH1F* onehist if (withOverflow) onehistogram=ShowOverflow(onehistogram); onehistogram->Draw(); + Double_t* parameters = (Double_t *)calloc(10, sizeof(Double_t)); // allocate 10 parameters for safety, maximum 9 used at the moment Float_t maxValue = 0; if (fitFuncType!="") -- 2.43.0