Belle II Software  light-2205-abys
PCmsLabTransform.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 <mdst/dbobjects/CollisionBoostVector.h>
12 #include <mdst/dbobjects/CollisionInvariantMass.h>
13 #include <framework/database/DBObjPtr.h>
14 #include <framework/geometry/B2Vector3.h>
15 
16 #include <Math/Boost.h>
17 #include <Math/LorentzRotation.h>
18 #include <Math/Vector4D.h>
19 
20 namespace Belle2 {
30 
31  public:
32 
37 
42  {
43  return m_boostVectorDB->getBoost();
44  }
45 
49  double getCMSEnergy() const
50  {
51  return m_invariantMassDB->getMass();
52  }
53 
57  ROOT::Math::PxPyPzEVector getBeamFourMomentum() const
58  {
59  return rotateCmsToLab() * ROOT::Math::PxPyPzEVector(0, 0, 0, getCMSEnergy());
60  }
61 
66  const ROOT::Math::LorentzRotation rotateLabToCms() const
67  {
68  ROOT::Math::LorentzRotation rotation(ROOT::Math::Boost(-1.*getBoostVector()));
69  return rotation;
70  }
71 
76  const ROOT::Math::LorentzRotation rotateCmsToLab() const
77  {
78  return rotateLabToCms().Inverse();
79  }
80 
86  static ROOT::Math::PxPyPzMVector labToCms(const ROOT::Math::PxPyPzMVector& vec);
87 
93  static ROOT::Math::PxPyPzMVector cmsToLab(const ROOT::Math::PxPyPzMVector& vec);
94 
100  static ROOT::Math::PxPyPzEVector labToCms(const ROOT::Math::PxPyPzEVector& vec);
101 
107  static ROOT::Math::PxPyPzEVector cmsToLab(const ROOT::Math::PxPyPzEVector& vec);
108 
109  private:
112  };
113 
115 } // Belle2 namespace
116 
117 
118 
119 
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Class to hold Lorentz transformations from/to CMS and boost vector.
ROOT::Math::PxPyPzEVector getBeamFourMomentum() const
Returns LAB four-momentum of e+e-.
double getCMSEnergy() const
Returns CMS energy of e+e- (aka.
static ROOT::Math::PxPyPzMVector labToCms(const ROOT::Math::PxPyPzMVector &vec)
Transforms Lorentz vector into CM System.
const ROOT::Math::LorentzRotation rotateLabToCms() const
Returns Lorentz transformation from Lab to CMS.
PCmsLabTransform()
Constructor.
static ROOT::Math::PxPyPzMVector cmsToLab(const ROOT::Math::PxPyPzMVector &vec)
Transforms Lorentz vector into Laboratory System.
const DBObjPtr< CollisionBoostVector > m_boostVectorDB
db object for boost vector.
const ROOT::Math::LorentzRotation rotateCmsToLab() const
Returns Lorentz transformation from CMS to Lab.
const DBObjPtr< CollisionInvariantMass > m_invariantMassDB
db object for invariant mass.
B2Vector3D getBoostVector() const
Returns boost vector (beta=p/E)
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:23