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