]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Small corrections to the TENDER code, which will support AliTenderInputHander(current...
authormvala <mvala@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 10:55:54 +0000 (10:55 +0000)
committermvala <mvala@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 10:55:54 +0000 (10:55 +0000)
ANALYSIS/Tender/AliTender.cxx
ANALYSIS/Tender/AliTender.h
ANALYSIS/TenderSupplies/AliTPCTenderSupply.cxx
ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx

index c985362a8dc628e584284569c61b2500f0703e93..092e7c5b0c9c604ef8cec788689d4f532f0a21cf 100644 (file)
@@ -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<AliESDInputHandler *>(fInputHandler);
+  
+  if (!fESDhandler) { 
+    AliAnalysisTaskSE::ConnectInputData(option);
+    fESDhandler = dynamic_cast<AliESDInputHandler *>(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);
 }
 
 //______________________________________________________________________________
index a4850047e08ca1bd499fc14e189c209e0599deb3..171c48740c47e3f79a02a6555438454352f266e2 100644 (file)
@@ -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 = "");
index c838be2af539a865749938412e7b63fd4354d9dd..7865473b9ea046a386f72ac5650f92c570ff728d 100644 (file)
@@ -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<AliESDInputHandler*> (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;
index a2ed3272234706fb7559fca057ecdf8ddc5cb0f1..404fdf116b5d156d2aa977a5838ca6fa69732a35 100644 (file)
@@ -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;