Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-28 09:20:47

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2025 Wouter Deconinck
0003 
0004 #pragma once
0005 
0006 namespace eicrecon {
0007 
0008 struct TruthinessConfig {
0009   // Penalty weights for different contributions. These scale the relative
0010   // importance of each term in the overall truthiness score without changing
0011   // the underlying calculation.
0012 
0013   // Global weight applied to the penalty for mismatched particle identification (PID)
0014   // between reconstructed and Monte Carlo (MC) particles.
0015   //
0016   // - Larger values (> 1) make the truthiness metric more sensitive to PID
0017   //   mismatches, i.e. a wrong PID assignment will reduce the score more
0018   //   strongly. This can be useful in studies where PID performance is the
0019   //   primary focus and you want mis-identified particles to dominate the
0020   //   metric.
0021   // - Smaller values (< 1) down-weight PID information relative to other
0022   //   matching criteria (e.g. kinematics or association completeness). This
0023   //   can be appropriate if the PID is known to be noisy or still under
0024   //   development, and you do not want its imperfections to overwhelm the
0025   //   overall truthiness assessment.
0026   double pidPenaltyWeight = 1.0;
0027 
0028   // Weight for penalties assigned to MC particles that have no associated
0029   // reconstructed counterpart.
0030   //
0031   // - Increasing this weight emphasizes inefficiencies (missed MC truth
0032   //   particles) in the reconstruction. This is useful when you want the
0033   //   metric to strongly penalize missing particles, for example in studies
0034   //   of reconstruction efficiency.
0035   // - Decreasing this weight makes the metric more tolerant of unobserved MC
0036   //   particles, which can be reasonable in regions of phase space where
0037   //   detector acceptance is limited or where you expect a large amount of
0038   //   uninstrumented activity.
0039   double unassociatedMCPenaltyWeight = 1.0;
0040 
0041   // Weight for penalties assigned to reconstructed particles that cannot be
0042   // matched to any MC particle.
0043   //
0044   // - Increasing this weight emphasizes reconstruction purity: extra or fake
0045   //   reconstructed particles will reduce the truthiness score more strongly.
0046   //   This is useful when fake-rate control is a priority.
0047   // - Decreasing this weight makes the metric less sensitive to additional,
0048   //   possibly spurious, reconstructed objects, which can be acceptable in
0049   //   high-occupancy environments where a small fake rate is expected.
0050   double unassociatedRecoPenaltyWeight = 1.0;
0051 
0052   // Default resolutions when the per-particle covariance matrix is unavailable
0053   // or found to be zero. These act as fallback energy/momentum uncertainties,
0054   // expressed in GeV, and control how strongly deviations between reco and MC
0055   // kinematics contribute to the truthiness penalty.
0056 
0057   // Effective energy resolution (sigma_E) used when no reliable energy
0058   // uncertainty is available from the covariance matrix.
0059   //
0060   // - Smaller values (< 1.0 GeV) assume a more precise detector: even small
0061   //   differences between reconstructed and true energies will be treated as
0062   //   significant, increasing the sensitivity of the metric to energy
0063   //   mismatches.
0064   // - Larger values (> 1.0 GeV) assume a less precise detector: only large
0065   //   energy differences will be strongly penalized, making the metric less
0066   //   sensitive to modest energy discrepancies.
0067   // Adjust this to roughly match the expected energy scale and resolution of
0068   // the subsystem providing the measurement when no per-object uncertainty is
0069   // available.
0070   double defaultEnergyResolution = 1.0;
0071 
0072   // Effective resolution for individual momentum components (px, py, pz), used
0073   // when the covariance matrix does not provide a usable uncertainty.
0074   //
0075   // - Smaller values make the truthiness metric more sensitive to small
0076   //   differences in the reconstructed vs. true momentum vectors, tightening
0077   //   the matching requirement.
0078   // - Larger values make the metric more tolerant to such differences, which
0079   //   can be appropriate in regions with poorer tracking or for very low/high
0080   //   momentum particles where the resolution is intrinsically worse.
0081   double defaultMomentumResolution = 1.0;
0082 };
0083 
0084 } // namespace eicrecon