LCOV - code coverage report
Current view: top level - EMCAL/EMCALUtils - AliEMCALPIDUtils.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 9 33.3 %
Date: 2016-06-14 17:26:59 Functions: 3 18 16.7 %

          Line data    Source code
       1             : #ifndef ALIEMCALPIDUTILS_H
       2             : #define ALIEMCALPIDUTILS_H
       3             : 
       4             : //_________________________________________________________________________
       5             : /// \class AliEMCALPIDUtils
       6             : /// \brief Compute cluster PID weights 
       7             : ///
       8             : ///   Compute PID weights for all the clusters that are in AliESDs.root file
       9             : ///   the AliESDs.root have to be in the same directory as the class.
      10             : ///
      11             : ///   It is called during reconstruction by EMCALrec/AliEMCALPID. 
      12             : ///   It can be executed at analysis level.
      13             : ///
      14             : ///   Implementation based on simulations before 2009, executed in reconstruction but
      15             : ///   not really used after 2009. To be revisited.
      16             : ///
      17             : ///   Do:    
      18             : ///   AliEMCALPIDUtils *pid = new AliEMCALPIDUtils();
      19             : ///   pid->SetPrintInfo(kTRUE);
      20             : ///   pid->SetHighFluxParam(); //   pid->SetLowFluxParam(); 
      21             : ///   
      22             : ///   then in cluster loop do
      23             : ///   pid->ComputePID(energy, lambda0);
      24             : ///       
      25             : ///   Compute PID Weight for all clusters in AliESDs.root file
      26             : ///   keep this function for the moment for a simple verification, could be removed
      27             : ///
      28             : ///   Get back the probabilities with 
      29             : ///   pid->GetPIDFinal(pidFinal) 
      30             : ///
      31             : ///   where Double_t pidFinal[AliPID::kSPECIESCN] is the standard PID for :
      32             : ///
      33             : ///       kElectron :  fPIDFinal[0]
      34             : ///       kMuon     :  fPIDFinal[1]
      35             : ///       kPion     :  fPIDFinal[2]
      36             : ///       kKaon     :  fPIDFinal[3]
      37             : ///       kProton   :  fPIDFinal[4]
      38             : ///       kPhoton   :  fPIDFinal[5]
      39             : ///       kPi0      :  fPIDFinal[6]
      40             : ///       kNeutron  :  fPIDFinal[7]
      41             : ///       kKaon0    :  fPIDFinal[8]
      42             : ///       kEleCon   :  fPIDFinal[9]
      43             : ///       kUnknown  :  fPIDFinal[10]
      44             : ///
      45             : /// \author Genole Bourdaud, SUBATECH
      46             : /// First implementation, 2007
      47             : /// \author Marie Germain, <Marie.Germain@subatech.in2p3.fr>, SUBATECH 
      48             : /// New parametrization for low and high flux environment, 07/2009
      49             : /// \author Gustavo Conesa, <Gustavo.Conesa.Balbastre@cern.ch>, LNF, 08/2009 
      50             : /// Divide class in AliEMCALPID and AliEMCALPIDUtils, PIDUtils belong to library EMCALUtils 
      51             : ///
      52             : 
      53             : // Root includes
      54             : #include "TNamed.h"
      55             : class TArrayD ;
      56             : 
      57             : // AliRoot includes
      58             : #include "AliPID.h" 
      59             : 
      60          16 : class AliEMCALPIDUtils : public TNamed {
      61             : 
      62             : public:
      63             :   
      64             :   AliEMCALPIDUtils();
      65             :     
      66             :   void     ComputePID(Double_t energy, Double_t lambda0); 
      67             : 
      68             :   void     InitParameters();
      69             :   void     SetLowFluxParam();
      70             :   void     SetHighFluxParam();
      71             : 
      72             :   TArrayD  DistLambda0(Double_t energy, Int_t nature) ; 
      73             :   
      74             :   Double_t DistEnergy (Double_t energy, Int_t nature) ;
      75             : 
      76           0 :   Double_t GetPID      (Int_t idx) const { if (idx>=0&&idx<3) return fPID[idx];       else return 0. ; }
      77           0 :   Double_t GetPIDFinal (Int_t idx) const { if (idx>=0&&idx<AliPID::kSPECIESCN) return fPIDFinal[idx]; else return 0. ; }
      78           0 :   Double_t GetPIDWeight(Int_t idx) const { if (idx>=0&&idx<3) return fPIDWeight[idx]; else return 0. ; }
      79             :   
      80         180 :   void     SetPID      (Double_t val, Int_t idx) { if (idx>=0&&idx<3) fPID[idx]       = val ; }
      81           0 :   void     SetPIDFinal (Double_t val, Int_t idx) { if (idx>=0&&idx<AliPID::kSPECIESCN) fPIDFinal[idx] = val ; }
      82           0 :   void     SetPIDWeight(Double_t val, Int_t idx) { if (idx>=0&&idx<3) fPIDWeight[idx] = val ; }
      83             : 
      84           0 :   void     SetPrintInfo(Bool_t yesno)            { fPrintInfo = yesno ; }
      85             :         
      86             :  private:
      87             :   
      88             :   Double_t Polynomial      (Double_t x, const Double_t * params) const ;
      89             :   Double_t Polynomialinv   (Double_t x, const Double_t * params) const ;
      90             :   Double_t PolynomialMixed1(Double_t x, const Double_t * params) const ;
      91             :   Double_t PolynomialMixed2(Double_t x, const Double_t * params) const ;
      92             :   Double_t Polynomial0     (            const Double_t * params) const ;
      93             :   Double_t PowerExp        (Double_t x, const Double_t * params) const ;
      94             :         
      95             : protected:      
      96             :   Bool_t   fPrintInfo;            ///< Flag to decide if details about PID must be printed.
      97             :   
      98             :   Double_t fGamma[6][6];          ///< Parameter to Compute PID for photons.
      99             :   Double_t fGamma1to10[6][6];     ///< Parameter to Compute PID not used.
     100             :   Double_t fHadron[6][6];         ///< Parameter to Compute PID for hadrons, 1 to 10 GeV.
     101             :   Double_t fHadron1to10[6][6];    ///< Parameter to Compute PID for hadrons, 1 to 10 GeV.
     102             :   Double_t fPiZero[6][6];         ///< Parameter to Compute PID for pi0.
     103             :   
     104             :   Double_t fHadronEnergyProb[6];  ///< Parameter to Compute PID for energy ponderation for hadrons.   
     105             :   Double_t fPiZeroEnergyProb[6];  ///< Parameter to Compute PID for energy ponderation for Pi0.       
     106             :   Double_t fGammaEnergyProb[6];   ///< Parameter to Compute PID for energy ponderation for gamma.     
     107             :   
     108             :   Float_t  fPID[3];               ///< Order: gamma, pi0, hadrons. Final container?
     109             :   Float_t  fPIDFinal[AliPID::kSPECIESCN+1]; ///< Final PID format, all species.
     110             :   Float_t  fPIDWeight[3];         ///< Order: gamma, pi0, hadrons. Temporal container?
     111             :   
     112             :   Double_t fProbGamma;            ///< Probability to be a Gamma.
     113             :   Double_t fProbPiZero;           ///< Probability to be a PiO.
     114             :   Double_t fProbHadron;           ///< Probability to be a Hadron.
     115             :   
     116             :   Double_t fWeightHadronEnergy;   ///< Weight for a Hadron to have a given energy  (parametr from a flat distrib from 0 to 100).
     117             :   Double_t fWeightGammaEnergy;    ///< Weight for a Gamma to have a given energy  (for the moment =1.).
     118             :   Double_t fWeightPiZeroEnergy;   ///< Weight for a Pi0 Hadron to have a given energy (for the moment =1.).
     119             :   
     120             :   /// \cond CLASSIMP
     121          72 :   ClassDef(AliEMCALPIDUtils, 2) ;
     122             :   /// \endcond
     123             : 
     124             : };
     125             : 
     126             : #endif // ALIEMCALPIDUTILS_H
     127             : 
     128             : 

Generated by: LCOV version 1.11