]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSGammaJet.cxx
Moving AliMUONTriggerEfficiencyCells from sim to base
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGammaJet.cxx
index 3b168153fd48764cec4ca48cd0525e276aaf7393..abee14de0db086efe42ac0f676a7fa9a229c5fa0 100644 (file)
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.12  2006/03/10 13:23:36  hristov
+ * Using AliESDCaloCluster instead of AliESDtrack
+ *
+ * Revision 1.11  2006/01/31 20:30:52  hristov
+ * Including TFile.h
+ *
+ * Revision 1.10  2006/01/23 18:04:08  hristov
+ * Removing meaningless const
+ *
  * Revision 1.9  2006/01/12 16:23:26  schutz
  * ESD is properly read with methods of macros/AliReadESD.C copied in it
  *
 
 // --- ROOT system ---
 
-#include "TParticle.h"
-#include "TCanvas.h"
-#include "TPaveLabel.h"
-#include "TPad.h"
+#include <TFile.h>
+#include <TParticle.h>
+#include <TCanvas.h>
+#include <TPaveLabel.h>
+#include <TPad.h>
+#include <TH2.h>
+
 #include "AliPHOSGammaJet.h" 
 #include "AliPHOSGetter.h" 
-#include "TH2.h"
 #include "AliPHOSGeometry.h"
 #include "AliPHOSFastGlobalReconstruction.h"
 #include "AliESD.h"
 #include "AliESDtrack.h"
+#include "AliESDCaloCluster.h"
 #include "Riostream.h"
 
-//#include "../PYTHIA6/AliGenPythia.h"
 
 ClassImp(AliPHOSGammaJet)
 
@@ -835,26 +846,26 @@ void AliPHOSGammaJet::CreateParticleListFromESD(TClonesArray * pl,
 
   Int_t index = pl->GetEntries() ; 
   Int_t npar  = 0 ;
-  Double_t pid[AliPID::kSPECIESN];  
+  Float_t *pid = new Float_t[AliPID::kSPECIESN];  
 
   //########### PHOS ##############
   //Info("CreateParticleListFromESD","Fill ESD PHOS list");
-  Int_t begphos = esd->GetFirstPHOSParticle();  
-  Int_t endphos = esd->GetFirstPHOSParticle() + 
-    esd->GetNumberOfPHOSParticles() ;  
+  Int_t begphos = esd->GetFirstPHOSCluster();  
+  Int_t endphos = esd->GetFirstPHOSCluster() + 
+    esd->GetNumberOfPHOSClusters() ;  
   Int_t indexNePHOS = plNePHOS->GetEntries() ;
   if(strstr(fOptionGJ,"deb all"))
     Info("CreateParticleListFromESD","PHOS: first particle %d, last particle %d",
         begphos,endphos);
 
   for (npar =  begphos; npar <  endphos; npar++) {//////////////PHOS track loop
-    AliESDtrack * track = esd->GetTrack(npar) ; // retrieve track from esd
+      AliESDCaloCluster * clus = esd->GetCaloCluster(npar) ; // retrieve track from esd
    
     //Create a TParticle to fill the particle list
 
-    Double_t en = track->GetPHOSsignal() ;
-    Double_t * p = new Double_t();
-    track->GetPHOSposition(p) ;
+    Float_t en = clus->GetClusterEnergy() ;
+    Float_t *p = new Float_t();
+    clus->GetGlobalPosition(p) ;
     TVector3 pos(p[0],p[1],p[2]) ; 
     Double_t phi  = pos.Phi();
     Double_t theta= pos.Theta();
@@ -867,7 +878,7 @@ void AliPHOSGammaJet::CreateParticleListFromESD(TClonesArray * pl,
 
     //Select only photons
     
-    track->GetPHOSpid(pid);
+    pid=clus->GetPid();
     //cout<<"pid "<<pid[AliPID::kPhoton]<<endl ;
     if( pid[AliPID::kPhoton] > 0.75)
       new((*plNePHOS)[indexNePHOS++])   TParticle(*particle) ;
@@ -886,10 +897,11 @@ void AliPHOSGammaJet::CreateParticleListFromESD(TClonesArray * pl,
     AliESDtrack * track = esd->GetTrack(npar) ; // retrieve track from esd
     
     Double_t en = track ->GetTPCsignal() ;
-    TVector3 mom = track->P3() ;
-    Double_t px = mom.Px();
-    Double_t py = mom.Py();
-    Double_t pz = mom.Pz(); //Check with TPC people if this is correct.
+    Double_t mom[3];
+    track->GetPxPyPz(mom) ;
+    Double_t px = mom[0];
+    Double_t py = mom[1];
+    Double_t pz = mom[2]; //Check with TPC people if this is correct.
 
     //cout<<"TPC signal "<<en<<endl;
     //cout<<"px "<<px<<"; py "<<py<<"; pz "<<pz<<endl;
@@ -907,20 +919,20 @@ void AliPHOSGammaJet::CreateParticleListFromESD(TClonesArray * pl,
   //##########Uncomment when ESD for EMCAL works ##########  
   //Info("CreateParticleListFromESD","Fill ESD EMCAL list");
  
-  Int_t begem = esd->GetFirstEMCALParticle();  
-  Int_t endem = esd->GetFirstEMCALParticle() + 
-    esd->GetNumberOfEMCALParticles() ;  
+  Int_t begem = esd->GetFirstEMCALCluster();  
+  Int_t endem = esd->GetFirstEMCALCluster() + 
+    esd->GetNumberOfEMCALClusters() ;  
   Int_t indexNe  = plNe->GetEntries() ; 
   if(strstr(fOptionGJ,"deb all"))
     Info("CreateParticleListFromESD","EMCAL: first particle %d, last particle %d",
         begem,endem);
    
   for (npar =  begem; npar <  endem; npar++) {//////////////EMCAL track loop
-     AliESDtrack * track = esd->GetTrack(npar) ; // retrieve track from esd
+     AliESDCaloCluster * clus = esd->GetCaloCluster(npar) ; // retrieve track from esd
   
-    Double_t en = track->GetEMCALsignal() ;
-    Double_t *p = new Double_t();
-    track->GetEMCALposition(p) ;
+    Float_t en = clus->GetClusterEnergy() ;
+    Float_t *p = new Float_t();
+    clus->GetGlobalPosition(p) ;
     TVector3 pos(p[0],p[1],p[2]) ;
     Double_t phi  = pos.Phi();
     Double_t theta= pos.Theta();