Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SQReco.h
Go to the documentation of this file.
1 /*
2  * Entry class for all SpinQuest reconstruction
3  */
4 
5 #ifndef _SQRECO_H
6 #define _SQRECO_H
7 
8 #include <fun4all/SubsysReco.h>
9 
10 #include <vector>
11 #include <string>
12 #include <iostream>
13 #include <list>
14 #include <map>
15 
16 #include <TString.h>
17 
18 #include "GFFitter.h"
19 
20 class PHField;
21 
22 class Tracklet;
23 class KalmanFastTracking;
24 class KalmanFitter;
25 class EventReducer;
26 class SRawEvent;
27 class SRecEvent;
28 
29 class SQRun;
30 class SQSpillMap;
31 
32 class SQEvent;
33 class SQHitMap;
34 class SQHitVector;
35 class SQTrackVector;
36 
37 class TFile;
38 class TTree;
39 class TGeoManager;
40 class TClonesArray;
41 
42 class SQReco: public SubsysReco
43 {
44 public:
47 
48  SQReco(const std::string& name = "SQReco");
49  virtual ~SQReco();
50 
51  int Init(PHCompositeNode* topNode);
52  int InitRun(PHCompositeNode* topNode);
53  int process_event(PHCompositeNode* topNode);
54  int End(PHCompositeNode* topNode);
55 
56  void setInputTy(SQReco::INPUT_TYPE input_ty) { _input_type = input_ty; }
57  void setFitterTy(SQReco::FITTER_TYPE fitter_ty) { _fitter_type = fitter_ty; }
58 
59  const TString& get_eval_file_name() const { return _eval_file_name; }
60  void set_eval_file_name(const TString& evalFileName) { _eval_file_name = evalFileName; }
61 
62  const std::string& get_geom_file_name() const { return _geom_file_name; }
63  void set_geom_file_name(const std::string& geomFileName) { _geom_file_name = geomFileName; }
64 
65  bool is_KF_enabled() const { return _enable_KF; }
66  void set_enable_KF(bool enable) { _enable_KF = enable; }
67 
68  bool is_eval_enabled() const { return _enable_eval; }
69  void set_enable_eval(bool enable) { _enable_eval = enable; }
70  bool is_eval_dst_enabled() const { return _enable_eval_dst; }
71  void set_enable_eval_dst(bool enable) { _enable_eval_dst = enable; }
72  void add_eval_list(int listID);
73 
74  const TString& get_evt_reducer_opt() const { return _evt_reducer_opt; }
75  void set_evt_reducer_opt(const TString& opt) { _evt_reducer_opt = opt; }
76 
77  void set_legacy_rec_container(const bool b = true) { _legacy_rec_container = b; }
78 
79 private:
80 
81  int InitField(PHCompositeNode* topNode);
82  int InitGeom(PHCompositeNode* topNode);
83  int MakeNodes(PHCompositeNode* topNode);
84  int GetNodes(PHCompositeNode* topNode);
85 
86  int InitEvalTree();
87  int ResetEvalVars();
88 
89  SRawEvent* BuildSRawEvent();
90  int updateHitInfo(SRawEvent* sraw_event);
91 
92  bool fitTrackCand(Tracklet& tracklet, KalmanFitter* fitter);
93  bool fitTrackCand(Tracklet& tracklet, SQGenFit::GFFitter* fitter);
94 
95  void fillRecTrack(SRecTrack& recTrack);
96 
97  SQReco::INPUT_TYPE _input_type;
98  SQReco::FITTER_TYPE _fitter_type;
99 
100  bool _enable_eval;
101  TString _eval_file_name;
102  TTree* _eval_tree;
103  TClonesArray* _tracklets;
104  std::vector<int> _eval_listIDs;
105 
106  bool _enable_eval_dst;
107  TrackletVector* _tracklet_vector;
108 
109  TString _evt_reducer_opt;
110  KalmanFastTracking* _fastfinder;
111  EventReducer* _eventReducer;
112 
113  bool _enable_KF;
114  KalmanFitter* _kfitter;
115  SQGenFit::GFFitter* _gfitter;
116 
117  PHField* _phfield;
118  SQGenFit::GFField* _gfield;
119 
120  recoConsts* rc;
121 
122  size_t _event;
123 
124  SQRun* _run_header;
125  SQSpillMap* _spill_map;
126 
127  SQEvent* _event_header;
128  SQHitVector* _hit_vector;
129  SQHitVector* _triggerhit_vector;
130 
131  //map from the unique hitID to the index in the SQHitVector
132  std::map<int, size_t> _m_hitID_idx;
133  std::map<int, size_t> _m_trghitID_idx;
134 
135  bool _legacy_rec_container;
136  SRawEvent* _rawEvent;
137  SRecEvent* _recEvent;
138  SQTrackVector* _recTrackVec;
139 
140  std::string _geom_file_name;
141  TGeoManager* _t_geo_manager;
142 };
143 
144 #endif
void set_legacy_rec_container(const bool b=true)
Definition: SQReco.h:77
int Init(PHCompositeNode *topNode)
Definition: SQReco.cxx:86
An SQ interface class to hold a list of SQTrack objects.
Definition: SQTrackVector.h:19
bool is_eval_enabled() const
Definition: SQReco.h:68
FITTER_TYPE
Definition: SQReco.h:46
int process_event(PHCompositeNode *topNode)
Definition: SQReco.cxx:343
int InitRun(PHCompositeNode *topNode)
Definition: SQReco.cxx:91
transient DST object for field storage and access
Definition: PHField.h:13
void set_geom_file_name(const std::string &geomFileName)
Definition: SQReco.h:63
void set_enable_KF(bool enable)
Definition: SQReco.h:66
INPUT_TYPE
Definition: SQReco.h:45
An SQ interface class to hold a list of SQHit objects as std::map.
Definition: SQHitMap.h:23
void set_eval_file_name(const TString &evalFileName)
Definition: SQReco.h:60
virtual ~SQReco()
Definition: SQReco.cxx:83
An SQ interface class to hold a list of SQHit objects.
Definition: SQHitVector.h:32
Definition: SQReco.h:42
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
void setInputTy(SQReco::INPUT_TYPE input_ty)
Definition: SQReco.h:56
void set_evt_reducer_opt(const TString &opt)
Definition: SQReco.h:75
void set_enable_eval(bool enable)
Definition: SQReco.h:69
bool is_eval_dst_enabled() const
Definition: SQReco.h:70
An SQ interface class to hold the run-level info.
Definition: SQRun.h:18
const TString & get_eval_file_name() const
Definition: SQReco.h:59
const std::string & get_geom_file_name() const
Definition: SQReco.h:62
SQReco(const std::string &name="SQReco")
Definition: SQReco.cxx:48
An SQ interface class to hold a list of SQSpill objects.
Definition: SQSpillMap.h:19
const TString & get_evt_reducer_opt() const
Definition: SQReco.h:74
bool is_KF_enabled() const
Definition: SQReco.h:65
int End(PHCompositeNode *topNode)
Called at the end of all processing.
Definition: SQReco.cxx:462
void setFitterTy(SQReco::FITTER_TYPE fitter_ty)
Definition: SQReco.h:57
void set_enable_eval_dst(bool enable)
Definition: SQReco.h:71
void add_eval_list(int listID)
Definition: SQReco.cxx:665