File indexing completed on 2025-08-05 08:16:49
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef PHGENFIT_FITTER_H
0009 #define PHGENFIT_FITTER_H
0010
0011
0012
0013 #include <phgenfit/Track.h>
0014
0015 #include <GenFit/EventDisplay.h>
0016 #include "GenFit/Exception.h"
0017
0018 #include <string>
0019
0020
0021
0022
0023
0024
0025
0026 class TGeoManager;
0027 class PHField;
0028
0029 namespace genfit
0030 {
0031 class AbsKalmanFitter;
0032 class AbsBField;
0033 }
0034
0035 namespace PHGenFit
0036 {
0037
0038 class Fitter
0039 {
0040 public:
0041 enum FitterType
0042 {
0043 KalmanFitter,
0044 KalmanFitterRefTrack,
0045 DafSimple,
0046 DafRef
0047 };
0048 enum TrackRepType
0049 {
0050 RKTrackRep
0051 };
0052
0053
0054 Fitter(const std::string& tgeo_file_name,
0055 const PHField* field,
0056 const std::string& fitter_choice = "KalmanFitterRefTrack",
0057 const std::string& track_rep_choice = "RKTrackRep",
0058 const bool doEventDisplay = false);
0059
0060 Fitter(TGeoManager* tgeo_manager,
0061 genfit::AbsBField* fieldMap,
0062 const std::string& fitter_choice = "KalmanFitterRefTrack",
0063 const std::string& track_rep_choice = "RKTrackRep",
0064 const bool doEventDisplay = false);
0065
0066 Fitter(TGeoManager* tgeo_manager,
0067 genfit::AbsBField* fieldMap,
0068 const PHGenFit::Fitter::FitterType& fitter_choice = PHGenFit::Fitter::KalmanFitter,
0069 const PHGenFit::Fitter::TrackRepType& track_rep_choice = PHGenFit::Fitter::RKTrackRep,
0070 const bool doEventDisplay = false);
0071
0072
0073 ~Fitter();
0074 explicit Fitter(const Fitter&) = delete;
0075 Fitter& operator=(const Fitter&) = delete;
0076
0077 static Fitter* getInstance(const std::string& tgeo_file_name,
0078 const PHField* field,
0079 const std::string& fitter_choice = "KalmanFitterRefTrack",
0080 const std::string& track_rep_choice = "RKTrackRep",
0081 const bool doEventDisplay = false);
0082
0083 static Fitter* getInstance(TGeoManager* tgeo_manager,
0084 const PHField* field,
0085 const std::string& fitter_choice = "KalmanFitterRefTrack",
0086 const std::string& track_rep_choice = "RKTrackRep",
0087 const bool doEventDisplay = false);
0088
0089 static Fitter* getInstance(TGeoManager* tgeo_manager,
0090 const PHField* field,
0091 const PHGenFit::Fitter::FitterType& fitter_choice = PHGenFit::Fitter::KalmanFitter,
0092 const PHGenFit::Fitter::TrackRepType& track_rep_choice = PHGenFit::Fitter::RKTrackRep,
0093 const bool doEventDisplay = false);
0094
0095 int processTrack(PHGenFit::Track* track, const bool save_to_evt_disp = false);
0096
0097 int displayEvent();
0098
0099 bool is_do_Event_Display() const
0100 {
0101 return _doEventDisplay;
0102 }
0103
0104 void set_do_Event_Display(bool doEventDisplay)
0105 {
0106 _doEventDisplay = doEventDisplay;
0107 if (!_display && _doEventDisplay)
0108 _display = genfit::EventDisplay::getInstance();
0109 }
0110
0111 genfit::EventDisplay* getEventDisplay()
0112 {
0113 return _display;
0114 }
0115
0116 int get_verbosity() const
0117 {
0118 return verbosity;
0119 }
0120
0121 void set_verbosity(int v)
0122 {
0123 this->verbosity = v;
0124 if (verbosity >= 1)
0125 genfit::Exception::quiet(false);
0126 else
0127 genfit::Exception::quiet(true);
0128 }
0129
0130 private:
0131
0132
0133
0134
0135
0136
0137
0138
0139 int verbosity;
0140
0141 TGeoManager* _tgeo_manager;
0142
0143 bool _doEventDisplay;
0144
0145 genfit::EventDisplay* _display;
0146 genfit::AbsKalmanFitter* _fitter;
0147
0148 };
0149
0150 }
0151
0152 #endif