]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/MUONmassPlot_ESD.C
Correct range of board numbers, 1-234 (Bogdan)
[u/mrichter/AliRoot.git] / MUON / MUONmassPlot_ESD.C
index dfecc1d6a0e583854f2ebde87b8adc2c8be5b6eb..85a96086e5720bbe09f94c381b6de9076c9806f9 100644 (file)
@@ -11,6 +11,7 @@
 #include "TTree.h"
 #include <Riostream.h>
 #include <TGeoManager.h>
+#include <TROOT.h>
 
 // STEER includes
 #include "AliRun.h"
@@ -20,7 +21,8 @@
 #include "AliLoader.h"
 #include "AliStack.h"
 #include "AliMagFMaps.h"
-#include "AliESD.h"
+#include "AliESDEvent.h"
+#include "AliESDVertex.h"
 #include "AliTracker.h"
 
 // MUON includes
@@ -62,7 +64,7 @@
 
 // Add parameters and histograms for analysis 
 
-Bool_t MUONmassPlot(Int_t ExtrapToVertex = -1, char* geoFilename = "geometry.root", char* filename = "galice.root",
+Bool_t MUONmassPlot(char* filename = "galice_sim.root", Int_t ExtrapToVertex = -1, char* geoFilename = "geometry.root", 
                  Int_t FirstEvent = 0, Int_t LastEvent = 10000, char* esdFileName = "AliESDs.root", Int_t ResType = 553, 
                   Float_t Chi2Cut = 100., Float_t PtCutMin = 1., Float_t PtCutMax = 10000.,
                   Float_t massMin = 9.17,Float_t massMax = 9.77)
@@ -151,12 +153,13 @@ Bool_t MUONmassPlot(Int_t ExtrapToVertex = -1, char* geoFilename = "geometry.roo
     Error("MUONmass_ESD", "getting run loader from file %s failed", filename);
     return kFALSE;
   }
-
+/*  
+  runLoader->LoadgAlice();
   if (!gAlice) {
     Error("MUONmass_ESD", "no galice object found");
     return kFALSE;
   }
-  
+*/  
 
   // open the ESD file
   TFile* esdFile = TFile::Open(esdFileName);
@@ -165,14 +168,14 @@ Bool_t MUONmassPlot(Int_t ExtrapToVertex = -1, char* geoFilename = "geometry.roo
     return kFALSE;
   }
   
-  AliESD* esd = new AliESD();
+  AliESDEvent* esd = new AliESDEvent();
   TTree* tree = (TTree*) esdFile->Get("esdTree");
   if (!tree) {
     Error("CheckESD", "no ESD tree found");
     return kFALSE;
   }
-  tree->SetBranchAddress("ESD", &esd);
-  
+//  tree->SetBranchAddress("ESD", &esd);
+  esd->ReadFromTree(tree);
   
 
   runLoader->LoadHeader();