StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AgML.C
1 void AgML(const Char_t *tag="y2013_2", const Char_t *geom="") {
2  TString Tag(tag);
3  TString Geom(geom);
4  if (Tag == "") {
5  cout << "Tag has not defined" << endl;
6  exit(1);
7  }
8  if (Geom == "") Geom = Tag;
9  gSystem->Load("StarAgmlLib");
10  // gSystem->Load("StarGeometry");
11  gSystem->Load("Geometry");
12  gSystem->AddIncludePath(" -IStRoot -Igeom -IStarVMC -IStarVMC/Geometry/macros -I$STAR/StRoot -Igeom -I$STAR/StarVMC -I$STAR/StarVMC/Geometry/macros ");
13  gErrorIgnoreLevel=9999; // Silence ROOT warnings for now
14  gGeoManager = new TGeoManager(Geom.Data(),Form("%s/AgML",Geom.Data()));
15  AgBlock::SetStacker( new StarTGeoStacker() ); // Creates TGeo geometry
16  Geometry *build = new Geometry(); // Instantiate the geometry
17  build -> ConstructGeometry ( Geom.Data() );
18 
19  gGeoManager->CloseGeometry();
20  // gGeoManager->Export(Form("%s.root",Geom.Data()));
21  TObjectSet *geomOS = new TObjectSet("Geometry",gGeoManager,kFALSE);
22  TFile *fOut = new TFile(Form("Geometry.%s.root",Tag.Data()),"recreate");
23  geomOS->Write();
24  fOut->Close();
25  TCollection::StartGarbageCollection();
26  delete fOut;
27  delete gGeoManager;
28 }
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Definition: TDataSet.cxx:893