Observable¶
-
class Observable : public madspace::FunctionGenerator¶
Kinematic observable evaluated for a selection of outgoing particles.
Selects particles by PDG id (
pids), optionally groups them into tuples (select_pids) and sums the momenta of each tuple, then evaluates one ObservableOption for every selection [1]. Several PDG types may be combined, for example all jet flavours. The available observables are single-momentum functions (e,px,py,pz,mass,pt,p_mag,phi,theta,y,y_abs,eta,eta_abs), pair functions (delta_eta,delta_phi,delta_r,pair_mass,sfos_pair_mass), and the event-levelsqrt_s.sfos_pair_massispair_massrestricted to same-flavour opposite-sign pairs, i.e. pairs whose PDG ids areidand-id(the l+ l- pairs of MadEvent’smmll); it needs the signed PDG ids of the actual flavours inpidsand cannot be combined with ordering. The same mechanism defines the observables used by Cuts and ObservableHistograms.batchis the leading batch dimension.nis the number of selected particles andkthe number of selections.Arguments
momenta–float, shape(batch, n, 4)– the selected four-momenta.
Returns
observable–float, shape(batch,)or(batch, k)– the observable value, one per selection unlesssum_observablecollapses them.
References
[1] T. Heimel, O. Mattelaer, R. Winterhalder, “MadSpace”, https://arxiv.org/abs/2602.06895 (Sec. 3.2.4)
Public Types
-
enum ObservableOption¶
Kinematic quantity computed by an Observable.
Values:
-
enumerator obs_e¶
-
enumerator obs_px¶
-
enumerator obs_py¶
-
enumerator obs_pz¶
-
enumerator obs_mass¶
-
enumerator obs_pt¶
-
enumerator obs_p_mag¶
-
enumerator obs_phi¶
-
enumerator obs_theta¶
-
enumerator obs_y¶
-
enumerator obs_y_abs¶
-
enumerator obs_eta¶
-
enumerator obs_eta_abs¶
-
enumerator obs_delta_eta¶
-
enumerator obs_delta_phi¶
-
enumerator obs_delta_r¶
-
enumerator obs_pair_mass¶
-
enumerator obs_sqrt_s¶
-
enumerator obs_sfos_pair_mass¶
-
enumerator obs_e¶
Public Functions
-
Observable(const std::vector<int> &pids, ObservableOption observable, const nested_vector2<int> &select_pids, bool sum_momenta = false, bool sum_observable = false, const std::optional<ObservableOption> &order_observable = std::nullopt, const std::vector<int> &order_indices = {}, bool ignore_incoming = true, const std::string &name = "")¶
- Parameters:
pids – PDG ids selecting the outgoing particles.
observable – Which ObservableOption to compute.
select_pids – Groups of PDG ids forming the tuples the pair / summed observables act on; empty selects every matching particle individually.
sum_momenta – Sum the four-momenta within each tuple before evaluating the observable.
sum_observable – Sum the computed observable over all selections.
order_observable – Optional observable used to sort the selections before
order_indicesis applied.order_indices – After sorting by
order_observable, keep only these positions.ignore_incoming – Exclude the two incoming partons from the selection.
name – Label for the returned value.
-
inline ObservableOption observable() const¶
The kinematic quantity this observable computes.
-
inline const nested_vector2<me_int_t> &indices() const¶
Per-selection lists of particle indices the observable is evaluated on.
-
inline bool sum_momenta() const¶
Whether the tuple momenta are summed before evaluation.
-
inline bool ordered() const¶
Whether the selection is sorted first (e.g.
the leading jet). The entries of indices() are then positions in the sorted list, not particle indices.
-
inline std::vector<std::size_t> simple_observable_indices() const¶
Flat particle-index list for a single ungrouped, unsummed selection; empty otherwise.
-
inline std::string name() const¶
The label passed to the constructor.
-
bool not_found() const¶
True when no particle in the event matches the requested
pids.
Public Static Attributes
-
static const std::vector<int> jet_pids¶
PDG ids commonly grouped as a jet.
-
static const std::vector<int> bottom_pids¶
PDG ids of the b quark.
-
static const std::vector<int> lepton_pids¶
PDG ids of the charged leptons.
-
static const std::vector<int> missing_pids¶
PDG ids treated as missing energy (neutrinos).
-
static const std::vector<int> photon_pids¶
PDG id of the photon.