GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
testSiPlanesgear.cc
1 
2 #include "gearimpl/Util.h"
3 #include "gearxml/GearXML.h"
4 #include "gear/GearMgr.h"
5 #include "gear/GEAR.h"
6 #include "gear/SiPlanesParameters.h"
7 
8 #include <iostream>
9 #include <assert.h>
10 
11 #include <exception>
12 #include <cstdlib>
13 
14 #include <sstream>
15 #include <fstream>
16 
17 #include <math.h>
18 
19 
20 using namespace gear ;
21 
22 void testSiPlanes( const SiPlanesParameters& siplanesParams ) ;
23 
24 void gear_unexpected(){
25 
26  try {
27 
28  throw ;
29 
30  } catch( std::exception& e) {
31 
32  std::cout << " A runtime error has occured : "
33  << e.what()
34  << std::endl
35  << " the program will have to be terminated - sorry." << std::endl ;
36  exit(1) ;
37  }
38 }
39 
40 
41 
46 int main(int argc, char**argv){
47 
48 
49  std::set_terminate( gear_unexpected ) ;
50 
51  if( argc < 2 ) {
52  std::cout << " testgear: Testprogram for SiPlanes detector in gear. " << std::endl
53  << " usage: testgear GearOutput.xml " << std::endl ;
54  exit(1) ;
55  }
56 
57  std::string fileName( argv[1] ) ;
58 
59  GearXML gearXML( fileName ) ;
60 
61  GearMgr* gearMgr = gearXML.createGearMgr() ;
62 
63 
64  std::cout << " testSiPlanesgear - instantiated GearMgr from file " << fileName
65  << std::endl ;
66 
67  const SiPlanesParameters& vp =
68  dynamic_cast<const SiPlanesParameters&>( gearMgr->getSiPlanesParameters() ) ;
69 
70 
71  std::cout << " SiPlanes parameters : " << std::endl
72  << vp
73  << std::endl ;
74 
75 }
virtual const SiPlanesParameters & getSiPlanesParameters() const =0
Get the SiPlanes parameters.
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
Geometry properties of a pixel beam telescope needed for reconstruction code.