EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxTrack.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxTrack.h
1 #ifndef TRACKBASEHISTORIC_SVTXTRACK_H
2 #define TRACKBASEHISTORIC_SVTXTRACK_H
3 
4 #include "SvtxTrackState.h"
5 
6 #include <trackbase/TrkrDefs.h>
7 
8 #include <g4main/PHG4HitDefs.h>
9 #include <phool/PHObject.h>
10 
11 #include <limits.h>
12 #include <cmath>
13 #include <iostream>
14 #include <map>
15 #include <set>
16 
17 class SvtxTrack : public PHObject
18 {
19  public:
20  typedef std::map<float, SvtxTrackState*> StateMap;
21  typedef StateMap::const_iterator ConstStateIter;
22  typedef StateMap::iterator StateIter;
23 
24  typedef std::set<unsigned int> ClusterSet;
25  typedef ClusterSet::const_iterator ConstClusterIter;
26  typedef ClusterSet::iterator ClusterIter;
27 
28  typedef std::set<TrkrDefs::cluskey> ClusterKeySet;
29  typedef ClusterKeySet::const_iterator ConstClusterKeyIter;
30  typedef ClusterKeySet::iterator ClusterKeyIter;
31 
32  enum CAL_LAYER
33  {
34  PRES = 0,
35  CEMC = 1,
36  HCALIN = 2,
37  HCALOUT = 3
38  };
39 
40  ~SvtxTrack() override = default;
41 
42  // The "standard PHObject response" functions...
43  void identify(std::ostream& os = std::cout) const override
44  {
45  os << "SvtxTrack base class" << std::endl;
46  }
47 
48  int isValid() const override { return 0; }
49  PHObject* CloneMe() const override { return nullptr; }
50 
52  using PHObject::CopyFrom;
53 
55  virtual void CopyFrom( const SvtxTrack& )
56  {}
57 
59  virtual void CopyFrom( SvtxTrack* )
60  {}
61 
62  //
63  // basic track information ---------------------------------------------------
64  //
65 
66  virtual unsigned int get_id() const { return UINT_MAX; }
67  virtual void set_id(unsigned int) {}
68 
69  virtual unsigned int get_vertex_id() const { return UINT_MAX; }
70  virtual void set_vertex_id(unsigned int) {}
71 
72  virtual bool get_positive_charge() const { return false; }
73  virtual void set_positive_charge(bool) {}
74 
75  virtual int get_charge() const { return -1; }
76  virtual void set_charge(int) {}
77 
78  virtual float get_chisq() const { return NAN; }
79  virtual void set_chisq(float) {}
80 
81  virtual unsigned int get_ndf() const { return UINT_MAX; }
82  virtual void set_ndf(int) {}
83 
84  virtual float get_quality() const { return NAN; }
85 
86  virtual float get_dca() const { return NAN; }
87  virtual void set_dca(float) {}
88 
89  virtual float get_dca_error() const { return NAN; }
90  virtual void set_dca_error(float) {}
91 
92  virtual float get_dca2d() const { return NAN; }
93  virtual void set_dca2d(float) {}
94 
95  virtual float get_dca2d_error() const { return NAN; }
96  virtual void set_dca2d_error(float) {}
97 
98  virtual float get_dca3d_xy() const { return NAN; }
99  virtual void set_dca3d_xy(float) {}
100 
101  virtual float get_dca3d_xy_error() const { return NAN; }
102  virtual void set_dca3d_xy_error(float) {}
103 
104  virtual float get_dca3d_z() const { return NAN; }
105  virtual void set_dca3d_z(float) {}
106 
107  virtual float get_dca3d_z_error() const { return NAN; }
108  virtual void set_dca3d_z_error(float) {}
109 
110  virtual float get_x() const { return NAN; }
111  virtual void set_x(float) {}
112 
113  virtual float get_y() const { return NAN; }
114  virtual void set_y(float) {}
115 
116  virtual float get_z() const { return NAN; }
117  virtual void set_z(float) {}
118 
119  virtual float get_pos(unsigned int) const { return NAN; }
120 
121  virtual float get_px() const { return NAN; }
122  virtual void set_px(float) {}
123 
124  virtual float get_py() const { return NAN; }
125  virtual void set_py(float) {}
126 
127  virtual float get_pz() const { return NAN; }
128  virtual void set_pz(float) {}
129 
130  virtual float get_mom(unsigned int) const { return NAN; }
131 
132  virtual float get_p() const { return NAN; }
133  virtual float get_pt() const { return NAN; }
134  virtual float get_eta() const { return NAN; }
135  virtual float get_phi() const { return NAN; }
136 
137  virtual float get_error(int /*i*/, int /*j*/) const { return NAN; }
138  virtual void set_error(int /*i*/, int /*j*/, float /*value*/) {}
139 
140  //
141  // state methods -------------------------------------------------------------
142  //
143  virtual bool empty_states() const { return false; }
144  virtual size_t size_states() const { return 0; }
145  virtual size_t count_states(float /*pathlength*/) const { return 0; }
146  virtual void clear_states() {}
147 
148  virtual const SvtxTrackState* get_state(float /*pathlength*/) const { return nullptr; }
149  virtual SvtxTrackState* get_state(float /*pathlength*/) { return nullptr; }
150  virtual SvtxTrackState* insert_state(const SvtxTrackState*) { return nullptr; }
151  virtual size_t erase_state(float /*pathlength*/) { return 0; }
152 
153  virtual ConstStateIter begin_states() const;
154  virtual ConstStateIter find_state(float pathlength) const;
155  virtual ConstStateIter end_states() const;
156 
157  virtual StateIter begin_states();
158  virtual StateIter find_state(float pathlength);
159  virtual StateIter end_states();
160 
161  //
162  // associated cluster ids methods --------------------------------------------
163  //
164 
165  // needed by old tracking
166 
168  virtual void clear_clusters() {}
170  virtual bool empty_clusters() const { return false; }
172  virtual size_t size_clusters() const { return 0; }
173 
175  virtual void insert_cluster(unsigned int /*clusterid*/) {}
177  virtual size_t erase_cluster(unsigned int /*clusterid*/) { return 0; }
179  virtual ConstClusterIter begin_clusters() const;
181  virtual ConstClusterIter find_cluster(unsigned int /*clusterid*/) const;
183  virtual ConstClusterIter end_clusters() const;
185  virtual ClusterIter begin_clusters();
187  virtual ClusterIter find_cluster(unsigned int clusterid);
189  virtual ClusterIter end_clusters();
190 
191  // needed by new tracking
192  virtual void clear_cluster_keys() {}
193  virtual bool empty_cluster_keys() const { return false; }
194  virtual size_t size_cluster_keys() const { return 0; }
195 
196  virtual void insert_cluster_key(TrkrDefs::cluskey /*clusterid*/) {}
197  virtual size_t erase_cluster_key(TrkrDefs::cluskey /*clusterid*/) { return 0; }
198  virtual ConstClusterKeyIter find_cluster_key(TrkrDefs::cluskey clusterid) const;
199  virtual ConstClusterKeyIter begin_cluster_keys() const;
200  virtual ConstClusterKeyIter end_cluster_keys() const;
202  virtual ClusterKeyIter find_cluster_keys(unsigned int clusterid);
204 
205  //
206  // calo projection methods ---------------------------------------------------
207  //
208  virtual float get_cal_dphi(CAL_LAYER /*layer*/) const { return 0.; }
209  virtual void set_cal_dphi(CAL_LAYER /*layer*/, float /*dphi*/) {}
210 
211  virtual float get_cal_deta(CAL_LAYER /*layer*/) const { return 0.; }
212  virtual void set_cal_deta(CAL_LAYER /*layer*/, float /*deta*/) {}
213 
214  virtual float get_cal_energy_3x3(CAL_LAYER /*layer*/) const { return 0.; }
215  virtual void set_cal_energy_3x3(CAL_LAYER /*layer*/, float /*energy_3x3*/) {}
216 
217  virtual float get_cal_energy_5x5(CAL_LAYER /*layer*/) const { return 0.; }
218  virtual void set_cal_energy_5x5(CAL_LAYER /*layer*/, float /*energy_5x5*/) {}
219 
220  virtual unsigned int get_cal_cluster_id(CAL_LAYER /*layer*/) const { return 0; }
221  virtual void set_cal_cluster_id(CAL_LAYER /*layer*/, unsigned int /*id*/) {}
222 
223  virtual TrkrDefs::cluskey get_cal_cluster_key(CAL_LAYER /*layer*/) const { return 0; }
224  virtual void set_cal_cluster_key(CAL_LAYER /*layer*/, TrkrDefs::cluskey /*key*/) {}
225 
226  virtual float get_cal_cluster_e(CAL_LAYER /*layer*/) const { return 0.; }
227  virtual void set_cal_cluster_e(CAL_LAYER /*layer*/, float /*e*/) {}
228 
229  // Acts methods for use by Acts modules only
230  virtual float get_acts_covariance(unsigned int /*i*/, unsigned int /*j*/) const { return NAN;}
231  virtual void set_acts_covariance(unsigned int /*i*/, unsigned int /*j*/, float /*value*/) {}
232 
233 
234 
235  //
236  // truth track interface ---------------------------------------------------
237  //
238 
239  //SvtxTrack_FastSim
240  virtual unsigned int get_truth_track_id() const { return UINT_MAX; }
241  virtual void set_truth_track_id(unsigned int) {}
242  virtual void set_num_measurements(int) {}
243  virtual unsigned int get_num_measurements() const { return 0; }
244 
245  //SvtxTrack_FastSim_v1
246  typedef std::map<int, std::set<PHG4HitDefs::keytype> > HitIdMap;
247  typedef HitIdMap::iterator HitIdIter;
248  typedef HitIdMap::const_iterator HitIdConstIter;
249 
250  virtual bool empty_g4hit_id() const { return true; }
251  virtual size_t size_g4hit_id() const { return 0; }
252  virtual void add_g4hit_id(int /*volume*/, PHG4HitDefs::keytype /*id*/) {}
253  virtual HitIdIter begin_g4hit_id();
254  virtual HitIdConstIter begin_g4hit_id() const;
255  virtual HitIdIter find_g4hit_id(int /*volume*/);
256  virtual HitIdConstIter find_g4hit_id(int /*volume*/) const;
257  virtual HitIdIter end_g4hit_id();
258  virtual HitIdConstIter end_g4hit_id() const;
259  virtual size_t remove_g4hit_id(int /*volume*/, PHG4HitDefs::keytype /*id*/) { return 0; }
260  virtual size_t remove_g4hit_volume(int /*volume*/) { return 0; }
261  virtual void clear_g4hit_id() {}
262  virtual const HitIdMap& g4hit_ids() const;
263 
264  protected:
266 
268 };
269 
270 #endif