]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PMD/AliPMDesdanal.C
Including St2 in the new geometry segmentation (Christian)
[u/mrichter/AliRoot.git] / PMD / AliPMDesdanal.C
index eee6c8d824f910963704d909887894e02231e176..2a040262b5e637004091c09f4c0184a66fe9e216 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"
@@ -28,17 +28,17 @@ Int_t AliPMDesdanal() {
 //****** File with the ESD
    TFile *ef=TFile::Open("AliESDcheck.root");
    if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
+   AliESD* event = new AliESD;
+   TTree* tree = (TTree*) ef->Get("esdTree");
+   if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
+   tree->SetBranchAddress("ESD", &event);
 
    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;