From: Dennis Doering Date: Tue, 29 Sep 2015 10:34:33 +0000 (+0200) Subject: FSBB Matrix gedreht, cluster nicht mehr gehackt X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=636038e1eda4de8ce1e4c6e4860a7ac8f7bdba3c;p=radhard.git FSBB Matrix gedreht, cluster nicht mehr gehackt --- diff --git a/MABS_run_analyzer/MAPS.c b/MABS_run_analyzer/MAPS.c index 2465a3d..affa6ce 100644 --- a/MABS_run_analyzer/MAPS.c +++ b/MABS_run_analyzer/MAPS.c @@ -86,7 +86,7 @@ Bool_t MAPS::initOldRootFile() { // } // int MaxFiles = TMath::Ceil((Float_t) FileTotalEvNbInConfig/FileEvNbInConfig); // checkDataFiles(MaxFiles); - cout<<"COLUMNS"<IsZombie()) { @@ -687,7 +687,7 @@ bool MAPS::getFrame(UInt_t FrameNumber) { if (fOrderCode == "") { } else if (fOrderCode == "Mi34") { } else if (fOrderCode == "Pegasus"){ } - // else if (fOrderCode == "FSBB") { } + // else if (fOrderCode == "FSBB") { } else if (fOrderCode == "FSBB") { reorderFSBB(); } else if (fOrderCode == "Mi29a") { reorderMi29a(); } // else if (fOrderCode == "Mi29b") { reorderMi29b(); } @@ -1041,7 +1041,31 @@ void MAPS::debugStream(const arraytype* (a), Int_t n, Int_t columns, Int_t preci cout << colorwhite << "----------------------------------" << colorreset << endl; cout << endl; } - +template +void MAPS::debugStreamVerse(const arraytype* (a), Int_t n, Int_t rows, Int_t precision, float highlightabove) { + cout << colorwhite << "----------------------------------" << colorreset << endl; + + for (int irows=0; irows highlightabove) + std::cout << colorgreen; + else if ((-1)*a[irows+i*rows] > highlightabove) + std::cout << colorred; + std::cout.width(precision+5); + std::cout << std::fixed; + std::cout << std::left << std::setprecision(precision); + std::cout << a[i*rows+irows] << colorreset; + + + } + cout << endl< fColumns-2 || A < 1 || A > fRows-2) - bordercluster = false; + { + //cout< fColumns-2 || A < 2 || A > fRows-3) + { + bordercluster = true; + // cout<<"border cluster in frame "<(fCdsmatrix, fPixels, fRows, 0, 39); + // cout<<"CDS matrix:"<(fCdsmatrix, fPixels, fColumns, 0, 39); Float_t cdsmatrixCorrPed[fPixels]; for(Int_t i=0; i(cdsmatrixCorrPed, fPixels, fRows, 0, 10); + debugStreamVerse<>(cdsmatrixCorrPed, fPixels, fColumns, 0, 10); // cout<(fHittedPixel, fPixels, fRows, 1, 1); - Double_t cdsmatrixSum; + // debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1); + Double_t cdsmatrixSum=0; for(Int_t i=0; iSetHistLineWidth(5); + // TH2F *h1 = new TH2F("Frame 0 vs T" , "Frame 0 vs T" , Frames, Start, Start+Frames, 2*16384, -16384, 16384); + // TH2F *h2 = new TH2F("Frame 1 vs T" , "Frame 1 vs T" , Frames, Start, Start+Frames, 2*16384, -16384, 16384); + // TH2F *h3 = new TH2F("CDS vs T" , "CDS vs T" , Frames, Start, Start+Frames, 2*16384, -16384, 16384); TH1F *h1 = new TH1F("Frame 0 vs T" , "Frame 0 vs T" , Frames, Start, Start+Frames); TH1F *h2 = new TH1F("Frame 1 vs T" , "Frame 1 vs T" , Frames, Start, Start+Frames); TH1F *h3 = new TH1F("CDS vs T" , "CDS vs T" , Frames, Start, Start+Frames); @@ -2164,17 +2199,34 @@ void MAPS::plotPixSignal(UInt_t Start, UInt_t Frames, Int_t Pixel) { // h5->SetBit(TH1::kCanRebin); // h6->SetBit(TH1::kCanRebin); // h4->Rebin(k) - - for(UInt_t i=Start; iFill( i,fF0matrix[Pixel]) ; -// h2->Fill( i,fF1matrix[Pixel]) ; -// h3->Fill( i,fCdsmatrix[Pixel] ); - h1->SetBinContent( i,fF0matrix[Pixel]) ; + // h1->Fill( i,fF0matrix[Pixel]) ; + // h2->Fill( i,fF1matrix[Pixel]) ; + // h3->Fill( i,fCdsmatrix[Pixel] ); + Double_t cdsFrameSum=0; + for(UInt_t iPixel=0; iPixelSetBinContent( i,cdsFrameSum) ; + //h1->SetBinContent( i,fF0matrix[Pixel]) ; h2->SetBinContent( i,fF1matrix[Pixel]) ; h3->SetBinContent( i,fCdsmatrix[Pixel] ); + + } + } + + for(UInt_t i=Start; iFill( i,fF0matrix[Pixel]) ; + // h2->Fill( i,fF1matrix[Pixel]) ; + // h3->Fill( i,fCdsmatrix[Pixel] ); + h4->Fill( fF0matrix[Pixel] ); h5->Fill( fF1matrix[Pixel] ); @@ -2184,17 +2236,19 @@ void MAPS::plotPixSignal(UInt_t Start, UInt_t Frames, Int_t Pixel) { cm4->cd(1); // h1->Draw("colz"); - h1->Draw(""); + h1->SetLineStyle(1); + h1->Draw("ARR"); + h1->GetXaxis()->SetTitle("Frame#"); h1->GetYaxis()->SetTitle("Signal"); cm4->cd(2); - h2->Draw(""); + h2->Draw("c"); h2->GetXaxis()->SetTitle("Frame#"); h2->GetYaxis()->SetTitle("Signal"); cm4->cd(3); - h3->Draw(""); + h3->Draw("c"); h3->GetXaxis()->SetTitle("Frame#"); h3->GetYaxis()->SetTitle("Signal"); @@ -2527,7 +2581,7 @@ void MAPS::reorderMi29a() { } } //#################################################################### -void MAPS::reorderFSBB() { +void MAPS::reorderFSBB2() { Float_t CDSMATRIX [fPixels]; Int_t F0MATRIX [fPixels]; @@ -2573,8 +2627,8 @@ void MAPS::reorderFSBB() { for(Int_t iPixelInZeile=0; iPixelInZeile(tMatrix, fPixels, fColumns, 0, 20); // exit(0); } +void MAPS::reorderFSBB() { + + Float_t CDSMATRIX [fPixels]; + Int_t F0MATRIX [fPixels]; + Int_t F1MATRIX [fPixels]; + for(Int_t i=0; i(fCdsmatrix, fPixels, 4, 0, 20); + // for(Int_t iPixel=0; iPixel(fCdsmatrix, fPixels, 4, 0, 20); + // exit(0); +} //#################################################################### void MAPS::reorderFSBBSicherung() { diff --git a/MABS_run_analyzer/MAPS.h b/MABS_run_analyzer/MAPS.h index fe15134..1b91290 100644 --- a/MABS_run_analyzer/MAPS.h +++ b/MABS_run_analyzer/MAPS.h @@ -280,6 +280,7 @@ private: */ void reorderFSBB(); void reorderFSBBSicherung(); + void reorderFSBB2(); /** * @brief Sums over a given array * @@ -290,7 +291,8 @@ private: template void debugStream(const arraytype* (a), Int_t n=512, Int_t columns=8, Int_t precision=2, float highlightabove = 99999999); - + template + void debugStreamVerse(const arraytype* (a), Int_t n=512, Int_t columns=8, Int_t precision=2, float highlightabove = 99999999); /** * @brief Initialize histogram labels and histograms #MAPS::hint1, #MAPS::hint2, #MAPS::fdiscriminatedhitmatrix, #MAPS::fADCHitmatrix */ @@ -481,7 +483,7 @@ public: void plotPixSignal (UInt_t Start, UInt_t Frames, Int_t Pixel); void writeData (); - + Int_t GetNumberHits() { return fHits; } Int_t GetNumberRun() { return fRunNumber; } Int_t GetNumberFrames() { return fEventsSum; } Int_t GetNumberPixels() { return fPixels; } diff --git a/MABS_run_analyzer/Run.c b/MABS_run_analyzer/Run.c index 859c8eb..261e507 100644 --- a/MABS_run_analyzer/Run.c +++ b/MABS_run_analyzer/Run.c @@ -219,11 +219,11 @@ void Run::setSystemSpecificParameters() systemparam systemparamUSB (2800/*maxbin*/,2800/4/*nbins*/, 25/*vetothreshold*/, 10/*maxbinnoise*/, 100/*nbinsnoise*/); systemparam systemparamPegasus (2800,2800/2,20,10,100); systemparam systemparamPXI (800*16,800,75,150,150); - systemparam systemparamFSBB (2800,2800/4,25,10,100); + systemparam systemparamFSBB (2000,2000,20,10,100); if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("Mi34") ) cursystemparam = systemparamUSB; else if (labbook.system.EqualTo("USB") && labbook.chipGen.EqualTo("FSBB") ) - cursystemparam = systemparamUSB; + cursystemparam = systemparamFSBB; else if (labbook.system.EqualTo("PXI")) // && labbook.chipGen.EqualTo("34") ) cursystemparam = systemparamPXI; else if (labbook.system.EqualTo("Pegasus")) // && labbook.chipGen.EqualTo("34") ) @@ -351,7 +351,7 @@ Bool_t Run::analyzeRun(Bool_t force) processed->InitialDynNoise(); int start = 0; int nframes = processed->GetNumberFrames(); - // for(int i=0; i<1000000;i++) // TODO remove 100000 run 342272 + // for(int i=0; i<1000000;i++) // TODO remove 100000 run 342272 for(int i=0; ifilterCommonMode(); // cout << "hitana " << i << endl; processed->hitana(); + // if(processed->GetNumberHits()>0) + // processed->plotFrame(i); // cout << "regetDynNoise " << endl; if (dynamicalNoise) processed->regetDynNoise(); @@ -447,8 +449,9 @@ Bool_t Run::rescaleHistogramClasses() return 1; } -Bool_t Run::analyzeFrame(Int_t frame) +Bool_t Run::analyzeFrame(Int_t frame, Int_t pixel) { +cout<<"ANALYZE FRAME "<filterCommonMode(); processed->hitana(); processed->plotFrame(frame); + processed->plotPixSignal(0, frame+1000,pixel); + // cout<<"CDS-Matrix"<getFrame(frame-10+i); + // cout<GetCDSFrame()[78]<<"\t"; + // } + // cout<getFrame(frame-10+i); + // cout<GetF0Frame()[78]<<"\t"; + // } + // cout<getFrame(frame-10+i); + // cout<GetF1Frame()[78]<<"\t"; + // } + // cout<fNoiseTree->SetBranchAddress("noise", &noise, &noiseBranch); // for (Int_t cnt=0; cntfNoiseTree->GetEntries(); cnt++) { - for (Int_t cnt=208*lauf; cnt<208*(lauf+1); cnt++) { + for (Int_t cnt=submatrix_y_start*submatrix_x_end; cntfNoiseTree->GetEntry(cnt); oneHistogramClass->Noise->Fill(noise); } @@ -733,8 +756,8 @@ Bool_t Run::binNoise(HistogramType* oneHistogramClass) oneHistogramClass->avgNoise = noisequantiles[1]; oneHistogramClass->avgNoisePlus = noisequantiles[2] - noisequantiles[1]; oneHistogramClass->avgNoiseMinus = noisequantiles[1] - noisequantiles[0]; - cout<<"Channel: "<avgNoise<avgNoise<fHitTree->GetEntries(); framei++) // loop over all frames { processed->fHitTree->GetEntry(framei); @@ -848,23 +873,28 @@ Bool_t Run::binSeedSumVeto() } pixelnoisesum=TMath::Sqrt(pixelnoisesum); - if (pixelchargesum>5.0*pixelnoisesum&& fPixelFakeHits[processed->fFrameInfo.pixel[hiti]+1]>0) - { + //if (pixelchargesum>2.0*pixelnoisesum&& fPixelFakeHits[processed->fFrameInfo.pixel[hiti]+1]>0) + if (pixelchargesum>2.0*pixelnoisesum) + { histogramFSBB->numberofhits++; // cout<fFrameInfo.n[12][hiti]<Seed->Fill(processed->fFrameInfo.p[12][hiti]); histogramFSBB->Sum->Fill(pixelSum); - if (TMath::Abs(notSeedSum) < cursystemparam.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd"))) - histogramFSBB->Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel + // cout<fFrameInfo.pixel[hiti]<<" Charge in Seed: "<fFrameInfo.p[12][hiti]<<" Charge in Sum: "<Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel + histogramFSBB->Veto->Fill(processed->fFrameInfo.pixel[hiti]); } - if (pixelchargesum>5.0*pixelnoisesum) + if (pixelchargesum<265&& fPixelFakeHits[processed->fFrameInfo.pixel[hiti]+1]>0&&processed->fFrameInfo.p[12][hiti]>40) { + foundSuspFrame++; histogramFSBB2->numberofhits++; - // cout<fFrameInfo.n[12][hiti]<fFrameInfo.n[12][hiti]<Seed->Fill(processed->fFrameInfo.p[12][hiti]); histogramFSBB2->Sum->Fill(pixelSum); - if (TMath::Abs(notSeedSum) < cursystemparam.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd"))) - histogramFSBB->Veto->Fill(processed->fFrameInfo.p[12][hiti]); // histogram with the single pixel + histogramFSBB2->Veto->Fill(processed->fFrameInfo.pixel[hiti]); // histogram with the single pixel + // if(processed->fFrameInfo.p[12][hiti]>20&&processed->fFrameInfo.p[12][hiti]<60) + // cout<fFrameInfo.pixel[hiti]<<" Charge in Seed: "<fFrameInfo.p[12][hiti]<<" Charge in Sum: "<SetBatch(kTRUE); for (vector::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++) { @@ -1713,9 +1744,12 @@ void Run::getPixelWithFakehits() { sourceIntensity=2; } + cout<<"Pixel 321"<GetBinContent(321)<GetBinContent(322)<<"must be larger than"<GetBinContent(ipixel)>fakehitrate*sourceIntensity*labbook.frames_foundDB)//show only pixels with a fake hit rate above 1e-5 + //if(histoPixel->GetBinContent(ipixel)>1000)//show only pixels with a fake hit rate above 1e-5 { fcountPixelFakeHits++; fPixelFakeHits[ipixel]=0;//pixel is a fake hit pixel diff --git a/MABS_run_analyzer/Run.h b/MABS_run_analyzer/Run.h index 04f6712..74e8c36 100644 --- a/MABS_run_analyzer/Run.h +++ b/MABS_run_analyzer/Run.h @@ -276,7 +276,7 @@ public: * * F0, F1 matrix are generated */ - Bool_t analyzeFrame(Int_t frame); + Bool_t analyzeFrame(Int_t frame, Int_t pixel); Int_t getClustersize();