|
VMC Version 2.2
|
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... | |
| enum | StorageMode { kTTree , kRNTuple , kRNTupleParallel } |
Public Member Functions | |
| TMCRootManager (const char *projectName, FileMode fileMode=kWrite, Int_t threadRank=-1) | |
| virtual | ~TMCRootManager () |
| template<typename T> | |
| void | Register (const char *name, T *&obj) |
| void | Register (const char *name, const char *className, void *objAddress) |
| void | Register (const char *name, const char *className, const void *objAddress) |
| void | CreateRNTuple () |
| void | Fill () |
| void | WriteAll () |
| void | Close () |
| void | WriteAndClose () |
| void | ReadEvent (Int_t i) |
| TString | GetFileModifier () const |
| TMCVNtupleWriter * | GetNtupleWriter () |
Static Public Member Functions | |
| static TMCRootManager * | Instance () |
| static void | SetDebug (Bool_t debug) |
| static Bool_t | GetDebug () |
| static void | SetStorageMode (StorageMode mode) |
| static StorageMode | GetStorageMode () |
| static TString | GetFileModifier (StorageMode mode) |
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 {0} |
| TFile * | fFile {nullptr} |
| TMCVNtupleWriter * | fNtupleWriter {nullptr} |
| Bool_t | fIsClosed {false} |
Static Private Attributes | |
| static Int_t | fgCounter = 0 |
| static Bool_t | fgDebug = false |
| static StorageMode | fgStorageMode = kTTree |
| static TMCThreadLocal TMCRootManager * | fgInstance = nullptr |
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 33 of file TMCRootManager.h.
| Enumerator | |
|---|---|
| kTTree | |
| kRNTuple | |
| kRNTupleParallel | |
Definition at line 40 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 | >0 when MT mode, -1 when sequential mode |
Definition at line 103 of file TMCRootManager.cxx.
Referenced by Instance(), operator=(), and TMCRootManager().
|
virtual |
Destructor
Definition at line 143 of file TMCRootManager.cxx.
|
private |
|
static |
Definition at line 62 of file TMCRootManager.cxx.
|
inlinestatic |
Definition at line 105 of file TMCRootManager.h.
|
inlinestatic |
Definition at line 110 of file TMCRootManager.h.
|
static |
Definition at line 70 of file TMCRootManager.cxx.
|
inlinestatic |
Definition at line 115 of file TMCRootManager.h.
|
static |
Definition at line 86 of file TMCRootManager.cxx.
| void TMCRootManager::Register | ( | const char * | name, |
| T *& | obj ) |
Definition at line 121 of file TMCRootManager.h.
Referenced by Register(), Register(), and Register().
| 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 230 of file TMCRootManager.cxx.
| 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 246 of file TMCRootManager.cxx.
| void TMCRootManager::CreateRNTuple | ( | ) |
RNTuple must be create after registering all the user data to RNTupleModel For kTTree storage mode this function is empty.
Definition at line 257 of file TMCRootManager.cxx.
| void TMCRootManager::Fill | ( | ) |
Definition at line 266 of file TMCRootManager.cxx.
| void TMCRootManager::WriteAll | ( | ) |
Definition at line 272 of file TMCRootManager.cxx.
Referenced by WriteAndClose().
| void TMCRootManager::Close | ( | ) |
Close the Root file.
Definition at line 278 of file TMCRootManager.cxx.
Referenced by WriteAndClose().
| void TMCRootManager::WriteAndClose | ( | ) |
Write the Root tree in the file and close the file
Definition at line 299 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(entry) to be read |
Definition at line 308 of file TMCRootManager.cxx.
| TString TMCRootManager::GetFileModifier | ( | ) | const |
|
inline |
Definition at line 74 of file TMCRootManager.h.
|
private |
|
private |
Definition at line 174 of file TMCRootManager.cxx.
Referenced by TMCRootManager().
|
staticprivate |
Definition at line 82 of file TMCRootManager.h.
Referenced by TMCRootManager(), and ~TMCRootManager().
|
staticprivate |
Definition at line 84 of file TMCRootManager.h.
Referenced by GetDebug(), OpenFile(), SetDebug(), TMCRootManager(), and ~TMCRootManager().
|
staticprivate |
Definition at line 85 of file TMCRootManager.h.
Referenced by Close(), GetStorageMode(), OpenFile(), Register(), Register(), and SetStorageMode().
|
staticprivate |
Definition at line 88 of file TMCRootManager.h.
Referenced by Instance(), and TMCRootManager().
|
private |
Definition at line 97 of file TMCRootManager.h.
Referenced by Close(), and TMCRootManager().
|
private |
Definition at line 98 of file TMCRootManager.h.
Referenced by Close(), OpenFile(), and ~TMCRootManager().
|
private |
Definition at line 99 of file TMCRootManager.h.
Referenced by Close(), CreateRNTuple(), Fill(), GetNtupleWriter(), OpenFile(), ReadEvent(), Register(), Register(), WriteAll(), and ~TMCRootManager().
|
private |
Definition at line 100 of file TMCRootManager.h.
Referenced by Close(), and ~TMCRootManager().