]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDesdanal.C
VZERO DAs + Object target dependencies
[u/mrichter/AliRoot.git] / PMD / AliPMDesdanal.C
index eee6c8d824f910963704d909887894e02231e176..4c520290f07bf7c6915ef48a23c784926afb2db5 100644 (file)
@@ -7,7 +7,7 @@
 
 #if !defined( __CINT__) || defined(__MAKECINT__)
   #include <Riostream.h>
-  #include "TKey.h"
+  #include "TTree.h"
   #include "TFile.h"
   #include "TH1F.h"
   #include "TCanvas.h"
@@ -26,19 +26,18 @@ Int_t AliPMDesdanal() {
    gStyle->SetOptFit(1);
 
 //****** File with the ESD
-   TFile *ef=TFile::Open("AliESDcheck.root");
+   TFile *ef=TFile::Open("AliESDs.root");
    if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
-
+   AliESDEvent * event = new AliESDEvent;
+   TTree* tree = (TTree*) ef->Get("esdTree");
+   if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
+   event->ReadFromTree(tree);
    Int_t n=0;
-   TKey *key=0;
-   TIter next(ef->GetListOfKeys());
 
 //******* The loop over events
-   while ((key=(TKey*)next())!=0) {
+   while (tree->GetEvent(n)) {
      cout<<endl<<"Processing event number : "<<n++<<endl;
 
-     AliESD *event=(AliESD*)key->ReadObj();
-
 
      Int_t npmdcl=event->GetNumberOfPmdTracks();
      cout<<"Number of PMD tracks : "<<npmdcl<<endl; 
@@ -47,16 +46,21 @@ Int_t AliPMDesdanal() {
      while (npmdcl--) {
        AliESDPmdTrack *pmdtr = event->GetPmdTrack(npmdcl);
        
-       Int_t   det   = pmdtr->GetDetector();
-       Float_t theta = pmdtr->GetTheta();
-       Float_t phi   = pmdtr->GetPhi();
+       Int_t   det   = pmdtr->GetDetector(); 
+       Float_t clsX  = pmdtr->GetClusterX();
+       Float_t clsY  = pmdtr->GetClusterY();
+       Float_t clsZ  = pmdtr->GetClusterZ();
+       Float_t ncell = pmdtr->GetClusterCells();
        Float_t adc   = pmdtr->GetClusterADC();
        Float_t pid   = pmdtr->GetClusterPID();
        
      }
    }
+
+   delete event;
+
    timer.Stop();
    timer.Print();
 
    return 0;
-}
+}
\ No newline at end of file