From 5fff655e3fe05b91c7ab9623e05874bb0e64b330 Mon Sep 17 00:00:00 2001 From: vicinanz Date: Mon, 22 Apr 2002 11:30:32 +0000 Subject: [PATCH] Review on transient/persistent data members --- TOF/AliTOFPID.cxx | 6 ++++++ TOF/AliTOFPID.h | 2 +- TOF/AliTOFReconstructioner.cxx | 13 +++++++++++++ TOF/AliTOFReconstructioner.h | 6 +++--- TOF/AliTOFT0.cxx | 4 ++++ 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/TOF/AliTOFPID.cxx b/TOF/AliTOFPID.cxx index 73e4156d932..ff7e41f0580 100644 --- a/TOF/AliTOFPID.cxx +++ b/TOF/AliTOFPID.cxx @@ -101,9 +101,15 @@ ClassImp(AliTOFPID) //____________________________________________________________________________ AliTOFPID::AliTOFPID(char* headerFile, char *cutsFile, const Option_t* opt):TTask("AliTOFPID","") { + felectron = 0; + fpion = 0; + fkaon = 0; + fproton = 0; fhfile = TFile::Open(headerFile); // connect file with ntuple fcut = TFile::Open(cutsFile); // connect file for cuts foutfileName=headerFile; + fNtuple = 0; + fgen = 0; Init(opt); // add Task to //root/Tasks folder diff --git a/TOF/AliTOFPID.h b/TOF/AliTOFPID.h index 98a0cf81499..cb11c3538f3 100644 --- a/TOF/AliTOFPID.h +++ b/TOF/AliTOFPID.h @@ -49,7 +49,7 @@ private: protected: - ClassDef(AliTOFPID,1) // Task class for TOF pid + ClassDef(AliTOFPID,0) // Task class for TOF pid }; diff --git a/TOF/AliTOFReconstructioner.cxx b/TOF/AliTOFReconstructioner.cxx index db1c5d73f1d..ce2eb476670 100644 --- a/TOF/AliTOFReconstructioner.cxx +++ b/TOF/AliTOFReconstructioner.cxx @@ -450,6 +450,12 @@ void AliTOFReconstructioner::Exec(const char* datafile, Option_t *option) }//event loop + // free used memory for ftail + if (ftail) + { + delete ftail; + ftail = 0; + } // writing ntuple on output file foutputfile->cd(); @@ -1600,6 +1606,9 @@ void AliTOFReconstructioner::ReadTOFHits(Int_t ntracks, TTree* treehits, TClones } } + // speed-up the code + treehits->SetBranchStatus("*",0); // switch off all branches + treehits->SetBranchStatus("TOF*",1); // switch on only TOF for (Int_t track=0; trackSetBranchStatus("*",0); // switch off all branches + treehits->SetBranchStatus("TPC*",1); // switch on only TPC + for (Int_t track=0; trackResetHits(); nbytes += treehits->GetEvent(track); diff --git a/TOF/AliTOFReconstructioner.h b/TOF/AliTOFReconstructioner.h index 6f82a2c651c..1b5bdfb12de 100644 --- a/TOF/AliTOFReconstructioner.h +++ b/TOF/AliTOFReconstructioner.h @@ -169,9 +169,9 @@ public: Bool_t operator == (const AliTOFReconstructioner & tofrec) const ; private: - TGeant3 *fg3; // pointer to GEANT geometry - TFile *foutputfile; // pointer to output file - TNtuple *foutputntuple; // pointer to output ntuple + TGeant3 *fg3; //! pointer to GEANT geometry + TFile *foutputfile; //! pointer to output file + TNtuple *foutputntuple; //! pointer to output ntuple TF1 *fZnoise; // pointer to formula giving the noise along z direction TF1 *ftail; // pointer to formula for time with tail Int_t fdbg; // Flag for debug, 0 no debug, 1 debug diff --git a/TOF/AliTOFT0.cxx b/TOF/AliTOFT0.cxx index c87306faf63..3f88b51edbd 100644 --- a/TOF/AliTOFT0.cxx +++ b/TOF/AliTOFT0.cxx @@ -234,6 +234,10 @@ void AliTOFT0::Exec(Option_t *option) Int_t lasttrack=-1; Int_t nset=0; + + TH->SetBranchStatus("*",0); // switch off all branches + TH->SetBranchStatus("TOF*",1); // switch on only TOF + // Start loop on primary tracks in the hits containers Int_t ntracks = static_cast(TH->GetEntries()); -- 2.43.0