StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
build_geom.C
1 //usr/bin/env root4star -l -b -q $0; exit $?
2 // that is a valid shebang to run script as executable
3 
4 
5 void build_geom( TString geomtag = "dev2022", TString output="fGeom.root" ) {
6 
7  gSystem->Load( "libStarRoot.so" );
8 
9  //gROOT->SetMacroPath("/star-sw/StRoot/macros/");
10  // gROOT->SetMacroPath(".:./StRoot/macros:./StRoot/macros/graphics:./StRoot/macros/analysis:./StRoot/macros/test:./StRoot/macros/examples:./StRoot/macros/html:./StRoot/macros/qa:./StRoot/macros/calib:./StRoot/macros/mudst:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/graphics:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/analysis:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/test:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/examples:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/html:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/qa:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/calib:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/mudst:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/macros:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/tutorials");
11  gROOT->SetMacroPath(".:/star-sw/StRoot/macros/:./StRoot/macros:./StRoot/macros/graphics:./StRoot/macros/analysis:./StRoot/macros/test:./StRoot/macros/examples:./StRoot/macros/html:./StRoot/macros/qa:./StRoot/macros/calib:./StRoot/macros/mudst:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/graphics:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/analysis:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/test:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/examples:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/html:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/qa:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/calib:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/mudst:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/macros:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/tutorials");
12  gROOT->LoadMacro("bfc.C");
13  bfc(0, "fzin agml sdt20211016", "" );
14 
15  gSystem->Load("libStarClassLibrary.so");
16  gSystem->Load("libStEvent.so" );
17 
18  // Force build of the geometry
19  TFile *geom = TFile::Open( output.Data() );
20 
21  if ( 0 == geom ) {
22  AgModule::SetStacker( new StarTGeoStacker() );
23  AgPosition::SetDebug(2);
24  StarGeometry::Construct("dev2022");
25 
26  // Genfit requires the geometry is cached in a ROOT file
27  gGeoManager->Export( output.Data() );
28  cout << "Writing output to geometry file [" << output.Data() << "]" << endl;
29  }
30  else {
31  cout << "WARNING: Geometry file [" << output.Data() << "] already exists." << endl;
32  cout << "Existting without doing anything!" << endl;
33  delete geom;
34  }
35 
36 }