|
BrModuleContainerclass description - source file - inheritance tree class BrModuleContainer : public BrModulepublic: Data Membersprotected: See also
Class DescriptionBrModuleContainer ----------------- Class to manage modules to be executed in sequence in BRAHMS analysis Description: ----------------- This class is a container class for BRAHMS Analysis Modules. It is meant to be used to simplify like-kinds of analyis. This will set up a pipeline of modules that will be asked to go through each of the stages in the analysis. +-----------+ | Container | +-----------+ ||...| +------------+| +-----------+ | | | +----------+ +----------+ +----------+ | Module 1 | | Module 2 | ... | Module N | +----------+ +----------+ +----------+ -------------- Execution ---------------> Please note, that Modules do not see each other in this pipeline. They must communicate via a BrEvent, or some common Manager. Usage: ------ The Object is created, modules previously created are added to it and then is used in the event by event loop to call the Event method of each module that was added. Usage of this class essentially eliminates a loop. This also applies to the Book() and Init() methods implemented for all Modules See also the BrModule class description for more information, including a flow diagram of the execution of this and the BrModule classes. Example: -------- BrModuleContainer* digitize = new BrModuleContainer("digitize","Digitize Modules"); //add t1Digitize, ... previously created digitize->AddModule(t1Digitize); digitize->AddModule(t2Digitize); digitize->AddModule(t3Digitize); digitize->AddModule(t4Digitize); digitize->AddModule(t5Digitize); // Event Loop // Get GBRAHMS data and create BrEvent *geantevent BrEvent *digTable = new BrEvent("Digitized Table",0,0); digitize->Event(geantevent,digTable); // Analyze digTable as needed delete digTable; // End Event Loop See also BrModule class description for a ASCII art flow diagram for modules, module pipelines, and BRAT applications Packages: --------- Specialised containers, doing a specific set of task, such as doing a full tracking in a TPC or DC, can be defined in terms of the appropiate modules. Simply define a class Br<name>Package, inheriting from BrModuleContainer, and in the constructor of that class, add the needed modules. Should one desire to put all histograms of the contained module in one directory, the Book method can also be overwritten in the package. No other methods, except trivial Getters and Print should be defined in the package. Example of packages are BrGlbPackage, BrTpcHitPackage, and BrTpcTrackPackage. All packages should reside in the packages directory in the source tree of BRAT. Further information: -------------------- More information on the design of BRAT, in particular the module system can be found in "The Hitchhikers Guide to BRAT" avaliable in the doc subdiretory of the BRAT source tree. A pointer to a HTML version of that document should be in place at the BRAHMS computing webpage. Here BrModuleContainer() : BrModule() Default constructor. Normal use is named constructor. This method implemented for used by ROOT system, but should not every really be used, since modules (and therefore also containers) are not persistent. BrModuleContainer(const Char_t *name, const Char_t *title) : BrModule(name, title ? title : name) Constructor Set up Module list ~BrModuleContainer() Destructor Delete module list if it was created Int_t AddModule(BrModule *module) Routine to add a module to the list of modules to be executed Int_t AddModuleAt(BrModule *module, Int_t position) Add module at position. Exisiting module at position and subsequent modules will be pushed back. Int_t AddModuleBefore(BrModule* before, BrModule* module) Add a BrModule module before BrModule before. Module before and subsequent modules are pushed back. Before maybe null, in which case this is the same as AddFirst. Int_t AddModuleAfter(BrModule* after, BrModule* module) Add a BrModule module after BrModule after. Modules after module will be pushed back. After maybe null, in which case this is the same as AddLast. BrModule* RemoveModule(const Char_t* name) Remove the module named name from the container, and return a pointer to that module. Please note, that the module is _not_ deleted. If no match on name was found, return 0. This method is usefull in the case you have a package, but you don't really want to do all the things is does. For example, to analyse global data output from a BRAG simulation, we'd like to use BrGlbPackage, since that's what's used for real data passes. However, since there's currently (Sat Aug 18 12:09:16 2001) no digisation output from BrZdcDigModule, we don't want the BrZdcRdoModule in the package. We can therefor simply remove that module from the package, by doing: BrGlbPackage* glbPackage = new BrGlbPackage("glb", "glb"); mainModule->AddModule(glbPackage); if (!useZdc) { TString name = BrDetectorList::GetDetectorName(kBrZDC); glbPackage->RemoveModule(name.Data()); } void Begin() The method to be used run by run to reinitialize the modules in this container. The loop over the modules will immediately halt, should one of the modules status become kStop, the status of this container is set to kFailure, and the method returns. void Book() The method can be used to call Booking for all modules in a container. The loop over the modules will immediately halt, should one of the modules status become bigger than or equal to fStatusLimit, the status of this container is set to that status, and the method returns. void End() The method to be used run by run to finish the modules in this container. The loop over the modules will immediately halt, should one of the modules status become bigger than or equal to fStatusLimit, the status of this container is set to that status, and the method returns. void Event() The method to be used event by event in case there are no arguments in the Event method of the modules in the list. The loop over the modules will immediately halt, should one of the modules status become bigger than or equal to fStatusLimit, the status of this container is set to that status, and the method returns. void Event(BrEventNode* indat, BrEventNode* outdat) The method to be used event by event in case there is an input table and output table in the Event method of the modules in the list. The loop over the modules will immediately halt, should one of the modules status become bigger than or equal to fStatusLimit, the status of this container is set to that status, and the method returns. void Finish() The method can be used to call Finishing for all modules in a container. The loop over the modules will immediately halt, should one of the modules status become bigger than or equal to fStatusLimit, the status of this container is set to that status, and the method returns. void Print(Option_t* option) Print information on all modules Options (see also BrModule::Print()) R Recusrsively print module information This non-const version only exists for backward compatiblity with ROOT pre3. void Print(Option_t* option) const Print information on all modules Options (see also BrModule::Print()) R Recusrsively print module information void Init() The method can be used to call Init for all modules in a container. Init is always implemented as a dummy default at the minimum. The loop over the modules will immediately halt, should one of the modules status become bigger than or equal to fStatusLimit, the status of this container is set to that status, and the method returns. void ListEventStatistics() Call The ListEventStatistics for all Modules in the container void ListModules() Routine to list the names of all modules that have been added. void Reset() Set the status of all contained modules to kOk. void SetDebugLevel(const int level) Set debug level of all contained modules void SetVerbose(const int level) Set the verbosity of all contained modules void SetStatusLimit(EBrModuleStatus status=kStop) Set the limit for when to stop module pipeline Inline FunctionsInt_t AddModuleFirst(BrModule* m) Int_t AddModuleLast(BrModule* m) BrModule* ModuleAt(Int_t idx) const BrModule* FindModule(const BrModule* obj) const BrModule* FindModule(const Char_t* name) const BrModule* RemoveModule(BrModule* module) BrModule* RemoveModuleAt(Int_t i) void SetOwner(Bool_t enable = kTRUE) TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) BrModuleContainer BrModuleContainer(BrModuleContainer&) |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|