ROOT logo
#ifndef ALIPHOSEMCRECPOINT_H
#define ALIPHOSEMCRECPOINT_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

/* History of cvs commits:
 *
 * $Log$
 * Revision 1.36  2007/04/05 10:18:58  policheh
 * Introduced distance to nearest bad crystal.
 *
 * Revision 1.35  2007/03/06 06:47:28  kharlov
 * DP:Possibility to use actual vertex position added
 *
 * Revision 1.34  2005/05/28 14:19:04  schutz
 * Compilation warnings fixed by T.P.
 *
 */

//_________________________________________________________________________
//  RecPoint implementation for PHOS-EMC 
//  An EmcRecPoint is a cluster of digits   
//           
//-- Author: Dmitri Peressounko (RRC KI & SUBATECH)

// --- ROOT system ---

// --- Standard library ---

// --- AliRoot header files ---

//#include "AliPHOSDigit.h"
#include "AliPHOSRecPoint.h"

class AliPHOSEmcRecPoint : public AliPHOSRecPoint  {

public:

  AliPHOSEmcRecPoint() ;
  AliPHOSEmcRecPoint(const char * opt) ;
  AliPHOSEmcRecPoint(const AliPHOSEmcRecPoint & rp) ; 
 
  virtual ~AliPHOSEmcRecPoint() ;  

  virtual void Clear(const Option_t* /*option*/ ="") { delete[] fEnergyList; fEnergyList=0; AliPHOSRecPoint::Clear(); }

  //This virtual function has signature different from AliPHOSRecPoint::AddDigit
  //it hides, not overrides. using - declaration should fix the problem, at least for
  //g++
//  using AliPHOSRecPoint::AddDigit;
  virtual void  AddDigit(AliPHOSDigit & digit, Float_t Energy, Float_t time=0.) ;          // add a digit to the digits list  
  Int_t       Compare(const TObject * obj) const;                         // method for sorting  

  virtual void  EvalAll(TClonesArray * digits) ; //Those tasks which can be done without vertex
  virtual void  EvalAll(Float_t logWeight, TVector3 &vtx, TClonesArray * digits) ;
          void  EvalCoreEnergy(Float_t logWeight, Float_t coreRadius, TClonesArray * digits) ;             

  //in base class this functions is non-const
  virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py) /*const*/; 

  Float_t         GetCoreEnergy()const {return fCoreEnergy ;}
  virtual Float_t GetDispersion()const {return fDispersion ;}
  virtual void    GetElipsAxis(Float_t * lambda)const { lambda[0] = fLambda[0] ;
                                                        lambda[1] = fLambda[1] ; }
  Float_t *   GetEnergiesList() const {return fEnergyList ;}       // gets the list of energies making this recpoint
  Float_t     GetMaximalEnergy(void) const ;                       // get the highest energy in the cluster
  Int_t       GetMaximumMultiplicity() const {return fMaxDigit ;}  // gets the maximum number of digits allowed
  Int_t       GetMultiplicity(void) const { return fMulDigit ; }   // gets the number of digits making this recpoint
  Int_t       GetMultiplicityAtLevel(Float_t level) const ;  // computes multiplicity of digits with 
                                                                   // energy above relative level
  Short_t     GetNExMax(void) const {return fNExMax ;}             // Number of maxima found in cluster in unfolding:
                                                                   // 0: was no unfolging
                                                                   //-1: unfolding failed
  void        SetNExMax(Int_t nmax=1){fNExMax = static_cast<Short_t>(nmax) ;}
  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 *)const ; 
  void        Purify(Float_t threshold, const TClonesArray * digits) ;                          //Removes digits below threshold

  Float_t     GetM2x()   const {return fM2x;  } // Get second X-moment
  Float_t     GetM2z()   const {return fM2z;  } // Get second Z-moment
  Float_t     GetM3x()   const {return fM3x;  } // Get third  X-moment
  Float_t     GetM4z()   const {return fM4z;  } // Get forth  Z-moment
  Float_t     GetPhixe() const {return fPhixe;} // Get angle between center gravity and eigen vector

  Float_t     GetDistanceToBadCrystal() const {return fDistToBadCrystal;}
  void        SetDistanceToBadCrystal(Float_t dist) {fDistToBadCrystal=dist;}

private:
  AliPHOSEmcRecPoint & operator = (const AliPHOSEmcRecPoint & /*rvalue*/) {return *this;}

protected:
  virtual void  EvalLocalPosition(Float_t logWeight, TVector3 &vtx, TClonesArray * digits, TVector3 &vInc) ;// computes the position in the PHOS module 
  virtual void  EvalDispersion(Float_t logWeight, TClonesArray * digits, TVector3 &vInc) ;   // computes the dispersion of the shower
  virtual void  EvalElipsAxis(Float_t logWeight, TClonesArray * digits, TVector3 &vInc );   // computes the axis of shower ellipsoide
          void  EvalMoments(Float_t logWeight, TClonesArray * digits, TVector3 &vInc );     // computes shower moments
  virtual void  EvalPrimaries(TClonesArray * digits) ;
          void  EvalTime( TClonesArray * digits );
  virtual Bool_t AreNeighbours(AliPHOSDigit * digit1, AliPHOSDigit * digit2 ) const ;

  Float_t fCoreEnergy ;       // energy in a shower core 
  Float_t fLambda[2] ;        // shower ellipse axes
  Float_t fDispersion ;       // shower dispersion
  Float_t *fEnergyList ;      //[fMulDigit] energy of digits
  Float_t fTime ;             // Time of the digit with maximal energy deposition
  Short_t fNExMax ;           // number of (Ex-)maxima before unfolding

  Float_t fM2x;               // Second moment along X axis
  Float_t fM2z;               // Second moment along Z axis
  Float_t fM3x;               // Third  moment along X axis
  Float_t fM4z;               // Forth  moment along Z axis
  Float_t fPhixe;             // Angle between center-gravity vector and eigen vector
  Float_t fDistToBadCrystal;  // Distance to nearest bad crystal

  Int_t fDebug;               //! debug level (0 - no output)
   Long64_t fInstCount;
  static Long64_t fgInstCount;
 
  ClassDef(AliPHOSEmcRecPoint,4)  // EMC RecPoint (cluster)

};

#endif // AliPHOSEMCRECPOINT_H
 AliPHOSEmcRecPoint.h:1
 AliPHOSEmcRecPoint.h:2
 AliPHOSEmcRecPoint.h:3
 AliPHOSEmcRecPoint.h:4
 AliPHOSEmcRecPoint.h:5
 AliPHOSEmcRecPoint.h:6
 AliPHOSEmcRecPoint.h:7
 AliPHOSEmcRecPoint.h:8
 AliPHOSEmcRecPoint.h:9
 AliPHOSEmcRecPoint.h:10
 AliPHOSEmcRecPoint.h:11
 AliPHOSEmcRecPoint.h:12
 AliPHOSEmcRecPoint.h:13
 AliPHOSEmcRecPoint.h:14
 AliPHOSEmcRecPoint.h:15
 AliPHOSEmcRecPoint.h:16
 AliPHOSEmcRecPoint.h:17
 AliPHOSEmcRecPoint.h:18
 AliPHOSEmcRecPoint.h:19
 AliPHOSEmcRecPoint.h:20
 AliPHOSEmcRecPoint.h:21
 AliPHOSEmcRecPoint.h:22
 AliPHOSEmcRecPoint.h:23
 AliPHOSEmcRecPoint.h:24
 AliPHOSEmcRecPoint.h:25
 AliPHOSEmcRecPoint.h:26
 AliPHOSEmcRecPoint.h:27
 AliPHOSEmcRecPoint.h:28
 AliPHOSEmcRecPoint.h:29
 AliPHOSEmcRecPoint.h:30
 AliPHOSEmcRecPoint.h:31
 AliPHOSEmcRecPoint.h:32
 AliPHOSEmcRecPoint.h:33
 AliPHOSEmcRecPoint.h:34
 AliPHOSEmcRecPoint.h:35
 AliPHOSEmcRecPoint.h:36
 AliPHOSEmcRecPoint.h:37
 AliPHOSEmcRecPoint.h:38
 AliPHOSEmcRecPoint.h:39
 AliPHOSEmcRecPoint.h:40
 AliPHOSEmcRecPoint.h:41
 AliPHOSEmcRecPoint.h:42
 AliPHOSEmcRecPoint.h:43
 AliPHOSEmcRecPoint.h:44
 AliPHOSEmcRecPoint.h:45
 AliPHOSEmcRecPoint.h:46
 AliPHOSEmcRecPoint.h:47
 AliPHOSEmcRecPoint.h:48
 AliPHOSEmcRecPoint.h:49
 AliPHOSEmcRecPoint.h:50
 AliPHOSEmcRecPoint.h:51
 AliPHOSEmcRecPoint.h:52
 AliPHOSEmcRecPoint.h:53
 AliPHOSEmcRecPoint.h:54
 AliPHOSEmcRecPoint.h:55
 AliPHOSEmcRecPoint.h:56
 AliPHOSEmcRecPoint.h:57
 AliPHOSEmcRecPoint.h:58
 AliPHOSEmcRecPoint.h:59
 AliPHOSEmcRecPoint.h:60
 AliPHOSEmcRecPoint.h:61
 AliPHOSEmcRecPoint.h:62
 AliPHOSEmcRecPoint.h:63
 AliPHOSEmcRecPoint.h:64
 AliPHOSEmcRecPoint.h:65
 AliPHOSEmcRecPoint.h:66
 AliPHOSEmcRecPoint.h:67
 AliPHOSEmcRecPoint.h:68
 AliPHOSEmcRecPoint.h:69
 AliPHOSEmcRecPoint.h:70
 AliPHOSEmcRecPoint.h:71
 AliPHOSEmcRecPoint.h:72
 AliPHOSEmcRecPoint.h:73
 AliPHOSEmcRecPoint.h:74
 AliPHOSEmcRecPoint.h:75
 AliPHOSEmcRecPoint.h:76
 AliPHOSEmcRecPoint.h:77
 AliPHOSEmcRecPoint.h:78
 AliPHOSEmcRecPoint.h:79
 AliPHOSEmcRecPoint.h:80
 AliPHOSEmcRecPoint.h:81
 AliPHOSEmcRecPoint.h:82
 AliPHOSEmcRecPoint.h:83
 AliPHOSEmcRecPoint.h:84
 AliPHOSEmcRecPoint.h:85
 AliPHOSEmcRecPoint.h:86
 AliPHOSEmcRecPoint.h:87
 AliPHOSEmcRecPoint.h:88
 AliPHOSEmcRecPoint.h:89
 AliPHOSEmcRecPoint.h:90
 AliPHOSEmcRecPoint.h:91
 AliPHOSEmcRecPoint.h:92
 AliPHOSEmcRecPoint.h:93
 AliPHOSEmcRecPoint.h:94
 AliPHOSEmcRecPoint.h:95
 AliPHOSEmcRecPoint.h:96
 AliPHOSEmcRecPoint.h:97
 AliPHOSEmcRecPoint.h:98
 AliPHOSEmcRecPoint.h:99
 AliPHOSEmcRecPoint.h:100
 AliPHOSEmcRecPoint.h:101
 AliPHOSEmcRecPoint.h:102
 AliPHOSEmcRecPoint.h:103
 AliPHOSEmcRecPoint.h:104
 AliPHOSEmcRecPoint.h:105
 AliPHOSEmcRecPoint.h:106
 AliPHOSEmcRecPoint.h:107
 AliPHOSEmcRecPoint.h:108
 AliPHOSEmcRecPoint.h:109
 AliPHOSEmcRecPoint.h:110
 AliPHOSEmcRecPoint.h:111
 AliPHOSEmcRecPoint.h:112
 AliPHOSEmcRecPoint.h:113
 AliPHOSEmcRecPoint.h:114
 AliPHOSEmcRecPoint.h:115
 AliPHOSEmcRecPoint.h:116
 AliPHOSEmcRecPoint.h:117
 AliPHOSEmcRecPoint.h:118
 AliPHOSEmcRecPoint.h:119
 AliPHOSEmcRecPoint.h:120
 AliPHOSEmcRecPoint.h:121
 AliPHOSEmcRecPoint.h:122
 AliPHOSEmcRecPoint.h:123
 AliPHOSEmcRecPoint.h:124
 AliPHOSEmcRecPoint.h:125
 AliPHOSEmcRecPoint.h:126
 AliPHOSEmcRecPoint.h:127
 AliPHOSEmcRecPoint.h:128
 AliPHOSEmcRecPoint.h:129
 AliPHOSEmcRecPoint.h:130