Skip to content

Commit

Permalink
fix: calculate MX2 instead of MX
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Nov 11, 2024
1 parent 39edef0 commit 15e7460
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/iguana/algorithms/physics/DihadronKinematics/Algorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace iguana::physics {
"Mh/D",
"z/D",
"PhPerp/D",
"MX/D",
"MX2/D",
"xF/D",
"phiH/D",
"phiR/D",
Expand All @@ -41,7 +41,7 @@ namespace iguana::physics {
i_Mh = result_schema.getEntryOrder("Mh");
i_z = result_schema.getEntryOrder("z");
i_PhPerp = result_schema.getEntryOrder("PhPerp");
i_MX = result_schema.getEntryOrder("MX");
i_MX2 = result_schema.getEntryOrder("MX2");
i_xF = result_schema.getEntryOrder("xF");
i_phiH = result_schema.getEntryOrder("phiH");
i_phiR = result_schema.getEntryOrder("phiR");
Expand Down Expand Up @@ -144,8 +144,8 @@ namespace iguana::physics {
// calculate Mh
double Mh = p_Ph.M();

// calculate MX
double MX = (p_target + p_q - p_Ph).M();
// calculate MX2
double MX2 = (p_target + p_q - p_Ph).M2();

// calculate xF
double xF = 2 * p_Ph__qp.Vect().Dot(p_q__qp.Vect()) / (W * p_q__qp.Vect().R());
Expand Down Expand Up @@ -197,7 +197,7 @@ namespace iguana::physics {
result_bank.putDouble(i_Mh, dih_row, Mh);
result_bank.putDouble(i_z, dih_row, z);
result_bank.putDouble(i_PhPerp, dih_row, PhPerp);
result_bank.putDouble(i_MX, dih_row, MX);
result_bank.putDouble(i_MX2, dih_row, MX2);
result_bank.putDouble(i_xF, dih_row, xF);
result_bank.putDouble(i_phiH, dih_row, phiH);
result_bank.putDouble(i_phiR, dih_row, phiR);
Expand Down
6 changes: 3 additions & 3 deletions src/iguana/algorithms/physics/DihadronKinematics/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace iguana::physics {
double z;
/// @brief @latex{P_h^\perp}: transverse momentum of the dihadron in the @latex{\perp}-frame (transverse to @latex{\vec{q}})
double PhPerp;
/// @brief @latex{M_X(ehhX)}: Missing mass of the dihadron
double MX;
/// @brief @latex{M_X(ehhX)^2}: Missing mass squared of the dihadron
double MX2;
/// @brief @latex{x_F}: Feynman-x of the dihadron
double xF;
/// @brief @latex{\phi_h}: @latex{q}-azimuthal angle between the lepton-scattering plane and the @latex{\vec{q}\times\vec{P}_h} plane;
Expand Down Expand Up @@ -98,7 +98,7 @@ namespace iguana::physics {
int i_Mh;
int i_z;
int i_PhPerp;
int i_MX;
int i_MX2;
int i_xF;
int i_phiH;
int i_phiR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace iguana::physics {
},
{
new TH1D("MX_dist", "missing mass M_{X} [GeV];", n_bins, 0, 4),
[](auto const& b, auto const r) { return b.getDouble("MX", r); }
[](auto const& b, auto const r) { auto MX2 = b.getDouble("MX2", r); return MX2 >= 0 ? std::sqrt(MX2) : -100; } // FIXME: handle space-like case better
},
{
new TH1D("xF_dist", "x_{F};", n_bins, -1, 1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace iguana::physics {
"pdg/I",
"z/D",
"PhPerp/D",
"MX/D",
"MX2/D",
"xF/D",
"phiH/D",
"xi/D"
Expand All @@ -35,7 +35,7 @@ namespace iguana::physics {
i_pdg = result_schema.getEntryOrder("pdg");
i_z = result_schema.getEntryOrder("z");
i_PhPerp = result_schema.getEntryOrder("PhPerp");
i_MX = result_schema.getEntryOrder("MX");
i_MX2 = result_schema.getEntryOrder("MX2");
i_xF = result_schema.getEntryOrder("xF");
i_phiH = result_schema.getEntryOrder("phiH");
i_xi = result_schema.getEntryOrder("xi");
Expand Down Expand Up @@ -121,8 +121,8 @@ namespace iguana::physics {
// calculate xi
double xi = p_q.Dot(p_Ph) / p_target.Dot(p_q);

// calculate MX
double MX = (p_target + p_q - p_Ph).M();
// calculate MX2
double MX2 = (p_target + p_q - p_Ph).M2();

// calculate xF
double xF = 2 * p_Ph__qp.Vect().Dot(p_q__qp.Vect()) / (W * p_q__qp.Vect().R());
Expand All @@ -142,7 +142,7 @@ namespace iguana::physics {
result_bank.putInt(i_pdg, row, pdg);
result_bank.putDouble(i_z, row, z);
result_bank.putDouble(i_PhPerp, row, PhPerp);
result_bank.putDouble(i_MX, row, MX);
result_bank.putDouble(i_MX2, row, MX2);
result_bank.putDouble(i_xF, row, xF);
result_bank.putDouble(i_phiH, row, phiH);
result_bank.putDouble(i_xi, row, xi);
Expand All @@ -153,7 +153,7 @@ namespace iguana::physics {
result_bank.putInt(i_pdg, row, pdg);
result_bank.putDouble(i_z, row, 0);
result_bank.putDouble(i_PhPerp, row, 0);
result_bank.putDouble(i_MX, row, 0);
result_bank.putDouble(i_MX2, row, 0);
result_bank.putDouble(i_xF, row, 0);
result_bank.putDouble(i_phiH, row, 0);
result_bank.putDouble(i_xi, row, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace iguana::physics {
double z;
/// @brief @latex{P_h^\perp}: transverse momentum of the hadron in the @latex{\perp}-frame (transverse to @latex{\vec{q}})
double PhPerp;
/// @brief @latex{M_X(ehX)}: Missing mass of the hadron
double MX;
/// @brief @latex{M_X(ehX)^2}: Missing mass squared of the hadron
double MX2;
/// @brief @latex{x_F}: Feynman-x of the hadron
double xF;
/// @brief @latex{\phi_h}: @latex{q}-azimuthal angle between the lepton-scattering plane and the @latex{\vec{q}\times\vec{P}_h} plane;
Expand Down Expand Up @@ -69,7 +69,7 @@ namespace iguana::physics {
int i_pdg;
int i_z;
int i_PhPerp;
int i_MX;
int i_MX2;
int i_xF;
int i_phiH;
int i_xi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace iguana::physics {
},
{
new TH1D("MX_dist", "missing mass M_{X} [GeV];", n_bins, 0, 4),
[](auto const& b, auto const r) { return b.getDouble("MX", r); }
[](auto const& b, auto const r) { auto MX2 = b.getDouble("MX2", r); return MX2 >= 0 ? std::sqrt(MX2) : -100; } // FIXME: handle space-like case better
},
{
new TH1D("xF_dist", "x_{F};", n_bins, -1, 1),
Expand Down

0 comments on commit 15e7460

Please sign in to comment.