EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EICG4dRICHHit.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EICG4dRICHHit.h
1 #ifndef DRICHHIT_H
2 #define DRICHHIT_H
3 
4 #include <g4main/PHG4Hit.h>
5 #include <g4main/PHG4HitDefs.h>
6 #include <g4main/PHG4Hitv1.h>
7 
8 #include <climits> // for INT_MIN, ULONG_LONG_MAX
9 #include <cmath>
10 #include <cstdint>
11 #include <iostream>
12 #include <map>
13 #include <string>
14 #include <utility>
15 
16 #include <G4String.hh>
17 #include <G4ThreeVector.hh>
18 
19 class EICG4dRICHHit : public PHG4Hit
20 {
21  public:
22  EICG4dRICHHit() = default;
23  explicit EICG4dRICHHit(const PHG4Hit *g4hit);
24  virtual ~EICG4dRICHHit() = default;
25  void Reset();
26 
27  // accessors
28  int get_trkid() const { return trackid; }
29  G4ThreeVector get_position(const int i) const { return hitPos[i]; } // 0=hit-entry, 1=hit-exit
30  float get_x(const int i) const { return hitPos[i].x(); }
31  float get_y(const int i) const { return hitPos[i].y(); }
32  float get_z(const int i) const { return hitPos[i].z(); }
33  float get_t(const int i) const { return t[i]; }
34  G4ThreeVector get_momentum() const { return momVec; }
35  G4ThreeVector get_momentum_dir() const { return momDir; }
36  G4ThreeVector get_vertex_position() const { return vtxPos; }
37  G4ThreeVector get_vertex_momentum_dir() const { return vtxMomDir; }
38  float get_delta_t() const { return t[1] - t[0]; }
39  G4String get_hit_type_name() const { return hitTypeName; }
40  G4String get_hit_subtype_name() const { return hitSubtypeName; }
41  int get_petal() const { return petal; }
42  int get_psst() const { return psst; }
43  int get_pdg() const { return pdg; }
44  G4String get_particle_name() const { return pname; }
45  G4String get_process() const { return process; }
46  int get_parent_id() const { return parentID; }
47 
48  float get_edep() const { return edep; }
50  int get_detid() const;
51  int get_shower_id() const { return showerid; }
52 
53  // modifiers
54  void set_position(const int i, const G4ThreeVector v) { hitPos[i] = v; }
55  void set_momentum(const G4ThreeVector v) { momVec = v; }
56  void set_momentum_dir(const G4ThreeVector v) { momDir = v; }
57  void set_vertex_position(const G4ThreeVector v) { vtxPos = v; }
58  void set_vertex_momentum_dir(const G4ThreeVector v) { vtxMomDir = v; }
59  void set_t(const int i, const float f) { t[i] = f; }
60  void set_hit_type_name(const G4String s) { hitTypeName = s; }
61  void set_hit_subtype_name(const G4String s) { hitSubtypeName = s; }
62  void set_petal(const int i) { petal = i; }
63  void set_psst(const int i) { psst = i; }
64  void set_pdg(const int i) { pdg = i; }
65  void set_particle_name(const G4String s) { pname = s; }
66  void set_process(const G4String s) { process = s; }
67  void set_parent_id(const int i) { parentID = i; }
68 
69  void set_edep(const float f) { edep = f; }
70  void set_hit_id(const PHG4HitDefs::keytype i) { hitid = i; }
71  void set_shower_id(const int i) { showerid = i; }
72  void set_trkid(const int i) { trackid = i; }
73 
74  // diagnostics
75  virtual void print() const;
76 
77  protected:
78  float x[2] = {NAN, NAN};
79  float y[2] = {NAN, NAN};
80  float z[2] = {NAN, NAN};
81  float t[2] = {NAN, NAN};
82  G4ThreeVector hitPos[2];
83  G4ThreeVector momVec, momDir, vtxPos, vtxMomDir;
85  int petal = INT_MIN;
86  int psst = INT_MIN;
87  int pdg = INT_MIN;
88  G4String pname, process;
89  int parentID = -1;
90  PHG4HitDefs::keytype hitid = ULONG_LONG_MAX;
91  int trackid = INT_MIN;
92  int showerid = INT_MIN;
93  float edep = NAN;
94 };
95 
96 #endif