Logo ROOT  
Reference Guide
na49geomfile.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_geom
3 /// Before executing this macro, the file makegeometry.C must have been executed
4 ///
5 /// \macro_code
6 ///
7 /// \author Andrei Gheata
8 
9 void na49geomfile() {
10  gBenchmark->Start("geometry");
11  TGeometry *n49 =(TGeometry*)gROOT->FindObject("na49");
12  if (n49) {
13  TFile na("na49.root","RECREATE");
14  n49->Write();
15  na.Write();
16  }
17  gBenchmark->Show("geometry");
18 }
TBenchmark::Start
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition: TBenchmark.cxx:172
TGeometry
TGeometry description.
Definition: TGeometry.h:39
gBenchmark
R__EXTERN TBenchmark * gBenchmark
Definition: TBenchmark.h:59
na49geomfile
Definition: na49geomfile.py:1
TFile
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
TObject::Write
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:795
TBenchmark::Show
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition: TBenchmark.cxx:155
gROOT
#define gROOT
Definition: TROOT.h:406