File indexing completed on 2025-02-22 10:41:29
0001
0002
0003
0004 #pragma once
0005
0006 #include "Math/Vector4D.h"
0007 using ROOT::Math::PxPyPzEVector;
0008
0009 #include "Math/LorentzRotation.h"
0010 #include "Math/LorentzVector.h"
0011 #include "Math/RotationX.h"
0012 #include "Math/RotationY.h"
0013 #include "Math/Boost.h"
0014
0015 namespace Jug::Base::Boost {
0016
0017 using ROOT::Math::LorentzRotation;
0018
0019 inline LorentzRotation determine_boost(PxPyPzEVector ei, PxPyPzEVector pi) {
0020
0021 using ROOT::Math::RotationX;
0022 using ROOT::Math::RotationY;
0023 using ROOT::Math::Boost;
0024
0025
0026
0027
0028
0029 const auto cmBoost = (ei + pi).BoostToCM();
0030
0031 const Boost boost_to_cm(-cmBoost);
0032
0033
0034 const Boost boost_to_headon(cmBoost);
0035
0036
0037
0038
0039 boost_to_cm(pi);
0040 boost_to_cm(ei);
0041
0042 RotationY rotAboutY(-1.0*atan2(pi.Px(), pi.Pz()));
0043 RotationX rotAboutX(+1.0*atan2(pi.Py(), pi.Pz()));
0044
0045 LorentzRotation tf;
0046 tf *= boost_to_cm;
0047 tf *= rotAboutY;
0048 tf *= rotAboutX;
0049 tf *= boost_to_headon;
0050 return tf;
0051 }
0052
0053 inline PxPyPzEVector apply_boost(const LorentzRotation& tf, PxPyPzEVector part) {
0054
0055
0056
0057
0058
0059 tf(part);
0060 return part;
0061 }
0062
0063 }