|
VMC Version 2.1
|
The Root IO manager for VMC examples for both sequential and multi-threaded applications. More...
#include <TMCRootManager.h>
Public Types | |
| enum | FileMode { kRead , kWrite } |
| Root file mode. More... | |
Public Member Functions | |
| TMCRootManager (const char *projectName, FileMode fileMode=kWrite, Int_t threadRank=-1) | |
| virtual | ~TMCRootManager () |
| void | Register (const char *name, const char *className, void *objAddress) |
| void | Register (const char *name, const char *className, const void *objAddress) |
| void | Fill () |
| void | WriteAll () |
| void | Close () |
| void | WriteAndClose () |
| void | ReadEvent (Int_t i) |
Static Public Member Functions | |
| static TMCRootManager * | Instance () |
| static void | SetDebug (Bool_t debug) |
| static Bool_t | GetDebug () |
Private Member Functions | |
| TMCRootManager (const TMCRootManager &rhs) | |
| TMCRootManager & | operator= (const TMCRootManager &rhs) |
| void | OpenFile (const char *projectName, FileMode fileMode, Int_t threadRank) |
Private Attributes | |
| Int_t | fId |
| TFile * | fFile |
| TTree * | fTree |
| Bool_t | fIsClosed |
Static Private Attributes | |
| static Int_t | fgCounter = 0 |
| static Bool_t | fgDebug = false |
| static TMCThreadLocal TMCRootManager * | fgInstance = 0 |
The Root IO manager for VMC examples for both sequential and multi-threaded applications.
It facilitates use of ROOT IO in VMC examples and also handles necessary locking in multi-threaded applications.
Definition at line 31 of file TMCRootManager.h.
| TMCRootManager::TMCRootManager | ( | const char * | projectName, |
| TMCRootManager::FileMode | fileMode = kWrite, | ||
| Int_t | threadRank = -1 ) |
Standard constructor
| projectName | The project name (passed as the Root tree name) |
| fileMode | Option for opening Root file (read or write mode) |
| threadRank | The thread Id (-1 when sequential mode) |
Definition at line 52 of file TMCRootManager.cxx.
Referenced by Instance(), operator=(), and TMCRootManager().
|
virtual |
Destructor
Definition at line 91 of file TMCRootManager.cxx.
|
private |
|
static |
Definition at line 40 of file TMCRootManager.cxx.
|
inlinestatic |
Definition at line 87 of file TMCRootManager.h.
|
inlinestatic |
Definition at line 92 of file TMCRootManager.h.
| void TMCRootManager::Register | ( | const char * | name, |
| const char * | className, | ||
| void * | objAddress ) |
Create a branch and associates it with the given address.
| name | The branch name |
| className | The class name of the object |
| objAddress | The object address |
Definition at line 159 of file TMCRootManager.cxx.
Referenced by Register().
| void TMCRootManager::Register | ( | const char * | name, |
| const char * | className, | ||
| const void * | objAddress ) |
Create a branch and associates it with the given address.
| name | The branch name |
| className | The class name of the object |
| objAddress | The object address |
Definition at line 174 of file TMCRootManager.cxx.
| void TMCRootManager::Fill | ( | ) |
Fill the Root tree.
Definition at line 185 of file TMCRootManager.cxx.
| void TMCRootManager::WriteAll | ( | ) |
Write the Root tree in the file.
Definition at line 194 of file TMCRootManager.cxx.
Referenced by WriteAndClose().
| void TMCRootManager::Close | ( | ) |
Close the Root file.
Definition at line 203 of file TMCRootManager.cxx.
Referenced by WriteAndClose().
| void TMCRootManager::WriteAndClose | ( | ) |
Write the Root tree in the file and close the file
Definition at line 218 of file TMCRootManager.cxx.
| void TMCRootManager::ReadEvent | ( | Int_t | i | ) |
Read the event data for i -th event for all connected branches.
| i | The event to be read |
Definition at line 227 of file TMCRootManager.cxx.
|
private |
|
private |
Definition at line 119 of file TMCRootManager.cxx.
Referenced by TMCRootManager().
|
staticprivate |
Definition at line 65 of file TMCRootManager.h.
Referenced by TMCRootManager(), and ~TMCRootManager().
|
staticprivate |
Definition at line 67 of file TMCRootManager.h.
Referenced by GetDebug(), OpenFile(), SetDebug(), TMCRootManager(), and ~TMCRootManager().
|
staticprivate |
Definition at line 70 of file TMCRootManager.h.
Referenced by Instance(), and TMCRootManager().
|
private |
Definition at line 79 of file TMCRootManager.h.
Referenced by TMCRootManager().
|
private |
Definition at line 80 of file TMCRootManager.h.
Referenced by Close(), Fill(), OpenFile(), Register(), TMCRootManager(), WriteAll(), and ~TMCRootManager().
|
private |
Definition at line 81 of file TMCRootManager.h.
Referenced by Fill(), OpenFile(), ReadEvent(), Register(), and TMCRootManager().
|
private |
Definition at line 82 of file TMCRootManager.h.
Referenced by Close(), TMCRootManager(), and ~TMCRootManager().