From 0e373bac97debe2c8d8e1944ccd61deb0c7b73ee Mon Sep 17 00:00:00 2001 From: mvala Date: Fri, 18 Feb 2011 10:55:54 +0000 Subject: [PATCH] Small corrections to the TENDER code, which will support AliTenderInputHander(currently in development) needed for event mixing. --- ANALYSIS/Tender/AliTender.cxx | 14 ++++++++++---- ANALYSIS/Tender/AliTender.h | 4 ++++ ANALYSIS/TenderSupplies/AliTPCTenderSupply.cxx | 10 ++++++++-- ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx | 5 ++++- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/ANALYSIS/Tender/AliTender.cxx b/ANALYSIS/Tender/AliTender.cxx index c985362a8dc..092e7c5b0c9 100644 --- a/ANALYSIS/Tender/AliTender.cxx +++ b/ANALYSIS/Tender/AliTender.cxx @@ -90,8 +90,12 @@ void AliTender::ConnectInputData(Option_t* option) { // Connect the input data, create CDB manager. if (fDebug > 1) Printf("AliTender::ConnectInputData()\n"); - AliAnalysisTaskSE::ConnectInputData(option); - fESDhandler = dynamic_cast(fInputHandler); + + if (!fESDhandler) { + AliAnalysisTaskSE::ConnectInputData(option); + fESDhandler = dynamic_cast(fInputHandler); + } + if (fESDhandler) { fESD = fESDhandler->GetEvent(); } else { @@ -126,7 +130,7 @@ void AliTender::UserCreateOutputObjects() } //______________________________________________________________________________ -void AliTender::UserExec(Option_t* /*option*/) +void AliTender::UserExec(Option_t* option) { // // Execute all supplied analysis of one event. Notify run change via RunChanged(). @@ -154,7 +158,9 @@ void AliTender::UserExec(Option_t* /*option*/) // Lock CDB fCDBkey = fCDB->SetLock(kTRUE, fCDBkey); - PostData(1, fESD); + + TString opt = option; + if (!opt.Contains("NoPost")) PostData(1, fESD); } //______________________________________________________________________________ diff --git a/ANALYSIS/Tender/AliTender.h b/ANALYSIS/Tender/AliTender.h index a4850047e08..171c48740c4 100644 --- a/ANALYSIS/Tender/AliTender.h +++ b/ANALYSIS/Tender/AliTender.h @@ -17,6 +17,9 @@ #include "AliAnalysisTaskSE.h" #endif +// #ifndef ALIESDINPUTHANDLER_H +// #include "AliESDInputHandler.h" +// #endif class AliCDBManager; class AliESDEvent; class AliESDInputHandler; @@ -58,6 +61,7 @@ public: Bool_t RunChanged() const {return fRunChanged;} // Configuration void SetDefaultCDBStorage(const char *dbString="local://$ALICE_ROOT/OCDB"); + void SetESDhandler(AliESDInputHandler*esdH) {fESDhandler = esdH;} // Run control virtual void ConnectInputData(Option_t *option = ""); diff --git a/ANALYSIS/TenderSupplies/AliTPCTenderSupply.cxx b/ANALYSIS/TenderSupplies/AliTPCTenderSupply.cxx index c838be2af53..7865473b9ea 100644 --- a/ANALYSIS/TenderSupplies/AliTPCTenderSupply.cxx +++ b/ANALYSIS/TenderSupplies/AliTPCTenderSupply.cxx @@ -209,7 +209,10 @@ void AliTPCTenderSupply::SetSplines() // //find previous entry from the UserInfo // - TTree *tree=((TChain*)fTender->GetInputData(0))->GetTree(); +// TTree *tree=((TChain*)fTender->GetInputData(0))->GetTree(); + AliAnalysisManager*mgr = AliAnalysisManager::GetAnalysisManager(); + AliAnalysisTaskSE *task = (AliAnalysisTaskSE*)mgr->GetTasks()->First(); + TTree *tree=((TChain*)task->GetInputData(0))->GetTree(); if (!tree) { AliError("Tree not found in ESDhandler"); return; @@ -340,7 +343,10 @@ void AliTPCTenderSupply::SetParametrisation() } //Get the current file to check the reconstruction pass (UGLY, but not stored in ESD... ) - TFile *file=((TChain*)fTender->GetInputData(0))->GetCurrentFile(); + AliESDInputHandler *esdIH = dynamic_cast (fTender->GetESDhandler()); + if (!esdIH) return; + TTree *tree= (TTree*)esdIH->GetTree(); + TFile *file= (TFile*) tree->GetCurrentFile(); if (!file) { AliError("File not found, not changing parametrisation"); return; diff --git a/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx b/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx index a2ed3272234..404fdf116b5 100644 --- a/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx +++ b/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx @@ -168,7 +168,10 @@ void AliTRDTenderSupply::SetChamberGain(){ // //find previous entry from the UserInfo - TTree *tree=((TChain*)fTender->GetInputData(0))->GetTree(); + // TTree *tree=((TChain*)fTender->GetInputData(0))->GetTree(); + AliAnalysisManager*mgr = AliAnalysisManager::GetAnalysisManager(); + AliAnalysisTaskSE *task = (AliAnalysisTaskSE*)mgr->GetTasks()->First(); + TTree *tree=((TChain*)task->GetInputData(0))->GetTree(); if (!tree) { AliError("Tree not found in ESDhandler"); return; -- 2.39.3