Warning, /jana2/docs/advanced.md is written in an unsupported language. File is not indexed.
0001
0002 ## Design Details
0003
0004 ### JComponent
0005
0006 JComponent is the base class for most JANA2 interfaces that users are meant to implement, such as `JFactory` and `JEventProcessor`. JComponents all have:
0007 - An `Init()` callback which is called sequentially during JApplication::Initialize()
0008 - `Parameter` and `Service` declarations that JANA2 will inject before `Init()` is called
0009 - A unique *parameter prefix* so that all parameters that belong to this component are given their own namespace
0010 - A `JLogger` logger which is preconfigured before `Init()` is called, and accessed via `GetLogger()`
0011 - A *logger group* name, which defaults to the parameter prefix. Thus each component's log levels can be changed individually, but this can be made less granular if desired
0012 - The type name of the component
0013 - The plugin name that provided the component
0014
0015
0016 ### JDatabundle
0017
0018 JDatabundle is JANA2's abstraction for all data input or output by a JComponent. Such data is roughly tabular, aka `awkward-array`-shaped. There are two distinct flavors: `lightweight` and `podio`, represented by `JLightweightDatabundle` and `JPodioDatabundle` respectively. Lightweight databundles contain a `std::vector<T*>` pointer, where `T` is fundamentally a plain `struct` which optionally inherits from `JObject`. Podio databundles, on the other hand, contain a pointer to a `podio::CollectionBase`.
0019
0020 Databundles are not required to own their contents -- Podio specifically forbids this. Lightweight databundles also do not own their contents, although this may be temporary, as this is mainly to assist in migrating away from the original design, where the contents of each databundle was wrapped by a unique JFactory instead. This new design allows a JFactory to have multiple outputs, and dramatically reduces the complexity of the machinery needed.
0021
0022 
0023
0024
0025 ### Component inputs and outputs
0026
0027 Components may inherit from JHasInputs and/or JHasOutputs. Specifically: JMultifactories, unfolders, and folders inherit from both, (old) JFactories and processors only inherit from JHasInputs, and eventually sources will inherit from HasOutputs. These enable the component writer to declare inputs and outputs respectively, bypassing the (old) JEvent interface.
0028
0029 Different flavors of inputs and outputs are provided. Each input or output is either single (i.e. it corresponds to exactly one databundle) or variadic (i.e. it corresponds to a list of databundles all of the same type and event level). This abstraction allows the component to be externally wired (e.g. by using JOmniFactoryGenerator or JWiredFactoryGenerator). To configure these inputs, the caller needs to provide:
0030
0031 - A vector of databundle names for the single inputs/outputs, assigned in declaration order.
0032 - A vector of vectors of databundle names for the variadic inputs/outputs, assigned in declaration order.
0033
0034
0035
0036