Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions
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 66 of file RootIO.cc.

67 {}
RootIO::RootIO ( )
protected

Definition at line 51 of file RootIO.cc.

Referenced by GetInstance().

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

Member Function Documentation

void RootIO::Close ( )

Definition at line 100 of file RootIO.cc.

Referenced by ExP01TrackerSD::~ExP01TrackerSD().

101 {
102  fFile->Close();
103 }
RootIO * RootIO::GetInstance ( void  )
static

Definition at line 71 of file RootIO.cc.

References RootIO().

Referenced by ExP01TrackerSD::EndOfEvent(), and ExP01TrackerSD::~ExP01TrackerSD().

72 {
73  if (instance == 0 )
74  {
75  instance = new RootIO();
76  }
77  return instance;
78 }
RootIO()
Definition: RootIO.cc:51
void RootIO::Write ( std::vector< ExP01TrackerHit * > *  hcont)

Definition at line 82 of file RootIO.cc.

Referenced by ExP01TrackerSD::EndOfEvent().

83 {
84  fNevents++;
85 
86  std::ostringstream os;
87  os << fNevents;
88  std::string stevt = "Event_" + os.str();
89  const char* chevt = stevt.c_str();
90 
91  std::cout << "writing " << stevt << std::endl;
92 
93 
94  fFile->WriteObject(hcont, chevt);
95 
96 }

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