]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSPIDv1.cxx
fixing small memory leak
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.cxx
index 3bac2915a08ecb2b554e93a148611f6be9819385..86b1598a3177754da67ba1c7311ad0342789800d 100644 (file)
 #include "TPrincipal.h"
 #include "TFile.h" 
 #include "TSystem.h"
-#include "TVector3.h"
 
 // --- AliRoot header files ---
              //#include "AliLog.h"
@@ -591,24 +590,6 @@ Float_t  AliPHOSPIDv1::GetParameterCalibration(Int_t i) const
   return param;
 }
 
-//____________________________________________________________________________
-Float_t  AliPHOSPIDv1::GetCalibratedEnergy(Float_t e) const
-{
-//      It calibrates Energy depending on the recpoint energy.
-//      The energy of the reconstructed cluster is corrected with 
-//      the formula A + B* E  + C* E^2, whose parameters where obtained 
-//      through the study of the reconstructed energy distribution of 
-//      monoenergetic photons.
-  
-  if(!fEnergyCorrectionOn) return e;
-  
-  Float_t p[]={0.,0.,0.};
-  for (Int_t i=0; i<3; i++) p[i] = GetParameterCalibration(i);
-  Float_t enerec = p[0] +  p[1]*e + p[2]*e*e;
-  return enerec ;
-
-}
-
 //____________________________________________________________________________
 Float_t  AliPHOSPIDv1::GetParameterCpv2Emc(Int_t i, TString axis) const 
 {
@@ -740,36 +721,6 @@ Float_t  AliPHOSPIDv1::GetParameterToCalculateEllipse(TString particle, TString
   
   return par;
 }
-
-
-//DP____________________________________________________________________________
-//Float_t  AliPHOSPIDv1::GetDistance(AliPHOSEmcRecPoint * emc,AliPHOSCpvRecPoint * cpv, Option_t *  axis)const
-//{
-//  // Calculates the distance between the EMC RecPoint and the PPSD RecPoint
-//  
-//  AliPHOSGeometry * geom =  AliPHOSGeometry::GetInstance();
-//  TVector3 vecEmc ;
-//  TVector3 vecCpv ;
-//  if(cpv){
-//    emc->GetLocalPosition(vecEmc) ;
-//    cpv->GetLocalPosition(vecCpv) ; 
-//    
-//    if(emc->GetPHOSMod() == cpv->GetPHOSMod()){      
-//      // Correct to difference in CPV and EMC position due to different distance to center.
-//      // we assume, that particle moves from center
-//      Float_t dCPV = geom->GetIPtoOuterCoverDistance();
-//      Float_t dEMC = geom->GetIPtoCrystalSurface() ;
-//      dEMC         = dEMC / dCPV ;
-//      vecCpv = dEMC * vecCpv  - vecEmc ; 
-//      if (axis == "X") return vecCpv.X();
-//      if (axis == "Y") return vecCpv.Y();
-//      if (axis == "Z") return vecCpv.Z();
-//      if (axis == "R") return vecCpv.Mag();
-//    }
-//    return 100000000 ;
-//  }
-//  return 100000000 ;
-//}
 //____________________________________________________________________________
 Int_t  AliPHOSPIDv1::GetCPVBit(AliPHOSTrackSegment * ts, Int_t effPur, Float_t e) const
 {
@@ -835,8 +786,7 @@ Int_t  AliPHOSPIDv1::GetHardPhotonBit(AliPHOSEmcRecPoint * emc) const
     TMath::Exp(-TMath::Power(e-GetParameterPhotonBoundary(1),2)/2.0/
                TMath::Power(GetParameterPhotonBoundary(2),2)) +
     GetParameterPhotonBoundary(3);
-  AliDebug(1, Form("GetHardPhotonBit","E=%f, m2x=%f, boundary=%f",
-                      e,m2x,m2xBoundary));
+  AliDebug(1, Form("E=%f, m2x=%f, boundary=%f", e,m2x,m2xBoundary));
   if (m2x < m2xBoundary)
     return 1;// A hard photon
   else
@@ -1036,7 +986,7 @@ void  AliPHOSPIDv1::MakePID()
 ////     track = ts->GetTrackIndex() ; //TPC tracks ?
     
     if (!emc) {
-      AliFatal(Form("-> emc(%d) = %d", ts->GetEmcIndex(), emc )) ;
+      AliFatal(Form("-> emc(%d)", ts->GetEmcIndex())) ;
     }
 
 
@@ -1365,12 +1315,12 @@ void  AliPHOSPIDv1::MakeRecParticles()
     // Choose the cluster energy range
     
     if (!emc) {
-      AliFatal(Form("-> emc(%d) = %d", ts->GetEmcIndex(), emc )) ;
+      AliFatal(Form("-> emc(%d)", ts->GetEmcIndex())) ;
     }
 
     Float_t e = emc->GetEnergy() ;   
     
-    Float_t  lambda[2] ;
+    Float_t  lambda[2]={0.,0.} ;
     emc->GetElipsAxis(lambda) ;
  
     if((lambda[0]>0.01) && (lambda[1]>0.01)){
@@ -1444,10 +1394,9 @@ void  AliPHOSPIDv1::MakeRecParticles()
       rp->SetPIDBit(14) ; 
 
     //Set momentum, energy and other parameters 
-    Float_t  encal = GetCalibratedEnergy(e);
     TVector3 dir   = GetMomentumDirection(emc,cpv) ; 
-    dir.SetMag(encal) ;
-    rp->SetMomentum(dir.X(),dir.Y(),dir.Z(),encal) ;
+    dir.SetMag(e) ;
+    rp->SetMomentum(dir.X(),dir.Y(),dir.Z(),e) ;
     rp->SetCalcMass(0);
     rp->Name(); //If photon sets the particle pdg name to gamma
     rp->SetProductionVertex(fVtx.X(),fVtx.Y(),fVtx.Z(),0);
@@ -1568,7 +1517,7 @@ void  AliPHOSPIDv1::SetParameters()
           &(*fParameters)(i,0), &(*fParameters)(i,1), 
           &(*fParameters)(i,2), &(*fParameters)(i,3));
     i++;
-    AliDebug(1, Form("SetParameters", "line %d: %s",i,string));
+    AliDebug(1, Form("Line %d: %s",i,string));
   }
   fclose(fd);
 }