From 9f575717e81178fc20b39eb8e381a51dfe931e7c Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 24 Jun 2005 08:20:53 +0000 Subject: [PATCH] 24-jun-2005 NvE Selection/overruling of specific job folder creation introduced in AliJob::ExecuteJob and the AliJob (derived) instance explicitly removed from the ListOfTasks to prevent ROOT crashing when closing after execution. 24-jun-2005 NvE In the IceF2k docs and the icef2k.cc example macro the output file is not explicitly closed to allow interactive investigation of the output data tree when the macro is run in an interactive ROOT/CINT session. --- RALICE/AliJob.cxx | 40 ++++++++++++++++++---- RALICE/AliJob.h | 4 +-- RALICE/history.txt | 3 ++ RALICE/icepack/iceconvert/IceF2k.cxx | 6 ++-- RALICE/icepack/iceconvert/history.txt | 12 ++++--- RALICE/icepack/iceconvert/macros/icef2k.cc | 6 ++-- 6 files changed, 55 insertions(+), 16 deletions(-) diff --git a/RALICE/AliJob.cxx b/RALICE/AliJob.cxx index 1509d6a431c..002bfeb191e 100644 --- a/RALICE/AliJob.cxx +++ b/RALICE/AliJob.cxx @@ -40,8 +40,9 @@ // The latter provides faster access to the main object structure than // the GetObject (search) based procedures. // -// Optionally one may invoke the MakeFolder() memberfunction to provide -// in addition to the above the following job-specific folder structure : +// Optionally one may invoke the MakeFolder() memberfunction or use the +// "mode" argument of ExecuteJob (see below) to provide in addition to the above +// the following job-specific folder structure : // // * A folder which may serve as a whiteboard for transferring pointers to // objects which are posted there by the top level processor or any @@ -79,7 +80,9 @@ // called "AliJob-folders" as a sub-folder under the same name as the one // introduced in the constructor of the derived top level processor class. // The folder will only be created if the MakeFolder() member function has been -// invoked explicitly and when the first object is posted via the AddObject() +// invoked or when selected explicitly by the "mode" argument of ExecuteJob(). +// Actual creation of the folder environment (and internal array storage as well) +// only takes place when the first object is posted via the AddObject() // or SetMainObject() facilities. // // Execution of the (user defined) top level processor has to be invoked via @@ -89,6 +92,9 @@ // processor class with as argument the name of the top level processor instance // as specified by the user in the top level processor constructor. // This will allow stepwise (e.g. event-by-event) execution of the various sub-tasks. +// In addition the "mode" argument of ExecuteJob() may be used to select/overrule +// creation of the folder environment for the complete job. +// See the docs of ExecuteJob() for further details. // // It is the user's responsibility to invoke the sub-tasks via the // ExecuteTasks() statement at the appropriate location in the top level @@ -128,6 +134,10 @@ AliJob::~AliJob() // Note : The objects belonging to the various pointers in the array/folder // and the main processing object are NOT deleted by this base class. + // Remove this AliJob based instance into the ROOT task list + TSeqCollection* tasks=gROOT->GetListOfTasks(); + if (tasks) tasks->Remove(this); + if (fObjects) { delete fObjects; @@ -168,10 +178,24 @@ void AliJob::ListEnvironment() cout << endl; } /////////////////////////////////////////////////////////////////////////// -void AliJob::ExecuteJob() +void AliJob::ExecuteJob(Int_t mode) { // Invokation of the top level processor via its Exec() memberfunction. +// The input argument "mode" can be used to explicitly specify the +// (de)selection of the folder environment creation. +// +// mode = -1 : Explicitly prohibit folder creation for the complete job +// 0 : Folder creation selection steered by MakeFolder() +// 1 : Explicitly select creation of the folder environment +// for the complete job. +// +// The default is mode=0. +// // Note : Before execution gROOT is set as the global working directory. + + if (mode<0) fMakefolder=-1; + if (mode>0) fMakefolder=1; + gROOT->cd(); Exec(GetName()); } @@ -180,7 +204,11 @@ void AliJob::MakeFolder() { // Select creation of the folder structure in addition to the internal // array storage of objects. - fMakefolder=1; +// Creation of the folder structure is only activated if it was not +// explicitly forbidden by the specified "mode" on invokation of the +// ExecuteJob() memberfunction. + + if (!fMakefolder) fMakefolder=1; } /////////////////////////////////////////////////////////////////////////// TFolder* AliJob::GetFolder() const @@ -213,7 +241,7 @@ void AliJob::AddObject(TObject* obj) if (!fObjects) fObjects=new TObjArray(); - if (fMakefolder && !fFolder) + if (fMakefolder>0 && !fFolder) { // Create the top level environment folder for all AliJobs if needed TList* list=gROOT->GetListOfBrowsables(); diff --git a/RALICE/AliJob.h b/RALICE/AliJob.h index a9b402bb103..e597b87ffd9 100644 --- a/RALICE/AliJob.h +++ b/RALICE/AliJob.h @@ -16,7 +16,7 @@ class AliJob : public TTask AliJob(const char* name="AliJob",const char* title=""); // Constructor virtual ~AliJob(); // Destructor void ListEnvironment(); // Provide listing of the job environment - void ExecuteJob(); // Invokation of the top level processing + void ExecuteJob(Int_t mode=0); // Invokation of the top level processing void MakeFolder(); // Select creation of the folder structure TFolder* GetFolder() const; // Provide pointer to the whiteboard folder TObject* GetMainObject() const; // Provide pointer to the main object structure @@ -38,6 +38,6 @@ class AliJob : public TTask void SetMainObject(TObject* obj); // Store pointer to the main object structure - ClassDef(AliJob,2) // Base class for top level job in a task based procedure + ClassDef(AliJob,3) // Base class for top level job in a task based procedure }; #endif diff --git a/RALICE/history.txt b/RALICE/history.txt index 03fb3f7c0a3..b2cb1ea4766 100644 --- a/RALICE/history.txt +++ b/RALICE/history.txt @@ -625,6 +625,9 @@ Also main object pointer updated in case of a match with removal of object(s) from the specific job environment. 23-jun-2005 NvE Creation of specific job folder made optionally in AliJob. +24-jun-2005 NvE Selection/overruling of specific job folder creation introduced in AliJob::ExecuteJob + and the AliJob (derived) instance explicitly removed from the ListOfTasks to prevent + ROOT crashing when closing after execution. \ No newline at end of file diff --git a/RALICE/icepack/iceconvert/IceF2k.cxx b/RALICE/icepack/iceconvert/IceF2k.cxx index 12875cf41ad..f264af59182 100644 --- a/RALICE/icepack/iceconvert/IceF2k.cxx +++ b/RALICE/icepack/iceconvert/IceF2k.cxx @@ -89,9 +89,11 @@ // TDatabasePDG* pdg=q.GetPDG(); // if (pdg) pdg->Write(); // -// // Flush and close output file +// // Flush the output file. +// // The output file is not explicitly closed here +// // to allow ineractive investigation of the data tree +// // when this macro is run in an interactive ROOT/CINT session. // ofile->Write(); -// ofile->Close(); // //--- Author: Nick van Eijndhoven 11-mar-2005 Utrecht University //- Modified: NvE $Date$ Utrecht University diff --git a/RALICE/icepack/iceconvert/history.txt b/RALICE/icepack/iceconvert/history.txt index bc25c1a8ce7..70958630e94 100644 --- a/RALICE/icepack/iceconvert/history.txt +++ b/RALICE/icepack/iceconvert/history.txt @@ -11,8 +11,12 @@ The example macro icef2k.cc has been updated accordingly. 21-jun-2005 NvE Install scripts for gcc corrected to also include the rdmc stuff in the produced shared libs. -23-jun-2005 NvE Specification and consequently writing-out of datastructures made - optionally in IceF2k. This will allow IceF2k to be used as a facility - to investigate/analyse F2K data using the Ralice/IcePack analysis tools - without producing output data files. +23-jun-2005 NvE Specification of output file and consequently writing-out of the + produced datastructures made optionally in IceF2k. + This will allow IceF2k to be used as a facility to investigate/analyse + F2K data using the Ralice/IcePack analysis tools without producing output + data files. +24-jun-2005 NvE In the IceF2k docs and the icef2k.cc example macro the output file is + not explicitly closed to allow interactive investigation of the output + data tree when the macro is run in an interactive ROOT/CINT session. diff --git a/RALICE/icepack/iceconvert/macros/icef2k.cc b/RALICE/icepack/iceconvert/macros/icef2k.cc index 4ef8d4884fa..abe65326576 100644 --- a/RALICE/icepack/iceconvert/macros/icef2k.cc +++ b/RALICE/icepack/iceconvert/macros/icef2k.cc @@ -60,7 +60,9 @@ TDatabasePDG* pdg=q.GetPDG(); if (pdg) pdg->Write(); - // Flush and close the output file + // Flush the output file. + // The output file is not explicitly closed here + // to allow ineractive investigation of the data tree + // when this macro is run in an interactive ROOT/CINT session. ofile->Write(); - ofile->Close(); } -- 2.43.0