MaCh3  2.4.2
Reference Guide
Classes
Implementing Samples and Parameters

Classes responsible for handling samples and parameters. More...

Classes

struct  EventInfo
 Stores info about each MC event used during reweighting routine. More...
 
class  SampleHandlerFD
 Class responsible for handling implementation of samples used in analysis, reweighting and returning LLH. More...
 
class  ParameterHandlerGeneric
 Class responsible for handling of systematic error parameters with different types defined in the config. Like spline, normalisation parameters etc. More...
 
struct  TypeParameterBase
 Base class storing info for parameters types, helping unify codebase. More...
 

Detailed Description

Classes responsible for handling samples and parameters.

Introduction

The SampleHandler classes are the main interface for storing information about the samples used in analysis. Practically, this involves storing the number of events predicted in each analysis bin for each sample, as well as modifying this for a given set of systematic and oscillation parameter values (i.e., "reweighting" the nominal Monte-Carlo prediction). Therefore, the SampleHandler class also interacts with many other classes in MaCh3, especially the ParameterHandlerGeneric and SplineBase. In turn, the FitterBase class obtains likelihood values by comparing the MC prediction with data in the SampleHandler class.

Each experiment needs to create a SampleHandler experiment class that inherits from the SampleHandlerFD class in the core repository.

Warning
The SampleHandlerFD class will be renamed in the future to avoid confusion, as it can be used for the Near Detector as well, not only the Far Detector (FD).

Constructing a SampleHandler Experiment Class

The main purpose of any SampleHandler class is to contain all information required to make MC predictions for a given set of systematic parameter values. To achieve this, the SampleHandler object reads information from different input files and keeps track of them in internal data structures. For flexibility in loading various experiment formats, the function SampleHandlerFD::SetupExperimentMC is declared pure virtual.

The Event Struct

The SampleHandlerFD class stores MC information using the EventInfo struct. Some variables of EventInfo, such as EventInfo::KinVar, need to refer to experiment-specific structures. This is mostly handled via SampleHandlerFD::GetPointerToKinematicParameter.

Setting Up Systematics

Systematic parameters are handled via TypeParameterBase. Note that the actual parameters, including prior values and errors, are defined in ParameterHandlerGeneric. However, their impact on samples is largely implemented in SampleHandlerFD.

Norm Parameters

NormParameter are Simple parameters that work as normalizations for subsets of events. Events are selected based on kinematic cuts. For example, events with TrueQ2 in the range [0.5, 1.0] can be selected.

Example YAML configuration:

- Systematic:
Names:
FancyName: Norm_Param_1
KinematicCuts:
- TrueQ2: [0.5, 1.0]
Type: Norm

The actual bins are defined when calling SampleHandlerFD::SetupNormParameters, while the actual values of TrueQ2 are returned using SampleHandlerFD::ReturnKinematicParameter.

Spline Parameters

SplineParameter or response functions are parameters with more complex behavior, often requiring calculations of higher-order polynomials. Several types of interpolation are available via SplineInterpolation. Actual weights are calculated via the Spline class, either in a binned approach via BinnedSplineHandler or event-by-event via SMonolith. Initialization is handled via SampleHandlerFD::SetupSplines.

Oscillation Parameter

OscillationParameter are handled via OscillationHandler, which is a wrapper around NuOscillator. This library provides access to a variety of oscillation engines.

Warning
Parameters must be defined exactly as expected by NuOscillator!

FunctionalParameters

FunctionalParameter represent shifts to kinematical variables or other complex responses that are not handled by other parameter types. Shifts are applied via SampleHandlerFD::ApplyShifts (virtual), which can be overridden to implement custom responses. Functional parameters must be registered via SampleHandlerFD::RegisterIndividualFunctionalParameter. This informs MaCh3 which functional parameters are available; the configuration file determines which are actually used.

Special Step Proposal

Most parameters are assumed to have Gaussian or flat priors. However, some require special treatment, mostly for oscillation parameters, though any parameter can be affected. Handled ParameterHandlerBase::SpecialStepProposal

Circular Bounds

Parameters like delta_CP are defined between -π and +π but can wrap around continuously. Hence are called ParameterHandlerBase::CircularParBounds

Example YAML configuration:

- Systematic:
Names:
FancyName: delta_cp
SpecialProposal:
CircularBounds: [-3.141592, 3.141592]

Flip Parameter Value

Parameters like delta_M2_32 can ParameterHandlerBase::FlipParameterValue between normal and inverted ordering.

Example YAML configuration:

- Systematic:
Names:
FancyName: sin2th_23
SpecialProposal:
FlipParameter: 0.5112 # Flip octant around point of maximal disappearance