]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
FSBB Matrix gedreht, cluster nicht mehr gehackt FSBB-Sicherung
authorDennis Doering <doering@physik.uni-frankfurt.de>
Tue, 29 Sep 2015 10:34:33 +0000 (12:34 +0200)
committerDennis Doering <doering@physik.uni-frankfurt.de>
Tue, 29 Sep 2015 10:34:33 +0000 (12:34 +0200)
MABS_run_analyzer/MAPS.c
MABS_run_analyzer/MAPS.h
MABS_run_analyzer/Run.c
MABS_run_analyzer/Run.h

index 2465a3d6c77d97cafbf145491276326b2afb7955..affa6ce939f8f49ae90dbd0c5407ef3227f39a3d 100644 (file)
@@ -86,7 +86,7 @@ Bool_t MAPS::initOldRootFile() {
   //  }
   //  int MaxFiles = TMath::Ceil((Float_t) FileTotalEvNbInConfig/FileEvNbInConfig);
   //  checkDataFiles(MaxFiles);
-  cout<<"COLUMNS"<<fColumns<<"ROWS"<<fRows<<endl;
// cout<<"COLUMNS"<<fColumns<<"ROWS"<<fRows<<endl;
     fOutputFile     = new TFile(fRootFile,"READ");
     if (fOutputFile->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 <typename arraytype>
+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<rows;irows++)
+    {
+               for (int i=0; i<n/rows;i++)
+               {
+                       if (a[irows+i*rows] > 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<<endl;
+       }
+    cout << colorwhite << "----------------------------------" << colorreset << endl;
+    cout << endl;
+       cout<<rows<<endl;
+}
 
 bool MAPS::regetDynNoise(Int_t Frames) {
     Bool_t pedestalhighinthisframe = false;
@@ -1258,7 +1282,7 @@ void MAPS::hitana() {
         Bool_t bordercluster=false;
         Float_t noisesumincluster=0;
         Float_t chargesumincluster=0;
-        cout<<"COLUMNS"<<fColumns<<"ROWS"<<fRows<<endl;
+     //   cout<<"COLUMNS"<<fColumns<<"ROWS"<<fRows<<endl;
         Float_t cdsMatrixSum=0;
         Float_t cdsmatrixCorrPed[fPixels];
         for(Int_t i=0; i<fPixels; i++)
@@ -1305,9 +1329,16 @@ void MAPS::hitana() {
         //         Determine clusters around them
         for(UInt_t rechargingpixeli=0; rechargingpixeli<rechargePixellist.size(); rechargingpixeli++)
         {
+               if(fOrderCode=="FSBB")
+               {
+                        seedrow = (rechargePixellist[rechargingpixeli])/fColumns;            // row of seed
+            seedcolumn = (rechargePixellist[rechargingpixeli])%fColumns;            // column of seed
+               }
+               else
+               {
             seedrow = (rechargePixellist[rechargingpixeli])/fColumns;            // row of seed
             seedcolumn = (rechargePixellist[rechargingpixeli])%fColumns;            // column of seed
-            
+        }    
             //Provide 5x5 clusters with CDS - content:
             for(Int_t row=0; row<5; row++)
             {
@@ -1620,9 +1651,13 @@ void MAPS::hitana() {
             if(CHANCE==100)
             {
                 if(fOrderCode=="FSBB")
-                {
-                    if (B < 1 || B > fColumns-2 || A < 1 || A > fRows-2)
-                        bordercluster = false;
+                {      
+                               //cout<<fFrameNumber<<"B: "<<B<<"fColumns: "<<fColumns<<"A: "<<A<<" fRows: "<<fRows<<endl;
+                    if (B < 1 || B > fColumns-2 || A < 2 || A > fRows-3)
+                                       {
+                        bordercluster = true;
+                                       //              cout<<"border cluster in frame "<<fFrameNumber<<endl;
+                                       }       
                     else
                         bordercluster = false;
                 }
@@ -1811,19 +1846,19 @@ void MAPS::plotFrame(Int_t FrameNumber) {
     }
     else {
         cout <<endl <<endl << colorwhite << "---------------- FRAME " << fFrameNumber << " ----------------" << colorreset << endl << endl;
-        cout<<"CDS matrix:"<<endl;
-        debugStream<>(fCdsmatrix, fPixels, fRows, 0, 39);
+       // cout<<"CDS matrix:"<<endl;
+        debugStreamVerse<>(fCdsmatrix, fPixels, fColumns, 0, 39);
         Float_t cdsmatrixCorrPed[fPixels];
         for(Int_t i=0; i<fPixels; i++)
         {
-            cdsmatrixCorrPed[i]=(float)(1.*fCdsmatrix[i]-fPedestals[i]);
+                                  cdsmatrixCorrPed[i]=(float)(1.*fCdsmatrix[i]-fPedestals[i]);
         }
         cout<<"CDS matrix minus pedestals:"<<endl;
-    //    debugStream<>(cdsmatrixCorrPed, fPixels, fRows, 0, 10);
+        debugStreamVerse<>(cdsmatrixCorrPed, fPixels, fColumns, 0, 10);
         // cout<<fCdsmatrix[0]<<","<<fCdsmatrix[1]<<","<<fCdsmatrix[2]<<","<<fCdsmatrix[3]<<","<<fCdsmatrix[4]<<","<<fCdsmatrix[5]<<","<<fCdsmatrix[6]<<endl;
       //  cout<<"Hitted pixel discriminator matrix:"<<endl;
-     //   debugStream<>(fHittedPixel, fPixels, fRows, 1, 1);
-               Double_t cdsmatrixSum;
+     //   debugStream<>(fHittedPixel, fPixels, fColumns, 1, 1);
+               Double_t cdsmatrixSum=0;
                for(Int_t i=0; i<fPixels; i++)
         {
             cdsmatrixSum+=cdsmatrixCorrPed[i];
@@ -2150,10 +2185,10 @@ void MAPS::plotPixSignal(UInt_t Start, UInt_t Frames, Int_t Pixel) {
             Start = fEventsSum-Frames;
             printf("Changed 'First Event'   to: %u\n", Start );
         }
-        
-//         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);
+       // gStyle->SetHistLineWidth(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; i<Start+Frames; i++)
+    for(UInt_t i=0; i<Frames; i++)
         {
             if(getFrame(i))
             {
-//                 h1->Fill( 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; iPixel<fPixels; iPixel++)
+                               {
+                                       cdsFrameSum+=fCdsmatrix[iPixel]-fPedestals[iPixel];
+                               }
+                               h1->SetBinContent( i,cdsFrameSum) ;
+                //h1->SetBinContent( i,fF0matrix[Pixel]) ;
                 h2->SetBinContent( i,fF1matrix[Pixel]) ;
                 h3->SetBinContent( i,fCdsmatrix[Pixel] );
+
+            }
+        }    
+    
+        for(UInt_t i=Start; i<Start+Frames; i++)
+        {
+            if(getFrame(i))
+            {
+                // h1->Fill( 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<subRows; iPixelInZeile++)
                        {
                        //      cout<<iPixelInZeile<<":"<<(4+iOutChannel)*subColumns+iPixelInZeile<<"-";
-                          a0[iOutChannel][iPixelInZeile]=CDSMATRIX     [iOutChannel*subRows+iPixelInZeile];
-                          a1[iOutChannel][iPixelInZeile]=CDSMATRIX     [(4+iOutChannel)*subRows+iPixelInZeile];//4+iOutChannel, because this is A1, which is shifted by four channels of A0
+                          a0[iOutChannel][iPixelInZeile]=CDSMATRIX     [iOutChannel+4*subRows+iPixelInZeile*subColumns];
+                          a1[iOutChannel][iPixelInZeile]=CDSMATRIX     [(iOutChannel)+iPixelInZeile*subColumns];//4+iOutChannel, because this is A1, which is shifted by four channels of A0
                        }
 
                }
@@ -2632,6 +2686,45 @@ void MAPS::reorderFSBB() {
                        //debugStream<>(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<fPixels; i++)
+        {
+            CDSMATRIX  [i] = fCdsmatrix[i];
+            F0MATRIX   [i] = fF0matrix [i];
+            F1MATRIX   [i] = fF1matrix [i];
+        }
+
+               int var[8]={0,4,1,5,2,6,3,7};//A0-0,A1-0,A0-1,A1-1,A0-2,A1-2,A0-3,A1-3, one line goes from 0..3 (which is A0), then newline, the second line goes from 4-7 (which is A1)
+               for(Int_t j=0; j<8; j++)
+               {
+                       int count=0;
+                       for(Int_t i=0; i<208; i++)
+                       {
+                               fCdsmatrix[count+var[j]]        = CDSMATRIX     [i+208*j];
+                               fF0matrix[count+var[j]]         = F0MATRIX      [i+208*j];
+                               fF1matrix[count+var[j]]         = F1MATRIX      [i+208*j];
+                               
+                               count+=8;
+                       }
+               }
+               //      for(Int_t iPixel=0; iPixel<fPixels;iPixel++)
+               //      { 
+               //      cout<<fCdsmatrix[iPixel]<<","; 
+               
+               //      }
+               //      debugStreamVerse<>(fCdsmatrix, fPixels, 4, 0, 20);
+               //      for(Int_t iPixel=0; iPixel<fPixels;iPixel++)
+               //      { 
+               //      fCdsmatrix[iPixel]=iPixel;
+               
+               //      }
+       //              debugStreamVerse<>(fCdsmatrix, fPixels, 4, 0, 20);
+       //              exit(0);
+}
 
 //####################################################################
 void MAPS::reorderFSBBSicherung() {
index fe1513428838751ae987c1f1a9de26ef3ad8fe14..1b912903afd80e1554cd612326d78bbcf73917c2 100644 (file)
@@ -280,6 +280,7 @@ private:
     */
       void reorderFSBB();  
           void reorderFSBBSicherung();  
+          void reorderFSBB2();  
     /**
      * @brief Sums over a given array
      *
@@ -290,7 +291,8 @@ private:
     
     template <typename arraytype>
     void debugStream(const arraytype* (a), Int_t n=512, Int_t columns=8, Int_t precision=2, float highlightabove = 99999999);
-        
+    template <typename arraytype>
+    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;                       }
index 859c8eb538001d6cf26b1373cf6e6e4ff4323245..261e507702acb4b0282672f7b914dc4e00153d49 100644 (file)
@@ -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; i<nframes;i++) // TODO remove 100000 run 342272
             {
 //                 cout << "getframe " << i << endl;
@@ -360,6 +360,8 @@ Bool_t Run::analyzeRun(Bool_t force)
                     processed->filterCommonMode();
 //                     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 "<<frame<<" AND PIXEL "<<pixel<<endl;
     if (!error)
     {
         processed = new MAPS(this);
@@ -462,6 +465,28 @@ Bool_t Run::analyzeFrame(Int_t frame)
                 processed->filterCommonMode();
             processed->hitana();
             processed->plotFrame(frame);
+                       processed->plotPixSignal(0, frame+1000,pixel);
+                       // cout<<"CDS-Matrix"<<endl;
+                       // for(int i=0;i<20;i++)
+                       // {
+                       // processed->getFrame(frame-10+i);
+                       // cout<<processed->GetCDSFrame()[78]<<"\t";
+                       // }
+                       // cout<<endl;
+                       // cout<<"F0-Matrix"<<endl;
+                       // for(int i=0;i<20;i++)
+                       // {
+                       // processed->getFrame(frame-10+i);
+                       // cout<<processed->GetF0Frame()[78]<<"\t";
+                       // }
+                       // cout<<endl;
+                       // cout<<"F1-Matrix"<<endl;
+                       // for(int i=0;i<20;i++)
+                       // {
+                       // processed->getFrame(frame-10+i);
+                       // cout<<processed->GetF1Frame()[78]<<"\t";
+                       // }
+                       // cout<<endl;
             delete processed;
             return 0;
         }
@@ -579,14 +604,13 @@ void Run::setSubMatrixBorders(u_int x_start, u_int x_end, u_int y_start, u_int y
 
 void Run::selectSubMatrixFSBB(TString matrixname)
 {   
-
-    if (matrixname.EqualTo("A0"))    {
-        setSubMatrixBorders(0, cursensorinfo.columns/2-2, 0, cursensorinfo.rows, false);
+       if (matrixname.EqualTo("A0")&& labbook.chipGen.EqualTo("FSBB"))    {
+        setSubMatrixBorders(0, cursensorinfo.columns, 0, cursensorinfo.rows/2-2, false);
         runcodesuffix += "_A0_";
         humanreadablesuffix += "A0, ";
     }
-    else if (matrixname.EqualTo("A1")) {
-        setSubMatrixBorders(cursensorinfo.columns/2+2, cursensorinfo.columns, 0, cursensorinfo.rows, false);   
+    else if (matrixname.EqualTo("A1")&& labbook.chipGen.EqualTo("FSBB")) {
+        setSubMatrixBorders(0, cursensorinfo.columns, cursensorinfo.rows/2+2, cursensorinfo.rows, false);   
         runcodesuffix += "_A1_";
         humanreadablesuffix += "A1, ";
     }
@@ -717,7 +741,6 @@ string Run::to_str_w_prec(const Float_t a_value, int precision = 3)
 
 Bool_t Run::binNoise(HistogramType* oneHistogramClass)
 {      
-       for (Int_t lauf=0; lauf<8; lauf++) {
     Float_t noise;
     TBranch* noiseBranch;
     Double_t const probabilities[] = {0.3415/2, 0.5, 1-0.3415/2}; // sigma/2 from gaus to the left and to the right //{0.17, 0.5, 1-0.17};
@@ -725,7 +748,7 @@ Bool_t Run::binNoise(HistogramType* oneHistogramClass)
     processed->fNoiseTree->SetBranchAddress("noise", &noise, &noiseBranch);    
    // for (Int_t cnt=0; cnt<processed->fNoiseTree->GetEntries(); cnt++) {
    
-   for (Int_t cnt=208*lauf; cnt<208*(lauf+1); cnt++) {
+   for (Int_t cnt=submatrix_y_start*submatrix_x_end; cnt<submatrix_y_end*submatrix_x_end; cnt++) {//Achtung, die Randpixel zwischen den Submatrizen sind aufgrund der Struktur submatrix_y_start und submatrix_y_end ebenfalls rausgenommen
         processed->fNoiseTree->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: "<<lauf<<"Noise :"<<oneHistogramClass->avgNoise<<endl;
-       }
+       //cout<<"Channel: "<<lauf<<"Noise :"<<oneHistogramClass->avgNoise<<endl;
+       
 //     if (labbook.system == "PXI")
 //         for (int j=0; j<3; j++)
 //             noisequantiles[j] /= 16.0; // TODO analyze PXI scales
@@ -751,6 +774,8 @@ Bool_t Run::binSeedSumVeto()
                for(int iPixel=0;iPixel<pixels;iPixel++)
        fPixelFakeHits[iPixel]=1; //Initiate fPixelFakeHits so that all pixel are accepted (=1), will be overwritten, if getPixelWithFakehits is executed
        getPixelWithFakehits();   
+       Int_t foundSuspFrame=0;
+   // for (Int_t framei=0; framei<100000; framei++) // loop over all frames
     for (Int_t framei=0; framei<processed->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<<framei<<":"<<processed->fFrameInfo.n[12][hiti]<<endl;
                         histogramFSBB->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<<framei<<"Pixelnr."<<processed->fFrameInfo.pixel[hiti]<<" Charge in Seed: "<<processed->fFrameInfo.p[12][hiti]<<" Charge in Sum: "<<pixelSum<<endl;
+                    //    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
+                                               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<<framei<<":"<<processed->fFrameInfo.n[12][hiti]<<endl;
+                    //    cout<<framei<<":"<<processed->fFrameInfo.n[12][hiti]<<endl;
                         histogramFSBB2->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<<framei<<"Pixelnr."<<processed->fFrameInfo.pixel[hiti]<<" Charge in Seed: "<<processed->fFrameInfo.p[12][hiti]<<" Charge in Sum: "<<pixelSum<<endl;
                     }
                                        
                                        //FSBB CODE END
@@ -872,6 +902,7 @@ Bool_t Run::binSeedSumVeto()
             }
         }
     }
+       cout<<"Found suspicious frames "<<foundSuspFrame<<endl;
 //     gROOT->SetBatch(kTRUE);
 
     for (vector<HistogramType*>::iterator curHistogramClass = HistogramClassVector.begin(); curHistogramClass != HistogramClassVector.end(); curHistogramClass++)  {
@@ -1713,9 +1744,12 @@ void Run::getPixelWithFakehits()
        {
                sourceIntensity=2;
        }
+       cout<<"Pixel 321"<<histoPixel->GetBinContent(321)<<endl;
+       cout<<"!!!!!!!!!!!!!!!!Pixel 322"<<histoPixel->GetBinContent(322)<<"must be larger than"<<fakehitrate*sourceIntensity*labbook.frames_foundDB<<endl;
        for(int ipixel=0;ipixel<pixels;ipixel++)
        {
                if(histoPixel->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
index 04f67122dd6c7c7de9eb77ab038f698657d91509..74e8c363230de95a9c6aceb0afafb9634e89db05 100644 (file)
@@ -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();