FairRoot/PandaRoot
createGeoSim.C
Go to the documentation of this file.
1 // Extracts the TOP volume of a geomanager
2 // Ralf Kliemt 05.03.2010
3 createGeoSim(TString infile = "TrackingStation.root")
4 {
5 // TString infile = "TrackingStation.root";
6 // TString outfile = "TrackingStationSim.root";
8  outfile.ReplaceAll(".root","Sim.root");
9  TString topVolumeName = "TS";
10  TString geomanagerName = "FAIRGeom";
11 
12  // load libraries
13  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
14 
15  TFile* fileIn = new TFile(infile,"READ");
16 
17  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject(geomanagerName.Data());
18  TGeoVolume *top = gGeoMan->GetTopVolume();
19  if(topVolumeName!="") top->SetName(topVolumeName);
20 
21  TFile* fileOut = new TFile(outfile,"RECREATE");
22  top->Write();
23  fileOut->Close();
24 
25  fileIn->Close();
26  //top->Draw("ogl");
27 }
28 
TGeoManager * gGeoMan
TGeoVolume * top
createGeoSim(TString infile="TrackingStation.root")
Definition: createGeoSim.C:3
TFile infile("dedx_out.root","READ")
TString outfile