From 5b5d8342f0e7e9551165480ef3453c970d9d0761 Mon Sep 17 00:00:00 2001 From: schutz Date: Tue, 24 Sep 2002 11:32:06 +0000 Subject: [PATCH] Removed fAlice and changed ReadTreeK to make it look as the others. Event now requires an option to do something. --- EMCAL/AliEMCALGetter.cxx | 29 ++++------------------------- EMCAL/AliEMCALGetter.h | 2 -- PHOS/AliPHOSGetter.cxx | 19 +++++-------------- PHOS/AliPHOSGetter.h | 1 - 4 files changed, 9 insertions(+), 42 deletions(-) diff --git a/EMCAL/AliEMCALGetter.cxx b/EMCAL/AliEMCALGetter.cxx index 97ece73256b..5c4717ad729 100644 --- a/EMCAL/AliEMCALGetter.cxx +++ b/EMCAL/AliEMCALGetter.cxx @@ -188,10 +188,6 @@ AliEMCALGetter::AliEMCALGetter(const char* headerFile, const char* branchTitle, fDebug = 0 ; - fAlice = 0 ; - - - fToSplit = toSplit ; fHeaderFile = headerFile ; @@ -354,10 +350,6 @@ void AliEMCALGetter::CloseFile() gAlice = 0 ; - delete fAlice ; - - fAlice = 0 ; - } @@ -2970,17 +2962,12 @@ TTree * AliEMCALGetter::TreeK(TString filename) file = static_cast(gROOT->GetFile(filename.Data() ) ) ; - if (file && (filename != fHeaderFile) ) { // file already open - - file->Close() ; + if (!file) { // file not yet open - delete fAlice ; + file = TFile::Open(filename.Data(), "read") ; } - file = TFile::Open(filename.Data(), "read") ; - - fAlice = static_cast(file->Get("gAlice")) ; TString treeName("TreeK") ; @@ -3160,14 +3147,7 @@ const TParticle * AliEMCALGetter::Primary(Int_t index) const TParticle * p = 0 ; - if (fAlice) - - p = fAlice->Particle(index) ; - - else - - p = gAlice->Particle(index) ; - + p = gAlice->Particle(index) ; return p ; @@ -4228,7 +4208,6 @@ void AliEMCALGetter::ReadPrimaries() fNPrimaries = gAlice->GetNtrack() ; - fAlice = 0 ; @@ -4318,7 +4297,7 @@ void AliEMCALGetter::Event(const Int_t event, const char* opt) - if( strstr(opt,"P") || (strcmp(opt,"")==0) ) + if( strstr(opt,"P") ) ReadPrimaries() ; diff --git a/EMCAL/AliEMCALGetter.h b/EMCAL/AliEMCALGetter.h index 30ffacb8b2a..777d446bec3 100644 --- a/EMCAL/AliEMCALGetter.h +++ b/EMCAL/AliEMCALGetter.h @@ -470,8 +470,6 @@ class AliEMCALGetter : public TObject { Int_t fDebug ; // Debug level - AliRun * fAlice ; //! needed to read TreeK if in an other file than fHeaderFile - Int_t fNPrimaries ; //! # of primaries TObjArray * fPrimaries ; //! list of lists of primaries-for the case of mixing diff --git a/PHOS/AliPHOSGetter.cxx b/PHOS/AliPHOSGetter.cxx index 87c974ed97c..4c7992600ba 100644 --- a/PHOS/AliPHOSGetter.cxx +++ b/PHOS/AliPHOSGetter.cxx @@ -91,7 +91,6 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle, co fFailed = kFALSE ; fDebug = 0 ; - fAlice = 0 ; fToSplit = toSplit ; fHeaderFile = headerFile ; @@ -174,8 +173,6 @@ void AliPHOSGetter::CloseFile() { delete gAlice ; gAlice = 0 ; - delete fAlice ; - fAlice = 0 ; } //____________________________________________________________________________ @@ -1479,12 +1476,9 @@ TTree * AliPHOSGetter::TreeK(TString filename) TFile * file = 0 ; file = static_cast(gROOT->GetFile(filename.Data() ) ) ; - if (file && (filename != fHeaderFile) ) { // file already open - file->Close() ; - delete fAlice ; + if (!file) { // file not yet open + file = TFile::Open(filename.Data(), "read") ; } - file = TFile::Open(filename.Data(), "read") ; - fAlice = static_cast(file->Get("gAlice")) ; TString treeName("TreeK") ; treeName += EventNumber() ; TTree * tree = static_cast(file->Get(treeName.Data())) ; @@ -1574,10 +1568,8 @@ const TParticle * AliPHOSGetter::Primary(Int_t index) const if(index < 0) return 0 ; TParticle * p = 0 ; - if (fAlice) - p = fAlice->Particle(index) ; - else - p = gAlice->Particle(index) ; + + p = gAlice->Particle(index) ; return p ; @@ -2107,7 +2099,6 @@ void AliPHOSGetter::ReadPrimaries() if (fDebug) cout << "INFO: AliPHOSGetter::ReadPrimaries -> TreeK found in " << fHeaderFile.Data() << endl ; fNPrimaries = gAlice->GetNtrack() ; - fAlice = 0 ; } else { // treeK not found in header file @@ -2152,7 +2143,7 @@ void AliPHOSGetter::Event(const Int_t event, const char* opt) if( strstr(opt,"Q") ) ReadTreeQA() ; - if( strstr(opt,"P") || (strcmp(opt,"")==0) ) + if( strstr(opt,"P")) ReadPrimaries() ; } diff --git a/PHOS/AliPHOSGetter.h b/PHOS/AliPHOSGetter.h index 66259f54101..88bc1101003 100644 --- a/PHOS/AliPHOSGetter.h +++ b/PHOS/AliPHOSGetter.h @@ -232,7 +232,6 @@ private: TString fSDigitsFileName ; //! Bool_t fFailed ; //! set if file not opend or galice not found Int_t fDebug ; //! Debug level - AliRun * fAlice ; //! needed to read TreeK if in an other file than fHeaderFile Int_t fNPrimaries ; //! # of primaries TObjArray * fPrimaries ; //! list of lists of primaries-for the case of mixing TFolder * fModuleFolder ; //!Folder that contains the modules -- 2.39.3