From: Dennis Doering Date: Fri, 11 Sep 2015 13:20:25 +0000 (+0200) Subject: FSBB nach Version A X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=99a14024ff039feb430dad7fd14023ee9d4a8973;p=radhard.git FSBB nach Version A 0 208 416 624 1 2 207 832 833 Weitere Versuche als reOrder drin aber nicht genutzt --- diff --git a/MABS_run_analyzer/MAPS.c b/MABS_run_analyzer/MAPS.c index d0e9496..3490fde 100644 --- a/MABS_run_analyzer/MAPS.c +++ b/MABS_run_analyzer/MAPS.c @@ -1549,26 +1549,49 @@ void MAPS::hitana() { // cout << endl; //Check seeds (whether highest entry in cluster): - for(Int_t i=6; i<19; i++) // why not over full cluster? (I=0 i<25 TODO - { - if ( (i!=12) && (pixelchargeincluster[i] > pixelchargeincluster[12]) ) { - CHANCE=0; -// cout << "kill cluster: " << Hitlist[hit] << " with ADC: " << pixelchargeincluster[12] << endl; - break; - } - // maybe this is unnecessary, if upper if clause is a >= comparison - else if ( (i!=12) && (pixelchargeincluster[i] == pixelchargeincluster[12]) && i>12 ) { - cout << "WARNING: next pixel value identical to precessor, frame : " << fFrameInfo.frame << ", values: " << pixelchargeincluster[i] << " == " << pixelchargeincluster[12] << endl; - CHANCE=0; //NOTE: potential error source - break; - } - else { - CHANCE=100; - if(i%5==3) { - i+=2; - }; - } - } + if(fOrderCode=="FSBB") + { + for(Int_t i=0; i<25; i++) // why not over full cluster? (I=0 i<25 TODO + { + if ( (i!=12) && (pixelchargeincluster[i] > pixelchargeincluster[12]) ) { + CHANCE=0; + // cout << "kill cluster: " << Hitlist[hit] << " with ADC: " << pixelchargeincluster[12] << endl; + break; + } + // maybe this is unnecessary, if upper if clause is a >= comparison + else if ( (i!=12) && (pixelchargeincluster[i] == pixelchargeincluster[12]) && i>12 ) { + cout << "WARNING: next pixel value identical to precessor, frame : " << fFrameInfo.frame << ", values: " << pixelchargeincluster[i] << " == " << pixelchargeincluster[12] << endl; + CHANCE=0; //NOTE: potential error source + break; + } + else { + CHANCE=100; + } + } + } + else + { + for(Int_t i=6; i<19; i++) // why not over full cluster? (I=0 i<25 TODO + { + if ( (i!=12) && (pixelchargeincluster[i] > pixelchargeincluster[12]) ) { + CHANCE=0; + // cout << "kill cluster: " << Hitlist[hit] << " with ADC: " << pixelchargeincluster[12] << endl; + break; + } + // maybe this is unnecessary, if upper if clause is a >= comparison + else if ( (i!=12) && (pixelchargeincluster[i] == pixelchargeincluster[12]) && i>12 ) { + cout << "WARNING: next pixel value identical to precessor, frame : " << fFrameInfo.frame << ", values: " << pixelchargeincluster[i] << " == " << pixelchargeincluster[12] << endl; + CHANCE=0; //NOTE: potential error source + break; + } + else { + CHANCE=100; + if(i%5==3) { + i+=2; + }; + } + } + } @@ -1577,6 +1600,7 @@ void MAPS::hitana() { //Begin: loop evaluate true seeds: if(CHANCE==100) { + //cout<<"CLUSTER ACCEPTED"< fColumns-3 || A < 1 || A > fRows-2) @@ -1591,26 +1615,26 @@ void MAPS::hitana() { else bordercluster = false; } - for(Int_t row=0; row<5; row++) - { - 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)) ) { } - else if ( (row==4) && (A>= (fRows-2)) ) { } - else - { - if ( (column==0) && (B<2) ) { } - else if ( (column==1) && (B==0) ) { } - else if ( (column==3) && (B==fColumns-1)) { } - else if ( (column==4) && (B>fColumns-3)) { } - else { - fHittedPixel[Hitlist[hit]+(row-2)*fColumns+(column-2)] = bordercluster?-1:1; - } - } - } - } + for(Int_t row=0; row<5; row++) + { + 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)) ) { } + else if ( (row==4) && (A>= (fRows-2)) ) { } + else + { + if ( (column==0) && (B<2) ) { } + else if ( (column==1) && (B==0) ) { } + else if ( (column==3) && (B==fColumns-1)) { } + else if ( (column==4) && (B>fColumns-3)) { } + else { + fHittedPixel[Hitlist[hit]+(row-2)*fColumns+(column-2)] = bordercluster?-1:1; + } + } + } + } // cout<<"Hitted pixel discriminator matrix:"<(fHittedPixel, fPixels, fColumns, 1, 1); if (bordercluster) @@ -1639,7 +1663,7 @@ void MAPS::hitana() { // if cluster charge > clusternoise * const if(fOrderCode=="FSBB") { - if (1.0*chargesumincluster4 > noisesumincluster4*6.0) + if (1.0*chargesumincluster4 > noisesumincluster4*5.0) fFrameInfo.pixelthreshold[fHits] = Hitlist[hit]; else fFrameInfo.pixelthreshold[fHits] = 0; @@ -1759,19 +1783,36 @@ void MAPS::plotFrame(Int_t FrameNumber) { cout<<"Frame could not be loaded!"<(fCdsmatrix, fPixels, fColumns, 0, 39); + // debugStream<>(fCdsmatrix, fPixels, fColumns, 0, 39); Float_t cdsmatrixCorrPed[fPixels]; for(Int_t i=0; i(cdsmatrixCorrPed, fPixels, fColumns, 0, 10); + // debugStream<>(cdsmatrixCorrPed, fPixels, fColumns, 0, 10); // cout<(fHittedPixel, fPixels, fColumns, 1, 1); - + //cout<<"Hitted pixel discriminator matrix:"<(fHittedPixel, fPixels, fColumns, 1, 1); + + cout << colorred <<"Accepted hit cluster:"<Divide(2,3); gStyle->SetOptFit(1011); @@ -1848,6 +1889,7 @@ void MAPS::plotFrame(Int_t FrameNumber) { cm1->Update(); cout<<"\rPIXELMATRIX plotted! "<(fCdsmatrix, fPixels, 4*416, 0, 39); + //Divide CDSMATRIX in the channels. First pixel is from A0-0, then A0-1, then A0-2, then A0-3, then A1-0, then A1-1, then A1-2, then A1-3, then second pixel is from A0-0, then... + // for(Int_t iPixelInZeile=0; iPixelInZeile0) // TODO better warning criteria + { + warning = true; + } + if(warning) { cout<<"\rFrame: "< Common Mode suspiciously high! "<(fCdsmatrix, fPixels, fColumns, 0, 20); + debugStream<>(a0[iOutChannel], subColumns, subColumns, 1, 20); + } + + for(int column=0; column(fCdsmatrix, fPixels, 4*416, 0, 39); + //Divide CDSMATRIX in the channels. First pixel is from A0-0, then A0-1, then A0-2, then A0-3, then A1-0, then A1-1, then A1-2, then A1-3, then second pixel is from A0-0, then... + // for(Int_t iPixelInZeile=0; iPixelInZeile0) // TODO better warning criteria + { + warning = true; + } + if(warning) { cout<<"\rFrame: "< Common Mode suspiciously high! "<(fCdsmatrix, fPixels, fColumns, 0, 20); + debugStream<>(a0[iOutChannel], subColumns, subColumns, 1, 20); + } + + for(int column=0; column(fCdsmatrix, fPixels, 4*416, 0, 39); + //Divide CDSMATRIX in the channels. First pixel is from A0-0, then A0-1, then A0-2, then A0-3, then A1-0, then A1-1, then A1-2, then A1-3, then second pixel is from A0-0, then... + // for(Int_t iPixelInZeile=0; iPixelInZeile0) // TODO better warning criteria + { + warning = true; + } + if(warning) { cout<<"\rFrame: "< Common Mode suspiciously high! "<(fCdsmatrix, fPixels, fColumns, 0, 20); + debugStream<>(a0[iOutChannel], subColumns, subColumns, 1, 20); + } + for(int column=0; column(fCdsmatrix, fPixels, fColumns, 0, 20); + for(Int_t iPixel=0; iPixel(fCdsmatrix, fPixels, 4*416, 0, 39); + //Divide CDSMATRIX in the channels. First pixel is from A0-0, then A0-1, then A0-2, then A0-3, then A1-0, then A1-1, then A1-2, then A1-3, then second pixel is from A0-0, then... + // for(Int_t iPixelInZeile=0; iPixelInZeile0) // TODO better warning criteria + { + warning = true; + } + if(warning) { cout<<"\rFrame: "< Common Mode suspiciously high! "<(fCdsmatrix, fPixels, fColumns, 0, 20); + debugStream<>(a0[iOutChannel], subColumns, subColumns, 1, 20); + } + + for(int column=0; column(fCdsmatrix, fPixels, fColumns, 0, 20); + for(Int_t iPixel=0; iPixelInitialDynNoise(); int start = 0; int nframes = processed->GetNumberFrames(); - // for(int i=0; i<1000;i++) // TODO remove 100000 run 342272 - for(int i=0; igetFrame(i); // processed->filterCommonMode(); // cout << "hitana " << i << endl; processed->hitana(); + // if(processed->GetHitNumberInFrame()>0) + // processed->plotFrame(i); // cout << "regetDynNoise " << endl; if (dynamicalNoise) processed->regetDynNoise(); @@ -366,6 +369,7 @@ Bool_t Run::rescaleHistograms() rescaleHistogram(histogramCalibrated.Seed, histogram.Seed); rescaleHistogram(histogramCalibrated.Sum, histogram.Sum); rescaleHistogram(histogramCalibrated.Veto, histogram.Veto); + rescaleHistogram(histogramCalibrated.VetoSum, histogram.VetoSum); rescaleHistogram(histogramCalibrated.Noise, histogram.Noise); if (histogram.histAvgCluster != nullptr) @@ -383,6 +387,7 @@ Bool_t Run::rescaleHistograms() rescaleHistogram(histogramthresholdCalibrated.Seed, histogramthreshold.Seed); rescaleHistogram(histogramthresholdCalibrated.Sum, histogramthreshold.Sum); rescaleHistogram(histogramthresholdCalibrated.Veto, histogramthreshold.Veto); + rescaleHistogram(histogramthresholdCalibrated.VetoSum, histogramthreshold.VetoSum); rescaleHistogram(histogramthresholdCalibrated.Noise, histogramthreshold.Noise); histogramthresholdCalibrated.posSeed = histogramthreshold.posSeed * gain; @@ -441,7 +446,8 @@ Bool_t Run::analyzeFrame(Int_t frame) processed->initNewRootFile(); int entries = processed->GetNumberFrames(); if (frame < entries) - { + { + if (dynamicalNoise) processed->InitialDynNoise(100); processed->getFrame(frame); // processed->filterCommonMode(); @@ -609,12 +615,12 @@ void Run::selectSubMatrixFSBB(TString matrixname) { if (matrixname.EqualTo("A0")) { - setSubMatrixBorders(0, sensorinfocur.columns/2-2, 0, sensorinfocur.rows, false); + setSubMatrixBorders(0, sensorinfocur.columns/2-2, 0, sensorinfocur.rows, true); runcodesuffix += "_A0_"; humanreadablesuffix += "A0, "; } else if (matrixname.EqualTo("A1")) { - setSubMatrixBorders(sensorinfocur.columns/2+2, sensorinfocur.columns, 0, sensorinfocur.rows, false); + setSubMatrixBorders(sensorinfocur.columns/2+2, sensorinfocur.columns, 0, sensorinfocur.rows, true); runcodesuffix += "_A1_"; humanreadablesuffix += "A1, "; } @@ -777,7 +783,7 @@ Bool_t Run::binSeedSumVeto() /// collected charge in cluster Float_t pixelSum = 0; Float_t notSeedSum = 0; - + // for (Int_t framei=0; framei<10000; framei++) // loop over all frames for (Int_t framei=0; frameifHitTree->GetEntries(); framei++) // loop over all frames { processed->fHitTree->GetEntry(framei); @@ -840,9 +846,37 @@ Bool_t Run::binSeedSumVeto() histogramthreshold.numberofhits++; histogramthreshold.Seed->Fill(processed->fFrameInfo.p[12][hiti]); + // cout<<"Hitnummer"<fFrameInfo.pixelthreshold[hiti]<<":"; + // for(int col=0;col<25;col++) + // cout<fFrameInfo.p[col][hiti]<<","; + // cout<fFrameInfo.p[row*5+column][hiti]; + // } + // cout << endl; + // } + // cout << endl; + histogramthreshold.Sum->Fill(pixelSum); if (TMath::Abs(notSeedSum) < systemparamcur.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd"))) histogramthreshold.Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel + + if (TMath::Abs(pixelSum) > 200 && (labbook.source.Contains("Fe"))) + { + histogramthreshold.VetoSum->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel + //histogramthreshold.VetoSum->Fill(pixelSum); + // cout<<"Hitnummer"<fFrameInfo.p[col][hiti]<<","; + // cout<Seed, "Seed" + suffix); initHistogram(histogramstructpointer->Sum, "Sum" + suffix); initHistogram(histogramstructpointer->Veto, "Veto" + suffix); + initHistogram(histogramstructpointer->VetoSum, "VetoSum" + suffix); TString prefix = "Noise" + suffix; diff --git a/MABS_run_analyzer/Run.h b/MABS_run_analyzer/Run.h index 590248d..dbafc9d 100644 --- a/MABS_run_analyzer/Run.h +++ b/MABS_run_analyzer/Run.h @@ -387,7 +387,8 @@ public: Bool_t plotSeedThresholdCalibrated(); Bool_t plotSum(); Bool_t plotVeto(); - + Bool_t plotVetoSumThreshold(); + /** @brief Prints all data gathered from the database */ Bool_t debugDBreadout(); @@ -497,6 +498,8 @@ public: TH1F* Sum; /// Veto spectrum, used to find better calibration peak, only entries where Sum over not seed pixels is below @c Run::vetothreshold are binned into this histogram TH1F* Veto; + /// Seed spectrum with Veto condition, accept only clusters with a sum charge>150 (hopefully helps to clean FSBB-spectrum, be careful, might not work for irradiated sensors due to recombinations + TH1F* VetoSum; /// Noise histogram TH1F* Noise;