]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Threshold for digits in RecPoint introduced
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Dec 2002 15:08:00 +0000 (15:08 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Dec 2002 15:08:00 +0000 (15:08 +0000)
PHOS/AliPHOSClusterizerv1.cxx
PHOS/AliPHOSClusterizerv1.h
PHOS/AliPHOSEmcRecPoint.cxx
PHOS/AliPHOSEmcRecPoint.h

index 42311dbfee006462af558be798eff836095ca8f8..dac548938c5911f96a32bbe031d4bb64228f0831 100644 (file)
@@ -369,7 +369,9 @@ void AliPHOSClusterizerv1::InitParameters()
   fEmcTimeGate             = 1.e-8 ; 
   
   fToUnfold                = kTRUE ;
-    
+
+  fPurifyThreshold         = 0.012 ;
+  
   TString clusterizerName( GetName()) ;
   if (clusterizerName.IsNull() ) 
     clusterizerName = "Default" ; 
@@ -493,9 +495,16 @@ void AliPHOSClusterizerv1::WriteRecPoints(Int_t event)
 
   Int_t index ;
   //Evaluate position, dispersion and other RecPoint properties...
-  for(index = 0; index < emcRecPoints->GetEntries(); index++)
-    ((AliPHOSEmcRecPoint *)emcRecPoints->At(index))->EvalAll(fW0,digits) ;
-  
+  for(index = 0; index < emcRecPoints->GetEntries(); index++){
+    AliPHOSEmcRecPoint * emcrp = static_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(index)) ;
+    emcrp->Purify(fPurifyThreshold) ; 
+    if(emcrp->GetMultiplicity())
+      emcrp->EvalAll(fW0,digits) ;
+    else
+      emcRecPoints->Remove(emcrp) ;
+ }
+
+  emcRecPoints->Compress() ;  
   emcRecPoints->Sort() ;
   for(index = 0; index < emcRecPoints->GetEntries(); index++)
     ((AliPHOSEmcRecPoint *)emcRecPoints->At(index))->SetIndexInList(index) ;
index dfb260ecaa95532457b1098df27d80a42db57eb2..f6a103fb585b7b8ca4c7ce44689f545b969ec342 100644 (file)
@@ -50,6 +50,7 @@ public:
   virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold;  } 
   virtual Float_t GetCpvLocalMaxCut()const        { return fCpvLocMaxCut;} 
   virtual Float_t GetCpvLogWeight()const          { return fW0CPV;}  
+  virtual Float_t GetPurifyThreshold()const       {return fPurifyThreshold; }
   virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
   virtual const Int_t GetRecPointsInRun() const   {return fRecPointsInRun ;} 
 
@@ -64,7 +65,8 @@ public:
   virtual void SetCpvClusteringThreshold(Float_t cluth)  { fCpvClusteringThreshold = cluth ; }
   virtual void SetCpvLocalMaxCut(Float_t cut)            { fCpvLocMaxCut = cut ; }
   virtual void SetCpvLogWeight(Float_t w)                { fW0CPV = w ; }
-   virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    { fToUnfold = toUnfold ;}  
+  virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    { fToUnfold = toUnfold ;}
+  virtual void SetPirifyThreshold(Float_t threshold)     {fPurifyThreshold = threshold ;}
   static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding; 
                                             //class member function (not object member function)
   static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ;
@@ -111,7 +113,8 @@ private:
   Float_t fADCpedestalEmc ;         //
   Float_t fADCchanelCpv ;           // width of one ADC channel in CPV 'popugais'
   Float_t fADCpedestalCpv ;         // 
-
+  
+  Float_t fPurifyThreshold ;         // threshold for cell energies after unfolding
   Float_t fEmcClusteringThreshold ;  // minimum energy to include a EMC digit in a cluster
   Float_t fCpvClusteringThreshold ;  // minimum energy to include a CPV digit in a cluster
   Float_t fEmcLocMaxCut ;            // minimum energy difference to distinguish local maxima in a cluster
index ef96e42f75091062b7e7661ef01fa18dd318e03f..468f2a4968ad28b0bac1db16b46a6a1ba6084a31 100644 (file)
@@ -654,7 +654,38 @@ void AliPHOSEmcRecPoint::EvalTime(TClonesArray * digits){
   
 }
 //____________________________________________________________________________
-void AliPHOSEmcRecPoint::Print(Option_t * option) 
+void AliPHOSEmcRecPoint::Purify(Float_t threshold){
+  //Removes digits below threshold
+
+  Int_t * tempo = new ( Int_t[fMaxDigit] ) ; 
+  Float_t * tempoE =  new ( Float_t[fMaxDigit] ) ;
+
+  Int_t mult = 0 ;
+  for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
+    if(fEnergyList[iDigit] > threshold){
+      tempo[mult] = fDigitsList[iDigit] ;
+      tempoE[mult] = fEnergyList[iDigit] ;
+      mult++ ;
+    }
+  }
+  
+  fMulDigit = mult ;
+  delete [] fDigitsList ;
+  delete [] fEnergyList ;
+  fDigitsList = new (Int_t[fMulDigit]) ;
+  fEnergyList = new ( Float_t[fMulDigit]) ;
+
+  for(Int_t iDigit=0;iDigit< fMulDigit ;iDigit++){
+      fDigitsList[iDigit] = tempo[iDigit];
+      fEnergyList[iDigit] = tempoE[iDigit] ;
+  }
+      
+  delete [] tempo ;
+  delete [] tempoE ;
+
+}
+//____________________________________________________________________________
+void AliPHOSEmcRecPoint::Print(Option_t * option) const
 {
   // Print the list of digits belonging to the cluster
   
index 94bc7a78b8cdd33284ec7d0b7fd60ce50f30fe77..e3761a9dcaf21ad9db3c4f17f2cd34dab1ff14dd 100644 (file)
@@ -57,10 +57,12 @@ public:
   virtual Int_t GetNumberOfLocalMax(AliPHOSDigit **  maxAt, Float_t * maxAtEnergy,
                                     Float_t locMaxCut,TClonesArray * digits ) const ; 
                                                                    // searches for the local maxima 
+  //returns number of local maxima in parent cluster or -2 if unfolding failed
   Float_t     GetTime(void) const{return  fTime ; } 
   Bool_t      IsEmc(void) const { return kTRUE ; }                 // true if the recpoint is in EMC
   Bool_t      IsSortable() const {return kTRUE ; }                 // says that emcrecpoints are sortable objects 
-  void        Print(Option_t * opt = "void") ; 
+  void        Print(Option_t * opt = "void")const ; 
+  void        Purify(Float_t threshold) ;                          //Removes digits below threshold
 
   AliPHOSEmcRecPoint & operator = (const AliPHOSEmcRecPoint & rvalue)  {
     // assignement operator requested by coding convention but not needed