GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
GEAR.h
1 // -*- C++ -*-
2 #ifndef GEAR_GEAR_H
3 #define GEAR_GEAR_H 1
4 
5 #include <map>
6 #include <vector>
7 #include <string>
8 #include <exception>
9 
10 #include "gear/GearConfig.h"
11 
12 // version macros are now defined with cmake
13 //#define GEAR_MAJOR_VERSION 0
14 //#define GEAR_MINOR_VERSION 14
15 //#define GEAR_VERSION_GE( MAJV , MINV ) ( ( GEAR_MAJOR_VERSION > MAJV ) || ( (GEAR_MAJOR_VERSION==MAJV) && ( GEAR_MINOR_VERSION >= MINV ) ) )
16 
17 #include "gearimpl/Vectors.h"
18 
19 
20 namespace gear {
21 
22 
23  typedef Vector2D Point2D ;
24  typedef Vector3D Point3D ;
25 
26  typedef std::vector<int> IntVec ;
27  typedef std::vector<double> DoubleVec ;
28  typedef std::vector<std::string> StringVec ;
29 
30 
32  typedef long long long64 ;
33  // FIXME: needs to be only long on 64bit machines -> flags??
34 
35 
41  class Exception : public std::exception {
42 
43 
44  protected:
45  std::string message{} ;
46 
47  Exception(){ /*no_op*/ ; }
48 
49  public:
50  virtual ~Exception() { /*no_op*/; }
51 
52  Exception( const std::string& text ){
53  message = "gear::Exception: " + text ;
54  }
55 
56  virtual const char* what() const noexcept { return message.c_str() ; }
57 
58  };
59 
60 
65  class ParseException : public Exception{
66 
67  protected:
68  ParseException() { /*no_op*/ ; }
69  public:
70  virtual ~ParseException() { /*no_op*/; }
71 
72  ParseException( std::string text ){
73  message = "gear::ParseException: " + text ;
74  }
75  };
76 
82 
83  protected:
84  NotImplementedException() { /*no_op*/ ; }
85 
86  public:
87  NotImplementedException( std::string text ){
88  message = "gear::NotImplementedException: " + text ;
89  }
90  virtual ~NotImplementedException() { /*no_op*/; }
91 
92  };
93 
100 
101  protected:
102  UnknownParameterException() { /*no_op*/ ; }
103 
104  public:
105  UnknownParameterException( std::string text ){
106  message = "gear::UnknownParameterException: " + text ;
107  }
108  virtual ~UnknownParameterException() { /*no_op*/; }
109 
110  };
111 
119 
120  protected:
121  OutsideGeometryException() { /*no_op*/ ; }
122 
123  public:
124  OutsideGeometryException( std::string text ){
125  message = "gear::OutsideGeometryException: " + text ;
126  }
127  virtual ~OutsideGeometryException() { /*no_op*/; }
128 
129  };
130 
131 
133  struct SensorID{
134  SensorID() : layer(0), side(0), module(0), sensor(0) {}
135  int layer ;
136  int side ;
137  int module ;
138  int sensor ;
139  } ;
140 
141 
142 }
143 
144 namespace gear {
145 
146 // namespace
149 class GEAR {
150 
151 public:
153  virtual ~GEAR() { /* nop */; }
154 
155 
156 
157  public:
158  static const char* GEARPARAMETERS ;
159  static const char* TPCPARAMETERS ;
160  static const char* CALORIMETERPARAMETERS ;
161  static const char* ZPLANARPARAMETERS ;
162  static const char* FTDPARAMETERS ;
163  static const char* SIPLANESPARAMETERS ;
164  static const char* TRACKERPLANESPARAMETERS ;
165 
166 
167 }; // class
168 } // namespace gear
169 #endif /* ifndef GEAR_GEAR_H */
Base exception class for GEAR - all other exceptions extend this.
Definition: GEAR.h:41
NotImplementedException used for features that are not implemented.
Definition: GEAR.h:81
long long long64
64 bit integer,e.g.to be used for cellids
Definition: GEAR.h:32
UnknownParameterException call Processor::end().
Definition: GEAR.h:99
ParseException used for parse errors, e.g.
Definition: GEAR.h:65
OutsideGeometryException used if user asks for info from geometry tree where no node is defined...
Definition: GEAR.h:118
virtual ~GEAR()
Destructor.
Definition: GEAR.h:153
Helper struct for decoding a sensor ID.
Definition: GEAR.h:133
Global constants used in GEAR.
Definition: GEAR.h:149