Belle II Software  release-08-01-10
TOPBarHit.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <framework/datastore/RelationsObject.h>
12 #include <TVector3.h>
13 #include <Math/Vector3D.h>
14 #include <Math/Point3D.h>
15 
16 namespace Belle2 {
28  class TOPBarHit : public RelationsObject {
29  public:
30 
35  {}
36 
51  int moduleID,
52  int PDG,
53  ROOT::Math::XYZPoint origin,
54  ROOT::Math::XYZPoint impact,
55  ROOT::Math::XYZVector momentum,
56  double time,
57  double length,
58  ROOT::Math::XYZPoint impactLoc,
59  double theta,
60  double phi
61  )
62  {
63  m_moduleID = moduleID;
64  m_pdg = PDG;
65  m_x0 = (float) origin.X();
66  m_y0 = (float) origin.Y();
67  m_z0 = (float) origin.Z();
68  m_x = (float) impact.X();
69  m_y = (float) impact.Y();
70  m_z = (float) impact.Z();
71  m_px = (float) momentum.X();
72  m_py = (float) momentum.Y();
73  m_pz = (float) momentum.Z();
74  m_time = (float) time;
75  m_length = (float) length;
76  m_xloc = (float) impactLoc.X();
77  m_yloc = (float) impactLoc.Y();
78  m_zloc = (float) impactLoc.Z();
79  m_theta = (float) theta;
80  m_phi = (float) phi;
81  }
82 
87  int getModuleID() const { return m_moduleID;}
88 
93  int getPDG() const { return m_pdg; }
94 
99  ROOT::Math::XYZPoint getProductionPoint() const {return ROOT::Math::XYZPoint(m_x0, m_y0, m_z0);}
100 
105  ROOT::Math::XYZPoint getPosition() const { return ROOT::Math::XYZPoint(m_x, m_y, m_z);}
106 
112  TVector3 getPositionTVector3() const { return TVector3(m_x, m_y, m_z);}
113 
118  ROOT::Math::XYZPoint getLocalPosition() const { return ROOT::Math::XYZPoint(m_xloc, m_yloc, m_zloc);}
119 
124  ROOT::Math::XYZVector getMomentum() const {return ROOT::Math::XYZVector(m_px, m_py, m_pz);}
125 
131  TVector3 getMomentumTVector3() const {return TVector3(m_px, m_py, m_pz);}
132 
137  double getLength() const { return m_length; }
138 
143  double getTime() const { return m_time; }
144 
149  double getTheta() const {return m_theta;}
150 
155  double getPhi() const {return m_phi;}
156 
157  private:
158 
159  int m_moduleID = 0;
160  int m_pdg = 0;
161  float m_x0 = 0;
162  float m_y0 = 0;
163  float m_z0 = 0;
164  float m_x = 0;
165  float m_y = 0;
166  float m_z = 0;
167  float m_px = 0;
168  float m_py = 0;
169  float m_pz = 0;
170  float m_time = 0;
171  float m_length = 0;
172  float m_xloc = 0;
173  float m_yloc = 0;
174  float m_zloc = 0;
175  float m_theta = 0;
176  float m_phi = 0;
180  };
181 
182 
184 } // end namespace Belle2
185 
186 
Defines interface for accessing relations of objects in StoreArray.
Class to store track parameters of incoming MC particles relation to MCParticle filled in top/simulat...
Definition: TOPBarHit.h:28
float m_z0
production point, z component
Definition: TOPBarHit.h:163
float m_time
impact time
Definition: TOPBarHit.h:170
float m_xloc
impact point, x component in local (bar) frame
Definition: TOPBarHit.h:172
TVector3 getPositionTVector3() const
Returns impact point TODO: to be removed when the constructor from GenVector classes is provided in E...
Definition: TOPBarHit.h:112
ROOT::Math::XYZPoint getLocalPosition() const
Returns impact point.
Definition: TOPBarHit.h:118
float m_zloc
impact point, z component in local (bar) frame
Definition: TOPBarHit.h:174
double getPhi() const
Returns azimuthal angle in local (bar) frame.
Definition: TOPBarHit.h:155
float m_phi
impact azimuthal angle in local (bar) frame
Definition: TOPBarHit.h:176
ROOT::Math::XYZPoint getPosition() const
Returns impact point.
Definition: TOPBarHit.h:105
int m_moduleID
TOP module ID.
Definition: TOPBarHit.h:159
int m_pdg
PDG code of particle.
Definition: TOPBarHit.h:160
float m_py
impact momentum, y component
Definition: TOPBarHit.h:168
float m_y0
production point, y component
Definition: TOPBarHit.h:162
TOPBarHit()
Default constructor.
Definition: TOPBarHit.h:34
int getModuleID() const
Returns module ID.
Definition: TOPBarHit.h:87
ROOT::Math::XYZPoint getProductionPoint() const
Returns production point.
Definition: TOPBarHit.h:99
float m_pz
impact momentum, z component
Definition: TOPBarHit.h:169
TOPBarHit(int moduleID, int PDG, ROOT::Math::XYZPoint origin, ROOT::Math::XYZPoint impact, ROOT::Math::XYZVector momentum, double time, double length, ROOT::Math::XYZPoint impactLoc, double theta, double phi)
Full constructor.
Definition: TOPBarHit.h:50
int getPDG() const
Returns PDG code of particle.
Definition: TOPBarHit.h:93
float m_x0
production point, x component
Definition: TOPBarHit.h:161
float m_px
impact momentum, x component
Definition: TOPBarHit.h:167
ClassDef(TOPBarHit, 3)
ClassDef.
TVector3 getMomentumTVector3() const
Returns impact momentum TODO: to be removed when the constructor from GenVector classes is provided i...
Definition: TOPBarHit.h:131
float m_y
impact point, y component
Definition: TOPBarHit.h:165
ROOT::Math::XYZVector getMomentum() const
Returns impact momentum.
Definition: TOPBarHit.h:124
float m_length
length of particle trajectory to impact point
Definition: TOPBarHit.h:171
float m_yloc
impact point, y component in local (bar) frame
Definition: TOPBarHit.h:173
float m_z
impact point, z component
Definition: TOPBarHit.h:166
float m_x
impact point, x component
Definition: TOPBarHit.h:164
double getTheta() const
Returns polar angle in local (bar) frame.
Definition: TOPBarHit.h:149
double getLength() const
Returns tract length from production to impact point.
Definition: TOPBarHit.h:137
double getTime() const
Returns time of impact.
Definition: TOPBarHit.h:143
float m_theta
impact polar angle in local (bar) frame
Definition: TOPBarHit.h:175
Abstract base class for different kinds of events.