Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootIO Class Reference

Root IO implementation for the persistency example. More...

#include <RootIO.hh>

Public Member Functions

virtual ~RootIO ()
 
void Write (std::vector< ExP01TrackerHit * > *)
 
void Close ()
 

Static Public Member Functions

static RootIOGetInstance ()
 

Protected Member Functions

 RootIO ()
 

Detailed Description

Root IO implementation for the persistency example.

Author
Witold POKORSKI
Date
2005-10-27

Definition at line 49 of file RootIO.hh.

Constructor & Destructor Documentation

RootIO::~RootIO ( )
virtual

Definition at line 63 of file RootIO.cc.

64 {}
RootIO::RootIO ( )
protected

Definition at line 50 of file RootIO.cc.

50  :fNevents(0)
51 {
52  // initialize ROOT
53  TSystem ts;
54  gSystem->Load("libExP01ClassesDict");
55 
56  //gDebug = 1;
57 
58  fFile = new TFile("hits.root","RECREATE");
59 }

Here is the caller graph for this function:

Member Function Documentation

void RootIO::Close ( )

Definition at line 96 of file RootIO.cc.

97 {
98  fFile->Close();
99 }

Here is the caller graph for this function:

RootIO * RootIO::GetInstance ( void  )
static

Definition at line 68 of file RootIO.cc.

69 {
70  if (instance == 0 )
71  {
72  instance = new RootIO();
73  }
74  return instance;
75 }
static RootIO * instance
Definition: RootIO.cc:46
RootIO()
Definition: RootIO.cc:50

Here is the call graph for this function:

Here is the caller graph for this function:

void RootIO::Write ( std::vector< ExP01TrackerHit * > *  hcont)

Definition at line 79 of file RootIO.cc.

80 {
81  fNevents++;
82 
83  std::ostringstream os;
84  os << fNevents;
85  std::string stevt = "Event_" + os.str();
86  const char* chevt = stevt.c_str();
87 
88  G4cout << "writing " << stevt << G4endl;
89 
90  fFile->WriteObject(hcont, chevt);
91 
92 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:


The documentation for this class was generated from the following files: