MarlinTrk  2.2.0
IMarlinTrkSystem.h
1 #ifndef IMarlinTrkSystem_h
2 #define IMarlinTrkSystem_h
3 
4 #include "MarlinTrkDiagnostics.h"
5 
6 #include <exception>
7 #include "ConfigFlags.h"
8 
9 namespace MarlinTrk{
10  class IMarlinTrack ;
11 }
12 
13 
14 namespace MarlinTrk {
15 
19  class Exception : public std::exception {
20 
21  protected:
22  std::string message ;
23 
24  Exception(){ /*no_op*/ ; }
25 
26  public:
27  virtual ~Exception() throw() { /*no_op*/; }
28 
29  Exception( const std::string& text ){
30  message = "MarlinTrk::Exception: " + text ;
31  }
32 
33  virtual const char* what() const throw() { return message.c_str() ; }
34 
35  };
36 
37  //----------------------------------------------------------------------------------------------------
38 
46 
47  public:
48 
51  struct CFG {
53  static const unsigned useQMS = 1 ;
55  static const unsigned usedEdx = 2 ;
57  static const unsigned useSmoothing = 3 ;
58  //---
59  static const unsigned size = 4 ;
60 
61  } ;
62 
63 
65  virtual ~IMarlinTrkSystem() {};
66 
67 
71  void setOption(unsigned CFGOption, bool val) ;
72 
75  bool getOption( unsigned CFGOption) ;
76 
79  std::string getOptions() ;
80 
82  virtual std::string name() { return "Unknown" ; }
83 
87  virtual void init() = 0 ;
88 
89 
92  virtual MarlinTrk::IMarlinTrack* createTrack() = 0 ;
93 
94 
95 #ifdef MARLINTRK_DIAGNOSTICS_ON
96 
99  virtual void * getDiagnositicsPointer() = 0 ;
100 
101 #endif
102 
103  protected:
104 
105  ConfigFlags _cfg ;
106 
109  void registerOptions() ;
110 
111 
112 
113  private:
114 
115  IMarlinTrkSystem& operator=( const IMarlinTrkSystem&) ; // disallow assignment operator
116 
117 
118  } ;
119 
120 } // end of MarlinTrk namespace
121 
122 #endif
123 
void registerOptions()
Register the possible configuration options.
Definition: IMarlinTrkSystem.cc:23
void setOption(unsigned CFGOption, bool val)
Sets the specified option ( one of the constants defined in IMarlinTrkSystem::CFG ) to the given valu...
Definition: IMarlinTrkSystem.cc:6
static const unsigned usedEdx
Use multiple scattering in the track fits.
Definition: IMarlinTrkSystem.h:55
static const unsigned useSmoothing
Use smoothing when calling fit( bool fitDirection )
Definition: IMarlinTrkSystem.h:57
virtual ~IMarlinTrkSystem()
D'tor - cleans up any allocated resources.
Definition: IMarlinTrkSystem.h:65
virtual std::string name()
the name of the implementation
Definition: IMarlinTrkSystem.h:82
Interface for generic tracks in MarlinTrk.
Definition: IMarlinTrack.h:28
bool getOption(unsigned CFGOption)
Return the option's current value - false if option not defined.
Definition: IMarlinTrkSystem.cc:11
std::string getOptions()
String with all configuration options and their current values.
Definition: IMarlinTrkSystem.cc:16
Base class for tracking system implementations in MarlinTrk.
Definition: IMarlinTrkSystem.h:45
'Enums' for configuration options to be used with setOption().
Definition: IMarlinTrkSystem.h:51
virtual MarlinTrk::IMarlinTrack * createTrack()=0
Return an instance of IMarlinTrack corresponding to the current implementation.
Definition: ConfigFlags.h:15
Exception thrown in IMarlinTrk namespace (implemetations of IMarlinTrkSystem and IMarlinTrack).
Definition: IMarlinTrkSystem.h:19
virtual void init()=0
Initialise tracking system - to be called after configuration with setOption() - IMarlinTrkSystem can...
static const unsigned useQMS
Use multiple scattering in the track fits.
Definition: IMarlinTrkSystem.h:53