Selection Template
selection_template is the abstract base class for all user-defined event
selections. It provides the framework integration (clone, build,
CompileEvent, merge) and a rich library of typed helper templates for
summing, vectorising, upcasting/downcasting, and uniquifying particle collections
without manual memory management.
Class: selection_template
Header: <templates/selection_template.h>
Inheritance: tools
Properties
Property |
Type |
Description |
|---|---|---|
|
|
Selection class name. Settable/Gettable. |
|
|
18-character event hash. Settable/Gettable. |
|
|
ROOT tree name. Read-only. |
|
|
Event weight. Settable/Gettable. |
|
|
Event sequential index. Settable. |
Public Fields
Field |
Type |
Description |
|---|---|---|
|
|
Maps selection-name → {weight-name → value} for passed events. |
|
|
Maps file hash → metadata struct for this selection. |
|
|
Pointer to the dataset metadata object. |
|
|
Source ROOT file path. |
|
|
Worker-thread index (set by the framework). Default |
|
|
Raw event-level data struct. |
Virtual Methods (Override in Subclass)
Signature |
Description |
|---|---|
|
Returns a heap-allocated copy of the selection. |
|
Primary override. Return |
|
Secondary filter called before |
|
Merges results from a parallel worker instance sel into |
|
Serialises the selection result for event at index idx / hash hx. |
|
Writes the kinematic attributes attrs for particles to the output ROOT tree under branch name. |
Scalar and Particle Write Methods
Signature |
Description |
|---|---|
|
Writes a pointer-to-scalar var to the output tree under branch name. |
|
Writes a scalar var by value to the output tree under branch name. |
|
Typed wrapper: downcasts particles to |
|
Dispatches kinematic attribute extraction to the appropriate output
vector ( |
Particle Utility Templates
Signature |
Description |
|---|---|
|
Sums the 4-momenta of ch into a new synthesised particle |
|
Convenience wrapper: vectorises the map and calls the vector overload. |
|
Returns the invariant mass (in GeV) of the combined particle. |
|
Deletes particles that are not marked ( |
|
Converts a hash→particle map to a flat vector. |
|
Returns a copy of inpt with duplicate hashes removed (last occurrence kept). |
|
Appends all elements of inpt cast to |
|
Appends all map values cast to g * into out. |
|
Appends all vector elements cast to g * into out. |
|
Filters inpt to particles with |
|
Returns |
Framework Methods
Signature |
Description |
|---|---|
|
Framework-internal: calls |
|
Framework-internal: links the selection to the event and calls
|
|
Hash-equality comparison. |
|
Looks up stored event weights by hash; returns a vector of weight maps. |