Skip to content

quick_check: moller_analysis/h_moller_x, h_moller_y, h_moller_z are always empty (FillMollerXY/FillMollerZ never called) #7

Description

@Chao1009

Where

What happens
Nothing in the tree calls PhysicsTools::FillMollerXY or PhysicsTools::FillMollerZ. Even so, prad2ana_quick_check writes moller_analysis/h_moller_x, h_moller_y and h_moller_z into every output file. All three histograms have zero entries on every run.

scripts/replay_viewer.py loads exactly these histograms into the "Moller Z vertex", "Moller X center" and "Moller Y center" panels of its Moller Analysis tab, and those panels have auto_cb_fit enabled. The panels are therefore always empty. moller_analysis/h_moller_phi_diff is the only filled histogram in that directory.

The two calls were removed in d17eead ("add a strict selection for e-p and e-e events yiled"). That commit moved the fits to merged->h_ee_center_x/y and h_ee_vertex_z but kept writing the PhysicsTools histograms.

Evidence

$ git grep -n -E "FillMollerXY|FillMollerZ" d21ae9f -- .
d21ae9f:analysis/include/PhysicsTools.h:176:    void FillMollerXY(float x, float y) { ... }
d21ae9f:analysis/include/PhysicsTools.h:177:    void FillMollerZ(float z) { ... }
d21ae9f:docs/PRAD2ANA_API.md:238:void  FillMollerXY    (float x, float y);
d21ae9f:docs/PRAD2ANA_API.md:239:void  FillMollerZ     (float z);
// quick_check.cpp:1334-1338
outfile.mkdir("moller_analysis"); outfile.cd("moller_analysis");
if (physics.GetMollerPhiDiffHist()) physics.GetMollerPhiDiffHist()->Write();
if (physics.GetMollerXHist()) physics.GetMollerXHist()->Write();   // never filled
if (physics.GetMollerYHist()) physics.GetMollerYHist()->Write();   // never filled
if (physics.GetMollerZHist()) physics.GetMollerZHist()->Write();   // never filled

To reproduce, run prad2ana_quick_check on any recon file and open moller_analysis/h_moller_x (or _y, _z). GetEntries() returns 0.

Suggested fix
There are two options.

  1. Fill the histograms. In the HyCal Moller block (quick_check.cpp L489-L500):

    • Call physics.FillMollerXY(center[0], center[1]) next to each h_ee_center_*_hc fill. This covers both center and center2.
    • Call physics.FillMollerZ(vertex) next to h_ee_vertex_z_hc->Fill(vertex).
    • Add GetMollerXHist(), GetMollerYHist() and GetMollerZHist() ->Add(...) lines to mergeResult next to L1176. Without them the per-thread fills are lost in the merge.

    The binning differs from the _hc histograms. h_moller_x and h_moller_y have 100 bins over ±10 mm, and h_moller_z has 1000 bins over 5000–8000 mm. The _hc histograms have 800 bins over ±20 mm and 8000 bins over 5000–9000 mm.

  2. Remove the duplicates. Drop moller_x_, moller_y_, moller_z_ and their Fill and Get methods from PhysicsTools and docs/PRAD2ANA_API.md. Write the existing ee_center_x_hc, ee_center_y_hc and ee_vertex_z_hc histograms into moller_analysis/ instead, and update the keys in scripts/replay_viewer.py.

Status
Still present on the dedup-refactor branch. Nothing calls FillMollerXY or FillMollerZ, and quick_check.cpp still writes the three histograms.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions