Skip to content

[PWGCF] Add files via upload#17

Closed
MartijnLaarhoven wants to merge 1 commit intomasterfrom
MartijnLaarhoven-patch-14
Closed

[PWGCF] Add files via upload#17
MartijnLaarhoven wants to merge 1 commit intomasterfrom
MartijnLaarhoven-patch-14

Conversation

@MartijnLaarhoven
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 12, 2026 11:59
@github-actions github-actions bot added the pwgcf label Feb 12, 2026
@github-actions github-actions bot changed the title Add files via upload [PWGCF] Add files via upload Feb 12, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the LongRangeDihadronCor analysis task to support FT0 dead-channel “mirroring” behavior and optional run-by-run FT0 amplitude QA output, while reorganizing forward-detector configurables and adjusting PID n-sigma configuration labels.

Changes:

  • Introduces a forward-detector configurable group (cfgFwdConfig) including FT0 channel rejection, dead-channel mirroring toggles, and a run-by-run FT0 amplitude QA option.
  • Adds per-run histogram creation/tracking (histAmpCorrectPerRun) and fills it during same-event processing.
  • Updates the PID nSigmas labeled array layout/labels (now “upCut/lowCut” style).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +445 to +452
if (cfgFwdConfig.cfgRunbyRunAmplitudeFT0) {
if (histAmpCorrectPerRun.find(runNumber) != histAmpCorrectPerRun.end()) {
LOGF(info, "you are trying to create QA hist again, please make sure you are not filling it twice");
}
const AxisSpec axisFit{1000, 0, 5000, "FIT amplitude"};
const AxisSpec axisChID{220, 0, 220, "FIT channel"};
std::shared_ptr<TH2> histFT0AmpCorrect = registry.add<TH2>(Form("%d/FT0AmpCorrect", runNumber), "FIT channel;FIT amplitude", {HistType::kTH2F, {axisChID, axisFit}});
histAmpCorrectPerRun.insert(std::make_pair(runNumber, histFT0AmpCorrect));
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

createOutputObjectsForRun() logs when the per-run histogram already exists, but still proceeds to add another histogram with the same name and then insert into the map. This can create duplicate registry objects and the insert will not replace the existing entry. Consider returning early (or skipping creation) when histAmpCorrectPerRun already contains runNumber.

Copilot uses AI. Check for mistakes.
O2_DEFINE_CONFIGURABLE(cfgPIDParticle, int, 0, "1 = pion, 2 = kaon, 3 = proton, 4 = kshort, 5 = lambda, 6 = phi, 0 for no PID")
O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 0.5f, "Minimum pt to use TOF N-sigma")
Configurable<LabeledArray<float>> nSigmas{"nSigmas", {LongArrayFloat[0], 3, 6, {"TPC", "TOF", "ITS"}, {"pos_pi", "pos_ka", "pos_pr", "neg_pi", "neg_ka", "neg_pr"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"};
Configurable<LabeledArray<float>> nSigmas{"nSigmas", {LongArrayFloat[0], 3, 6, {"TPC", "TOF", "ITS"}, {"upCut_pi", "upCut_ka", "upCut_pr", "lowCut_pi", "lowCut_ka", "lowCut_pr"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"};
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The nSigmas labeled array column labels were changed to upCut_/lowCut_ but the help text still says the values are for “positive and negative” particles. Please update the description to match the new semantics (upper/lower cuts), otherwise the configuration becomes misleading for users.

Suggested change
Configurable<LabeledArray<float>> nSigmas{"nSigmas", {LongArrayFloat[0], 3, 6, {"TPC", "TOF", "ITS"}, {"upCut_pi", "upCut_ka", "upCut_pr", "lowCut_pi", "lowCut_ka", "lowCut_pr"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"};
Configurable<LabeledArray<float>> nSigmas{"nSigmas",
{LongArrayFloat[0],
3,
6,
{"TPC", "TOF", "ITS"},
{"upCut_pi", "upCut_ka", "upCut_pr", "lowCut_pi", "lowCut_ka", "lowCut_pr"}},
"Labeled array for n-sigma upper/lower cuts in TPC, TOF, ITS for pions, kaons, protons (upCut_*/lowCut_*)"};

Copilot uses AI. Check for mistakes.
std::array<float, 6> tpcNsigmaCut;
int lastRunNumber = -1;
std::vector<int> runNumbers;
std::map<int, std::shared_ptr<TH2>> histAmpCorrectPerRun; // map of TH3 histograms for all runs
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Minor: histAmpCorrectPerRun is a map of TH2 histograms, but the trailing comment says “map of TH3 histograms”. Please fix the comment to match the actual type.

Suggested change
std::map<int, std::shared_ptr<TH2>> histAmpCorrectPerRun; // map of TH3 histograms for all runs
std::map<int, std::shared_ptr<TH2>> histAmpCorrectPerRun; // map of TH2 histograms for all runs

Copilot uses AI. Check for mistakes.
Comment on lines +689 to +703
if (system == SameEvent) {
registry.fill(HIST("FT0AmpCorrect"), id, ampl);
histAmpCorrectPerRun[lastRunNumber]->Fill(id, ampl);
}
} else if (fitType == kFT0A) {
id = ft0.channelA()[iCh];
ampl = ft0.amplitudeA()[iCh];
if (cfgRemapFT0ADeadChannels) {
if (id >= kFT0ARemapChannelStart && id <= kFT0ARemapChannelEnd) {
int dead_id = id - kFT0AOuterMirror;
float mirroredAmpl = ampl;
float mirroredAmplCorrected = mirroredAmpl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0Amp"), dead_id, mirroredAmpl);
registry.fill(HIST("FT0AmpCorrect"), dead_id, mirroredAmplCorrected);
}
}
if ((cfgRejectFT0AInside && (id >= kFT0AInnerRingMin && id <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (id >= kFT0AOuterRingMin && id <= kFT0AOuterRingMax)))
if ((cfgFwdConfig.cfgRejectFT0AInside && (id >= kFT0AInnerRingMin && id <= kFT0AInnerRingMax)) || (cfgFwdConfig.cfgRejectFT0AOutside && (id >= kFT0AOuterRingMin && id <= kFT0AOuterRingMax)))
ampl = 0.;
registry.fill(HIST("FT0Amp"), id, ampl);
if (system == SameEvent)
registry.fill(HIST("FT0Amp"), id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorrect"), id, ampl);
if (system == SameEvent) {
registry.fill(HIST("FT0AmpCorrect"), id, ampl);
histAmpCorrectPerRun[lastRunNumber]->Fill(id, ampl);
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

In getChannel(), histAmpCorrectPerRun[lastRunNumber]->Fill(...) is executed for SameEvent without checking cfgFwdConfig.cfgRunbyRunAmplitudeFT0 (or that the map contains lastRunNumber). If the run-by-run option is disabled, histAmpCorrectPerRun is empty and this will create a default null shared_ptr via operator[] and then dereference it, causing a crash. Please guard the fill with cfgFwdConfig.cfgRunbyRunAmplitudeFT0 and a presence check (or use at()/find() and only Fill when the histogram exists).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant