sEPD Event Plane Calibration - Application#4127
sEPD Event Plane Calibration - Application#4127Steepspace wants to merge 4 commits intosPHENIX-Collaboration:masterfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds EventPlaneRecov2 subsystem and Eventplaneinfov2 container for event-plane calibration and Q‑vector corrections across harmonics and subdetectors; extends Eventplaneinfo with raw/recentered accessors; includes SEPD in CaloTowerStatus hot-map selection; updates build to expose new headers/sources. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Recov as EventPlaneRecov2
participant CDB as CDB/Calib
participant EH as EventHeader
participant SEPD as SEPD Towers
participant Cent as Centrality
participant DST as DST/Nodes
Client->>Recov: Init(topNode)
Recov->>CDB: Load calibration (direct URL or calib dir)
CDB-->>Recov: CorrectionData (avg/Q-matrix per harmonic/cent)
Recov->>Recov: LoadCalib() (store matrices)
Client->>Recov: process_event(topNode)
Recov->>EH: Read global event index
Recov->>Cent: Read CentralityInfo
Cent-->>Recov: cent_bin
Recov->>SEPD: process_sEPD() (accumulate per-tower charge)
SEPD-->>Recov: Q_raw (S, N)
Recov->>Recov: correct_QVecs() (recenter then flatten using X-matrices)
Recov->>DST: FillNode(topNode) (create/insert EventplaneinfoMap entries)
DST-->>Recov: confirmation
Client->>Recov: ResetEvent(topNode)
Recov->>Recov: clear per-event Q-vector state
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Build & test reportReport for commit eb122648a02f13af194f74a9af44e64934e2ea02:
Automatically generated by sPHENIX Jenkins continuous integration |
|
There will be more comments but why do you add a version 2 of the reconstruction class? As far as I know this here is a replacement - is there any point in running the old version? |
Hi Chris, yes this will be a replacement for the
I did not want to just outright delete and replace the contents of |
Build & test reportReport for commit 760d32daa74846e600de6a512c93824da8d4f684:
Build & test reportReport for commit 561e967652518788cb59cd7b23a726994d5bef0e:
Build & test reportReport for commit 3fa48da17176b340a61716e6a0ab2aa69ea4894d:
Build & test reportReport for commit 9ec298fb7d3b94a243e8056445b7879d11f58659:
Build & test reportReport for commit 18c5a2c56900618bcf9798bb091f064b628994a4:
Build & test reportReport for commit f704495167ff5a179e3b400f49850351b7084714:
Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration |
Build & test reportReport for commit 1e206178d882a77d662fe8517b6f9901b826eab1:
Automatically generated by sPHENIX Jenkins continuous integration |
There was a problem hiding this comment.
Pull request overview
This PR adds an sEPD-specific event-plane reconstruction and calibration application, wiring it to the new CDB-based Q-vector calibration payloads and extending the event-plane info container to hold multiple calibration stages.
Changes:
- Introduces
Eventplaneinfov2, extending the event-plane info interface to hold raw, recentered, and final (flattened) Q-vectors and derived angles. - Adds
EventPlaneRecov2, aSubsysRecomodule that computes sEPD Q-vectors for harmonics 2–4, applies centrality-binned recentering and 2×2 flattening matrices from CDBTTree, and fills theEventplaneinfoMapwithEventplaneinfov2nodes. - Extends
CaloTowerStatushandling so SEPD uses the_BadTowerMapconvention for hot/bad channel maps, aligning sEPD operations with CEMC.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
offline/packages/eventplaneinfo/Makefile.am |
Registers Eventplaneinfov2 and EventPlaneRecov2 headers, implementations, and ROOT dictionaries with the build, so the new container and module are compiled and available. |
offline/packages/eventplaneinfo/Eventplaneinfov2LinkDef.h |
Adds ROOT CINT dictionary directives for Eventplaneinfov2, enabling persistence and I/O via ROOT. |
offline/packages/eventplaneinfo/Eventplaneinfov2.h |
Defines Eventplaneinfov2 as a subclass of Eventplaneinfo, adding storage and accessors for raw, recentered, and flattened Q-vectors, plus ring-resolved Q-vectors and psi accessors. |
offline/packages/eventplaneinfo/Eventplaneinfov2.cc |
Implements identify and a concrete GetPsi method (handling the Q=(0,0) case with NaN), providing core angle computation for the new container. |
offline/packages/eventplaneinfo/Eventplaneinfo.h |
Extends the base interface to include virtual hooks for raw and recentered Q-vectors, so downstream code can use these in a type-agnostic way via Eventplaneinfo*. |
offline/packages/eventplaneinfo/EventPlaneRecov2.h |
Declares the new EventPlaneRecov2 SubsysReco module, including configuration knobs, CDBTTree handle, correction-data structures, and internal Q-vector state for harmonics 2–4 across S/N/NS. |
offline/packages/eventplaneinfo/EventPlaneRecov2.cc |
Implements the sEPD event-plane reconstruction pipeline: loads per-harmonic, per-centrality recentering and flattening data from CDB, computes charge-weighted Q-vectors from TOWERINFO_CALIB_SEPD, applies recentering and 2×2 matrix flattening, and populates EventplaneinfoMap with Eventplaneinfov2 records for sEPDS, sEPDN, and sEPDNS (including raw and recentered vectors). |
offline/packages/eventplaneinfo/Eventplaneinfo.cc (unchanged content, but used by new code) |
Existing implementation remains the common base; new v2 class plugs into this hierarchy without altering behavior of v1 users. |
offline/packages/CaloReco/CaloTowerStatus.cc |
Adjusts hot-map calibration name selection so SEPD uses the same _BadTowerMap naming convention as CEMC, allowing SEPD bad tower maps produced by the calibration pipeline to be picked up automatically. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Build & test reportReport for commit 67ab2c156e2c3998324091661011e038f35cb04c:
Automatically generated by sPHENIX Jenkins continuous integration |
Introduces a new sEPD event plane reconstruction module (v2) and an expanded info container (v2) to support a full calibration chain including recentering and flattening.
Eventplaneinfov2:
- Inherits from Eventplaneinfo.
- Adds dedicated storage for raw, recentered, and final (flattened) Q-vectors.
- Provides getters/setters for extended Q-vector stages to allow for systematic studies of calibration effects.
EventPlaneRecov2:
- New SubsysReco module specifically for sEPD Q-vector calibration.
- Implements a multi-step calibration workflow:
1. Raw Q-vector calculation from sEPD channel charges and geometry.
2. Recentering: Subtracts <Q> offsets per centrality bin.
3. Flattening: Applies a 2x2 correction matrix calculated from Q-vector variances (Qxx, Qyy, Qxy).
- Features integration with CDBTTree to load calibration parameters dynamically via the Calibration Database.
- Processes harmonics n=2,3, and 4 for South, North, and Combined (NS) subdetectors.
- Automatically handles centrality-based binning (8 bins) for calibrations.
- Populates EventplaneinfoMap with Eventplaneinfov2 objects for downstream analysis.
- Includes diagnostic verbosity levels for inspecting calibration matrices and per-event vector transformations.
- Allow the sEPD bad tower maps to be processed via the CaloTowerStatus module.
Integrate the "Combined NS" calibration strategy into the reconstruction pipeline to improve event plane resolution and flatness. This update treats the combined North-South detector as a distinct third entity for flattening, while preserving multiplicity-based resolution weighting through individual sub-detector recentering. Core Logic Updates: - Calibration Loading: Updated LoadCalib to retrieve North-South specific second moments (⟨Qx2⟩, ⟨Qy2⟩, ⟨QxQy⟩) from the Calibration Database (CDB). - Matrix Computation: Implemented unique flattening matrix calculation for the NS detector slot (Index 2) during initialization. 1) "Best of Both Worlds" Correction: Refactored correct_QVecs to implement the optimized combination logic: 2) Recenters South and North vectors individually. 3) Sums the recentered components to form the combined recentered vector: Q_NS,rec = Q_S,rec + Q_N,rec. - Applies the dedicated NS flattening matrix to the resulting sum to ensure a circular (flat) distribution. - Raw Vector Summation: Updated process_sEPD to populate the raw NS vector by summing normalized sub-detector components, facilitating direct QA comparisons. Infrastructure & Efficiency: - Array Expansion: Increased internal storage arrays for m_correction_data, m_Q_raw, m_Q_recentered, and m_Q_flat from size 2 to size 3 to accommodate the NS detector index. Diagnostics & Quality Assurance: - Print Methods: Expanded print_correction_data and print_QVectors to display diagnostic information for all three detector slots (South, North, and NorthSouth). - Fallback Safety: Maintained fallback logic that utilizes raw Q-vectors in the event of missing calibration data or invalid event centrality, preventing empty output nodes.
Address Major Issues: - Ensure m_directURL_EventPlaneCalib is not empty before passing it to hasValidTree - Removed unused vectors in EventPlaneRecov2 (south_psi, north_psi, northsouth_psi) - Guard against order == 0 to avoid divide-by-zero. - Add bounds checks before indexing Q-vector storage.
67ab2c1 to
8b5c354
Compare
Build & test reportReport for commit 8b5c354c39a7ed64cae634b3bc9139e6a699c85d:
Automatically generated by sPHENIX Jenkins continuous integration |




Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
Introduces a new sEPD event plane reconstruction module (v2) and an expanded info container (v2) to support a full calibration chain including recentering and flattening.
Eventplaneinfov2:
EventPlaneRecov2:
Presentations:
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)
sEPD Q Vector Calibration Generation: #4106
sEPD Q Vector Calibration Generation (macros): sPHENIX-Collaboration/macros#1270
sEPD Event Plane Calibration – Application (PR #4127)
Motivation & Context
This PR delivers an application-layer implementation for sEPD event-plane calibration to support a full Q‑vector calibration chain (raw → recentered → flattened) and to provide calibrated event‑plane outputs for downstream consumers. Motivation and context:
Key Changes
New data type: Eventplaneinfov2
New reconstruction module: EventPlaneRecov2 (SubsysReco)
Build and infra updates
Safety/bugfix commits
Potential Risk Areas
Possible Future Improvements
Note: AI-generated summaries can contain mistakes. Reviewers should inspect the code (Q‑vector math, calibration loading, and node population) and validate results with real calibration data before adoption.