]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALClusterizerv1.h
updates for Effective C++ compiler flags
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizerv1.h
index 1d9b62623d86667ce0e3b387a17b5fae1f2cf14a..bf33d2abc99377652ac36e7826a9a203433f4f1b 100644 (file)
@@ -13,6 +13,9 @@
 //  PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
 //
 //*-- Author: Yves Schutz (SUBATECH)
+// Modif: 
+//  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
+//                           of new  IO (à la PHOS)
 
 // --- ROOT system ---
 
 // --- AliRoot header files ---
 
 #include "AliEMCALClusterizer.h"
-class AliEMCALTowerRecPoint ; 
+class TH1F;
+class AliEMCALRecPoint ; 
 class AliEMCALDigit ;
 class AliEMCALDigitizer ;
 class AliEMCALGeometry ;
-
+class AliEMCALCalibData ;
 
 class AliEMCALClusterizerv1 : public AliEMCALClusterizer {
   
 public:
   
   AliEMCALClusterizerv1() ;         
-  AliEMCALClusterizerv1(const char * headerFile, const char * name = "Default");
+  //cpy ctor required by coding convention
+  AliEMCALClusterizerv1(const AliEMCALClusterizerv1& clus);
+
+  AliEMCALClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
   virtual ~AliEMCALClusterizerv1()  ;
-  
+  virtual void Browse(TBrowser* b);
+
+  AliEMCALClusterizerv1 & operator = (const AliEMCALClusterizerv1 &) {
+    Fatal("operator =", "not implemented") ;
+    return *this ;
+  }
+
   virtual Int_t   AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const ; 
                                // Checks if digits are in neighbour cells 
 
-  virtual Float_t Calibrate(Int_t amp, Bool_t inpresho)const ;  // Tranforms Amp to energy 
+  // Checks if digits are in a tower group; for pseudoclusters 
+  virtual Int_t   AreInGroup(AliEMCALDigit * d1, AliEMCALDigit * d2)const ; 
+
+  virtual Float_t Calibrate(Int_t amp, Int_t cellId) ;  // Tranforms Amp to energy 
 
-  virtual void    GetNumberOfClustersFound(int * numb )const{  numb[0] = fNumberOfTowerClusters ; 
-                                                               numb[1] = fNumberOfPreShoClusters ; }
+  virtual void    GetNumberOfClustersFound(int numb )const{ numb = fNumberOfECAClusters ;} 
+  virtual Float_t GetECAClusteringThreshold()const{ return fECAClusteringThreshold;}  
+  virtual Float_t GetECALocalMaxCut()const       { return fECALocMaxCut;} 
+  virtual Float_t GetECALogWeight()const         { return fECAW0;}
+  virtual Float_t GetMinECut()const              { return fMinECut;}
 
-  virtual Float_t GetEmcClusteringThreshold()const{ return fTowerClusteringThreshold;}
-  virtual Float_t GetEmcLocalMaxCut()const        { return fTowerLocMaxCut;} 
-  virtual Float_t GetEmcLogWeight()const          { return fW0;}  
-  virtual Float_t GetTimeGate() const             { return fTimeGate ; }
-  virtual Float_t GetCpvClusteringThreshold()const{ return fPreShoClusteringThreshold;  } 
-  virtual Float_t GetCpvLocalMaxCut()const        { return fPreShoLocMaxCut;} 
-  virtual Float_t GetCpvLogWeight()const          { return fW0CPV;}  
-  virtual char *  GetRecPointsBranch() const      { return (char*) fRecPointsBranchTitle.Data() ;}
-  virtual const Int_t GetRecPointsInRun() const  {return fRecPointsInRun ;} 
-  virtual char *  GetDigitsBranch() const         { return (char*) fDigitsBranchTitle.Data() ;}
+  virtual Float_t GetTimeGate() const            { return fTimeGate ; }
+  virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
+  virtual Int_t GetRecPointsInRun() const   {return fRecPointsInRun ;} 
 
   void    Exec(Option_t *option);                // Does the job
 
   virtual void Print(Option_t * option)const ;
 
-  virtual void SetTowerClusteringThreshold(Float_t cluth)  { fTowerClusteringThreshold = cluth ; }
-  virtual void SetTowerLocalMaxCut(Float_t cut)            { fTowerLocMaxCut = cut ; }
-  virtual void SetTowerLogWeight(Float_t w)                { fW0 = w ; }
-  virtual void SetTimeGate(Float_t gate)                   { fTimeGate = gate ;}
-  virtual void SetPreShoClusteringThreshold(Float_t cluth) { fPreShoClusteringThreshold = cluth ; }
-  virtual void SetPreShoLocalMaxCut(Float_t cut)           { fPreShoLocMaxCut = cut ; }
-  virtual void SetPreShoLogWeight(Float_t w)               { fW0CPV = w ; }
-  virtual void SetDigitsBranch(const char * title) { fDigitsBranchTitle = title  ;}
-  virtual void SetRecPointsBranch(const char *title){fRecPointsBranchTitle = title; }
-  virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}  
+  virtual void SetECAClusteringThreshold(Float_t cluth)  { fECAClusteringThreshold = cluth ; }
+  virtual void SetMinECut(Float_t mine)                  { fMinECut = mine; }
+  virtual void SetECALocalMaxCut(Float_t cut)            { fECALocMaxCut = cut ; }
+  virtual void SetECALogWeight(Float_t w)                { fECAW0 = w ; }
+  virtual void SetTimeGate(Float_t gate)                 { fTimeGate = gate ;}
+  virtual void SetUnfolding(Bool_t toUnfold = kTRUE )    {fToUnfold = toUnfold ;}  
   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
+  void Unload() ; 
   virtual const char * Version() const { return "clu-v1" ; }  
-
+  TList* BookHists();
+  void   SaveHists(const char *fn="reco.root");  //*MENU*
 protected:
 
-  void           WriteRecPoints(Int_t event) ;
-  virtual void   MakeClusters( ) ;            
-  virtual Bool_t IsInTower (AliEMCALDigit * digit)const ;     // Tells if id digit is in Tower
-  virtual Bool_t IsInPreShower (AliEMCALDigit * digit)const ;     // Tells if id digit is in PreShower
+  void           WriteRecPoints() ;
+  virtual void   MakeClusters(char* opt ) ;            
+  virtual void   MakeClusters() { Fatal("MakeClusters","not implemented"); }
+            
+///////////////////// 
+   TList  *fHists;   //!
+   TH1F* fPointE;    //histogram of point energy
+   TH1F* fPointL1;   //histogram of point L1
+   TH1F* fPointL2;   //histogram of point L2
+   TH1F* fPointDis;  //histogram of point dispersion
+   TH1F* fPointMult; //histogram of point multiplicity
+   TH1F* fDigitAmp;  //histogram of digit ADC Amplitude
+   TH1F* fMaxE;      //histogram of maximum point energy
+   TH1F* fMaxL1;     //histogram of maximum point L1
+   TH1F* fMaxL2;     //histogram of maximum point L2
+   TH1F* fMaxDis;    //histogram of maximum point dispersion
+///////////////////////
+
 
-  
 private:
 
+  const TString BranchName() const ; 
   void    GetCalibrationParameters(void) ;
   
-  Bool_t  FindFit(AliEMCALTowerRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy, 
+  Bool_t  FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** 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(AliEMCALTowerRecPoint * iniEmc,Int_t Nmax, 
-                      AliEMCALDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
+  virtual void   MakeUnfolding() const;
+  void           UnfoldCluster(AliEMCALRecPoint * /*iniEmc*/, Int_t /*Nmax*/, 
+                              AliEMCALDigit ** /*maxAt*/,
+                              Float_t * /*maxAtEnergy*/ ) const; //Unfolds cluster using TMinuit package
   void           PrintRecPoints(Option_t * option) ;
 
 private:
+  AliEMCALGeometry* fGeom;           //! pointer to geometry for utilities
 
-  TString fHeaderFileName ;          // name of the file which contains gAlice, Tree headers etc.
-  TString fDigitsBranchTitle ;       // name of the file, where digits branch is stored
-  TString fRecPointsBranchTitle ;    // name of the file, where RecPoints branchs are stored
+  Bool_t  fDefaultInit;              //! Says if the task was created by defaut ctor (only parameters are initialized)
+  Bool_t  fToUnfold ;                // To perform unfolding 
+  Int_t   fNumberOfECAClusters ;     // number of clusters found in EC section
 
-  Int_t   fNTowers ;                 // number of Towers in EMCAL
+  Int_t   fNTowerInGroup;            // number of towers to group for pseudoclusters
 
-  Bool_t  fToUnfold ;                // To perform unfolding 
+  //Calibration parameters... to be replaced by database 
 
-  Int_t   fNumberOfTowerClusters ;     // number of Tower clusters found 
-  Int_t   fNumberOfPreShoClusters ;    // number of PreShower clusters found
+  AliEMCALCalibData * fCalibData  ;   //! Calibration database if aval
+  Float_t fADCchannelECA ;          // width of one ADC channel for EC section (GeV)
+  Float_t fADCpedestalECA ;         // pedestal of ADC for EC section (GeV) 
  
-  Float_t fADCchannelTower ;           // width of one ADC channel for Tower (GeV)
-  Float_t fADCpedestalTower ;          // pedestal of ADC for Tower (GeV) 
-  Float_t fADCchannelPreSho ;          // width of one ADC channel for Pre Shower (GeV)
-  Float_t fADCpedestalPreSho ;         // pedestal of ADC for PreShower (GeV)
-
-  Float_t fTowerClusteringThreshold ;  // minimum energy to include a EMC digit in a cluster
-  Float_t fPreShoClusteringThreshold ; // minimum energy to include a CPV digit in a cluster
-  Float_t fTowerLocMaxCut ;            // minimum energy difference to distinguish local maxima in a cluster
-  Float_t fW0 ;                        // logarithmic weight for the cluster center of gravity calculation
-  Float_t fPreShoLocMaxCut ;           //  minimum energy difference to distinguish local maxima in a CPV cluster
-  Float_t fW0CPV ;                   // logarithmic weight for the CPV cluster center of gravity calculation
+  Float_t fECAClusteringThreshold ;  // minimum energy to seed a EC digit in a cluster
+  Float_t fECALocMaxCut ;            // minimum energy difference to distinguish local maxima in a cluster
+  Float_t fECAW0 ;                   // logarithmic weight for the cluster center of gravity calculation
   Int_t fRecPointsInRun ;            //! Total number of recpoints in one run
   Float_t fTimeGate ;                // Maximum time difference between the digits in ont EMC cluster
-    
-  ClassDef(AliEMCALClusterizerv1,1)   // Clusterizer implementation version 1
+  Float_t fMinECut;                  // Minimum energy for a digit to be a member of a cluster
+
+  ClassDef(AliEMCALClusterizerv1,4)   // Clusterizer implementation version 1
 
 };