|
// // $Id: BrEventManager.cxx,v 1.2 2001/10/08 11:27:12 cholm Exp $ // #include <cstdio> #include <iostream.h> #include <iomanip.h> // // ROOT classes // // Brat classes #include <BrEventManager.h> #include <BrEvent.h> ClassImp(BrEventManager); ////////////////////////////////////////////////////////////////// // // BrEventManager // // This manager class will assits user module is retrieving general // event information regardless if a module has access to the EventHeader. // // // Sample code: // // The application can load the Manager and keep a global pointer // accesible via a Brat common application file. It is in fact // implemented via a Singleton mechanism. This enables us to use both // the global mechanism as well as the instantons. // // Main application will have // --------------------------- // BrEventManager *gEventMgr = // BrEventManager::Instance(); // // // // The application that reads the Event from DISK EVB etc // should call the event method for the EventManager i.e. // InputFile->Event(event); // if(InputFile->Eof()){ // cout << "End Of Data" << endl; // break; // } // gEventMgr->Event(event); // // // The user module should have (either in the Named Constructor // or in the Init() method. // ------------------------------------ // BrCalibrationManager *gParamDb = // BrCalibrationManager::Instance(); // // // At the time of Event the user code could access information e.g. // as such // BrEventManager *gEventMgr = // BrEventManager::Instance(); // // if(gEventMgr->IsEvent()){ // .... // } // int evno = gEventMgr->Event(); // if(gEventMgr->TriggerOn(6)){ // // collisions event // ... // } // // See also the TestEventManager.cxx in the brat/test directory //____________________________________________________ // // Static instance of // instanton. // BrEventManager* BrEventManager::fInstance=0; //____________________________________________________ // BrEventManager::BrEventManager(){ fState = INIT; } //____________________________________________________ BrEventManager* BrEventManager::Instance(){ if( fInstance == 0) fInstance = new BrEventManager; return fInstance; } //__________________________________________________ BrEventManager::~BrEventManager(){ } void BrEventManager::Event(const BrEvent* event) // // Extract Event runnumber from current event // and store in local variable. // This allows multiple modules to ask for // current values. // { if (!event) { fState = FAILED; return; } fRunNumber = event->GetRunNumber(); fEventNumber = event->GetEventNumber(); fEventType = event->GetEventType(); fTriggerType = event->GetTriggerMask(); fTime = event->GetTime(); fTriggerWord1 = event->GetEventHeader()->TriggerWord(1); fTriggerWord2 = event->GetEventHeader()->TriggerWord(2); fState = READ; } ////////////////////////////////////////////////////////////// // // $Log: BrEventManager.cxx,v $ // Revision 1.2 2001/10/08 11:27:12 cholm // Changed to use new DB access classes // // Revision 1.1.1.1 2001/06/21 14:55:15 hagel // Initial revision of brat2 // // Revision 1.2 2000/07/20 16:14:12 videbaek // Fixed problme in IsEventSync and IsEvent. // Added Finish method in Module container. // Moved comments CVSlog // // |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|