AliESD changed to AliESDEvent (Andrea)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jul 2007 13:50:10 +0000 (13:50 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jul 2007 13:50:10 +0000 (13:50 +0000)
PWG3/AliAnalysisVertexingHF.cxx
PWG3/AliAnalysisVertexingHF.h
PWG3/AliAnalysisVertexingHFTest.C
PWG3/AliBtoJPSItoEleAnalysis.cxx
PWG3/AliBtoJPSItoEleAnalysis.h
PWG3/AliD0toKpiAnalysis.cxx
PWG3/AliD0toKpiAnalysis.h

index 036768f..40e9f64 100644 (file)
@@ -25,7 +25,7 @@
 #include <TTree.h>
 #include <TDatabasePDG.h>
 #include <TString.h>
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliVertexerTracks.h"
 #include "AliESDVertex.h"
 #include "AliESDv0.h"
@@ -60,7 +60,7 @@ AliAnalysisVertexingHF::~AliAnalysisVertexingHF() {
   if(fV1) delete fV1;
 }
 //----------------------------------------------------------------------------
-void AliAnalysisVertexingHF::FindCandidates(AliESD *esd,TTree treeout[])
+void AliAnalysisVertexingHF::FindCandidates(AliESDEvent *esd,TTree treeout[])
 {
   // Find heavy-flavour vertex candidates
 
@@ -312,7 +312,7 @@ void AliAnalysisVertexingHF::FindCandidates(AliESD *esd,TTree treeout[])
 }
 //----------------------------------------------------------------------------
 AliAODRecoDecayHF2Prong *AliAnalysisVertexingHF::Make2Prong(
-                                  TObjArray *twoTrackArray1,AliESD *esd,
+                                  TObjArray *twoTrackArray1,AliESDEvent *esd,
                                   AliESDVertex *secVertexESD,Double_t dca,
                                   Bool_t &okD0,Bool_t &okJPSI) const
 {
@@ -418,7 +418,7 @@ AliAODRecoDecayHF2Prong *AliAnalysisVertexingHF::Make2Prong(
 }
 //----------------------------------------------------------------------------
 AliAODRecoDecayHF3Prong* AliAnalysisVertexingHF::Make3Prong(
-                             TObjArray *threeTrackArray,AliESD *esd,
+                             TObjArray *threeTrackArray,AliESDEvent *esd,
                             AliESDVertex *vertexp1n1,AliESDVertex *vertexp2n1,
                             Double_t dcap1n1,Double_t dcap2n1,Double_t dcap1p2,
                             Bool_t &ok3Prong) const
@@ -539,7 +539,7 @@ AliAODRecoDecayHF3Prong* AliAnalysisVertexingHF::Make3Prong(
 }
 //----------------------------------------------------------------------------
 AliAODRecoDecayHF4Prong* AliAnalysisVertexingHF::Make4Prong(
-                             TObjArray *fourTrackArray,AliESD *esd,
+                             TObjArray *fourTrackArray,AliESDEvent *esd,
                             AliESDVertex *vertexp1n1,AliESDVertex *vertexp2n1,
                             Double_t dcap1n1,Double_t dcap1n2,Double_t dcap2n1,
                             Bool_t &ok4Prong) const
@@ -663,7 +663,7 @@ AliAODRecoDecayHF4Prong* AliAnalysisVertexingHF::Make4Prong(
 //-----------------------------------------------------------------------------
 AliESDVertex* AliAnalysisVertexingHF::OwnPrimaryVertex(Int_t ntrks,
                                                       TObjArray *trkArray,
-                                                      AliESD *esd) const
+                                                      AliESDEvent *esd) const
 {
   // Returns primary vertex specific to this candidate
  
@@ -818,7 +818,7 @@ Bool_t AliAnalysisVertexingHF::SelectInvMass(Int_t decay,
   return retval;
 }
 //-----------------------------------------------------------------------------
-void AliAnalysisVertexingHF::SelectTracks(AliESD *esd,
+void AliAnalysisVertexingHF::SelectTracks(AliESDEvent *esd,
                                          TObjArray &trksP,Int_t &nTrksP,
                                          TObjArray &trksN,Int_t &nTrksN) const
 {
index eef7b81..f933d47 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <TNamed.h>
 #include <TTree.h>
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliESDVertex.h"
 #include "AliAODRecoDecayHF.h"
 #include "AliAODRecoDecayHF2Prong.h"
@@ -26,16 +26,16 @@ class AliAnalysisVertexingHF : public TNamed {
   AliAnalysisVertexingHF();
   virtual ~AliAnalysisVertexingHF();
 
-  void FindCandidates(AliESD *esd,TTree treeout[]);
-  AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray1,AliESD *esd,
+  void FindCandidates(AliESDEvent *esd,TTree treeout[]);
+  AliAODRecoDecayHF2Prong* Make2Prong(TObjArray *twoTrackArray1,AliESDEvent *esd,
                                     AliESDVertex *vertexp1n1,Double_t dcap1n1,
                                     Bool_t &okD0,Bool_t &okJPSI) const;
-  AliAODRecoDecayHF3Prong* Make3Prong(TObjArray *threeTrackArray,AliESD *esd,
+  AliAODRecoDecayHF3Prong* Make3Prong(TObjArray *threeTrackArray,AliESDEvent *esd,
                                     AliESDVertex *vertexp1n1,
                                     AliESDVertex *vertexp2n1,
                                     Double_t dcap1n1,Double_t dcap2n1,Double_t dcap1p2,
                                     Bool_t &ok3Prong) const;
-  AliAODRecoDecayHF4Prong* Make4Prong(TObjArray *fourTrackArray,AliESD *esd,
+  AliAODRecoDecayHF4Prong* Make4Prong(TObjArray *fourTrackArray,AliESDEvent *esd,
                               AliESDVertex *vertexp1n1,
                               AliESDVertex *vertexp2n1,
                               Double_t dcap1n1,Double_t dcap1n2,
@@ -144,10 +144,10 @@ class AliAnalysisVertexingHF : public TNamed {
                           // 11 = dca cut (cm)
 
   //
-  AliESDVertex* OwnPrimaryVertex(Int_t ntrks,TObjArray *trkArray,AliESD *esd) const;
+  AliESDVertex* OwnPrimaryVertex(Int_t ntrks,TObjArray *trkArray,AliESDEvent *esd) const;
   Bool_t SelectInvMass(Int_t decay,Int_t nprongs,
                       Double_t *px,Double_t *py,Double_t *pz) const;
-  void SelectTracks(AliESD *esd,
+  void SelectTracks(AliESDEvent *esd,
                    TObjArray &trksP,Int_t &nTrksP,
                    TObjArray &trksN,Int_t &nTrksN) const;
   void SetPrimaryVertex(AliESDVertex* v1) { fV1 = v1; }
index df9407a..6afe31e 100644 (file)
@@ -50,10 +50,10 @@ void AliAnalysisVertexingHFTest(Int_t evFirst=0,
   trees[2].Branch("Charmto3Prong","AliAODRecoDecayHF3Prong",&rd3);
   trees[3].Branch("D0to4Prong","AliAODRecoDecayHF4Prong",&rd4);
 
-  TFile *inesd=new TFile(infile.Data());
+  TFile *inesd = new TFile(infile.Data());
+  AliESDEvent *esd = new AliESDEvent();
   TTree *esdTree = (TTree*)inesd->Get("esdTree");
-  AliESD *esd=0;
-  esdTree->SetBranchAddress("ESD",&esd);
+  esd->ReadFromTree(esdTree);
 
   if(esdTree->GetEntries()<evLast) evLast=esdTree->GetEntries()-1;
   for(Int_t i=evFirst; i<=evLast; i++) {
index a2f6add..81cf2e4 100644 (file)
@@ -27,7 +27,7 @@
 #include <TString.h>
 #include <TSystem.h>
 #include <TParticle.h>
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliMC.h"
 #include "AliRun.h"
 #include "AliRunLoader.h"
@@ -187,13 +187,13 @@ void AliBtoJPSItoEleAnalysis::FindCandidates(Int_t evFirst,Int_t evLast,
 
   // open file with tracks
   TFile *esdFile = TFile::Open(esdName.Data());
-  AliESD* event = new AliESD;
+  AliESDEvent* event = new AliESDEvent();
   TTree* tree = (TTree*) esdFile->Get("esdTree");
   if(!tree) {
     Error("FindCandidatesESD", "no ESD tree found");
     return;
   }
-  tree->SetBranchAddress("ESD",&event);
+  event->ReadFromTree(tree);
 
   // loop on events in file
   for(Int_t iEvent = evFirst; iEvent < tree->GetEntries(); iEvent++) {
@@ -430,7 +430,7 @@ Bool_t AliBtoJPSItoEleAnalysis::SelectInvMass(const Double_t p[6]) const {
   return kFALSE;
 }
 //-----------------------------------------------------------------------------
-void AliBtoJPSItoEleAnalysis::SelectTracks(AliESD *event,
+void AliBtoJPSItoEleAnalysis::SelectTracks(AliESDEvent *event,
         TObjArray &trksP,Int_t *trkEntryP,Int_t &nTrksP,
         TObjArray &trksN,Int_t *trkEntryN,Int_t &nTrksN) const {
   // Create two TObjArrays with positive and negative tracks and 
@@ -526,9 +526,9 @@ void AliBtoJPSItoEleAnalysis::MakeTracksRefFile(AliRun *gAlice,
   TParticle *gmumpart;
   REFTRACK   reftrk;
   
-  AliESD* event = new AliESD;
+  AliESDEvent* event = new AliESDEvent();
   TTree* tree = (TTree*) esdFile->Get("esdTree");
-  tree->SetBranchAddress("ESD",&event);
+  event->ReadFromTree(tree);
   // loop on events in file
   for(Int_t iEvent=evFirst; iEvent<tree->GetEntries(); iEvent++) {
     if(iEvent>evLast) break;
index b534b15..5c5c871 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <TString.h>
 #include <TNamed.h>
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliRun.h"
 
 //-----------------------------------------------------------------------------
@@ -74,7 +74,7 @@ class AliBtoJPSItoEleAnalysis : public TNamed {
   //
   Double_t CalculateTOFmass(Double_t mom,Double_t length,Double_t time) const;
   Bool_t   SelectInvMass(const Double_t p[6]) const;
-  void     SelectTracks(AliESD *event,
+  void     SelectTracks(AliESDEvent *event,
                        TObjArray &trksP,Int_t *trkEntryP,Int_t &nTrksP,
                        TObjArray &trksN,Int_t *trkEntryN,Int_t &nTrksN) const;
   void     SetVertex1(Double_t x=0.,Double_t y=0.,Double_t z=0.) 
index 92bf4e4..80fd461 100644 (file)
@@ -26,7 +26,7 @@
 #include <TString.h>
 #include <TSystem.h>
 #include <TParticle.h>
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliMC.h"
 #include "AliRun.h"
 #include "AliRunLoader.h"
@@ -182,13 +182,13 @@ void AliD0toKpiAnalysis::FindCandidates(Int_t evFirst,Int_t evLast,
 
   // open file with tracks
   TFile *esdFile = TFile::Open(esdName.Data());
-  AliESD* event = new AliESD;
+  AliESDEvent* event = new AliESDEvent();
   TTree* tree = (TTree*) esdFile->Get("esdTree");
   if(!tree) {
     Error("FindCandidatesESD", "no ESD tree found");
     return;
   }
-  tree->SetBranchAddress("ESD",&event);
+  event->ReadFromTree(tree);
 
   // loop on events in file
   for(Int_t iEvent = evFirst; iEvent < tree->GetEntries(); iEvent++) {
@@ -427,7 +427,7 @@ Bool_t AliD0toKpiAnalysis::SelectInvMass(const Double_t p[6]) const {
   return kFALSE;
 }
 //-----------------------------------------------------------------------------
-void AliD0toKpiAnalysis::SelectTracks(AliESD *event,
+void AliD0toKpiAnalysis::SelectTracks(AliESDEvent *event,
         TObjArray &trksP,Int_t *trkEntryP,Int_t &nTrksP,
         TObjArray &trksN,Int_t *trkEntryN,Int_t &nTrksN) const {
   // Create two TObjArrays with positive and negative tracks and 
@@ -516,9 +516,9 @@ void AliD0toKpiAnalysis::MakeTracksRefFile(AliRun *gAlice,
   TParticle *mumpart;
   REFTRACK   reftrk;
   
-  AliESD* event = new AliESD;
+  AliESDEvent* event = new AliESDEvent();
   TTree* tree = (TTree*) esdFile->Get("esdTree");
-  tree->SetBranchAddress("ESD",&event);
+  event->ReadFromTree(tree);
   // loop on events in file
   for(Int_t iEvent=evFirst; iEvent<tree->GetEntries(); iEvent++) {
     if(iEvent>evLast) break;
index bc6ebcf..23a3857 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <TString.h>
 #include <TNamed.h>
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliRun.h"
 
 //-----------------------------------------------------------------------------
@@ -67,7 +67,7 @@ class AliD0toKpiAnalysis : public TNamed {
   //
   Double_t CalculateTOFmass(Double_t mom,Double_t length,Double_t time) const;
   Bool_t   SelectInvMass(const Double_t p[6]) const;
-  void     SelectTracks(AliESD *event,
+  void     SelectTracks(AliESDEvent *event,
                        TObjArray &trksP,Int_t *trkEntryP,Int_t &nTrksP,
                        TObjArray &trksN,Int_t *trkEntryN,Int_t &nTrksN) const;
   void     SetVertex1(Double_t x=0.,Double_t y=0.,Double_t z=0.)