SFrame 3.6
|
Special object type for the outputs produced by a cycle. More...
#include <core/include/SCycleOutput.h>
Public Member Functions | |
SCycleOutput (TObject *object=0, const char *name="", const char *path="") | |
Constructor with child object and name. | |
virtual | ~SCycleOutput () |
Destructor. | |
TObject * | GetObject () const |
Get the wrapped object. | |
void | SetObject (TObject *object) |
Set the pointer to the wrapped object. | |
const TString & | GetPath () const |
Get the output path of the wrapped object. | |
void | SetPath (const TString &path) |
Set the output path of the wrapped object. | |
Int_t | Merge (TCollection *list) |
Merge the contents of other objects into this one. | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write the wrapped object in the correct output directory (const version) | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write the wrapped object in the correct output directory (non-const version) |
Special object type for the outputs produced by a cycle.
In order to specify an output directory for the objects produced in a cycle, the objects can't be put directly into the output list of TSelector. Instead I wrap them into such an object.
The trickiest part of this class is the Merge function that takes care of summing up the results obtained from the individual worder nodes.
Definition at line 43 of file SCycleOutput.h.
SCycleOutput::SCycleOutput | ( | TObject * | object = 0 , |
const char * | name = "" , |
||
const char * | path = "" |
||
) |
Constructor with child object and name.
The constructor just initialises the base class and the member(s) to meaningul defauls.
object | Pointer to the object that should be wrapped |
name | Name of this object. The SCycleBase* classes should make sure that this is unique |
Definition at line 45 of file SCycleOutput.cxx.
SCycleOutput::~SCycleOutput | ( | ) | [virtual] |
Destructor.
Since this wrapper class owns the object it wraps, it deletes it when it is deleted itself.
Definition at line 56 of file SCycleOutput.cxx.
TObject * SCycleOutput::GetObject | ( | ) | const |
Get the wrapped object.
Definition at line 64 of file SCycleOutput.cxx.
Referenced by SCycleBaseHist::Book(), Merge(), and SCycleBaseHist::Retrieve().
const TString & SCycleOutput::GetPath | ( | ) | const |
Get the output path of the wrapped object.
Definition at line 78 of file SCycleOutput.cxx.
Int_t SCycleOutput::Merge | ( | TCollection * | coll | ) |
Merge the contents of other objects into this one.
Now this is a tricky one. In order to be able to merge trees, histograms, and any other kinds of ROOT objects, this function has to be very generic. (Remember, TObject doesn't define a "Merge" function!) Much of the code here is inspired by ROOT code. (I mean I never would've figured out the usage of TMethodCall without seeing some examples...)
coll | Collection of objects to merge into this one. Usually PROOF takes care of creating it. |
Definition at line 99 of file SCycleOutput.cxx.
References DEBUG, SLogger::endmsg(), GetObject(), REPORT_ERROR, and WARNING.
void SCycleOutput::SetObject | ( | TObject * | object | ) |
Set the pointer to the wrapped object.
object | Pointer to the wrapped object |
Definition at line 72 of file SCycleOutput.cxx.
void SCycleOutput::SetPath | ( | const TString & | path | ) |
Set the output path of the wrapped object.
Definition at line 83 of file SCycleOutput.cxx.
Int_t SCycleOutput::Write | ( | const char * | name = 0 , |
Int_t | option = 0 , |
||
Int_t | bufsize = 0 |
||
) | [virtual] |
Write the wrapped object in the correct output directory (non-const version)
Definition at line 279 of file SCycleOutput.cxx.
References Write().
Int_t SCycleOutput::Write | ( | const char * | name = 0 , |
Int_t | option = 0 , |
||
Int_t | bufsize = 0 |
||
) | const [virtual] |
Write the wrapped object in the correct output directory (const version)
This function is also quite tricky. It basically does two things:
Definition at line 188 of file SCycleOutput.cxx.
References DEBUG, SLogger::endmsg(), REPORT_ERROR, and REPORT_VERBOSE.
Referenced by Write().