From 16e24ca35b53c1e6ddbb759d9d8c077c542a160b Mon Sep 17 00:00:00 2001 From: jgrosseo Date: Mon, 12 Jun 2006 09:38:36 +0000 Subject: [PATCH] o) proper splitting of STEER dependent classes (PWG0dep) and ESD dependent classes o) fixed Makefile after introduction of all-PWG0 target o) copy contrustructor, destructor, =-op. in dNdEtaAnalysis o) some changes to run in PROOF --- PWG0/AliSelector.cxx | 116 +++++------------- PWG0/AliSelector.h | 15 +-- PWG0/AliSelectorRL.cxx | 61 ++++++++- PWG0/AliSelectorRL.h | 8 ++ PWG0/CreateESDChain.C | 8 +- PWG0/Makefile | 7 +- PWG0/PROOF-INF.PWG0base/SETUP.C | 2 + PWG0/PWG0baseLinkDef.h | 2 - PWG0/PWG0depLinkDef.h | 13 ++ PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.cxx | 82 +++++++++++-- PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.h | 11 +- PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.cxx | 60 ++++++++- PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.h | 9 +- PWG0/dNdEta/AlidNdEtaAnalysisSelector.cxx | 98 --------------- PWG0/dNdEta/AlidNdEtaAnalysisSelector.h | 30 ----- PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx | 20 +-- PWG0/dNdEta/AlidNdEtaCorrectionSelector.h | 4 +- PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx | 10 +- PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h | 4 +- PWG0/dNdEta/CreateCuts.C | 19 +++ PWG0/dNdEta/CreatedNdEta.C | 7 +- PWG0/dNdEta/dNdEtaAnalysis.cxx | 70 ++++++++++- PWG0/dNdEta/dNdEtaAnalysis.h | 5 + PWG0/dNdEta/runVertexRecEff.C | 30 +++++ PWG0/dNdEta/testAnalysis2.C | 93 ++++++++++---- PWG0/libPWG0base.pkg | 4 +- PWG0/libPWG0dep.pkg | 11 ++ 27 files changed, 492 insertions(+), 307 deletions(-) create mode 100644 PWG0/PWG0depLinkDef.h delete mode 100644 PWG0/dNdEta/AlidNdEtaAnalysisSelector.cxx delete mode 100644 PWG0/dNdEta/AlidNdEtaAnalysisSelector.h create mode 100644 PWG0/dNdEta/CreateCuts.C create mode 100644 PWG0/dNdEta/runVertexRecEff.C create mode 100644 PWG0/libPWG0dep.pkg diff --git a/PWG0/AliSelector.cxx b/PWG0/AliSelector.cxx index 5ffaa86b943..5a1c1d20d5d 100644 --- a/PWG0/AliSelector.cxx +++ b/PWG0/AliSelector.cxx @@ -40,23 +40,21 @@ #include #include -#include ClassImp(AliSelector) AliSelector::AliSelector() : TSelector(), - fChain(0), + fTree(0), fESD(0), fCountFiles(0), - fKineFile(0), - fHeaderFile(0), - fHeaderTree(0), - fHeader(0) + fKineFile(0) { // // Constructor. Initialization of pointers // + + AliLog::SetClassDebugLevel("AliSelector", AliLog::kDebug); } AliSelector::~AliSelector() @@ -69,26 +67,25 @@ AliSelector::~AliSelector() // list is deleted by the TSelector dtor } -void AliSelector::Begin(TTree *) +void AliSelector::Begin(TTree*) { // The Begin() function is called at the start of the query. // When running with PROOF Begin() is only called on the client. // The tree argument is deprecated (on PROOF 0 is passed). } -void AliSelector::SlaveBegin(TTree * tree) +void AliSelector::SlaveBegin(TTree* tree) { // The SlaveBegin() function is called after the Begin() function. // When running with PROOF SlaveBegin() is called on each slave server. // The tree argument is deprecated (on PROOF 0 is passed). - Init(tree); - AliDebug(AliLog::kDebug, "=======SLAVEBEGIN========"); AliDebug(AliLog::kDebug, Form("Hostname: %s", gSystem->HostName())); AliDebug(AliLog::kDebug, Form("Time: %s", gSystem->Now().AsString())); - TString option = GetOption(); + if (tree != 0) + Init(tree); } void AliSelector::Init(TTree *tree) @@ -101,27 +98,18 @@ void AliSelector::Init(TTree *tree) AliDebug(AliLog::kDebug, "=========Init=========="); - // Set branch addresses - if (tree == 0) - { - AliDebug(AliLog::kError, "ERROR: tree argument is 0."); - return; - } + fTree = tree; - fChain = dynamic_cast (tree); - if (fChain == 0) + if (fTree == 0) { - AliDebug(AliLog::kDebug, "ERROR: tree argument could not be casted to TChain."); + AliDebug(AliLog::kError, "ERROR: tree argument is 0."); return; } - fChain->SetBranchAddress("ESD", &fESD); + // Set branch address + fTree->SetBranchAddress("ESD", &fESD); if (fESD != 0) AliDebug(AliLog::kInfo, "INFO: Found ESD branch in chain."); - - /*fChain->SetBranchAddress("Header", &fHeader); - if (fHeader != 0) - AliDebug(AliLog::kInfo, "INFO: Found event header branch in chain.");*/ } Bool_t AliSelector::Notify() @@ -138,11 +126,17 @@ Bool_t AliSelector::Notify() AliDebug(AliLog::kDebug, Form("Time: %s", gSystem->Now().AsString())); ++fCountFiles; - TFile *f = fChain->GetCurrentFile(); - AliDebug(AliLog::kInfo, Form("Processing %d. file %s", fCountFiles, f->GetName())); + if (fTree) + { + TFile *f = fTree->GetCurrentFile(); + AliDebug(AliLog::kInfo, Form("Processing %d. file %s", fCountFiles, f->GetName())); + } + else + { + AliDebug(AliLog::kError, "fTree not available"); + } DeleteKinematicsFile(); - DeleteHeaderFile(); return kTRUE; } @@ -164,18 +158,18 @@ Bool_t AliSelector::Process(Long64_t entry) // WARNING when a selector is used with a TChain, you must use // the pointer to the current TTree to call GetEntry(entry). // The entry is always the local entry number in the current tree. - // Assuming that fChain is the pointer to the TChain being processed, - // use fChain->GetTree()->GetEntry(entry). + // Assuming that fTree is the pointer to the TChain being processed, + // use fTree->GetTree()->GetEntry(entry). AliDebug(AliLog::kDebug, Form("=========PROCESS========== Entry %lld", entry)); - if (!fChain) + if (!fTree) { - AliDebug(AliLog::kError, "ERROR: fChain is 0."); + AliDebug(AliLog::kError, "ERROR: fTree is 0."); return kFALSE; } - fChain->GetTree()->GetEntry(entry); + fTree->GetTree()->GetEntry(entry); /* // debugging @@ -200,7 +194,6 @@ void AliSelector::SlaveTerminate() // on each slave server. DeleteKinematicsFile(); - DeleteHeaderFile(); } void AliSelector::Terminate() @@ -214,16 +207,16 @@ void AliSelector::Terminate() TTree* AliSelector::GetKinematics() { - // Returns kinematics tree corresponding to current ESD active in fChain + // Returns kinematics tree corresponding to current ESD active in fTree // Loads the kinematics from the kinematics file, the file is identified by replacing "AliESDs" to // "Kinematics" in the file path of the ESD file. This is a hack, to be changed! if (!fKineFile) { - if (!fChain->GetCurrentFile()) + if (!fTree->GetCurrentFile()) return 0; - TString fileName(fChain->GetCurrentFile()->GetName()); + TString fileName(fTree->GetCurrentFile()->GetName()); fileName.ReplaceAll("AliESDs", "Kinematics"); AliDebug(AliLog::kInfo, Form("Opening %s", fileName.Data())); @@ -233,7 +226,7 @@ TTree* AliSelector::GetKinematics() return 0; } - return dynamic_cast (fKineFile->Get(Form("Event%d/TreeK", fChain->GetTree()->GetReadEntry()))); + return dynamic_cast (fKineFile->Get(Form("Event%d/TreeK", fTree->GetTree()->GetReadEntry()))); } void AliSelector::DeleteKinematicsFile() @@ -250,53 +243,6 @@ void AliSelector::DeleteKinematicsFile() } } -AliHeader* AliSelector::GetHeader() -{ - // Returns header corresponding to current ESD active in fChain - // Loads the header from galice.root, the file is identified by replacing "AliESDs" to - // "galice" in the file path of the ESD file. This is a hack, to be changed! - - if (!fHeaderFile || !fHeaderTree) - { - if (!fChain->GetCurrentFile()) - return 0; - - TString fileName(fChain->GetCurrentFile()->GetName()); - fileName.ReplaceAll("AliESDs", "galice"); - - AliDebug(AliLog::kInfo, Form("Opening %s", fileName.Data())); - - fHeaderFile = TFile::Open(fileName); - if (!fHeaderFile) - return 0; - - fHeaderTree = dynamic_cast (fHeaderFile->Get("TE")); - if (!fHeaderTree) - return 0; - - fHeaderTree->SetBranchAddress("Header", &fHeader); - } - - fHeaderTree->GetEntry(fChain->GetTree()->GetReadEntry()); - - return fHeader; -} - -void AliSelector::DeleteHeaderFile() -{ - // - // Closes the kinematics file and deletes the pointer. - // - - if (fHeaderFile) - { - fHeaderFile->Close(); - delete fHeaderFile; - fHeaderTree = 0; - fHeader = 0; - } -} - Bool_t AliSelector::IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries) const { // diff --git a/PWG0/AliSelector.h b/PWG0/AliSelector.h index ada3d82c558..2e76020efca 100644 --- a/PWG0/AliSelector.h +++ b/PWG0/AliSelector.h @@ -13,7 +13,6 @@ class TTree; class TParticle; class AliESD; -class AliHeader; class AliSelector : public TSelector { public: @@ -21,8 +20,8 @@ class AliSelector : public TSelector { virtual ~AliSelector(); virtual Int_t Version() const {return 1;} - virtual void Begin(TTree *tree); - virtual void SlaveBegin(TTree *tree); + virtual void Begin(TTree*); + virtual void SlaveBegin(TTree* tree); virtual void Init(TTree *tree); virtual Bool_t Notify(); virtual Bool_t Process(Long64_t entry); @@ -31,25 +30,17 @@ class AliSelector : public TSelector { protected: TTree* GetKinematics(); - AliHeader* GetHeader(); Bool_t IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries) const; - TChain *fChain; //! pointer to the analyzed TTree or TChain - + TTree *fTree; //! pointer to the TTree containing the events AliESD* fESD; //! "ESD" branch in fChain - Int_t fCountFiles; // number of processed file private: void DeleteKinematicsFile(); - void DeleteHeaderFile(); TFile* fKineFile; //! pointer to Kinematics.root if the file was opened - TFile* fHeaderFile; //! pointer to galice.root, if the file was opened - TTree* fHeaderTree; //! holds TE tree of current galice.root - AliHeader* fHeader; //! holds pointer to current header - ClassDef(AliSelector,0); }; diff --git a/PWG0/AliSelectorRL.cxx b/PWG0/AliSelectorRL.cxx index e481d7ab8c2..d4b858d8336 100644 --- a/PWG0/AliSelectorRL.cxx +++ b/PWG0/AliSelectorRL.cxx @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -18,7 +19,10 @@ ClassImp(AliSelectorRL) AliSelectorRL::AliSelectorRL() : AliSelector(), - fRunLoader(0) + fRunLoader(0), + fHeaderFile(0), + fHeaderTree(0), + fHeader(0) { // // Constructor. Initialization of pointers @@ -44,6 +48,7 @@ Bool_t AliSelectorRL::Notify() return kFALSE; DeleteRunLoader(); + DeleteHeaderFile(); return kTRUE; } @@ -55,20 +60,21 @@ void AliSelectorRL::SlaveTerminate() AliSelector::SlaveTerminate(); DeleteRunLoader(); + DeleteHeaderFile(); } AliRunLoader* AliSelectorRL::GetAliRunLoader() { - // Returns AliRun instance corresponding to current ESD active in fChain + // Returns AliRun instance corresponding to current ESD active in fTree // Loads galice.root, the file is identified by replacing "AliESDs" to // "galice" in the file path of the ESD file. This is a hack, to be changed! if (!fRunLoader) { - if (!fChain->GetCurrentFile()) + if (!fTree->GetCurrentFile()) return 0; - TString fileName(fChain->GetCurrentFile()->GetName()); + TString fileName(fTree->GetCurrentFile()->GetName()); fileName.ReplaceAll("AliESDs", "galice"); fRunLoader = AliRunLoader::Open(fileName); @@ -93,3 +99,50 @@ void AliSelectorRL::DeleteRunLoader() fRunLoader = 0; } } + +AliHeader* AliSelectorRL::GetHeader() +{ + // Returns header corresponding to current ESD active in fTree + // Loads the header from galice.root, the file is identified by replacing "AliESDs" to + // "galice" in the file path of the ESD file. This is a hack, to be changed! + + if (!fHeaderFile || !fHeaderTree) + { + if (!fTree->GetCurrentFile()) + return 0; + + TString fileName(fTree->GetCurrentFile()->GetName()); + fileName.ReplaceAll("AliESDs", "galice"); + + AliDebug(AliLog::kInfo, Form("Opening %s", fileName.Data())); + + fHeaderFile = TFile::Open(fileName); + if (!fHeaderFile) + return 0; + + fHeaderTree = dynamic_cast (fHeaderFile->Get("TE")); + if (!fHeaderTree) + return 0; + + fHeaderTree->SetBranchAddress("Header", &fHeader); + } + + fHeaderTree->GetEntry(fTree->GetTree()->GetReadEntry()); + + return fHeader; +} + +void AliSelectorRL::DeleteHeaderFile() +{ + // + // Closes the kinematics file and deletes the pointer. + // + + if (fHeaderFile) + { + fHeaderFile->Close(); + delete fHeaderFile; + fHeaderTree = 0; + fHeader = 0; + } +} diff --git a/PWG0/AliSelectorRL.h b/PWG0/AliSelectorRL.h index 18974d83d1a..0fee90a6643 100644 --- a/PWG0/AliSelectorRL.h +++ b/PWG0/AliSelectorRL.h @@ -8,6 +8,7 @@ #include "AliSelector.h" class AliRunLoader; +class AliHeader; class AliSelectorRL : public AliSelector { public: @@ -19,11 +20,18 @@ class AliSelectorRL : public AliSelector { protected: AliRunLoader* GetAliRunLoader(); + AliHeader* GetHeader(); private: void DeleteRunLoader(); + void DeleteHeaderFile(); + AliRunLoader* fRunLoader; //! pointer to the RunLoader if galice.root was opened + TFile* fHeaderFile; //! pointer to galice.root, if the file was opened + TTree* fHeaderTree; //! holds TE tree of current galice.root + AliHeader* fHeader; //! holds pointer to current header + ClassDef(AliSelectorRL,0); }; diff --git a/PWG0/CreateESDChain.C b/PWG0/CreateESDChain.C index 2f60dfe8a95..220abfce5b1 100644 --- a/PWG0/CreateESDChain.C +++ b/PWG0/CreateESDChain.C @@ -48,7 +48,7 @@ TChain* CreateESDChainFromDir(const char* aDataDir, Int_t aRuns = 20, Int_t offs return chain; } -TChain* CreateESDChainFromList(const char* listFile, Int_t aRuns = 20) +TChain* CreateESDChainFromList(const char* listFile, Int_t aRuns = 20, Int_t offset = 0) { // Creates a chain from a file which contains a list of ESD files @@ -70,6 +70,12 @@ TChain* CreateESDChainFromList(const char* listFile, Int_t aRuns = 20) in >> esdfile; if (!esdfile.Contains("root")) continue; // protection + if (offset > 0) + { + --offset; + continue; + } + if (count++ == aRuns) break; diff --git a/PWG0/Makefile b/PWG0/Makefile index 3700a1a2b7e..ca53ee54701 100644 --- a/PWG0/Makefile +++ b/PWG0/Makefile @@ -2,6 +2,8 @@ PACKAGE = PWG0base +default-target: libPWG0base.so + include $(ROOTSYS)/test/Makefile.arch include lib$(PACKAGE).pkg @@ -11,15 +13,12 @@ ALICEINC = -I. ifneq ($(ALICE_ROOT),) ALICEINC += -I$(ALICE_ROOT)/include else - ifneq ($(STEER_INCLUDE),) - ALICEINC += -I../$(STEER_INCLUDE) - endif ifneq ($(ESD_INCLUDE),) ALICEINC += -I../$(ESD_INCLUDE) endif endif -CXXFLAGS += $(ALICEINC) +CXXFLAGS += $(ALICEINC) -g SRCS += dict.cxx OBJS = $(SRCS:.cxx=.o) PARFILE = $(PACKAGE).par diff --git a/PWG0/PROOF-INF.PWG0base/SETUP.C b/PWG0/PROOF-INF.PWG0base/SETUP.C index 00817cafcfa..24a35fa4a53 100644 --- a/PWG0/PROOF-INF.PWG0base/SETUP.C +++ b/PWG0/PROOF-INF.PWG0base/SETUP.C @@ -1,5 +1,7 @@ void SETUP() { + gSystem->Load("libPWG0base"); + // Set the Inlucde paths gSystem->SetIncludePath("-I$ROOTSYS/include -IPWG0base"); gROOT->ProcessLine(".include PWG0base"); diff --git a/PWG0/PWG0baseLinkDef.h b/PWG0/PWG0baseLinkDef.h index 26ff721ba58..cf2094713e9 100644 --- a/PWG0/PWG0baseLinkDef.h +++ b/PWG0/PWG0baseLinkDef.h @@ -9,9 +9,7 @@ #pragma link off all functions; #pragma link C++ class AliSelector+; -#pragma link C++ class AliSelectorRL+; -#pragma link C++ class AlidNdEtaAnalysisSelector+; #pragma link C++ class dNdEtaAnalysis+; #pragma link C++ class dNdEtaCorrection+; diff --git a/PWG0/PWG0depLinkDef.h b/PWG0/PWG0depLinkDef.h new file mode 100644 index 00000000000..c79aecdd3c2 --- /dev/null +++ b/PWG0/PWG0depLinkDef.h @@ -0,0 +1,13 @@ +#ifdef __CINT__ +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class AliSelectorRL+; + +#endif diff --git a/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.cxx b/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.cxx index 12d5655bf1e..d6ab08a7d51 100644 --- a/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.cxx +++ b/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.cxx @@ -7,23 +7,26 @@ #include #include #include +#include #include #include #include #include "esdTrackCuts/AliESDtrackCuts.h" -#include "dNdEtaAnalysis.h" +#include "dNdEta/dNdEtaAnalysis.h" ClassImp(AlidNdEtaAnalysisESDSelector) AlidNdEtaAnalysisESDSelector::AlidNdEtaAnalysisESDSelector() : - AlidNdEtaAnalysisSelector(), + AliSelector(), fEsdTrackCuts(0) { // // Constructor. Initialization of pointers // + + AliLog::SetClassDebugLevel("AlidNdEtaAnalysisESDSelector", AliLog::kDebug); } AlidNdEtaAnalysisESDSelector::~AlidNdEtaAnalysisESDSelector() @@ -36,19 +39,38 @@ AlidNdEtaAnalysisESDSelector::~AlidNdEtaAnalysisESDSelector() // list is deleted by the TSelector dtor } -void AlidNdEtaAnalysisESDSelector::SlaveBegin(TTree * tree) +void AlidNdEtaAnalysisESDSelector::SlaveBegin(TTree* tree) { // The SlaveBegin() function is called after the Begin() function. // When running with PROOF SlaveBegin() is called on each slave server. // The tree argument is deprecated (on PROOF 0 is passed). - AlidNdEtaAnalysisSelector::SlaveBegin(tree); + AliSelector::SlaveBegin(tree); - if (fChain) + if (fInput) { - fEsdTrackCuts = dynamic_cast (fChain->GetUserInfo()->FindObject("AliESDtrackCuts")); + printf("Printing input list:\n"); + fInput->Print(); } + if (!fEsdTrackCuts && fInput) + fEsdTrackCuts = dynamic_cast (fInput->FindObject("AliESDtrackCuts")); + + if (!fEsdTrackCuts) + AliDebug(AliLog::kError, "ERROR: Could not read EsdTrackCuts from input list."); + + fdNdEtaAnalysis = new dNdEtaAnalysis("dndeta", "dndeta"); +} + +void AlidNdEtaAnalysisESDSelector::Init(TTree* tree) +{ + // read the user objects + + AliSelector::Init(tree); + + if (!fEsdTrackCuts && fTree) + fEsdTrackCuts = dynamic_cast (fTree->GetUserInfo()->FindObject("AliESDtrackCuts")); + if (!fEsdTrackCuts) AliDebug(AliLog::kError, "ERROR: Could not read EsdTrackCuts from user info."); } @@ -70,10 +92,10 @@ Bool_t AlidNdEtaAnalysisESDSelector::Process(Long64_t entry) // WARNING when a selector is used with a TChain, you must use // the pointer to the current TTree to call GetEntry(entry). // The entry is always the local entry number in the current tree. - // Assuming that fChain is the pointer to the TChain being processed, - // use fChain->GetTree()->GetEntry(entry). + // Assuming that fTree is the pointer to the TChain being processed, + // use fTree->GetTree()->GetEntry(entry). - if (AlidNdEtaAnalysisSelector::Process(entry) == kFALSE) + if (AliSelector::Process(entry) == kFALSE) return kFALSE; // Check prerequisites @@ -142,10 +164,48 @@ Bool_t AlidNdEtaAnalysisESDSelector::Process(Long64_t entry) return kTRUE; } -void AlidNdEtaAnalysisESDSelector::WriteObjects() +void AlidNdEtaAnalysisESDSelector::SlaveTerminate() +{ + // The SlaveTerminate() function is called after all entries or objects + // have been processed. When running with PROOF SlaveTerminate() is called + // on each slave server. + + AliSelector::SlaveTerminate(); + + // Add the histograms to the output on each slave server + if (!fOutput) + { + AliDebug(AliLog::kError, Form("ERROR: Output list not initialized.")); + return; + } + + fOutput->Add(fdNdEtaAnalysis); +} + +void AlidNdEtaAnalysisESDSelector::Terminate() { - AlidNdEtaAnalysisSelector::WriteObjects(); + // The Terminate() function is the last function to be called during + // a query. It always runs on the client, it can be used to present + // the results graphically or save the results to file. + + AliSelector::Terminate(); + + fdNdEtaAnalysis = dynamic_cast (fOutput->FindObject("dndeta")); + + if (!fdNdEtaAnalysis) + { + AliDebug(AliLog::kError, Form("ERROR: Histograms not available %p", (void*) fdNdEtaAnalysis)); + return; + } + + TFile* fout = new TFile("analysis_esd.root","RECREATE"); + + if (fdNdEtaAnalysis) + fdNdEtaAnalysis->SaveHistograms(); if (fEsdTrackCuts) fEsdTrackCuts->SaveHistograms("esd_tracks_cuts"); + + fout->Write(); + fout->Close(); } diff --git a/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.h b/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.h index 4caa9596930..40eaac589cd 100644 --- a/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.h +++ b/PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.h @@ -3,21 +3,24 @@ #ifndef ALIDNDETAANALYSISESDSELECTOR_H #define ALIDNDETAANALYSISESDSELECTOR_H -#include "AlidNdEtaAnalysisSelector.h" +#include "AliSelectorRL.h" class AliESDtrackCuts; +class dNdEtaAnalysis; -class AlidNdEtaAnalysisESDSelector : public AlidNdEtaAnalysisSelector { +class AlidNdEtaAnalysisESDSelector : public AliSelector { public: AlidNdEtaAnalysisESDSelector(); virtual ~AlidNdEtaAnalysisESDSelector(); virtual void SlaveBegin(TTree *tree); + virtual void Init(TTree *tree); virtual Bool_t Process(Long64_t entry); + virtual void SlaveTerminate(); + virtual void Terminate(); protected: - virtual void WriteObjects(); - + dNdEtaAnalysis* fdNdEtaAnalysis; // contains the target histograms AliESDtrackCuts* fEsdTrackCuts; // Object containing the parameters of the esd track cuts private: diff --git a/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.cxx b/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.cxx index 8ff4d27abe7..05ba91adcf9 100644 --- a/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.cxx +++ b/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.cxx @@ -11,18 +11,20 @@ #include #include #include +#include #include #include #include -#include "dNdEtaAnalysis.h" +#include "dNdEta/dNdEtaAnalysis.h" ClassImp(AlidNdEtaAnalysisMCSelector) AlidNdEtaAnalysisMCSelector::AlidNdEtaAnalysisMCSelector() : - AlidNdEtaAnalysisSelector(), + AliSelectorRL(), + fdNdEtaAnalysis(0), fVertex(0), fPartEta(0), fEvents(0) @@ -39,9 +41,20 @@ AlidNdEtaAnalysisMCSelector::~AlidNdEtaAnalysisMCSelector() // } +void AlidNdEtaAnalysisMCSelector::SlaveBegin(TTree * tree) +{ + // The SlaveBegin() function is called after the Begin() function. + // When running with PROOF SlaveBegin() is called on each slave server. + // The tree argument is deprecated (on PROOF 0 is passed). + + AliSelectorRL::SlaveBegin(tree); + + fdNdEtaAnalysis = new dNdEtaAnalysis("dndeta", "dndeta"); +} + void AlidNdEtaAnalysisMCSelector::Init(TTree *tree) { - AlidNdEtaAnalysisSelector::Init(tree); + AliSelectorRL::Init(tree); tree->SetBranchStatus("ESD", 0); @@ -52,9 +65,9 @@ void AlidNdEtaAnalysisMCSelector::Init(TTree *tree) Bool_t AlidNdEtaAnalysisMCSelector::Process(Long64_t entry) { - // + // fill the dNdEtaAnalysis class from the monte carlo - if (AliSelector::Process(entry) == kFALSE) + if (AliSelectorRL::Process(entry) == kFALSE) return kFALSE; TTree* particleTree = GetKinematics(); @@ -117,9 +130,44 @@ Bool_t AlidNdEtaAnalysisMCSelector::Process(Long64_t entry) return kTRUE; } +void AlidNdEtaAnalysisMCSelector::SlaveTerminate() +{ + // The SlaveTerminate() function is called after all entries or objects + // have been processed. When running with PROOF SlaveTerminate() is called + // on each slave server. + + AliSelectorRL::SlaveTerminate(); + + // Add the histograms to the output on each slave server + if (!fOutput) + { + AliDebug(AliLog::kError, Form("ERROR: Output list not initialized.")); + return; + } + + fOutput->Add(fdNdEtaAnalysis); +} + void AlidNdEtaAnalysisMCSelector::Terminate() { - AlidNdEtaAnalysisSelector::Terminate(); + // + + AliSelectorRL::Terminate(); + + fdNdEtaAnalysis = dynamic_cast (fOutput->FindObject("dndeta")); + + if (!fdNdEtaAnalysis) + { + AliDebug(AliLog::kError, Form("ERROR: Histograms not available %p", (void*) fdNdEtaAnalysis)); + return; + } + + TFile* fout = new TFile("analysis_mc.root","RECREATE"); + + fdNdEtaAnalysis->SaveHistograms(); + + fout->Write(); + fout->Close(); fPartEta->Scale(1.0/fEvents); fPartEta->Scale(1.0/fPartEta->GetBinWidth(1)); diff --git a/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.h b/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.h index 3aae19ec791..d2be00af583 100644 --- a/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.h +++ b/PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.h @@ -3,16 +3,19 @@ #ifndef ALIDNDETAANALYSISSELECTORMC_H #define ALIDNDETAANALYSISSELECTORMC_H -#include "AlidNdEtaAnalysisSelector.h" +#include "AliSelectorRL.h" class TH3F; class TH1F; +class dNdEtaAnalysis; -class AlidNdEtaAnalysisMCSelector : public AlidNdEtaAnalysisSelector { +class AlidNdEtaAnalysisMCSelector : public AliSelectorRL { public: AlidNdEtaAnalysisMCSelector(); virtual ~AlidNdEtaAnalysisMCSelector(); + virtual void SlaveBegin(TTree *tree); + virtual void SlaveTerminate(); virtual void Init(TTree *tree); virtual Bool_t Process(Long64_t entry); virtual void Terminate(); @@ -20,6 +23,8 @@ class AlidNdEtaAnalysisMCSelector : public AlidNdEtaAnalysisSelector { protected: private: + dNdEtaAnalysis* fdNdEtaAnalysis; // contains the intermediate histograms (on each slave) + TH3F* fVertex; //! vertex of counted particles TH1F* fPartEta; //! counted particles as function of eta Int_t fEvents; //! number of processed events diff --git a/PWG0/dNdEta/AlidNdEtaAnalysisSelector.cxx b/PWG0/dNdEta/AlidNdEtaAnalysisSelector.cxx deleted file mode 100644 index 743a515f642..00000000000 --- a/PWG0/dNdEta/AlidNdEtaAnalysisSelector.cxx +++ /dev/null @@ -1,98 +0,0 @@ -/* $Id$ */ - -#include "AlidNdEtaAnalysisSelector.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "dNdEtaAnalysis.h" - -ClassImp(AlidNdEtaAnalysisSelector) - -AlidNdEtaAnalysisSelector::AlidNdEtaAnalysisSelector() : - AliSelector(), - fdNdEtaAnalysis(0) -{ - // - // Constructor. Initialization of pointers - // -} - -AlidNdEtaAnalysisSelector::~AlidNdEtaAnalysisSelector() -{ - // - // Destructor - // - - // histograms are in the output list and deleted when the output - // list is deleted by the TSelector dtor -} - -void AlidNdEtaAnalysisSelector::SlaveBegin(TTree * tree) -{ - // The SlaveBegin() function is called after the Begin() function. - // When running with PROOF SlaveBegin() is called on each slave server. - // The tree argument is deprecated (on PROOF 0 is passed). - - AliSelector::SlaveBegin(tree); - - fdNdEtaAnalysis = new dNdEtaAnalysis("dndeta", "dndeta"); -} - -void AlidNdEtaAnalysisSelector::SlaveTerminate() -{ - // The SlaveTerminate() function is called after all entries or objects - // have been processed. When running with PROOF SlaveTerminate() is called - // on each slave server. - - AliSelector::SlaveTerminate(); - - // Add the histograms to the output on each slave server - if (!fOutput) - { - AliDebug(AliLog::kError, Form("ERROR: Output list not initialized.")); - return; - } - - fOutput->Add(fdNdEtaAnalysis); -} - -void AlidNdEtaAnalysisSelector::Terminate() -{ - // The Terminate() function is the last function to be called during - // a query. It always runs on the client, it can be used to present - // the results graphically or save the results to file. - - AliSelector::Terminate(); - - fdNdEtaAnalysis = dynamic_cast (fOutput->FindObject("dndeta")); - - if (!fdNdEtaAnalysis) - { - AliDebug(AliLog::kError, Form("ERROR: Histograms not available %p", (void*) fdNdEtaAnalysis)); - return; - } - - TFile* fout = new TFile("out.root","RECREATE"); - WriteObjects(); - fout->Write(); - fout->Close(); -} - -void AlidNdEtaAnalysisSelector::WriteObjects() -{ - // Write objects to output file - // this is an extra function to be overloaded... - // - - fdNdEtaAnalysis->SaveHistograms(); -} diff --git a/PWG0/dNdEta/AlidNdEtaAnalysisSelector.h b/PWG0/dNdEta/AlidNdEtaAnalysisSelector.h deleted file mode 100644 index e70f14bdee8..00000000000 --- a/PWG0/dNdEta/AlidNdEtaAnalysisSelector.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ */ - -#ifndef ALIDNDETAANALYSISSELECTOR_H -#define ALIDNDETAANALYSISSELECTOR_H - -#include "AliSelector.h" - -class dNdEtaAnalysis; -class dNdEtaCorrection; - -class AlidNdEtaAnalysisSelector : public AliSelector { - public: - AlidNdEtaAnalysisSelector(); - virtual ~AlidNdEtaAnalysisSelector(); - - virtual void SlaveBegin(TTree *tree); - virtual void SlaveTerminate(); - virtual void Terminate(); - - protected: - virtual void WriteObjects(); - - dNdEtaAnalysis* fdNdEtaAnalysis; // contains the intermediate histograms (on each slave) - dNdEtaCorrection* fdNdEtaCorrection; // correction map - - private: - ClassDef(AlidNdEtaAnalysisSelector, 0); -}; - -#endif diff --git a/PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx b/PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx index 91c5580b940..6aa6f30d895 100644 --- a/PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx +++ b/PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx @@ -25,7 +25,7 @@ ClassImp(AlidNdEtaCorrectionSelector) AlidNdEtaCorrectionSelector::AlidNdEtaCorrectionSelector() : - AliSelector(), + AliSelectorRL(), fEsdTrackCuts(0), fdNdEtaCorrection(0), fdNdEtaCorrectionFinal(0) @@ -51,7 +51,7 @@ void AlidNdEtaCorrectionSelector::Begin(TTree * tree) // When running with PROOF Begin() is only called on the client. // The tree argument is deprecated (on PROOF 0 is passed). - AliSelector::Begin(tree); + AliSelectorRL::Begin(tree); } void AlidNdEtaCorrectionSelector::SlaveBegin(TTree * tree) @@ -60,12 +60,12 @@ void AlidNdEtaCorrectionSelector::SlaveBegin(TTree * tree) // When running with PROOF SlaveBegin() is called on each slave server. // The tree argument is deprecated (on PROOF 0 is passed). - AliSelector::SlaveBegin(tree); + AliSelectorRL::SlaveBegin(tree); fdNdEtaCorrection = new dNdEtaCorrection(); - if (fChain) - fEsdTrackCuts = dynamic_cast (fChain->GetUserInfo()->FindObject("AliESDtrackCuts")); + if (fTree) + fEsdTrackCuts = dynamic_cast (fTree->GetUserInfo()->FindObject("AliESDtrackCuts")); if (!fEsdTrackCuts) AliDebug(AliLog::kError, "ERROR: Could not read EsdTrackCuts from user info"); @@ -88,10 +88,10 @@ Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry) // WARNING when a selector is used with a TChain, you must use // the pointer to the current TTree to call GetEntry(entry). // The entry is always the local entry number in the current tree. - // Assuming that fChain is the pointer to the TChain being processed, - // use fChain->GetTree()->GetEntry(entry). + // Assuming that fTree is the pointer to the TChain being processed, + // use fTree->GetTree()->GetEntry(entry). - if (AliSelector::Process(entry) == kFALSE) + if (AliSelectorRL::Process(entry) == kFALSE) return kFALSE; // check prerequesites @@ -212,7 +212,7 @@ void AlidNdEtaCorrectionSelector::SlaveTerminate() // have been processed. When running with PROOF SlaveTerminate() is called // on each slave server. - AliSelector::SlaveTerminate(); + AliSelectorRL::SlaveTerminate(); // Add the histograms to the output on each slave server if (!fOutput) @@ -230,7 +230,7 @@ void AlidNdEtaCorrectionSelector::Terminate() // a query. It always runs on the client, it can be used to present // the results graphically or save the results to file. - AliSelector::Terminate(); + AliSelectorRL::Terminate(); fdNdEtaCorrectionFinal = dynamic_cast (fOutput->FindObject("dndeta_correction")); diff --git a/PWG0/dNdEta/AlidNdEtaCorrectionSelector.h b/PWG0/dNdEta/AlidNdEtaCorrectionSelector.h index 82c70b92bd2..cff24d3426d 100644 --- a/PWG0/dNdEta/AlidNdEtaCorrectionSelector.h +++ b/PWG0/dNdEta/AlidNdEtaCorrectionSelector.h @@ -3,12 +3,12 @@ #ifndef ALIDNDETACORRECTIONSELECTOR_H #define ALIDNDETACORRECTIONSELECTOR_H -#include "AliSelector.h" +#include "AliSelectorRL.h" class AliESDtrackCuts; class dNdEtaCorrection; -class AlidNdEtaCorrectionSelector : public AliSelector { +class AlidNdEtaCorrectionSelector : public AliSelectorRL { public: AlidNdEtaCorrectionSelector(); virtual ~AlidNdEtaCorrectionSelector(); diff --git a/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx b/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx index 45fc0bd4088..2bf0fff8b3b 100644 --- a/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx +++ b/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx @@ -25,7 +25,7 @@ ClassImp(AlidNdEtaVertexRecEffSelector) const Float_t AlidNdEtaVertexRecEffSelector::fkEtaRange = 0.9; AlidNdEtaVertexRecEffSelector::AlidNdEtaVertexRecEffSelector() : - AliSelector(), + AliSelectorRL(), fdNGen(0), fdNRec(0), fVtxGen(0), @@ -50,7 +50,7 @@ void AlidNdEtaVertexRecEffSelector::SlaveBegin(TTree * tree) { // initializes the histograms - AliSelector::SlaveBegin(tree); + AliSelectorRL::SlaveBegin(tree); fdNGen = new TH1F("dNGen", "dNGen", 90, 0, 50); fdNRec = dynamic_cast(fdNGen->Clone("dNRec")); @@ -94,7 +94,7 @@ Bool_t AlidNdEtaVertexRecEffSelector::Process(Long64_t entry) // fills fdNGen and fdNRec // - if (AliSelector::Process(entry) == kFALSE) + if (AliSelectorRL::Process(entry) == kFALSE) return kFALSE; // check prerequisites @@ -163,7 +163,7 @@ void AlidNdEtaVertexRecEffSelector::SlaveTerminate() // have been processed. When running with PROOF SlaveTerminate() is called // on each slave server. - AliSelector::SlaveTerminate(); + AliSelectorRL::SlaveTerminate(); // Add the histograms to the output on each slave server if (!fOutput) @@ -184,7 +184,7 @@ void AlidNdEtaVertexRecEffSelector::Terminate() // a query. It always runs on the client, it can be used to present // the results graphically or save the results to file. - AliSelector::Terminate(); + AliSelectorRL::Terminate(); if (!fOutput) { diff --git a/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h b/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h index 8e66b173cfb..1311a412d19 100644 --- a/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h +++ b/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h @@ -5,11 +5,11 @@ // This class plots the vertex reconstruction efficiency -#include "AliSelector.h" +#include "AliSelectorRL.h" class TH1F; -class AlidNdEtaVertexRecEffSelector : public AliSelector { +class AlidNdEtaVertexRecEffSelector : public AliSelectorRL { public: AlidNdEtaVertexRecEffSelector(); virtual ~AlidNdEtaVertexRecEffSelector(); diff --git a/PWG0/dNdEta/CreateCuts.C b/PWG0/dNdEta/CreateCuts.C new file mode 100644 index 00000000000..68e6ed93d17 --- /dev/null +++ b/PWG0/dNdEta/CreateCuts.C @@ -0,0 +1,19 @@ +/* $Id$ */ + +// this macro creates the track and event cuts used in this analysis + +AliESDtrackCuts* CreateTrackCuts() +{ + AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts(); + esdTrackCuts->DefineHistograms(1); + + esdTrackCuts->SetMinNClustersTPC(50); + esdTrackCuts->SetMaxChi2PerClusterTPC(3.5); + esdTrackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2); + esdTrackCuts->SetRequireTPCRefit(kTRUE); + + esdTrackCuts->SetMinNsigmaToVertex(3); + esdTrackCuts->SetAcceptKingDaughters(kFALSE); + + return esdTrackCuts; +} diff --git a/PWG0/dNdEta/CreatedNdEta.C b/PWG0/dNdEta/CreatedNdEta.C index d176a839959..4cde252de81 100644 --- a/PWG0/dNdEta/CreatedNdEta.C +++ b/PWG0/dNdEta/CreatedNdEta.C @@ -14,7 +14,12 @@ void CreatedNdEta(Bool_t correct = kTRUE) fdNdEtaAnalysis = new dNdEtaAnalysis("dndeta", "dndeta"); - TFile::Open("out.root"); + TFile* file = TFile::Open("out.root"); + if (!file) + { + cout << "Error. File out.root not found" << endl; + return; + } fdNdEtaAnalysis->LoadHistograms(); fdNdEtaAnalysis->Finish(dNdEtaCorrection); diff --git a/PWG0/dNdEta/dNdEtaAnalysis.cxx b/PWG0/dNdEta/dNdEtaAnalysis.cxx index 55a6e3cc7ff..4e21461b867 100644 --- a/PWG0/dNdEta/dNdEtaAnalysis.cxx +++ b/PWG0/dNdEta/dNdEtaAnalysis.cxx @@ -19,7 +19,10 @@ ClassImp(dNdEtaAnalysis) //____________________________________________________________________ dNdEtaAnalysis::dNdEtaAnalysis(Char_t* name, Char_t* title) : -TNamed(name, title) + TNamed(name, title), + fEtaVsVtx(0), + fEtaVsVtxUncorrected(0), + fVtx(0) { // constructor @@ -39,6 +42,71 @@ TNamed(name, title) fVtx->Sumw2(); } +//____________________________________________________________________ +dNdEtaAnalysis::~dNdEtaAnalysis() +{ + // destructor + + delete fEtaVsVtx; + fEtaVsVtx = 0; + + delete fEtaVsVtxUncorrected; + fEtaVsVtxUncorrected = 0; + + delete fVtx; + fVtx = 0; + + for (Int_t i=0; i (fEtaVsVtx->Clone()); + target.fEtaVsVtxUncorrected = dynamic_cast (fEtaVsVtxUncorrected->Clone()); + target.fVtx = dynamic_cast (fVtx->Clone()); + + for (Int_t i=0; i (fdNdEta[i]->Clone()); + + TNamed::Copy((TNamed &) c); +} + //____________________________________________________________________ void dNdEtaAnalysis::FillTrack(Float_t vtx, Float_t eta) { diff --git a/PWG0/dNdEta/dNdEtaAnalysis.h b/PWG0/dNdEta/dNdEtaAnalysis.h index 575f972ce07..3ac557357fd 100644 --- a/PWG0/dNdEta/dNdEtaAnalysis.h +++ b/PWG0/dNdEta/dNdEtaAnalysis.h @@ -31,6 +31,11 @@ public: enum { kVertexBinning = 1+4 }; // the first is for the whole vertex range, the others divide the vertex range dNdEtaAnalysis(Char_t* name, Char_t* title); + virtual ~dNdEtaAnalysis(); + + dNdEtaAnalysis(const dNdEtaAnalysis &c); + dNdEtaAnalysis &operator=(const dNdEtaAnalysis &c); + virtual void Copy(TObject &c) const; void FillTrack(Float_t vtx, Float_t eta); void FillEvent(Float_t vtx); diff --git a/PWG0/dNdEta/runVertexRecEff.C b/PWG0/dNdEta/runVertexRecEff.C new file mode 100644 index 00000000000..323e8e155b8 --- /dev/null +++ b/PWG0/dNdEta/runVertexRecEff.C @@ -0,0 +1,30 @@ +/* $Id$ */ + +// +// Script to test the class AlidNdEtaVertexRecEffSelector that creates +// a vertex reconstruction efficiency plot +// +// implementation with TSelector +// + +#include "../CreateESDChain.C" + +runVertexRecEff(Char_t* dataDir, Int_t nRuns=20, Int_t offset=0) +{ + gSystem->Load("libPWG0base"); + gSystem->Load("libPWG0dep"); + + TChain* chain = CreateESDChainFromDir(dataDir, nRuns, offset); + + TString selectorName = "AlidNdEtaVertexRecEffSelector"; + + AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo); + + TStopwatch timer; + timer.Start(); + + chain->Process(selectorName + ".cxx+"); + + timer.Stop(); + timer.Print(); +} diff --git a/PWG0/dNdEta/testAnalysis2.C b/PWG0/dNdEta/testAnalysis2.C index 266fce801e2..835f8dc961c 100644 --- a/PWG0/dNdEta/testAnalysis2.C +++ b/PWG0/dNdEta/testAnalysis2.C @@ -9,52 +9,97 @@ // #include "../CreateESDChain.C" -#include "CreatedNdEta.C" -testAnalysis2(Char_t* dataDir, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE) +void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE) { + gSystem->Load("libEG"); + gSystem->Load("libGeom"); + gSystem->Load("libESD"); gSystem->Load("libPWG0base"); + if (aMC != kFALSE) + gSystem->Load("libPWG0dep"); - TChain* chain = CreateESDChainFromDir(dataDir, nRuns, offset); + gROOT->ProcessLine(".L CreatedNdEta.C"); + gROOT->ProcessLine(".L CreateCuts.C"); + + TChain* chain = 0; + TVirtualProof* proof = 0; + if (aProof == kFALSE) + chain = CreateESDChainFromDir(data, nRuns, offset); + else + { + chain = CreateESDChainFromList(data, nRuns, offset); + proof = gROOT->Proof("alicecaf@lxb6041"); + + if (!proof) + { + printf("ERROR: PROOF connection not established.\n"); + return; + } + + if (proof->EnablePackage("ESD")) + { + printf("ERROR: ESD package could not be enabled.\n"); + return; + } + + if (proof->EnablePackage("PWG0base")) + { + printf("ERROR: PWG0base package could not be enabled.\n"); + return; + } + + if (aMC != kFALSE) + { + if (proof->EnablePackage("PWG0dep")) + { + printf("ERROR: PWG0dep package could not be enabled.\n"); + return; + } + } + + chain->SetProof(proof); + } // ######################################################## // selection of esd tracks - AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts(); - esdTrackCuts->DefineHistograms(1); - - esdTrackCuts->SetMinNClustersTPC(50); - esdTrackCuts->SetMaxChi2PerClusterTPC(3.5); - esdTrackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2); - esdTrackCuts->SetRequireTPCRefit(kTRUE); - - esdTrackCuts->SetMinNsigmaToVertex(3); - esdTrackCuts->SetAcceptKingDaughters(kFALSE); - - chain->GetUserInfo()->Add(esdTrackCuts); - - if (aMC == kFALSE) + AliESDtrackCuts* esdTrackCuts = CreateTrackCuts(); + if (!esdTrackCuts) { - dNdEtaCorrection* dNdEtaCorrection = new dNdEtaCorrection(); - dNdEtaCorrection->LoadHistograms("correction_map.root","dndeta_correction"); - dNdEtaCorrection->RemoveEdges(2, 0, 2); - - chain->GetUserInfo()->Add(dNdEtaCorrection); + printf("ERROR: esdTrackCuts could not be created\n"); + return; } + chain->GetUserInfo()->Add(esdTrackCuts); + if (proof) + proof->AddInput(esdTrackCuts); + TString selectorName = ((aMC == kFALSE) ? "AlidNdEtaAnalysisESDSelector" : "AlidNdEtaAnalysisMCSelector"); AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo); - selectorName += ".cxx++"; + // workaround for a bug in PROOF that only allows header files for .C files + // please create symlink from .cxx to .C + if (proof != kFALSE) + selectorName += ".C+"; + else + selectorName += ".cxx+"; + if (aDebug != kFALSE) selectorName += "g"; TStopwatch timer; timer.Start(); - chain->Process(selectorName); + Long64_t result = chain->Process(selectorName); + if (result != 0) + { + printf("ERROR: Executing process failed with %d.\n", result); + return; + } timer.Stop(); timer.Print(); CreatedNdEta(aMC ? kFALSE : kTRUE); } + diff --git a/PWG0/libPWG0base.pkg b/PWG0/libPWG0base.pkg index d5e48180972..040862210ba 100644 --- a/PWG0/libPWG0base.pkg +++ b/PWG0/libPWG0base.pkg @@ -1,8 +1,6 @@ # $Id$ HDRS = AliSelector.h \ - AliSelectorRL.h \ - dNdEta/AlidNdEtaAnalysisSelector.h \ dNdEta/dNdEtaAnalysis.h \ dNdEta/dNdEtaCorrection.h \ esdTrackCuts/AliESDtrackCuts.h \ @@ -14,4 +12,4 @@ DHDR= PWG0baseLinkDef.h EINCLUDE= -all-PWG0: all-PWG0base all-PWG0selectors \ No newline at end of file +all-PWG0: all-PWG0base all-PWG0selectors all-PWG0dep diff --git a/PWG0/libPWG0dep.pkg b/PWG0/libPWG0dep.pkg new file mode 100644 index 00000000000..d015c7c080a --- /dev/null +++ b/PWG0/libPWG0dep.pkg @@ -0,0 +1,11 @@ +# $Id$ + +# this library contains classed that depend on STEER + +HDRS = AliSelectorRL.h + +SRCS = $(HDRS:.h=.cxx) + +DHDR= PWG0depLinkDef.h + +EINCLUDE= -- 2.39.3