coverity fix
[u/mrichter/AliRoot.git] / PWG4 / totEt / AliAnalysisEtReconstructedPhos.cxx
1 //_________________________________________________________________________
2 //  Utility Class for transverse energy studies
3 //  Base class for ESD analysis, for PHOS
4 //  - reconstruction output
5 // implementation file
6 //
7 //*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
8 //_________________________________________________________________________
9 #include "AliAnalysisEtReconstructedPhos.h"
10 #include "AliAnalysisEtCuts.h"
11 #include "AliESDtrack.h"
12 using namespace std;
13
14 ClassImp(AliAnalysisEtReconstructedPhos);
15
16 /*// Worst case (protons and neutrons):
17 const Double_t kMEANCHARGED = 0.335;
18 const Double_t kMEANNEUTRAL = 0.434;
19 const Double_t kMEANGAMMA = 0.374;
20
21 // Best case (pions and K0s): 
22 const Double_t kMEANCHARGED = 0.304;
23 const Double_t kMEANNEUTRAL = 0.3356;
24 const Double_t kMEANGAMMA = 0.374;
25 */
26 // Simulated case:
27 const Double_t kMEANCHARGED = 0.307;
28 const Double_t kMEANNEUTRAL = 0.407;
29 const Double_t kMEANGAMMA = 0.374;
30
31
32 AliAnalysisEtReconstructedPhos::AliAnalysisEtReconstructedPhos() :
33 AliAnalysisEtReconstructed()
34 {
35    fHistogramNameSuffix = TString("PhosRec");    
36 }
37
38 AliAnalysisEtReconstructedPhos::~AliAnalysisEtReconstructedPhos() 
39 {
40 }
41
42 void AliAnalysisEtReconstructedPhos::Init()
43 { // Init
44   AliAnalysisEtReconstructed::Init();
45     
46   fDetectorRadius = fCuts->GetGeometryPhosDetectorRadius();
47   fEtaCutAcc = fCuts->GetGeometryPhosEtaAccCut();
48   fPhiCutAccMax = fCuts->GetGeometryPhosPhiAccMaxCut() * TMath::Pi()/180.;
49   fPhiCutAccMin = fCuts->GetGeometryPhosPhiAccMinCut() * TMath::Pi()/180.;
50   fClusterEnergyCut = fCuts->GetReconstructedPhosClusterEnergyCut();
51   fSingleCellEnergyCut = fCuts->GetReconstructedPhosSingleCellEnergyCut();
52   
53   fClusterType = fCuts->GetReconstructedPhosClusterType();
54   fTrackDistanceCut = fCuts->GetPhosTrackDistanceCut();
55   fTrackDxCut = fCuts->GetPhosTrackDxCut();
56   fTrackDzCut = fCuts->GetPhosTrackDzCut();
57   
58   fDetector = fCuts->GetDetectorPhos();
59   
60   fGeomCorrection = 1.0/0.036;
61   
62   fEMinCorrection = 1.0;
63
64 }
65
66 bool AliAnalysisEtReconstructedPhos::TrackHitsCalorimeter(AliVParticle* track, Double_t magField)
67 {
68   return  AliAnalysisEtReconstructed::TrackHitsCalorimeter(track, magField);
69 }
70
71 Double_t AliAnalysisEtReconstructedPhos::GetChargedContribution(Int_t clusterMult)
72 { // Charged contrib
73   if(clusterMult > 0)
74   {
75     Double_t nPart = 0.067 + 0.137*clusterMult;
76   
77     Double_t contr = nPart*kMEANCHARGED;
78   
79     return contr;
80   }
81   return 0;
82   
83 }
84
85 Double_t AliAnalysisEtReconstructedPhos::GetNeutralContribution(Int_t clusterMult)
86 { // Neutral contrib
87   if(clusterMult > 0)
88   {
89     Double_t nPart = 0.012 + 0.024*clusterMult - 0.00006*clusterMult*clusterMult;
90   
91     Double_t contr = nPart*kMEANNEUTRAL;
92   
93     return contr;
94   }
95   return 0;
96 }
97
98 Double_t AliAnalysisEtReconstructedPhos::GetGammaContribution(Int_t clusterMult)
99 { // Gamma contrib
100   if(clusterMult > 0)
101   {
102     Double_t nPart = -0.008 + 0.0057*clusterMult + 0.0002*clusterMult*clusterMult;
103   
104     Double_t contr = nPart*kMEANGAMMA;
105   
106     return contr;
107   }
108   return 0;
109 }
110
111
112
113
114
115