Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-11 09:47:18

0001 #pragma once
0002 
0003 #include "Beam.h"
0004 #include "Boost.h"
0005 
0006 #include <Math/LorentzVector.h>
0007 using ROOT::Math::PxPyPzEVector;
0008 
0009 #include <Math/LorentzRotation.h>
0010 using ROOT::Math::LorentzRotation;
0011 
0012 LorentzRotation getBoost(double eE, double eN, double mE, double mN) {
0013 
0014     TVector3 ve(0,0,-sqrt(eE*eE-mE*mE));
0015     TVector3 vn(0,0,sqrt(eN*eN-mN*mN));
0016     
0017     const PxPyPzEVector ei(
0018         eicrecon::round_beam_four_momentum(
0019             ve,
0020             mE,
0021             {-1*eE},
0022             0.0)
0023         );
0024 
0025     const PxPyPzEVector ni(
0026         eicrecon::round_beam_four_momentum(
0027             vn,
0028             mN,
0029             {eN},
0030             -0.025)
0031         );
0032 
0033     // std::cout << "initial electron beam: " << Form("(%f, %f, %f, %f)", ei.Px(), ei.Py(), ei.Pz(), ei.E()) << std::endl;
0034     // std::cout << "initial nucleon beam: " << Form("(%f, %f, %f, %f)", ni.Px(), ni.Py(), ni.Pz(), ni.E()) << std::endl;
0035     // std::cout << "Created vector, e, p (mrad) " << ei.Theta() * 1000 << " " << ni.Theta() * 1000 << std::endl;
0036 
0037     LorentzRotation boost = eicrecon::determine_boost(ei, ni);
0038 
0039     PxPyPzEVector boosted_e = boost(ei);
0040     PxPyPzEVector boosted_n = boost(ni);
0041 
0042     // std::cout << "Boosted electron beam: " << Form("(%f, %f, %f, %f)", boosted_e.Px(), boosted_e.Py(), boosted_e.Pz(), boosted_e.E()) << std::endl;
0043     // std::cout << "Boosted nucleon beam: " << Form("(%f, %f, %f, %f)", boosted_n.Px(), boosted_n.Py(), boosted_n.Pz(), boosted_n.E()) << std::endl;
0044     // std::cout << "Incoming headon, e, p (mrad) " << boosted_e.Theta() * 1000 << " " << boosted_n.Theta() * 1000 << std::endl;
0045 
0046     return boost;
0047 }