ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fitter.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fitter.h
1 
8 #ifndef PHGENFIT_FITTER_H
9 #define PHGENFIT_FITTER_H
10 
11 // needed, it crashes on Ubuntu using singularity with local cvmfs install
12 // shared pointer later on uses this, forward declaration does not cut it
13 #include <phgenfit/Track.h>
14 
15 #include <GenFit/EventDisplay.h>
16 #include "GenFit/Exception.h"
17 
18 #include <string>
19 
20 //BOOST
21 //#include<boost/make_shared.hpp>
22 //
23 //#define SMART(expr) boost::shared_ptr<expr>
24 //#define NEW(expr) boost::make_shared<expr>
25 
26 class TGeoManager;
27 class PHField;
28 
29 namespace genfit
30 {
31 class AbsKalmanFitter;
32 class AbsBField;
33 } // namespace genfit
34 
35 namespace PHGenFit
36 {
37 
38 class Fitter
39 {
40  public:
42  {
47  };
49  {
51  };
52 
54  Fitter(const std::string& tgeo_file_name,
55  const PHField* field,
56  const std::string& fitter_choice = "KalmanFitterRefTrack",
57  const std::string& track_rep_choice = "RKTrackRep",
58  const bool doEventDisplay = false);
59 
60  Fitter(TGeoManager* tgeo_manager,
61  genfit::AbsBField* fieldMap,
62  const std::string& fitter_choice = "KalmanFitterRefTrack",
63  const std::string& track_rep_choice = "RKTrackRep",
64  const bool doEventDisplay = false);
65 
66  Fitter(TGeoManager* tgeo_manager,
67  genfit::AbsBField* fieldMap,
70  const bool doEventDisplay = false);
71 
73  ~Fitter();
74 
75  static Fitter* getInstance(const std::string& tgeo_file_name,
76  const PHField* field,
77  const std::string& fitter_choice = "KalmanFitterRefTrack",
78  const std::string& track_rep_choice = "RKTrackRep",
79  const bool doEventDisplay = false);
80 
81  static Fitter* getInstance(TGeoManager* tgeo_manager,
82  const PHField* field,
83  const std::string& fitter_choice = "KalmanFitterRefTrack",
84  const std::string& track_rep_choice = "RKTrackRep",
85  const bool doEventDisplay = false);
86 
87  static Fitter* getInstance(TGeoManager* tgeo_manager,
88  const PHField* field,
91  const bool doEventDisplay = false);
92 
93  int processTrack(PHGenFit::Track* track, const bool save_to_evt_disp = false);
94 
95  int displayEvent();
96 
97  bool is_do_Event_Display() const
98  {
99  return _doEventDisplay;
100  }
101 
102  void set_do_Event_Display(bool doEventDisplay)
103  {
104  _doEventDisplay = doEventDisplay;
105  if (!_display && _doEventDisplay)
106  _display = genfit::EventDisplay::getInstance();
107  }
108 
109  genfit::EventDisplay* getEventDisplay()
110  {
111  return _display;
112  }
113 
114  int get_verbosity() const
115  {
116  return verbosity;
117  }
118 
120  {
121  this->verbosity = verbosity;
122  if (verbosity >= 1)
123  genfit::Exception::quiet(false);
124  else
125  genfit::Exception::quiet(true);
126  }
127 
128  private:
138 
139  TGeoManager* _tgeo_manager;
140 
142 
143  genfit::EventDisplay* _display;
144  genfit::AbsKalmanFitter* _fitter;
145 
146 }; //class Fitter
147 
148 } // namespace PHGenFit
149 
150 #endif