|
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 } |
Public Member Functions | |
| TMCRootManager (const char *projectName, FileMode fileMode=kWrite, Int_t threadRank=-1) | |
| TMCRootManager (const char *projectName, StorageMode storageMode, FileMode fileMode=kWrite, Int_t threadRank=-1) | |
| TMCRootManager (std::shared_ptr< RNTParaWriter > sharedWriter) | |
| 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 | Fill () |
| void | WriteAll () |
| void | Close () |
| void | WriteAndClose () |
| void | ReadEvent (Int_t i) |
| void | CreateRNTuple (bool parallelMode=false, bool workerMode=false) |
| std::shared_ptr< RNTParaWriter > | GetParallelRNTupleWriter () |
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 {nullptr} |
| TTree * | fTree {nullptr} |
| std::string | fStorageName {} |
| std::vector< std::pair< std::string, void * > > | fNameAddress |
| std::unique_ptr< REntry > | fEntry |
| std::unique_ptr< RNTupleModel > | fModel |
| std::unique_ptr< RNTupleWriter > | fWriter |
| std::shared_ptr< RNTParaWriter > | fParaWriter |
| std::shared_ptr< RNTupleFillContext > | fFillContext |
| StorageMode | fStorageMode {kTTree} |
| Bool_t | fIsClosed {false} |
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 52 of file TMCRootManager.h.
| Enumerator | |
|---|---|
| kTTree | |
| kRNTuple | |
Definition at line 59 of file TMCRootManager.h.
| TMCRootManager::TMCRootManager | ( | const char * | projectName, |
| TMCRootManager::FileMode | fileMode = kWrite, | ||
| Int_t | threadRank = -1 ) |
Definition at line 72 of file TMCRootManager.cxx.
Referenced by Instance(), operator=(), TMCRootManager(), TMCRootManager(), and TMCRootManager().
| TMCRootManager::TMCRootManager | ( | const char * | projectName, |
| TMCRootManager::StorageMode | storageMode, | ||
| 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 78 of file TMCRootManager.cxx.
| TMCRootManager::TMCRootManager | ( | std::shared_ptr< RNTParaWriter > | sharedWriter | ) |
Definition at line 119 of file TMCRootManager.cxx.
|
virtual |
Destructor
Definition at line 139 of file TMCRootManager.cxx.
|
private |
|
static |
Definition at line 60 of file TMCRootManager.cxx.
|
inlinestatic |
Definition at line 136 of file TMCRootManager.h.
|
inlinestatic |
Definition at line 141 of file TMCRootManager.h.
| void TMCRootManager::Register | ( | const char * | name, |
| T *& | obj ) |
Definition at line 147 of file TMCRootManager.h.
Referenced by 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 216 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 231 of file TMCRootManager.cxx.
| void TMCRootManager::Fill | ( | ) |
| void TMCRootManager::WriteAll | ( | ) |
Write the Root tree in the file.
Write the RNTuple in the file.
Definition at line 300 of file TMCRootManager.cxx.
Referenced by WriteAndClose().
| void TMCRootManager::Close | ( | ) |
Close the Root file.
Definition at line 322 of file TMCRootManager.cxx.
Referenced by WriteAndClose().
| void TMCRootManager::WriteAndClose | ( | ) |
Write the Root tree in the file and close the file
Definition at line 342 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 351 of file TMCRootManager.cxx.
| void TMCRootManager::CreateRNTuple | ( | bool | parallelMode = false, |
| bool | workerMode = false ) |
Definition at line 243 of file TMCRootManager.cxx.
|
inline |
Definition at line 92 of file TMCRootManager.h.
|
private |
|
private |
Definition at line 167 of file TMCRootManager.cxx.
Referenced by TMCRootManager().
|
staticprivate |
Definition at line 101 of file TMCRootManager.h.
Referenced by TMCRootManager(), TMCRootManager(), and ~TMCRootManager().
|
staticprivate |
Definition at line 103 of file TMCRootManager.h.
Referenced by GetDebug(), OpenFile(), SetDebug(), TMCRootManager(), and ~TMCRootManager().
|
staticprivate |
Definition at line 106 of file TMCRootManager.h.
Referenced by Instance(), TMCRootManager(), and TMCRootManager().
|
private |
Definition at line 115 of file TMCRootManager.h.
Referenced by TMCRootManager(), and TMCRootManager().
|
private |
Definition at line 116 of file TMCRootManager.h.
Referenced by Close(), CreateRNTuple(), Fill(), OpenFile(), Register(), Register(), WriteAll(), and ~TMCRootManager().
|
private |
Definition at line 117 of file TMCRootManager.h.
Referenced by Fill(), OpenFile(), ReadEvent(), Register(), and Register().
|
private |
Definition at line 120 of file TMCRootManager.h.
Referenced by CreateRNTuple(), and OpenFile().
|
private |
Definition at line 121 of file TMCRootManager.h.
Referenced by CreateRNTuple(), and Register().
|
private |
Definition at line 122 of file TMCRootManager.h.
Referenced by CreateRNTuple(), Fill(), and WriteAll().
|
private |
Definition at line 123 of file TMCRootManager.h.
Referenced by CreateRNTuple(), OpenFile(), Register(), and WriteAll().
|
private |
Definition at line 124 of file TMCRootManager.h.
Referenced by CreateRNTuple(), Fill(), and WriteAll().
|
private |
Definition at line 125 of file TMCRootManager.h.
Referenced by Close(), CreateRNTuple(), Fill(), GetParallelRNTupleWriter(), TMCRootManager(), and WriteAll().
|
private |
Definition at line 126 of file TMCRootManager.h.
Referenced by CreateRNTuple(), Fill(), and WriteAll().
|
private |
Definition at line 129 of file TMCRootManager.h.
Referenced by CreateRNTuple(), Fill(), OpenFile(), Register(), TMCRootManager(), TMCRootManager(), and WriteAll().
|
private |
Definition at line 131 of file TMCRootManager.h.
Referenced by Close(), and ~TMCRootManager().