LCOV - code coverage report
Current view: top level - STEER/AOD - AliAODCluster.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 15 31 48.4 %
Date: 2016-06-14 17:26:59 Functions: 10 28 35.7 %

          Line data    Source code
       1             : #ifndef AliAODCluster_H
       2             : #define AliAODCluster_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 AliAODCluster
       8             : /// \brief Base class for calorimeter cluster data handling
       9             : ///
      10             : ///   Base class to access calorimeter 
      11             : ///   (EMCAL, PHOS, PMD, FMD) cluster data
      12             : ///
      13             : ///  \author Markus Oldenburg, CERN
      14             : ///  \author Gustavo Conesa Balbastre, <Gustavo.Conesa.Balbastre@cern.ch>, LPSC-Grenoble, PHOS/EMCal stuff.
      15             : //-------------------------------------------------------------------------
      16             : 
      17             : #include <AliVCluster.h>
      18             : 
      19             : class AliAODCluster : public AliVCluster {
      20             : 
      21             :  public:
      22             :   
      23             :   AliAODCluster();
      24             :   AliAODCluster(Int_t id,
      25             :                 UInt_t nLabel,
      26             :                 Int_t *label,
      27             :                 Double_t energy,
      28             :                 Double_t x[3],
      29             :                 Double_t pid[13],
      30             :                 Char_t ttype=kUndef,
      31             :                 UInt_t selectInfo=0);
      32             : 
      33             :    AliAODCluster(Int_t id,
      34             :                  UInt_t nLabel,
      35             :                  Int_t *label,
      36             :                  Float_t energy,
      37             :                  Float_t x[3],
      38             :                  Float_t pid[13],
      39             :                  Char_t ttype=kUndef,
      40             :                  UInt_t selectInfo=0);
      41             :    
      42             :   virtual ~AliAODCluster();
      43             :   AliAODCluster(const AliAODCluster& clus); 
      44             :   AliAODCluster& operator=(const AliAODCluster& clus);
      45             :   void Clear(const Option_t*);
      46             :   
      47           0 :   Double_t Chi2() const { return fChi2; }
      48             :   
      49           0 :   Double_t E() const { return fEnergy; }
      50             :   
      51             :   //
      52             :   // PID
      53             :   //
      54             :   UShort_t  GetMostProbablePID() const;
      55           0 :   const Double_t *GetPID() const { return fPID; }//{ for(Int_t i=0; i<13; ++i) pid[i]=fPID[i]; }
      56           0 :   Int_t     GetID()  const { return fID; }
      57             :   
      58             :   //
      59             :   // MC
      60             :   //
      61             :   /// \return Label of MC particle that deposited more energy to the cluster
      62             :   Int_t     GetLabel() const   {
      63           0 :     if( fLabel &&  fNLabel > 0)  return  fLabel[0]; 
      64           0 :     else return -1;} 
      65             :   Int_t  GetLabelAt(UInt_t i) const;
      66          44 :   Int_t  * GetLabels() const {return fLabel ; }
      67          44 :   UInt_t GetNLabels() const { return (UInt_t)fNLabel; }
      68             :   
      69           0 :   Bool_t TestFilterBit(UInt_t filterBit) const { return (Bool_t) ((filterBit & fFilterMap) != 0); }
      70             :   
      71           0 :   Char_t GetType() const { return fType; }
      72             :   
      73             :   void GetPosition(Float_t *x) const {
      74           0 :     x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];}
      75             :   
      76         119 :   Bool_t IsEMCAL() const {if(fType == kEMCALClusterv1) return kTRUE;
      77          53 :     else return kFALSE;}
      78             :   
      79         139 :   Bool_t IsPHOS() const {if(fType == kPHOSCharged || fType == kPHOSNeutral) return kTRUE;
      80          76 :     else return kFALSE;}
      81             :   
      82             :   void  Print(const Option_t *opt = "") const;
      83             :   
      84             :   //
      85             :   // Setters
      86             :   //
      87           0 :   void SetE(Double32_t energy) {fEnergy = energy ; }
      88           0 :   void SetID(Int_t id) { fID = id; }
      89           0 :   void SetType(Char_t ttype) { fType=ttype; }
      90             :   void SetLabel(Int_t *label, UInt_t size);  
      91           0 :   void SetChi2(Double_t chi2) { fChi2 = chi2; }
      92             :   
      93             :   void SetPosition(Float_t *x);
      94        1935 :   void SetPositionAt(Float_t x,Int_t i) { if(i>=0 && i<3) fPosition[i] = x ; 
      95         645 :     else printf("Bad index for position array, i = %d\n",i);}
      96             :   
      97        6708 :   void SetPIDAt(Float_t x,Int_t i) { if(i>=0 && i<13) fPID[i] = x ; 
      98        2236 :     else printf("Bad index for PID array, i = %d\n",i);}
      99             :   void SetPID(const Float_t *pid) {
     100          12 :     if(pid) for(Int_t i=0; i<13; ++i) fPID[i]=pid[i];
     101         174 :     else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
     102             :   template <class T> void SetPIDFromESD(const T *pid) {
     103        1161 :     if(pid) {for(Int_t i=0; i<11; ++i) fPID[i]=pid[i];  fPID[11]=0;   fPID[12]=0;}
     104          43 :     else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
     105             :   
     106             :   void RemoveLabel();
     107             : 
     108           0 :   Double_t    GetMCEnergyFraction() const           { return fMCEnergyFraction ; }
     109           0 :   void        SetMCEnergyFraction(Double_t e)       { fMCEnergyFraction = e    ; }
     110             :   
     111             :   void        SetClusterMCEdepFractionFromEdepArray(Float_t *array) ;
     112             :   void        SetClusterMCEdepFraction(UShort_t *array) ;
     113           0 :   UShort_t  * GetClusterMCEdepFraction() const      { return fClusterMCEdepFraction ; }
     114             :   Float_t     GetClusterMCEdepFraction(Int_t mcIndex) const ;  
     115             :   
     116             :  private :
     117             :   
     118             :   Double32_t    fEnergy;         ///< Cluster energy.
     119             :   
     120             :   Double32_t    fPosition[3];    ///< Position of the cluster.
     121             :   
     122             :   Double32_t    fChi2;           ///< Chi2 of unfolding fit (probably not necessary for PMD).
     123             :   
     124             :   /// Pointer to PID object, array with bayesian probability weights.
     125             :   Double32_t    fPID[13];        //[0.,1.,8] 
     126             :   
     127             :   Int_t         fID;             ///< Unique cluster ID, points back to the ESD cluster.
     128             :   
     129             :   Int_t         fNLabel;         ///< Number of original MC particles generating this cluster.     
     130             :   
     131             :   /// Particle label array, points back to MC particles that generated the cluster.
     132             :   Int_t        *fLabel;          //[fNLabel] 
     133             :   
     134             :   UInt_t        fFilterMap;      ///< Filter information, one bit per set of cuts.
     135             :   
     136             :   Char_t        fType;           ///< cluster type
     137             : 
     138             :   Double_t      fMCEnergyFraction; //!<! MC energy (embedding)
     139             :   
     140             :   /// Array with fraction of deposited energy per MC particle contributing to the cluster.
     141             :   UShort_t     *fClusterMCEdepFraction;//[fNLabel] 
     142             : 
     143             :   /// \cond CLASSIMP
     144         190 :   ClassDef(AliAODCluster,7) ;
     145             :   /// \endcond
     146             : 
     147             : };
     148             : 
     149             : #endif

Generated by: LCOV version 1.11