From: Dennis Doering Date: Wed, 29 Jul 2015 18:02:56 +0000 (+0200) Subject: FSBB erste funktionierende Version X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5c2dcfcf5c9704b5a3942c27ade849a1e43d02ef;p=radhard.git FSBB erste funktionierende Version --- diff --git a/MABS_run_analyzer/MAPS.c b/MABS_run_analyzer/MAPS.c index 6465962..6d21333 100644 --- a/MABS_run_analyzer/MAPS.c +++ b/MABS_run_analyzer/MAPS.c @@ -57,6 +57,7 @@ Bool_t MAPS::initNewRootFile() { fHitTree->Branch("frame" , &fFrameInfo.frame , "frame/i" , 32000); fHitTree->Branch("hits" , &fFrameInfo.hits , "hits/i" , 32000); fHitTree->Branch("pixel" , &fFrameInfo.pixel[0] , "pixel[hits]/i" , 32000); + fHitTree->Branch("pixelRaw" , &fFrameInfo.pixelRaw[0] , "pixelRaw[hits]/i" , 32000); fHitTree->Branch("pixelthreshold", &fFrameInfo.pixelthreshold[0],"pixelthreshold[hits]/i", 32000); for(int i=0; i<25; i++) { fHitTree->Branch( Form("p%i",i+1) , &fFrameInfo.p[i][0] , Form("p%i [hits]/F",i+1) , 32000); @@ -198,6 +199,7 @@ Bool_t MAPS::initMapsRun( ) { fColumns = run->sensorinfocur.columns; fPixels = fRows*fColumns; fMatrix = run->labbook.matrix; + fOrderCode = run->labbook.chipGen; fSystem = run->labbook.system; fConfigFile = fInDir+Form("/RUN_%i_i.rz",fRunNumber); fRootFile = fOutDir+Form("/RUN_%i_i.root",fRunNumber); @@ -647,11 +649,12 @@ bool MAPS::getFrame(UInt_t FrameNumber) { // - fF1matrix // Use 'fOrderCode' to choose the respective order! // ----------------- - if (fOrderCode == "") { } -// else if (fOrderCode == "Mi26") { reorderMi26(); } - else if (fOrderCode == "Mi29a") { - reorderMi29a(); - } + + if (fOrderCode == "") { } + else if (fOrderCode == "Mi34") { } + else if (fOrderCode == "Pegasus"){ } + else if (fOrderCode == "FSBB") { reorderFSBB(); } + else if (fOrderCode == "Mi29a") { reorderMi29a(); } // else if (fOrderCode == "Mi29b") { reorderMi29b(); } //========================================================================== delete[] HDRDATA; @@ -1221,11 +1224,24 @@ void MAPS::hitana() { Bool_t bordercluster=false; Float_t noisesumincluster=0; Float_t chargesumincluster=0; - + + Float_t cdsMatrixSum=0; + Float_t cdsmatrixCorrPed[fPixels]; + for(Int_t i=0; i(fCdsmatrix, fPixels, fColumns, 2, 20); + // cout<<"Pedestals"<(fPedestals, fPixels, fColumns, 2, 20); for(Int_t i=0; i (50.) ) if( (float)(1.*fCdsmatrix[i]-fPedestals[i]) > (5.*fNoise[i]) ) { HITNR++; @@ -1248,6 +1264,7 @@ void MAPS::hitana() { for(Int_t i=0; i(fHittedPixel, fPixels, fColumns, 1, 1); + // cout<<"Hitted pixel discriminator matrix:"<(fHittedPixel, fPixels, fColumns, 1, 1); fHittedPixel[rechargePixellist[rechargingpixeli]] = -4; } } + //Begin: loop over all potential seed pixels: //Determine 'hit-vicinity': @@ -1465,21 +1483,56 @@ void MAPS::hitana() { } } } - noisesumincluster=TMath::Sqrt(noisesumincluster); -// cout << coloryellow << "Noise für Cluster: " << noisesumincluster << endlr; -// cout << coloryellow << "ChargeSum für Cluster: " << chargesumincluster << endlr; -// debug -// for(Int_t row=0; row<5; row++) -// { -// for(Int_t column=0; column<5; column++) -// { -// std::cout.width(10); -// std::cout << std::fixed; -// std::cout << std::left << std::setprecision(2) << pixelchargeincluster[row*5+column]; -// } -// cout << endl; -// } -// cout << endl; + int index[25]; + TMath::Sort(25,pixelchargeincluster,index,1); + // for(int i=0;i<25;i++) + // cout<(cdsMatrixMinusPedestal, fPixels, fColumns, 0, 20); + // cout << colorred << "Noise für Cluster: " << noisesumincluster << endlr; + // cout << colorred << "ChargeSum für Cluster: " << chargesumincluster <<"WholeMatrix:"< fColumns-3 || A < 1 || A > fRows-2) + bordercluster = true; + else + bordercluster = false; + } + else //if not FSBB + { if (B < 2 || B > fColumns-3 || A < 2 || A > fRows-3) bordercluster = true; else bordercluster = false; + } for(Int_t row=0; row<5; row++) { for(Int_t column=0; column<5; column++) @@ -1534,8 +1597,8 @@ void MAPS::hitana() { } } } -// cout<<"Hitted pixel discriminator matrix:"<(fHittedPixel, fPixels, fColumns, 1, 1); + // cout<<"Hitted pixel discriminator matrix:"<(fHittedPixel, fPixels, fColumns, 1, 1); if (bordercluster) fHittedPixel[Hitlist[hit]] = -2; else @@ -1548,25 +1611,60 @@ void MAPS::hitana() { { fFrameInfo.p [clupos][fHits] = pixelchargeincluster[clupos]; } - + // for(Int_t row=0; row<5; row++) + // { + // for(Int_t column=0; column<5; column++) + // { + // std::cout.width(10); + // std::cout << std::fixed; + // std::cout << std::left << std::setprecision(2) << pixelchargeincluster[row*5+column]; + // } + // cout << endl; + // } + // cout << endl; // if cluster charge > clusternoise * const - if (1.0*chargesumincluster > noisesumincluster*2.0) - fFrameInfo.pixelthreshold[fHits] = Hitlist[hit]; - else - fFrameInfo.pixelthreshold[fHits] = 0; - + if(fOrderCode=="FSBB") + { + if (1.0*chargesumincluster4 > noisesumincluster4*6.0) + fFrameInfo.pixelthreshold[fHits] = Hitlist[hit]; + else + fFrameInfo.pixelthreshold[fHits] = 0; + } + else + { + if (1.0*chargesumincluster > noisesumincluster*2.0) + fFrameInfo.pixelthreshold[fHits] = Hitlist[hit]; + else + fFrameInfo.pixelthreshold[fHits] = 0; + } if(fSave) { hint1->Fill( Hitlist[hit]%fColumns, (int)(Hitlist[hit]/fColumns) ); } - fHits++; - + // if(fFrameInfo.pixelthreshold[fHits]!=0) + // { + + // debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1); + // for(Int_t row=0; row<5; row++) + // { + // for(Int_t column=0; column<5; column++) + // { + // std::cout.width(10); + // std::cout << std::fixed; + // std::cout << std::left << std::setprecision(2) << pixelchargeincluster[row*5+column]; + // } + // cout << endl; + // } + // cout << endl; + // debugStream<>(cdsmatrixCorrPed, fPixels, fColumns, 1, 10); + // } + fHits++; } } } //End: loop evaluate true seeds: //End: loop over all potential seed pixels: - + if(fSave) { for(Int_t i=0; iSetBinContent(i%fColumns, (int)(i/fColumns), fHittedPixel[i]); fADCHitmatrix->SetBinContent(i%fColumns, (int)(i/fColumns), fCdsmatrix[i]); + // cout<<"HITHERE"<20) // TODO better warning criteria + if(TMath::Abs(CommonModeInRow)>1000) // TODO better warning criteria { warning = true; } @@ -1650,7 +1748,8 @@ void MAPS::plotFrame(Int_t FrameNumber) { cout <(fCdsmatrix, fPixels, fColumns, 0, 39); - + debugStream<>(fCdsmatrix, fPixels, 512, 0, 39); + cout<(fHittedPixel, fPixels, fColumns, 1, 1); @@ -2297,6 +2396,149 @@ void MAPS::reorderMi29a() { } } +//#################################################################### +void MAPS::reorderFSBB() { + + Float_t CDSMATRIX2 [4*208]; + Float_t CDSMATRIX [fPixels]; + Int_t F0MATRIX [fPixels]; + Int_t F1MATRIX [fPixels]; + for(Int_t i=0; i highlightabove) + // std::cout << colorred; + // std::cout.width(precision+5); + // std::cout << std::fixed; + // std::cout << std::left << std::setprecision(precision); + // std::cout << aMerge[ichannel][i] << colorreset; + + // } + // cout<InitialDynNoise(); int start = 0; int nframes = processed->GetNumberFrames(); - // for(int i=15580; i<15685;i++) // TODO remove 100000 run 342272 - for(int i=0; igetFrame(i); - // processed->filterCommonMode(); + processed->filterCommonMode(); // cout << "hitana " << i << endl; processed->hitana(); // cout << "regetDynNoise " << endl; @@ -392,8 +392,10 @@ Bool_t Run::analyzeFrame(Int_t frame) { processed->InitialDynNoise(100); processed->getFrame(frame); -// processed->filterCommonMode(); + + processed->filterCommonMode(); processed->hitana(); + exit(1); processed->plotFrame(frame); delete processed; return 0; @@ -699,12 +701,32 @@ Bool_t Run::binSeedSumVeto() // sum histogram pixelSum = 0; notSeedSum = 0; - for (Int_t clusteri=0; clustericlustersize*processed->clustersize; clusteri++) - { - pixelSum += processed->fFrameInfo.p[clusteri][hiti]; - if (clusteri != 12) - notSeedSum += processed->fFrameInfo.p[clusteri][hiti]; - } + if(labbook.chipGen=="FSBB") + { + Float_t clusterArray[processed->clustersize*processed->clustersize]; + Int_t index[processed->clustersize*processed->clustersize]; + for (Int_t clusteri=0; clustericlustersize*processed->clustersize; clusteri++) + { + clusterArray[clusteri] = processed->fFrameInfo.p[clusteri][hiti]; + if (clusteri != 12) + notSeedSum += processed->fFrameInfo.p[clusteri][hiti]; + } + TMath::Sort(processed->clustersize*processed->clustersize,clusterArray,index,1); + for (Int_t clusteri=0; clusteri<4; clusteri++) + { + pixelSum += clusterArray[index[clusteri]]; + + } + } + else + { + for (Int_t clusteri=0; clustericlustersize*processed->clustersize; clusteri++) + { + pixelSum += processed->fFrameInfo.p[clusteri][hiti]; + if (clusteri != 12) + notSeedSum += processed->fFrameInfo.p[clusteri][hiti]; + } + } histogram.Sum->Fill(pixelSum); // veto spectrum @@ -837,7 +859,7 @@ Bool_t Run::plotAllHistograms(histogramstruct* histogramstructpointer) plotVerticalLine(histogramstructpointer->Seed, histogramstructpointer->posSeed); lastbin = histogramstructpointer->Seed->GetBinCenter(histogramstructpointer->Seed->FindLastBinAbove(2,1)); histogramstructpointer->Seed->SetAxisRange(0,lastbin*1.1,"X"); - gPad->SetLogy(1); + // gPad->SetLogy(1); canvas->cd(2); histogramstructpointer->Sum->Draw(); plotVerticalLine(histogramstructpointer->Sum, histogramstructpointer->posSum); diff --git a/MABS_run_analyzer/Run.h b/MABS_run_analyzer/Run.h index d0a688b..1f157ed 100644 --- a/MABS_run_analyzer/Run.h +++ b/MABS_run_analyzer/Run.h @@ -240,9 +240,9 @@ private: 150 }; systemparam systemparamFSBB { - 2800, // maxbin; - 2800/4,// nbins; - 25, //vetothreshold + 400, // maxbin; + 400/4,// nbins; + 15, //vetothreshold 10, 100 }; diff --git a/MABS_run_analyzer/help.h b/MABS_run_analyzer/help.h index 51aa0f0..04b8045 100644 --- a/MABS_run_analyzer/help.h +++ b/MABS_run_analyzer/help.h @@ -107,6 +107,8 @@ struct frameInfo{ UInt_t hits; /// holds pixel number of hitted seed pixel in frame UInt_t pixel [MAXHITS]; + /// holds pixel number of hitted seed pixel in frame for play! + UInt_t pixelRaw [MAXHITS]; /// holds pixel number of hitted cluster seed pixel over the threshold in frame UInt_t pixelthreshold [MAXHITS]; /// holds charge collected by cluster for a given hit in frame, p[12][7] f.e. holds seed pixel charge of hit number 8 in frame