EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairGeoLoader.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairGeoLoader.cxx
1 /***************************************************************************
2  FairGeoLoader.cxx - description
3  -------------------
4  begin : Thu Jun 17 2004
5  copyright : (C) 2004 by ilse koenig , M. Al-turany
6  email : m.al-turany@gsi.de
7  ***************************************************************************/
8 
9 #include "FairGeoLoader.h"
10 
11 #include "FairGeoInterface.h"
12 #include "FairGeoRootBuilder.h"
13 //#include "FairGeoG3Builder.h"
14 
15 #include "TGeoManager.h"
16 
17 #include <iostream>
18 #include <cstdlib>
19 
20 using std::cout;
21 using std::endl;
22 
24 //_____________________________________________________________________________
26 {
27  return fgInstance;
28 }
29 //_____________________________________________________________________________
31  :TNamed(),
32  fInterface(NULL),
33  fGeoBuilder(NULL)
34 {
35  fgInstance=this;
36 }
37 //_____________________________________________________________________________
38 FairGeoLoader::FairGeoLoader(const char* Name, const char* title)
39  :TNamed(Name,title),
40  fInterface(NULL),
41  fGeoBuilder(NULL)
42 {
43  if (fgInstance) {
44  Fatal("FairGeoLoader", "Singleton instance already exists.");
45  return;
46  }
47  fgInstance = this;
49  if ( strncmp(Name,"TGeo",4) == 0 ) {
50  TGeoManager* geom = new TGeoManager("FAIRGeom", "FAIR geometry");
51  fGeoBuilder=new FairGeoRootBuilder("TGeo builder","geometry builder");
52  ((FairGeoRootBuilder*)fGeoBuilder)->setGeoManager(geom);
53  } else if ( strncmp(Name,"G3Native",8) == 0) {
54  cout << "-I- FairGeoLoader() : Native G3 Geometry is used: This option is not supported any more!" << endl;
55  exit(0);
56  // gGeoManager = NULL;
57  // fGeoBuilder=new FairGeoG3Builder("G3 builder","geometry builder");
58  }
59 
61 
62 }
63 //_____________________________________________________________________________
65 {
66  delete fInterface;
67 
68 }
69 //_____________________________________________________________________________
70