Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxVertex_v2.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxVertex_v2.h
1 #ifndef TRACKBASEHISTORIC_SVTXVERTEXV1_H
2 #define TRACKBASEHISTORIC_SVTXVERTEXV1_H
3 
4 #include "SvtxVertex.h"
5 
6 #include <cstddef> // for size_t
7 #include <iostream>
8 #include <set>
9 
10 class PHObject;
11 
12 class SvtxVertex_v2 : public SvtxVertex
13 {
14  public:
15  SvtxVertex_v2();
16  ~SvtxVertex_v2() override {}
17 
18  // PHObject virtual overloads
19 
20  void identify(std::ostream& os = std::cout) const override;
21  void Reset() override { *this = SvtxVertex_v2(); }
22  int isValid() const override;
23  PHObject* CloneMe() const override { return new SvtxVertex_v2(*this); }
24 
25  // vertex info
26 
27  unsigned int get_id() const override { return _id; }
28  void set_id(unsigned int id) override { _id = id; }
29 
30  float get_t() const override { return _t0; }
31  void set_t(float t0) override { _t0 = t0; }
32 
33  float get_x() const override { return _pos[0]; }
34  void set_x(float x) override { _pos[0] = x; }
35 
36  float get_y() const override { return _pos[1]; }
37  void set_y(float y) override { _pos[1] = y; }
38 
39  float get_z() const override { return _pos[2]; }
40  void set_z(float z) override { _pos[2] = z; }
41 
42  float get_chisq() const override { return _chisq; }
43  void set_chisq(float chisq) override { _chisq = chisq; }
44 
45  unsigned int get_ndof() const override { return _ndof; }
46  void set_ndof(unsigned int ndof) override { _ndof = ndof; }
47 
48  float get_position(unsigned int coor) const override { return _pos[coor]; }
49  void set_position(unsigned int coor, float xi) override { _pos[coor] = xi; }
50 
51  float get_error(unsigned int i, unsigned int j) const override; //< get vertex error covar
52  void set_error(unsigned int i, unsigned int j, float value) override; //< set vertex error covar
53 
54  unsigned int get_beam_crossing() const override { return _beamcrossing; }
55  void set_beam_crossing(unsigned int cross) override { _beamcrossing = cross; }
56 
57  //
58  // associated track ids methods
59  //
60  void clear_tracks() override { _track_ids.clear(); }
61  bool empty_tracks() override { return _track_ids.empty(); }
62  size_t size_tracks() const override { return _track_ids.size(); }
63  void insert_track(unsigned int trackid) override { _track_ids.insert(trackid); }
64  size_t erase_track(unsigned int trackid) override { return _track_ids.erase(trackid); }
65  ConstTrackIter begin_tracks() const override { return _track_ids.begin(); }
66  ConstTrackIter find_track(unsigned int trackid) const override { return _track_ids.find(trackid); }
67  ConstTrackIter end_tracks() const override { return _track_ids.end(); }
68  TrackIter begin_tracks() override { return _track_ids.begin(); }
69  TrackIter find_track(unsigned int trackid) override { return _track_ids.find(trackid); }
70  TrackIter end_tracks() override { return _track_ids.end(); }
71 
72  private:
73  unsigned int covar_index(unsigned int i, unsigned int j) const;
74 
75  unsigned int _id; //< unique identifier within container
76  float _t0; //< collision time
77  float _pos[3]; //< collision position x,y,z
78  float _chisq; //< vertex fit chisq
79  unsigned int _ndof; //< degrees of freedom
80  float _err[6]; //< error covariance matrix (packed storage) (+/- cm^2)
81  std::set<unsigned int> _track_ids; //< list of track ids
82  unsigned int _beamcrossing;
83 
85 };
86 
87 #endif