1 |
formato |
1.1 |
#ifndef PAM_ROOT_MANAGER_H |
2 |
|
|
#define PAM_ROOT_MANAGER_H |
3 |
|
|
|
4 |
|
|
#include <TObject.h> |
5 |
|
|
#include <TTree.h> |
6 |
|
|
#include <TFile.h> |
7 |
|
|
#include <TDirectoryFile.h> |
8 |
|
|
|
9 |
|
|
class TParticle; |
10 |
|
|
|
11 |
|
|
enum FileMode { kRead, kWrite}; |
12 |
|
|
|
13 |
|
|
class PamRootManager : public TObject |
14 |
|
|
{ |
15 |
|
|
public: |
16 |
|
|
PamRootManager(const char* projectName, FileMode fileMode); |
17 |
|
|
PamRootManager(); |
18 |
|
|
virtual ~PamRootManager(); |
19 |
|
|
|
20 |
|
|
// static access method |
21 |
|
|
static PamRootManager* Instance(); |
22 |
|
|
|
23 |
|
|
// methods |
24 |
|
|
void Register(const char* name, const char* className, void* objAddress); |
25 |
|
|
void Fill(); |
26 |
|
|
void WriteAll(); |
27 |
|
|
void ReadEvent(Int_t i); |
28 |
|
|
|
29 |
|
|
private: |
30 |
|
|
// data members |
31 |
|
|
static PamRootManager* fgInstance; //Singleton instance |
32 |
|
|
|
33 |
|
|
// data members |
34 |
|
|
TDirectory * fDirectory; // directory to store root-file |
35 |
|
|
TFile* fFile; |
36 |
|
|
TTree* fTree; |
37 |
|
|
|
38 |
|
|
ClassDef(PamRootManager,0) // Root IO manager |
39 |
|
|
}; |
40 |
|
|
|
41 |
|
|
#endif //PAM_ROOT_MANAGER_H |
42 |
|
|
|
43 |
|
|
|