Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions offline/packages/eventplaneinfo/EventPlaneReco.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,27 @@ int EventPlaneReco::process_sEPD(PHCompositeNode* topNode)
TowerInfo* tower = towerinfosEPD->get_tower_at_channel(channel);

unsigned int key = TowerInfoDefs::encode_epd(channel);
int rbin = TowerInfoDefs::get_epd_rbin(key);
double charge = tower->get_energy();

// skip bad channels
// skip channels with very low charge
if (tower->get_isHot() || charge < m_sepd_min_channel_charge)
// Skip Innermost Ring
if (m_skipRing0 && rbin == 0)
{
continue;
}

// Skip Noise
if (charge <= m_sepd_min_channel_charge)
{
continue;
}

// Clamp on high charge threshold
if (m_sEPD_charge_threshold > 0 && charge > m_sEPD_charge_threshold)
{
charge = m_sEPD_charge_threshold;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

// arm = 0: South
// arm = 1: North
unsigned int arm = TowerInfoDefs::get_epd_arm(key);
Expand Down
15 changes: 14 additions & 1 deletion offline/packages/eventplaneinfo/EventPlaneReco.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ class EventPlaneReco : public SubsysReco
m_sepd_min_channel_charge = sepd_min_channel_charge;
}

void set_charge_threshold(double threshold)
{
m_sEPD_charge_threshold = std::max(0.0, threshold);
}

Comment on lines +68 to +72
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_charge_threshold is ambiguous in this class (threshold for which detector/quantity?). Since this setter configures sEPD-specific charge clamping, consider renaming it (and the backing member) to something like set_sepd_charge_threshold/m_sepd_charge_threshold to match the existing set_sepd_min_channel_charge naming and avoid confusion if other detectors get thresholds later.

Suggested change
void set_charge_threshold(double threshold)
{
m_sEPD_charge_threshold = threshold;
}
void set_sepd_charge_threshold(double threshold)
{
m_sEPD_charge_threshold = threshold;
}
void set_charge_threshold(double threshold)
{
set_sepd_charge_threshold(threshold);
}

Copilot uses AI. Check for mistakes.
void set_skipRing0(bool skip)
{
m_skipRing0 = skip;
}
Comment on lines +68 to +76
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Couple these new reconstruction knobs to calibration validity.

set_charge_threshold() / set_skipRing0() and the new defaults all change the raw sEPD Q-vector definition, but calibration selection is still independent of those settings. That makes it easy to apply recentering/flattening constants from a different channel/charge model and silently bias the corrected event planes. Please require a configuration-matched calibration payload for non-default settings (or disable calibration when the payload does not match) and spell out the reprocessing scope for existing productions.

Based on learnings, "If the PR changes reconstruction outputs, calibration constants, or simulation behavior, ensure the description states expected analysis impact and whether reprocessing is required".

Also applies to: 104-109


void set_EventPlaneInfoNodeName(const std::string &name)
{
m_EventPlaneInfoNodeName = name;
Expand All @@ -91,9 +101,12 @@ class EventPlaneReco : public SubsysReco
bool m_doNotCalib{false};
bool m_doNotCalibEvent{false};

bool m_skipRing0{true};

double m_cent{0.0};
double m_globalEvent{0};
double m_sepd_min_channel_charge{0.2};
double m_sepd_min_channel_charge{0.5};
double m_sEPD_charge_threshold{50};

std::string m_calibName{"SEPD_EventPlaneCalib"};
std::string m_inputNode{"TOWERINFO_CALIB_SEPD"};
Expand Down