]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/totEt/AliAnalysisEtReconstructedPhos.cxx
ALIROOT-5420 Missing include
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEtReconstructedPhos.cxx
index eece3574935e3ec3b8e640d1bcace9ef2d8eb2c6..dbec5cad61b1161cdb416fdef785aeb1b70f2196 100644 (file)
@@ -96,5 +96,47 @@ bool AliAnalysisEtReconstructedPhos::TrackHitsCalorimeter(AliVParticle* track, D
 
 void AliAnalysisEtReconstructedPhos::CreateHistograms()
 { // add some extra histograms & objects to the ones from base class
+  if(!fSelector){
+    cout<<__FILE__<<" "<<"Creating new fSelector"<<endl;
+    fSelector = new AliAnalysisEtSelectorPhos(fCuts);
+  }
   AliAnalysisEtReconstructed::CreateHistograms();
 }
+
+Double_t AliAnalysisEtReconstructedPhos::GetCorrectionModification(const AliESDCaloCluster& cluster,Int_t nonLinCorr, Int_t effCorr, Int_t cent){//nonLinCorr 0 = nominal 1 = high -1 = low, effCorr  0 = nominal 1 = high -1 = low
+  Double_t factor = 1.0;
+  if(nonLinCorr!=0){
+    if(nonLinCorr==1){//high bound on nonlinearity
+      Double_t a1=0.045-0.010;
+      Double_t a2=0.045+0.010;
+      Double_t b1=1.055-0.450 ;
+      Double_t b2=1.055+0.450 ;
+      Double_t y = (1+a2/(1+cluster.E()*cluster.E()/b2/b2))/(1+a1/(1+cluster.E()*cluster.E()/b1/b1)) ;
+      factor *=y*GetCorrectionModification(cluster,0,0,cent);
+    }
+    else{//nonLinCorr==-1
+      Double_t a1=0.045-0.010;
+      Double_t a2=0.045+0.010;
+      Double_t b1=1.055-0.450 ;
+      Double_t b2=1.055+0.450 ;
+      Double_t y = (1+a1/(1+cluster.E()*cluster.E()/b1/b1))/(1+a2/(1+cluster.E()*cluster.E()/b2/b2)) ;
+      factor *=y*GetCorrectionModification(cluster,0,0,cent);
+    }
+  }
+  else{//nonlinearity correction
+    factor = 0.9728*(1+0.02/(1+cluster.E()*cluster.E()/1.5));
+  }
+  if(effCorr!=0){
+    if(effCorr==1){//high bound
+      factor *=1.005*GetCorrectionModification(cluster,0,0,cent);
+    }
+    else{//low bound
+      factor *=0.995*GetCorrectionModification(cluster,0,0,cent);
+    }
+    if(cent<0){//this condition will never be met but it will stop a compiler warning that results in Coverity sending me an email about once every two weeks.
+      Double_t E = cluster.E();
+      factor = 1.0*E;
+    }
+  }
+  return factor;
+}