// $Log: BrModule.cxx,v $
// Revision 1.4 1998/04/06 21:11:51 videbaek
// Clean up and additions for Win95
//
// Revision 1.3 1998/03/09 20:53:51 videbaek
// Ensure that pointers are non-NULL before deleting
//
// Revision 1.2 1998/03/06 22:10:00 videbaek
// Working update
//
// Revision 1.1.1.1 1998/03/04 21:32:48 brahmlib
// Brat base
//
// $Id: BrModule.cxx,v 1.4 1998/04/06 21:11:51 videbaek Exp $
//
#include "BrModule.h"
#include "BrEventNode.h"
//
// Needed for Info
#ifndef ROOT_TClass
#include "TClass.h"
#endif
#include <iostream.h>
///////////////////////////////////////////////////////////
//
// BrModule
//
// BRAHMS Analysis Module Class
//
// A standard Physics analysis Module should be derived from
// this base class. This ensure that the general framework
// is capable of accessing these in a common and general way.
// The methods (member functions) consists of a general set for
// all modules; but the user if free to add specific ones for
// specific needs. Ideas for this has been taken from both the
// PHOBOS tool set as well as from the BABAR framework. The initial version
// is derived from the ROOT base classes,
//
// Author : Flemming Videbaek
// Created: 27/12/97
// Version: 1.0
//
///////////////////////////////////////////////////////////
ClassImp(BrModule)
BrModule::BrModule()
{
// Vanilla constructor; Should not be called within the ROOT environment.
//
d_Verbose = 0;
d_HistogramList_p = NULL;
d_DebugLevel = 0;
fCpuTime = 0;
fRequiredTableList = NULL;
}
BrModule::BrModule(Char_t *Name, Char_t *Title){
//
// Constructor. This is the default constructor to use. The names of the
// Modules can be used for navigation and identification.
//
SetName(Name);
if(Title)
SetTitle(Title);
else
SetTitle(Name);
d_Verbose = 0;
d_HistogramList_p = NULL;
d_DebugLevel = 0;
fCpuTime = 0;
fRequiredTableList = new TList();
}
BrModule::~BrModule()
{
//
// default destructor; Should not be called within the ROOT environment.
//
if(d_HistogramList_p)
delete d_HistogramList_p;
if(fRequiredTableList)
delete fRequiredTableList;
}
void BrModule::Event(){
//
// Event method with no Data objects. In normal application to be called once per event.
// The method should also be overwritten in the concrete class. A dummy
// routine is supplied in case a module for some strange reason is not called
// per event.
//
cout << "Calling Event from Module " << GetName() << endl;
};
void BrModule::Event(BrEventNode* inev, BrEventNode* outev){
//
// Default Event method with in/out Data objects. In normal application to be
// called once per event.
// method should also be overwritten in the concrete class. A dummy
// routine is supplied in case a module for some strange reason is not called
// per event.
//
if(d_Verbose != 0)
cout << "Calling Event from Module " << GetName() << endl;
};
void BrModule::Info() const {
// Information module. In the final implementation this MUST be overwritten by the derived
// class. Here a default behaviour is implemented.
cout << "**********************************************************n";
cout << "* Module *n";
cout << "* Class : " << IsA()->GetName()<< "n";
cout << "* Name : " << GetName() << "n";
cout << "* Title : " << GetTitle() << "n";
cout << "*n";
cout << "**********************************************************n";
cout << flush;
}
void BrModule::SetRequiredData(Char_t* name){
//
// Set the name of a required DataObject. The name will be stored in
// a list. The intent is that the calling Event method can check against
// the names (by calling a base Module member function which will search
// the input Event and return a pointer to the object.
//
// CheckDataObjects();
// GetDataObject
// Note none of this is implemented so far.
// 2/17/98
//
}
void BrModule::EventStatisticsStart() {
fTimer.Start();
}
void BrModule::EventStatisticsEnd() {
fTimer.Stop();
fCpuTime += fTimer.CpuTime();
}
void BrModule::ListEventStatistics() {
cout<<"Accumulated CPU time in "<<GetName()<<" is "<<fCpuTime<<endl;
}
ROOT page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.