GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
printParameters.cc
1 #include "gearimpl/FixedPadSizeDiskLayout.h"
2 #include "gearimpl/Util.h"
3 #include "gearxml/GearXML.h"
4 #include "gear/GearMgr.h"
5 #include "gear/GEAR.h"
6 
7 
8 #include <iostream>
9 #include <cstdlib>
10 #include <sstream>
11 
12 using namespace gear ;
13 
14 
15 void gear_unexpected(){
16 
17  try {
18 
19  throw ;
20 
21  } catch( std::exception& e) {
22 
23  std::cout << " A runtime error has occured : "
24  << e.what()
25  << std::endl
26  << " the program will have to be terminated - sorry." << std::endl ;
27  exit(1) ;
28  }
29 }
30 
31 
36 int main(int argc, char**argv){
37 
38 
39  std::set_terminate( gear_unexpected ) ;
40 
41  if( argc < 2 ) {
42  std::cout << " printParameters: " << std::endl
43  << " usage: printParameters input.xml " << std::endl ;
44  exit(1) ;
45  }
46 
47  std::string fileName( argv[1] ) ;
48 
49  GearXML gearXML( fileName ) ;
50 
51  GearMgr* gearMgr = gearXML.createGearMgr() ;
52 
53 
54  std::cout << std::endl
55  << " printParameters - instantiated GearMgr from file " << fileName
56  << std::endl << std::endl ;
57 
58  std::cout << *gearMgr << std::endl ;
59 
60 }
61 
62 
Implementation of GEAR using XML.
Definition: GearXML.h:18
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
Definition: GearMgr.h:36