Skip to content

Commit

Permalink
feat: single hadron PhPerp
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Oct 28, 2024
1 parent 1202e27 commit 6c3f33e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/iguana/algorithms/physics/SingleHadronKinematics/Algorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace iguana::physics {
"pindex/S",
"pdg/I",
"z/D",
"PhPerp/D",
"MX/D",
"xF/D",
"phiH/D",
Expand All @@ -33,6 +34,7 @@ namespace iguana::physics {
i_pindex = result_schema.getEntryOrder("pindex");
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_xF = result_schema.getEntryOrder("xF");
i_phiH = result_schema.getEntryOrder("phiH");
Expand Down Expand Up @@ -112,6 +114,10 @@ namespace iguana::physics {
// calculate z
double z = p_target.Dot(p_Ph) / p_target.Dot(p_q);

// calculate PhPerp
auto opt_PhPerp = tools::RejectVector(p_Ph.Vect(), p_q.Vect());
double PhPerp = opt_PhPerp.has_value() ? opt_PhPerp.value().R() : tools::UNDEF;

// calculate xi
double xi = p_q.Dot(p_Ph) / p_target.Dot(p_q);

Expand All @@ -132,23 +138,25 @@ namespace iguana::physics {
result_bank_rowlist.push_back(row);

// fill the bank
result_bank.putShort(i_pindex, row, static_cast<int16_t>(row));
result_bank.putInt(i_pdg, row, pdg);
result_bank.putDouble(i_z, row, z);
result_bank.putDouble(i_MX, row, MX);
result_bank.putDouble(i_xF, row, xF);
result_bank.putDouble(i_phiH, row, phiH);
result_bank.putDouble(i_xi, row, xi);
result_bank.putShort(i_pindex, row, static_cast<int16_t>(row));
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_xF, row, xF);
result_bank.putDouble(i_phiH, row, phiH);
result_bank.putDouble(i_xi, row, xi);
}
else {
// zero the row
result_bank.putShort(i_pindex, row, static_cast<int16_t>(row));
result_bank.putInt(i_pdg, row, pdg);
result_bank.putDouble(i_z, row, 0);
result_bank.putDouble(i_MX, row, 0);
result_bank.putDouble(i_xF, row, 0);
result_bank.putDouble(i_phiH, row, 0);
result_bank.putDouble(i_xi, row, 0);
result_bank.putShort(i_pindex, row, static_cast<int16_t>(row));
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_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 @@ -14,6 +14,8 @@ namespace iguana::physics {
int pdg;
/// @brief @latex{z}: Momentum fraction of the fragmenting parton carried by the hadron
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{x_F}: Feynman-x of the hadron
Expand Down Expand Up @@ -66,6 +68,7 @@ namespace iguana::physics {
int i_pindex;
int i_pdg;
int i_z;
int i_PhPerp;
int i_MX;
int i_xF;
int i_phiH;
Expand Down

0 comments on commit 6c3f33e

Please sign in to comment.