]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Improved getPixelWithFakehits
authorDennis Doering <doering@physik.uni-frankfurt.de>
Thu, 17 Sep 2015 14:58:20 +0000 (16:58 +0200)
committerDennis Doering <doering@physik.uni-frankfurt.de>
Thu, 17 Sep 2015 14:58:20 +0000 (16:58 +0200)
MABS_run_analyzer/Run.c

index 3c1b8f178584111651ef45b650d6a7c144fb6cfc..d16e39a2fef98ce6a76442269faff6ac522377ff 100644 (file)
@@ -856,24 +856,9 @@ Bool_t Run::binSeedSumVeto()
                     if (TMath::Abs(notSeedSum) < systemparamcur.vetothreshold && (labbook.source.Contains("Fe")||labbook.source.Contains("Cd")))
                         histogram.Veto->Fill(processed->fFrameInfo.p[12][hiti]);    // histogram with the single pixel
                     
-                    if (processed->fFrameInfo.pixelthreshold[hiti]>0)
+                    if (processed->fFrameInfo.pixelthreshold[hiti]*fPixelFakeHits[processed->fFrameInfo.pixel[hiti]]>0)//If clustercharge is above threshold AND pixel is NOT a fake hit pixel according getPixelWithFakehits()
                     {
-                                                Bool_t pixelfound=false;
-                                                for(int col=0;col<fcountPixelFakeHits;col++)
-                                                {
-                                                if(fPixelFakeHits[col]==processed->fFrameInfo.pixel[hiti])
-                                                       {
-                                                        pixelfound=true;
-                                                        }
-                                                }
-                                                if(pixelfound==true)
-                                                {
-                                                       continue;//If pixel is a fake hit pixel with a rate >1e-5, do not count it
-                                                }
-                                                 // if(pixelfound==false)
-                                                // {
-                                                       // cout<<"Pixel"<<processed->fFrameInfo.pixel[hiti]<<" NOT found in array"<<endl;
-                                                // }
+                                               
                         histogramthreshold.numberofhits++;
                         
                         histogramthreshold.Seed->Fill(processed->fFrameInfo.p[12][hiti]);
@@ -2049,29 +2034,36 @@ void Run::getPixelWithFakehits()
        }
        fPixelFakeHits  = new Float_t [pixels]();
        fcountPixelFakeHits=0;
-       for(int col=0;col<pixels;col++)
+       Float_t fakehitrate=0.00001;
+       Float_t sourceIntensity=1;//Adjust it depending on the intensity of the used source
+       if(labbook.source.Contains("Fe"))
        {
-               Float_t fakehitrate=0.00001;
-               Float_t sourceIntensity=1;//Adjust it depending on the intensity of the used source
-               if(labbook.source.Contains("Fe"))
-               {
-                       sourceIntensity=30;
-               }
-               else if(labbook.source.Contains("Sr"))
-               {
-                       sourceIntensity=2;
+               sourceIntensity=30;
+       }
+       else if(labbook.source.Contains("Sr"))
+       {
+               sourceIntensity=2;
+       }
+       else if(labbook.source.Contains("Cd"))
+       {
+               sourceIntensity=2;
+       }
+       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
+               {       
+                       fcountPixelFakeHits++;
+                       fPixelFakeHits[ipixel]=0;//pixel is a fake hit pixel
+                       
+               //       cout<<ipixel<<":"<<histoPixel->GetBinContent(ipixel)<<endl;
                }
-               else if(labbook.source.Contains("Cd"))
+               else
                {
-                       sourceIntensity=2;
-               }
-               if(histoPixel->GetBinContent(col)>fakehitrate*sourceIntensity*labbook.frames_foundDB)//show only pixels with a fake hit rate above 1e-5
-               {       
-                       fPixelFakeHits[fcountPixelFakeHits]=col;
-                               fcountPixelFakeHits++;
-                        cout<<col<<":"<<histoPixel->GetBinContent(col)<<endl;
+                       fPixelFakeHits[ipixel]=1;//pixel is NOT a fake hit pixel
                }
+               
        }
+       cout<<"Number of masked pixel due to a fake hit rate above "<<fakehitrate<<"is: "<<fcountPixelFakeHits<<" of "<<pixels<<endl;
 return;        
 }
 #endif