EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
Boost.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2026 Wouter Deconinck, Barak Schmookler, Stephen Maple
3
4#pragma once
5
6#include <Math/Vector4D.h>
7#include <Math/LorentzRotation.h>
8#include <Math/LorentzVector.h>
9#include <Math/RotationX.h>
10#include <Math/RotationY.h>
11#include <Math/Boost.h>
12
13using ROOT::Math::PxPyPzEVector;
14
15namespace eicrecon {
16
17using ROOT::Math::LorentzRotation;
18
19inline LorentzRotation determine_boost(PxPyPzEVector ei, PxPyPzEVector pi) {
20
21 using ROOT::Math::Boost;
22 using ROOT::Math::RotationX;
23 using ROOT::Math::RotationY;
24
25 // Save original input for constructing target "head-on" boost
26 PxPyPzEVector eo = ei;
27 PxPyPzEVector po = pi;
28
29 // Step 1: Boost to CM frame
30 const auto cmBoost = (ei + pi).BoostToCM();
31 const Boost boost_from_og_to_cm(cmBoost);
32
33 ei = boost_from_og_to_cm(ei);
34 pi = boost_from_og_to_cm(pi);
35
36 // Step 2: Rotate so pi is aligned along +z
37 RotationY rotAboutY(-1.0 * atan2(pi.Px(), pi.Pz()));
38 RotationX rotAboutX(+1.0 * atan2(pi.Py(), pi.Pz()));
39
40 ei = rotAboutX(rotAboutY(ei));
41 pi = rotAboutX(rotAboutY(pi));
42
43 // Step 3: Construct "ideal" head-on configuration (same energies, back-to-back along z)
44 double e_energy = eo.E();
45 double p_energy = po.E();
46 double e_pz = -eo.P();
47 double p_pz = +po.P();
48
49 PxPyPzEVector eh(0, 0, e_pz, e_energy);
50 PxPyPzEVector ph(0, 0, p_pz, p_energy);
51
52 // Step 4: Boost to the frame where those particles look like the current ei/pi
53 const auto hoBoost = (eh + ph).BoostToCM(); // CM of head-on frame
54 const Boost boost_from_cm_to_headon(-hoBoost); // Boost from CM to head-on
55
56 // Final transformation = headon boost * rotations * CM boost
57 LorentzRotation tf;
58 tf *= boost_from_cm_to_headon;
59 tf *= rotAboutX;
60 tf *= rotAboutY;
61 tf *= boost_from_og_to_cm;
62
63 return tf;
64}
65
66inline PxPyPzEVector apply_boost(const LorentzRotation& tf, const PxPyPzEVector& part) {
67
68 // Step 5: Apply boosts and rotations to any particle 4-vector
69 // (here too, choices will have to be made as to what the 4-vector is for reconstructed particles)
70
71 // Boost and rotate particle 4-momenta into the headon frame
72 return tf(part);
73}
74
75} // namespace eicrecon
-client
Definition CalorimeterClusterRecoCoG.cc:37
PxPyPzEVector apply_boost(const LorentzRotation &tf, const PxPyPzEVector &part)
Definition Boost.h:66
LorentzRotation determine_boost(PxPyPzEVector ei, PxPyPzEVector pi)
Definition Boost.h:19