]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSClusterizerv1.h
Coding convention obeyed
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.h
index 3b897b64b28e6b62a9ce458aec2f9a6665b9ce05..abb824da0e42a8e38de0d013f169c268779ec05e 100644 (file)
 
 /* $Id$ */
 
-////////////////////////////////////////////////
-//  Clusterizer implementation version 1      //
-//  algorithme class                          //
-//                                            //
-//  Author Yves Schutz     SUBATECH           //
-//                                            //  
-//                                            //
-////////////////////////////////////////////////
+//_________________________________________________________________________
+//  Implementation version 1 of the clusterization algorithm                     
+//  Performs clusterization (collects neighbouring active cells) and 
+//  unfolding of the clusters with several local maxima.  
+//  results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
+//  PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
+//
+//*-- Author: Dmitri Peressounko (SUBATECH)
 
 // --- ROOT system ---
-
+#include "TArrayS.h"
 // --- Standard library ---
 
 // --- AliRoot header files ---
 
 #include "AliPHOSClusterizer.h"
-#include "AliPHOSDigit.h" 
-
-
+class AliPHOSEmcRecPoint ; 
+class AliPHOSDigit ;
+class AliPHOSDigitizer ;
+class AliPHOSGeometry ;
+class AliPHOSCalibrationData ;
 
 class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
   
 public:
   
-  AliPHOSClusterizerv1() ;             // ctor            
-  virtual ~AliPHOSClusterizerv1(){} ;  // dtor
+  AliPHOSClusterizerv1() ;         
+  AliPHOSClusterizerv1(const char * headerFile, const char * name = "Default", const Bool_t toSplit=kFALSE);
+  AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clusterizer) {
+    // copy ctor: no implementation yet
+    Fatal("cpy ctor", "not implemented") ;
+  }
+  virtual ~AliPHOSClusterizerv1()  ;
   
-  Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2) ; // Checks if digits are in neighbour cells 
-  Float_t Calibrate(Int_t Amp){ return (fA + fB * Amp) ;}     // Tranforms Amp to energy 
-  void FillandSort(const DigitsList * dl, TObjArray * tl) ;   // Sorts the list according to increasing id
-  Float_t GetLogWeightCut(void){return  fW0 ; }
-  Float_t GetLocalMaxCut(void) {return  fLocMaxCut ; }
-  virtual void GetNumberOfClustersFound(Int_t * numb) ;   
-  Bool_t IsInEmc(AliPHOSDigit * digit) ;                      // Tells if id digit is in EMC
-  virtual void MakeClusters(const DigitsList * dl, RecPointsList * emcl, RecPointsList * ppsdl) ; // does the job 
-  virtual void PrintParameters() ;  
-  virtual void SetCalibrationParameters(Float_t A,Float_t B){ fA = A ; fB = B;} 
-  virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
-  virtual void SetEmcEnergyThreshold(Float_t enth) { fEmcEnergyThreshold = enth ; } 
-  virtual void SetLocalMaxCut(Float_t cut) { fLocMaxCut = cut ; }
-  virtual void SetLogWeightCut(Float_t w) { fW0 = w ; }
-  virtual void SetPpsdClusteringThreshold(Float_t cluth) { fPpsdClusteringThreshold = cluth ; }
-  virtual void SetPpsdEnergyThreshold(Float_t enth) { fPpsdEnergyThreshold = enth ; } 
+  virtual Int_t   AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ; 
+                               // Checks if digits are in neighbour cells 
+
+  virtual Float_t Calibrate(Int_t amp, Int_t absId)const ;  // Tranforms Amp to energy 
+
+  virtual void    GetNumberOfClustersFound(int * numb )const{  numb[0] = fNumberOfEmcClusters ; 
+                                                               numb[1] = fNumberOfCpvClusters ; }
+
+  virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
+  virtual Float_t GetEmcLocalMaxCut()const        { return fEmcLocMaxCut;} 
+  virtual Float_t GetEmcLogWeight()const          { return fW0;}  
+  virtual Float_t GetEmcTimeGate() const          { return fEmcTimeGate ; }
+  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 ;} 
+
+  void    Exec(Option_t *option);                // Does the job
+
+  virtual void Print(Option_t * option)const ;
+
+  virtual void SetEmcClusteringThreshold(Float_t cluth)  { fEmcClusteringThreshold = cluth ; }
+  virtual void SetEmcLocalMaxCut(Float_t cut)            { fEmcLocMaxCut = cut ; }
+  virtual void SetEmcLogWeight(Float_t w)                { fW0 = w ; }
+  virtual void SetEmcTimeGate(Float_t gate)              { fEmcTimeGate = gate ;}
+  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 SetPirifyThreshold(Float_t threshold)     {fPurifyThreshold = threshold ;}
+  void SetCalibrVersion(const char* version = "v1",Int_t run=1)  //Provides specification of calibrationData
+    {fCalibrVersion = version ; fCalibrRun = run ;} 
+  void SetPatterns(TArrayS * pats){if(fPatterns) delete fPatterns ; 
+                                  fPatterns = new TArrayS(*pats) ;} 
+  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)  ;
+                                            // Chi^2 of the fit. Should be static to be passes to MINUIT
+  AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & rvalue)  {
+    // assignement operator requested by coding convention but not needed
+    Fatal("operator =", "not implemented") ; return *this ; 
+  }
+
+  virtual const char * Version() const { return "clu-v1" ; }  
+
+protected:
+
+  void           WriteRecPoints(Int_t event) ;
+  virtual void   MakeClusters( ) ;            
+  virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ;     // Tells if id digit is in EMC
+  virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ;     // Tells if id digit is in CPV
+
   
 private:
+
+  const   TString BranchName() const ; 
+  void    GetCalibrationParameters(void) ;
   
-  Float_t fA ;
-  Float_t fB ;
-  Float_t fEmcClusteringThreshold ; 
-  Float_t fEmcEnergyThreshold ; 
-  Float_t fLocMaxCut ;   
-  Int_t   fNumberOfEmcClusters ; 
-  Int_t   fNumberOfPpsdClusters ; 
-  Float_t fPpsdClusteringThreshold ; 
-  Float_t fPpsdEnergyThreshold ;  
-  Float_t fW0 ;   
-  
-public: 
+  Bool_t  FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy, 
+                 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
+  void    Init() ;
+  void    InitParameters() ;
+
+  virtual void   MakeUnfolding() ;
+  void           UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax, 
+                      AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
+  void           PrintRecPoints(Option_t * option) ;
+
+private:
+
+  Bool_t  fDefaultInit;              //! Says if the task was created by defaut ctor (only parameters are initialized)
+
+  Int_t   fEmcCrystals ;             // number of EMC cristalls in PHOS
+
+  Bool_t  fToUnfold ;                // To perform unfolding 
+
+  Int_t   fNumberOfEmcClusters ;     // number of EMC clusters found 
+  Int_t   fNumberOfCpvClusters ;     // number of CPV clusters found
+  //Calibration parameters
+  AliPHOSCalibrationData * fPedestals ; //!
+  AliPHOSCalibrationData * fGains ;    //!
+  TArrayS                * fPatterns ;// Array of trigger patterns of events to handle
+  TString fCalibrVersion ;          // Version of calibration Data  
+  Int_t   fCalibrRun ;              // Specification of Calibration data
+  Float_t fADCchanelEmc ;           // width of one ADC channel in GeV
+  Float_t fADCpedestalEmc ;         // value of the EMC ADC pedestal
+  Float_t fADCchanelCpv ;           // width of one ADC channel in CPV 'popugais'
+  Float_t fADCpedestalCpv ;         // value of the CPV ADC pedestal
   
-  ClassDef(AliPHOSClusterizerv1,1)  // Clusterizer implementation , version 1
+  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
+  Float_t fW0 ;                      // logarithmic weight for the cluster center of gravity calculation
+  Float_t fCpvLocMaxCut ;            // minimum energy difference to distinguish local maxima in a CPV cluster
+  Float_t fW0CPV ;                   // logarithmic weight for the CPV cluster center of gravity calculation
+  Int_t fRecPointsInRun ;            //! Total number of recpoints in one run
+  Float_t fEmcTimeGate ;             // Maximum time difference between the digits in ont EMC cluster
+    
+  ClassDef(AliPHOSClusterizerv1,2)   // Clusterizer implementation version 1
 
 };