]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFComparison.C
c Version 1.38
[u/mrichter/AliRoot.git] / TOF / AliTOFComparison.C
index 20f2e658e6689d9ebdea7f80fb7e4605164361d1..65c0583fe6001639202c6415bbe42ab1045b7f9b 100644 (file)
@@ -27,7 +27,8 @@
   #include "AliTrackReference.h"
   #include "AliRunLoader.h"
   #include "AliRun.h"
-  #include "AliESD.h"
+  #include "AliESDEvent.h"
+  #include "AliESDtrack.h"
 
   #include "AliTOFcluster.h"
   #include "AliLoader.h"
@@ -122,7 +123,7 @@ Int_t AliTOFComparison(const Char_t *dir=".") {
 
 
    if (gAlice) { 
-     delete gAlice->GetRunLoader();
+     delete AliRunLoader::Instance();
      delete gAlice;//if everything was OK here it is already NULL
      gAlice = 0x0;
    }
@@ -147,13 +148,13 @@ Int_t AliTOFComparison(const Char_t *dir=".") {
       delete rl;
       return 4;
    }
-   AliESD* event = new AliESD;
+   AliESDEvent* event = new AliESDEvent();
    TTree* esdTree = (TTree*) ef->Get("esdTree");
    if (!esdTree) {
       ::Error("AliTOFComparison.C", "no ESD tree found");
       return 5;
    }
-   esdTree->SetBranchAddress("ESD", &event);
+   event->ReadFromTree(esdTree);
 
 
 
@@ -218,17 +219,19 @@ Int_t AliTOFComparison(const Char_t *dir=".") {
               cerr<<"Wrong cluster index ! "<<idx<<endl;
                return 5;
              }
-             AliTOFcluster *cls=(AliTOFcluster*)clusters->UncheckedAt(idx);
-             if (cls->GetLabel(0)!=lab)
-              if (cls->GetLabel(1)!=lab)
-                if (cls->GetLabel(2)!=lab) {
-                 mismatched++; 
-                 if (ptg>pmin) { hfake->Fill(ptg); hfak->Fill(tgl); } 
-                 break;
-               }
-             if (ptg>pmin) { hfound->Fill(ptg); hfoun->Fill(tgl); }
-             matched++;
-             break;
+             AliTOFcluster *cls=(AliTOFcluster*)clusters->At(idx);
+            if (cls) {
+              if (cls->GetLabel(0)!=lab)
+                if (cls->GetLabel(1)!=lab)
+                  if (cls->GetLabel(2)!=lab) {
+                    mismatched++; 
+                    if (ptg>pmin) { hfake->Fill(ptg); hfak->Fill(tgl); } 
+                    break;
+                  }
+              if (ptg>pmin) { hfound->Fill(ptg); hfoun->Fill(tgl); }
+              matched++;
+              break;
+            }
          }
          if (j==ntrk) {
            cerr<<"Not matched: "<<lab<<"   ";
@@ -251,6 +254,7 @@ Int_t AliTOFComparison(const Char_t *dir=".") {
    } //***** End of the loop over events
 
    delete event;
+   delete esdTree;
    ef->Close();
    
    delete tofTree;
@@ -313,7 +317,7 @@ Int_t AliTOFComparison(const Char_t *dir=".") {
 
 Int_t GoodTracksTOF(const Char_t *dir) {
    if (gAlice) { 
-       delete gAlice->GetRunLoader();
+       delete AliRunLoader::Instance();
        delete gAlice;//if everything was OK here it is already NULL
        gAlice = 0x0;
    }