LCOV - code coverage report
Current view: top level - STEER/AOD - AliAODCaloCluster.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 13 51 25.5 %
Date: 2016-06-14 17:26:59 Functions: 6 45 13.3 %

          Line data    Source code
       1             : #ifndef AliAODCaloCluster_H
       2             : #define AliAODCaloCluster_H
       3             : /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
       4             :  * See cxx source for full Copyright notice                               */
       5             : 
       6             : //-------------------------------------------------------------------------
       7             : /// \class AliAODCaloCluster
       8             : /// \brief Class for calorimeter cluster, EMCal and PHOS, data handling
       9             : ///
      10             : ///   Class to access calorimeter, EMCAL and PHOS, cluster data
      11             : ///
      12             : ///  \author Markus Oldenburg, CERN
      13             : ///  \author Gustavo Conesa Balbastre, <Gustavo.Conesa.Balbastre@cern.ch>, LPSC-Grenoble
      14             : //-------------------------------------------------------------------------
      15             : 
      16             : #include "AliAODCluster.h"
      17             : 
      18             : #include <TRefArray.h>
      19             : #include <TArrayS.h>
      20             : 
      21             : class TLorentzVector;
      22             : 
      23             : class AliAODCaloCluster : public AliAODCluster {
      24             : 
      25             :  public:
      26             :   
      27             :   AliAODCaloCluster();
      28             :   AliAODCaloCluster(Int_t id,
      29             :                     UInt_t nLabel,
      30             :                     Int_t *label,
      31             :                     Double_t energy,
      32             :                     Double_t x[3],
      33             :                     Double_t pid[13],
      34             :                     Char_t ttype=kUndef,
      35             :                     UInt_t selectInfo=0);
      36             :   
      37             :   AliAODCaloCluster(Int_t id,
      38             :                     UInt_t nLabel,
      39             :                     Int_t *label,
      40             :                     Float_t energy,
      41             :                     Float_t x[3],
      42             :                     Float_t pid[13],
      43             :                     Char_t ttype=kUndef,
      44             :                     UInt_t selectInfo=0);
      45             :   
      46             :   virtual ~AliAODCaloCluster();
      47             :   AliAODCaloCluster(const AliAODCaloCluster& clus); 
      48             :   AliAODCaloCluster& operator=(const AliAODCaloCluster& clus);
      49             :   void Clear(const Option_t*);
      50             :   
      51             :   //
      52             :   // Getters
      53             :   //
      54           0 :   Double_t GetDistanceToBadChannel() const { return fDistToBadChannel; }
      55           0 :   Double_t GetDispersion() const { return fDispersion; }
      56           0 :   Double_t GetM20() const { return fM20; }
      57           0 :   Double_t GetM02() const { return fM02; }
      58           0 :   Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; }
      59           0 :   Double_t GetTrackDx(void)const {return fTrackDx;}
      60           0 :   Double_t GetTrackDz(void)const {return fTrackDz;}
      61           0 :   UChar_t  GetNExMax() const { return fNExMax; }
      62           0 :   Double_t GetTOF() const { return fTOF; }
      63           0 :   Double_t GetCoreEnergy() const           {return fCoreEnergy ; }
      64             :  
      65           0 :   Int_t    GetNTracksMatched() const { return fTracksMatched.GetEntriesFast(); }
      66           0 :   TObject *GetTrackMatched(Int_t i) const { return fTracksMatched.At(i); }
      67             :  
      68          86 :   void  SetNCells(Int_t n) { fNCells = n;}
      69           0 :   Int_t GetNCells() const   { return fNCells;}
      70             :   
      71             :   void SetCellsAbsId(UShort_t *array);
      72           0 :   UShort_t *GetCellsAbsId() {return  fCellsAbsId;}
      73             :   
      74             :   void SetCellsAmplitudeFraction(Double32_t *array);
      75           0 :   Double32_t *GetCellsAmplitudeFraction() {return  fCellsAmpFraction;}
      76             :   
      77             :   Int_t GetCellAbsId(Int_t i) const {  
      78           0 :     if (fCellsAbsId && i >=0 && i < fNCells ) return fCellsAbsId[i];    
      79           0 :     else return -1;}
      80             :   
      81             :   Double_t GetCellAmplitudeFraction(Int_t i) const {  
      82           0 :     if (fCellsAmpFraction && i >=0 && i < fNCells ) return fCellsAmpFraction[i];    
      83           0 :     else return -1;}
      84             :         
      85             :   //
      86             :   // Setters
      87             :   //
      88           0 :   void SetDistanceToBadChannel(Double_t dist) { fDistToBadChannel = dist; }
      89           0 :   void SetDispersion(Double_t disp) { fDispersion = disp; }
      90           0 :   void SetM20(Double_t m20) { fM20 = m20; }
      91           0 :   void SetM02(Double_t m02) { fM02 = m02; }
      92           0 :   void SetEmcCpvDistance(Double_t emcCpvDist) { fEmcCpvDistance = emcCpvDist; }
      93           0 :   void SetNExMax(UChar_t nExMax) { fNExMax = nExMax; }
      94           0 :   void SetTOF(Double_t tof) { fTOF = tof; }
      95         136 :   void SetTrackDistance(Double_t dx, Double_t dz){fTrackDx=dx; fTrackDz=dz;}
      96           0 :   void SetCoreEnergy(Double_t e)         { fCoreEnergy=e; }
      97             : 
      98             :   void SetCaloCluster(Double_t dist = -999., 
      99             :                       Double_t disp = -1., 
     100             :                       Double_t m20 = 0., 
     101             :                       Double_t m02 = 0., 
     102             :                       Double_t emcCpvDist = -999., 
     103             :                       UShort_t nExMax = 0, 
     104             :                       Double_t tof = 0.) 
     105             :   {
     106          86 :     fDistToBadChannel = dist;
     107          43 :     fDispersion = disp;
     108          43 :     fM20 = m20;
     109          43 :     fM02 = m02;
     110          43 :     fEmcCpvDistance = emcCpvDist;
     111          43 :     fNExMax = nExMax;
     112          43 :     fTOF = tof ;
     113          43 :   }
     114             :   
     115             :   void GetMomentum(TLorentzVector& p, const Double_t * vertexPosition ) const;
     116             :   void GetMomentum(TLorentzVector& p, const Double_t * vertexPosition, VCluUserDefEnergy_t t ) const;
     117             : 
     118             :   /// Add reference to associated track to cluster.
     119             :   /// Make sure we attach the object to correct process number.
     120             :   void AddTrackMatched(TObject *trk) { 
     121          80 :     if(fTracksMatched.GetEntries()==0) { TRefArray ref(TProcessID::GetProcessWithUID(trk)) ; fTracksMatched = ref ; }
     122          22 :     fTracksMatched.Add(trk) ; }
     123             :   
     124           0 :   void RemoveTrackMatched(TObject *trk) { fTracksMatched.Remove(trk); }
     125             :   Bool_t HasTrackMatched(TObject *trk) const;
     126             : 
     127           0 :   Double_t    GetMCEnergyFraction() const          { return fMCEnergyFraction ; }
     128           0 :   void        SetMCEnergyFraction(Double_t e)      { fMCEnergyFraction = e    ; }
     129             : 
     130           0 :   Bool_t      GetIsExotic() const                  { return fIsExotic         ; }
     131           0 :   void        SetIsExotic(Bool_t b)                { fIsExotic         = b    ; }
     132             : 
     133           0 :   Double_t    GetUserDefEnergy(Int_t t)               const                     { return AliVCluster::GetUserDefEnergy(t); }
     134           0 :   Double_t    GetUserDefEnergy(VCluUserDefEnergy_t t) const                     { return E()*fUserDefEnergy[t]                   ; }
     135           0 :   void        SetUserDefEnergy(Int_t t, Double_t e)                             { AliVCluster::SetUserDefEnergy(t,e);}
     136           0 :   void        SetUserDefEnergy(VCluUserDefEnergy_t t, Double_t e)               { fUserDefEnergy[t] = E() > 1e-6 ? e / E() : 1.  ; }
     137           0 :   void        SetUserDefEnergyCorrFactor(VCluUserDefEnergy_t t, Double_t f)     { fUserDefEnergy[t] = f                          ; }
     138             :   
     139             :   void        SetCellsMCEdepFractionMap(UInt_t *array) ;
     140           0 :   UInt_t    * GetCellsMCEdepFractionMap() const    { return fCellsMCEdepFractionMap ; }
     141             :   
     142             :   void        GetCellMCEdepFractionArray(Int_t cellIndex, Float_t * eDep) const ;
     143             :   UInt_t      PackMCEdepFraction(Float_t * eDep) const ; 
     144             :   
     145             :  private :
     146             : 
     147             :   Double32_t   fDistToBadChannel; ///< Distance to nearest bad channel.
     148             :   Double32_t   fDispersion;       ///< cluster dispersion, for shape analysis.
     149             :   Double32_t   fM20;              ///< 2-nd moment along the main eigen axis.
     150             :   Double32_t   fM02;              ///< 2-nd moment along the second eigen axis.
     151             :   Double32_t   fEmcCpvDistance;   ///< The distance from PHOS EMC rec.point to the closest CPV rec.point.
     152             :   Double32_t   fTrackDx ;         ///< Distance to closest track in phi.
     153             :   Double32_t   fTrackDz ;         ///< Distance to closest track in z (eta).
     154             :   UShort_t     fNExMax;           ///< Number of local (Ex-)maxima before unfolding.
     155             :   
     156             :   /// Cluster time-of-flight
     157             :   Double32_t   fTOF;              //[0,0,12] 
     158             :   Double32_t   fCoreEnergy;       ///< Energy of the core of cluster, PHOS.
     159             : 
     160             :   TRefArray    fTracksMatched;    ///< References to tracks close to cluster. First entry is the most likely match.
     161             : 
     162             :   Int_t        fNCells ;          ///< Number of cells in cluster. 
     163             :   
     164             :   /// Array of cluster cell absolute Id numbers.
     165             :   UShort_t   * fCellsAbsId;       //[fNCells] 
     166             :   
     167             :   /// Array with cell amplitudes fraction. Only usable for unfolded clusters, where cell can be shared.
     168             :   /// here we store what fraction of the cell energy is assigned to a given cluster.
     169             :   Double32_t * fCellsAmpFraction; //[fNCells][0.,1.,16] 
     170             :   
     171             :   Double_t     fMCEnergyFraction;                    //!<! MC energy (embedding).
     172             :   Bool_t       fIsExotic;                            //!<! Cluster marked as "exotic" (high energy deposition concentrated in a single cell).
     173             :   Double_t     fUserDefEnergy[kLastUserDefEnergy+1]; //!<! Energy of the cluster after other higher level corrections (e.g. non-linearity, hadronic correction, ...).
     174             : 
     175             :   /// Array of maps (4 bits, each bit a different information) with fraction of deposited energy 
     176             :   //  per MC particle contributing to the cluster (4 particles maximum) per cell in the cluster.
     177             :   UInt_t     * fCellsMCEdepFractionMap; //[fNCells] 
     178             :   
     179             :   /// \cond CLASSIMP
     180         182 :   ClassDef(AliAODCaloCluster,9) ;
     181             :   /// \endcond
     182             : 
     183             : };
     184             : 
     185             : #endif

Generated by: LCOV version 1.11