LCOV - code coverage report
Current view: top level - ITS/ITSrec - AliITSOnlineSDD.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 47 2.1 %
Date: 2016-06-14 17:26:59 Functions: 1 6 16.7 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : ///////////////////////////////////////////////////////////////////
      17             : //                                                               //
      18             : // Implementation of the base class for SDD detector algorithms  //
      19             : // Origin: F.Prino, Torino, prino@to.infn.it                     //
      20             : //                                                               //
      21             : ///////////////////////////////////////////////////////////////////
      22             : 
      23             : #include "AliITSOnlineSDD.h"
      24             : #include "TH2F.h"
      25             : 
      26         116 : ClassImp(AliITSOnlineSDD)
      27             : //______________________________________________________________________
      28           0 :   AliITSOnlineSDD::AliITSOnlineSDD():TObject(),fDDL(0),fCarlos(0),fSide(0),fFirstGoodTB(0),fLastGoodTB(0)
      29           0 : {
      30             :   // default constructor
      31           0 :   SetFirstGoodTB();
      32           0 :   SetLastGoodTB();
      33           0 : }
      34             : //______________________________________________________________________
      35           0 :   AliITSOnlineSDD::AliITSOnlineSDD(Int_t nddl, Int_t ncarlos, Int_t sid):TObject(),fDDL(0),fCarlos(0),fSide(0),fFirstGoodTB(0),fLastGoodTB(0)
      36           0 : {
      37             :   // standard constructor
      38           0 :   SetDDL(nddl);
      39           0 :   SetCarlos(ncarlos);
      40           0 :   SetDetectorSide(sid);
      41           0 :   SetFirstGoodTB();
      42           0 :   SetLastGoodTB();
      43           0 : }
      44             : //______________________________________________________________________
      45             : TH2F* AliITSOnlineSDD::ApplyZeroSuppression(TH2F* hRaw, Float_t basl, Int_t tL, Int_t tH){
      46             :   // apply zero suppression 
      47             : 
      48           0 :   Int_t nx=hRaw->GetNbinsX();
      49           0 :   Float_t xmin=hRaw->GetXaxis()->GetXmin();
      50           0 :   Float_t xmax=hRaw->GetXaxis()->GetXmax();
      51           0 :   Int_t ny=hRaw->GetNbinsY();
      52           0 :   Float_t ymin=hRaw->GetYaxis()->GetXmin();
      53           0 :   Float_t ymax=hRaw->GetYaxis()->GetXmax();
      54           0 :   TH2F* hZeroSupp=new TH2F(Form("%s_ZeroSupp",hRaw->GetName()),"",nx,xmin,xmax,ny,ymin,ymax);
      55           0 :   for(Int_t ix=1; ix<=nx;ix++){
      56           0 :     for(Int_t iy=1; iy<=ny;iy++){
      57             :       //                     N
      58             :       // Get "quintuple":   WCE
      59             :       //                     S
      60           0 :       Float_t cC=hRaw->GetBinContent(ix,iy)-basl;
      61             :       Int_t nLow=0, nHigh=0;      
      62           0 :       if(cC<tL){
      63           0 :         hZeroSupp->SetBinContent(ix,iy,0.);
      64           0 :         continue;
      65             :       }
      66             :       nLow++; // cC is greater than tL
      67           0 :       if(cC>tH) nHigh++;
      68             :       Float_t wW=0.;
      69           0 :       if(iy>0) wW=hRaw->GetBinContent(ix,iy-1)-basl;
      70           0 :       if(wW>tL) nLow++;
      71           0 :       if(wW>tH) nHigh++;
      72             :       Float_t eE=0.;
      73           0 :       if(iy<ny) eE=hRaw->GetBinContent(ix,iy+1)-basl;
      74           0 :       if(eE>tL) nLow++;
      75           0 :       if(eE>tH) nHigh++;
      76             :       Float_t nN=0.;
      77           0 :       if(ix<nx) nN=hRaw->GetBinContent(ix+1,iy)-basl;
      78           0 :       if(nN>tL) nLow++;
      79           0 :       if(nN>tH) nHigh++;
      80             :       Float_t sS=0.;
      81           0 :       if(ix>0) sS=hRaw->GetBinContent(ix-1,iy)-basl;
      82           0 :       if(sS>tL) nLow++;
      83           0 :       if(sS>tH) nHigh++;
      84           0 :       if(nLow>=2 && nHigh>=1){
      85           0 :         hZeroSupp->SetBinContent(ix,iy,cC);
      86           0 :       }else{
      87           0 :         hZeroSupp->SetBinContent(ix,iy,0.);
      88             :       }
      89           0 :     }
      90             :   }
      91           0 :   return hZeroSupp;
      92           0 : }

Generated by: LCOV version 1.11