GEAR  1.6.1
 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_unexpected( gear_unexpected ) ;
40  std::set_terminate( gear_unexpected ) ;
41 
42  if( argc < 2 ) {
43  std::cout << " printParameters: " << std::endl
44  << " usage: printParameters input.xml " << std::endl ;
45  exit(1) ;
46  }
47 
48  std::string fileName( argv[1] ) ;
49 
50  GearXML gearXML( fileName ) ;
51 
52  GearMgr* gearMgr = gearXML.createGearMgr() ;
53 
54 
55  std::cout << std::endl
56  << " printParameters - instantiated GearMgr from file " << fileName
57  << std::endl << std::endl ;
58 
59  std::cout << *gearMgr << std::endl ;
60 
61 }
62 
63 
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