Added dummy task for deleting geometry in Terminate of runCalibTrain (both cpass0...
authorshahoian <ruben.shahoyan@cern.ch>
Mon, 11 Aug 2014 16:30:46 +0000 (18:30 +0200)
committershahoian <ruben.shahoyan@cern.ch>
Mon, 11 Aug 2014 16:30:46 +0000 (18:30 +0200)
PWGPP/CalibMacros/CPass0/runCalibTrain.C
PWGPP/CalibMacros/CPass1/runCalibTrain.C
PWGPP/CalibMacros/commonMacros/CleanGeom.C [new file with mode: 0644]

index e830e7b..684d151 100644 (file)
@@ -18,6 +18,7 @@ void runCalibTrain(Int_t runNumber, const char *inFileName = "AliESDs.root", con
   //
   AliSysInfo::SetVerbose(kTRUE);
   AliLog::SetGlobalLogLevel(AliLog::kError); 
+  gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/commonMacros/CleanGeom.C++");
   gROOT->Macro("$ALICE_ROOT/PWGPP/CalibMacros/CPass0/LoadLibraries.C");
   gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/CPass0/ConfigCalibTrain.C");
 
@@ -43,6 +44,10 @@ void runCalibTrain(Int_t runNumber, const char *inFileName = "AliESDs.root", con
   AliSysInfo::AddStamp("BeforeConfiguringCalibTrain");
   ConfigCalibTrain(runNumber, ocdb);
   AliSysInfo::AddStamp("AfterConfiguringCalibTrain");  
+  
+  if (gROOT->LoadMacro("localOCDBaccessConfig.C")==0) {
+    localOCDBaccessConfig();
+  }  
 
   //
   // check the presence of the detectors
@@ -98,6 +103,13 @@ void runCalibTrain(Int_t runNumber, const char *inFileName = "AliESDs.root", con
   if (!okTPC) itsAlign->SetUseITSstandaloneTracks(kTRUE); 
   if (grpData->GetL3Current()[0] < 300) itsAlign->SetMinPt(0.001);
   //
+  // dummy task to clean geometry in Terminate >>>>
+  CleanGeom* clgmTask = new CleanGeom("cleanGeom");
+  mgr->AddTask(clgmTask);
+  AliAnalysisDataContainer *dummyInp = mgr->GetCommonInputContainer();
+  if (dummyInp) mgr->ConnectInput(clgmTask,0,dummyInp);
+  // dummy task to clean geometry in Terminate <<<<
+   //
   // Run the analysis
   AliSysInfo::AddStamp("BeforeInitAnalysis");
   if (!mgr->InitAnalysis()) {
index 28b4aab..ecdc6bb 100644 (file)
@@ -18,6 +18,7 @@ void runCalibTrain(Int_t runNumber, const char *inFileName = "AliESDs.root", con
   //
   AliSysInfo::SetVerbose(kTRUE);
   AliLog::SetGlobalLogLevel(AliLog::kError); 
+  gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/commonMacros/CleanGeom.C++");
   gROOT->Macro("$ALICE_ROOT/PWGPP/CalibMacros/CPass1/LoadLibraries.C");
   gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/CPass1/ConfigCalibTrain.C");
 
@@ -99,6 +100,13 @@ void runCalibTrain(Int_t runNumber, const char *inFileName = "AliESDs.root", con
   if (!okTPC) itsAlign->SetUseITSstandaloneTracks(kTRUE);
   if (grpData->GetL3Current()[0] < 300) itsAlign->SetMinPt(0.001); 
   //
+  // dummy task to clean geometry in Terminate >>>>
+  CleanGeom* clgmTask = new CleanGeom("cleanGeom");
+  mgr->AddTask(clgmTask);
+  AliAnalysisDataContainer *dummyInp = mgr->GetCommonInputContainer();
+  if (dummyInp) mgr->ConnectInput(clgmTask,0,dummyInp);
+  // dummy task to clean geometry in Terminate <<<<
+  //
   // Run the analysis
   AliSysInfo::AddStamp("BeforeInitAnalysis");
   if (!mgr->InitAnalysis()) {
diff --git a/PWGPP/CalibMacros/commonMacros/CleanGeom.C b/PWGPP/CalibMacros/commonMacros/CleanGeom.C
new file mode 100644 (file)
index 0000000..b901991
--- /dev/null
@@ -0,0 +1,14 @@
+#include <TGeoManager.h>
+#include <TChain.h>
+#include "AliAnalysisTask.h"
+#include "AliGeomManager.h"
+
+// dummy task to delete geometry in Terminate
+class CleanGeom : public AliAnalysisTask {
+public:
+  CleanGeom(const char *name, const char *title="dummy") : AliAnalysisTask(name,title)  {DefineInput(0, TChain::Class());}
+  virtual void Terminate(Option_t * = "") {delete AliGeomManager::GetGeometry();}
+  virtual void Exec(Option_t * = "") {}
+  ClassDef(CleanGeom,0)
+};
+ClassImp(CleanGeom)