Mix-in to add mutability to a org.dianahep.histogrammar.Container.
Mix-in to add mutability to a org.dianahep.histogrammar.Container.
Containers without Aggregation
can only be merged with the +
operator, but containers with Aggregation
can additionally be accumulated with fill
.
Containers without Aggregation
are named as past-tense verbs, such as "Counted" and "Binned", which containers with Aggregation
are named with the gerund form, such as "Counting" and "Binning".
Aggregation
is parameterized by the fill data type Datum
, which is an abstract type member rather than a type parameter (square brackets) for better type inference.
This data type is implemented as contravariant: a container that expects to be filled with a given data type can accept that data type's subclass.
Sub-trait of org.dianahep.histogrammar.Aggregation for all containers except org.dianahep.histogrammar.Counting.
Sub-trait of org.dianahep.histogrammar.Aggregation for all containers except org.dianahep.histogrammar.Counting.
AggregationOnData
containers actually depend on their Datum
type; Counting
is the only one that ignores it.
Trait for aggregations that use a fill rule of any type.
An accumulated weighted mean of a given quantity.
An accumulated weighted mean of a given quantity.
Use the factory org.dianahep.histogrammar.Average to construct an instance.
Accumulating a weighted mean of a given quantity.
Accumulating a weighted mean of a given quantity.
Use the factory org.dianahep.histogrammar.Average to construct an instance.
An accumulated bag of numbers, vectors of numbers, or strings.
An accumulated bag of numbers, vectors of numbers, or strings.
Use the factory org.dianahep.histogrammar.Bag to construct an instance.
An accumulated bag of numbers, vectors of numbers, or strings.
An accumulated bag of numbers, vectors of numbers, or strings.
Use the factory org.dianahep.histogrammar.Bag to construct an instance.
An accumulated quantity that was split into equally spaced bins between specified limits and filling only one bin per datum.
An accumulated quantity that was split into equally spaced bins between specified limits and filling only one bin per datum.
Use the factory org.dianahep.histogrammar.Bin to construct an instance.
Accumulating a quantity by splitting it into equally spaced bins between specified limits and filling only one bin per datum.
Accumulating a quantity by splitting it into equally spaced bins between specified limits and filling only one bin per datum.
Use the factory org.dianahep.histogrammar.Bin to construct an instance.
An accumulated collection of containers of the ANY type, indexed by number.
An accumulated collection of containers of the ANY type, indexed by number.
Use the factory org.dianahep.histogrammar.Branch to construct an instance.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branched
containers.
Accumulating a collection of containers of the ANY type, indexed by number.
Accumulating a collection of containers of the ANY type, indexed by number.
Use the factory org.dianahep.histogrammar.Branch to construct an instance.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Add i0
, i1
, etc.
Add i0
, i1
, etc. methods to Branching
containers.
Wraps a user's function for extracting strings (categories) from the input data type.
Trait for aggregations that use a categorical (string-valued) fill rule.
An accumulated quantity that was split by its categorical (string-based) values, filling only one category per datum.
An accumulated quantity that was split by its categorical (string-based) values, filling only one category per datum.
Use the factory org.dianahep.histogrammar.Categorize to construct an instance.
Accumulating a quantity by splitting it by its categorical (string-based) value and filling only one category per datum.
Accumulating a quantity by splitting it by its categorical (string-based) value and filling only one category per datum.
Use the factory org.dianahep.histogrammar.Categorize to construct an instance.
An accumulated quantity that was split into bins defined by bin centers, filling only one datum per bin with no overflows or underflows.
An accumulated quantity that was split into bins defined by bin centers, filling only one datum per bin with no overflows or underflows.
Use the factory org.dianahep.histogrammar.CentrallyBin to construct an instance.
Accumulating a quantity by splitting it into bins defined by bin centers, filling only one datum per bin with no overflows or underflows.
Accumulating a quantity by splitting it into bins defined by bin centers, filling only one datum per bin with no overflows or underflows.
Use the factory org.dianahep.histogrammar.CentrallyBin to construct an instance.
Methods that are implicitly added to container combinations that look like (nested) collections.
Combine function for Apache Spark's aggregate
method.
Combine function for Apache Spark's aggregate
method.
Typical use: filledHistogram = datasetRDD.aggregate(initialHistogram)(new Increment, new Combine)
where datasetRDD
is a collection of initialHistogram
's Datum
type.
Interface for classes that contain aggregated data, such as "Counted" or "Binned" (immutable) or "Counting" or "Binning" (mutable).
Interface for classes that contain aggregated data, such as "Counted" or "Binned" (immutable) or "Counting" or "Binning" (mutable).
There are two "tenses" of containers: present tense ("Counting", "Binning", etc.) that additionally mix-in org.dianahep.histogrammar.Aggregation and have a fill
method for accumulating data, and past tense ("Counted", "Binned", etc.) that can only be merged with the +
operator.
Containers are monoids: they have a neutral element (zero
) and an associative operator (+
). Thus, partial sums aggregated in parallel can be combined arbitrarily.
The Container
is parameterized by itself (an example of the curiously recurring template pattern) to pass type information at compile-time.
Exception type for improperly configured containers.
An accumulated count (sum of weights) of data, ignoring its content.
An accumulated count (sum of weights) of data, ignoring its content.
Use the factory org.dianahep.histogrammar.Count to construct an instance.
Accumulating a count (sum of weights) of data, ignoring its content.
Accumulating a count (sum of weights) of data, ignoring its content.
Use the factory org.dianahep.histogrammar.Count to construct an instance.
This is the only container with org.dianahep.histogrammar.Aggregation that doesn't have a configurable data type: its Datum
is Any
. It is primarily for the sake of this container that Aggregation
is contravariant.
An accumulated weighted variance (and mean) of a given quantity.
An accumulated weighted variance (and mean) of a given quantity.
Use the factory org.dianahep.histogrammar.Deviate to construct an instance.
Accumulating a weighted variance (and mean) of a given quantity.
Accumulating a weighted variance (and mean) of a given quantity.
Use the factory org.dianahep.histogrammar.Deviate to construct an instance.
Interface for a container factory, always named as imperative verbs, such as "Count" and "Bin".
Interface for a container factory, always named as imperative verbs, such as "Count" and "Bin".
Each factory has:
apply
method to create an active container than can aggregate data (and is therefore mutable). This active container is named by the gerund form of the verb, such as "Counting" and "Binning".ed
method to create a fixed container that cannot aggregate data (immutable), only merge with the +
operator. This fixed container is named by the past tense form of the verb, such as "Counted" and "Binned".fromJsonFragment
method that can reconstruct a fixed (immutable) container from its JSON representation. This is used by the Factory
object's fromJson
entry point. (Click on the "t" in a circle in the upper-left to see the Factory
object's documentation, rather than the Factory
trait.unapply
methods to unpack active and fixed containers in Scala pattern matching.An accumulated pair of containers, one with all data (denominator), and one with data that passed a given selection (numerator).
An accumulated pair of containers, one with all data (denominator), and one with data that passed a given selection (numerator).
Use the factory org.dianahep.histogrammar.Fraction to construct an instance.
Methods that are implicitly added to container combinations that look like fractioned histograms.
Accumulating a pair of containers, one with all data (denominator), and one with data that passed a given selection (numerator).
Accumulating a pair of containers, one with all data (denominator), and one with data that passed a given selection (numerator).
Use the factory org.dianahep.histogrammar.Fraction to construct an instance.
Methods that are implicitly added to container combinations that look like histograms.
Type alias for conventional histograms (filled).
Type alias for conventional histograms (filling).
Increment function for Apache Spark's aggregate
method.
Increment function for Apache Spark's aggregate
method.
Typical use: filledHistogram = datasetRDD.aggregate(initialHistogram)(new Increment, new Combine)
where datasetRDD
is a collection of initialHistogram
's Datum
type.
An accumulated collection of containers of the SAME type, indexed by number.
An accumulated collection of containers of the SAME type, indexed by number.
Use the factory org.dianahep.histogrammar.Index to construct an instance.
Accumulating a collection of containers of the SAME type, indexed by number.
Accumulating a collection of containers of the SAME type, indexed by number.
Use the factory org.dianahep.histogrammar.Index to construct an instance.
An accumulated suite of containers, each collecting data between a pair of given cuts on a given quantity.
An accumulated suite of containers, each collecting data between a pair of given cuts on a given quantity.
Use the factory org.dianahep.histogrammar.IrregularlyBin to construct an instance.
Accumulating a suite of containers, each collecting data between a pair of given bins on a given quantity.
Accumulating a suite of containers, each collecting data between a pair of given bins on a given quantity.
Use the factory org.dianahep.histogrammar.IrregularlyBin to construct an instance.
Persistent JSON output file or named pipe (for use with Histogrammar Watcher (hgwatch)).
An accumulated collection of containers of the SAME type, labeled by strings.
An accumulated collection of containers of the SAME type, labeled by strings.
Use the factory org.dianahep.histogrammar.Label to construct an instance.
Accumulating a collection of containers of the SAME type, labeled by strings.
Accumulating a collection of containers of the SAME type, labeled by strings.
Use the factory org.dianahep.histogrammar.Label to construct an instance.
An accumulated maximum of a given quantity.
An accumulated maximum of a given quantity. If no data are observed, the result is NaN
.
Use the factory org.dianahep.histogrammar.Maximize to construct an instance.
Accumulating the maximum of a given quantity.
Accumulating the maximum of a given quantity. If no data are observed, the result is NaN
.
Use the factory org.dianahep.histogrammar.Maximize to construct an instance.
An accumulated minimum of a given quantity.
An accumulated minimum of a given quantity. If no data are observed, the result is NaN
.
Use the factory org.dianahep.histogrammar.Minimize to construct an instance.
Accumulating the minimum of a given quantity.
Accumulating the minimum of a given quantity. If no data are observed, the result is NaN
.
Use the factory org.dianahep.histogrammar.Minimize to construct an instance.
Wraps a user's function for extracting multidimensional numeric data from the input data type.
Mix-in to declare that the org.dianahep.histogrammar.Container is immutable (opposite of org.dianahep.histogrammar.Aggregation).
Introduces a ===
operator for all Double
tolerance comparisons.
Introduces a ===
operator for all Double
tolerance comparisons.
Custom equality rules:
Python's math.isclose algorithm is applied for non-NaNs:
abs(x - y) <= max(relativeTolerance * max(abs(x), abs(y)), absoluteTolerance)
Trait for aggregations that use a numerical (double-valued) fill rule.
Methods that are implicitly added to container combinations that look like partitioned histograms.
Methods that are implicitly added to container combinations that look like a physicist's "profile plot."
Type alias for a physicist's "profile plot," which is a Profile with variances (filled).
Type alias for a physicist's "profile plot," which is a Profile with variances (filling).
Methods that are implicitly added to container combinations that look like a physicist's "profile plot."
Type alias for binwise averages (filled).
Type alias for binwise averages (filling).
Mix-in to provide a quantity name for immutable Containers (analogous to org.dianahep.histogrammar.AnyQuantity for mutable Containers).
An accumulated aggregator of data that passed the cut.
Accumulating an aggregator of data that passes a cut.
An accumulated quantity that was split into equally spaced bins, filling only one bin per datum and creating new bins as necessary.
An accumulated quantity that was split into equally spaced bins, filling only one bin per datum and creating new bins as necessary.
Use the factory org.dianahep.histogrammar.SparselyBin to construct an instance.
Accumulating a quantity by splitting it into equally spaced bins, filling only one bin per datum and creating new bins as necessary.
Accumulating a quantity by splitting it into equally spaced bins, filling only one bin per datum and creating new bins as necessary.
Use the factory org.dianahep.histogrammar.SparselyBin to construct an instance.
Type alias for sparsely binned histograms (filled).
Type alias for sparsely binned histograms (filling).
Type alias for a physicist's sparsely binned "profile plot," which is a Profile with variances (filled).
Type alias for a physicist's sparsely binned "profile plot," which is a Profile with variances (filling).
Type alias for sparsely binned binwise averages.
Type alias for sparsely binned binwise averages. (filled).
Type alias for sparsely binned binwise averages (filling).
An accumulated suite of containers, each collecting data above a given cut on a given quantity.
An accumulated suite of containers, each collecting data above a given cut on a given quantity.
Use the factory org.dianahep.histogrammar.Stack to construct an instance.
Methods that are implicitly added to container combinations that look like stacked histograms.
Accumulating a suite of containers, each collecting data above a given cut on a given quantity.
Accumulating a suite of containers, each collecting data above a given cut on a given quantity.
Use the factory org.dianahep.histogrammar.Stack to construct an instance.
An accumulated weighted sum of a given quantity.
An accumulated weighted sum of a given quantity.
Use the factory org.dianahep.histogrammar.Sum to construct an instance.
Accumulating a weighted sum of a given quantity.
Accumulating a weighted sum of a given quantity.
Use the factory org.dianahep.histogrammar.Sum to construct an instance.
Methods that are implicitly added to container combinations that look like two-dimensional histograms.
Type alias for conventional, two-dimensional histograms (filled).
Type alias for conventional, two-dimensional histograms (filling).
Type alias for sparsely binned, two-dimensional histograms (filled).
Type alias for sparsely binned, two-dimensional histograms (filling).
An accumulated collection of containers of any type except org.dianahep.histogrammar.Counted, labeled by strings.
An accumulated collection of containers of any type except org.dianahep.histogrammar.Counted, labeled by strings.
Use the factory org.dianahep.histogrammar.UntypedLabel to construct an instance.
Accumulating a collection of containers of any type except org.dianahep.histogrammar.Counting, labeled by strings.
Accumulating a collection of containers of any type except org.dianahep.histogrammar.Counting, labeled by strings.
Use the factory org.dianahep.histogrammar.UntypedLabel to construct an instance.
Default weighting function that always returns 1.0.
Base trait for user functions.
Accumulate the weighted mean of a given quantity.
Accumulate the weighted mean of a given quantity.
Uses the numerically stable weighted mean algorithm described in Tony Finch, "Incremental calculation of weighted mean and variance" Univeristy of Cambridge Computing Service, 2009.
Factory produces mutable org.dianahep.histogrammar.Averaging and immutable org.dianahep.histogrammar.Averaged objects.
Accumulate raw numbers, vectors of numbers, or strings, with identical values merged.
Accumulate raw numbers, vectors of numbers, or strings, with identical values merged.
A bag is the appropriate data type for scatter plots: a container that collects raw values, maintaining multiplicity but not order. (A "bag" is also known as a "multiset.") Conceptually, it is a mapping from distinct raw values to the number of observations: when two instances of the same raw value are observed, one key is stored and their weights add.
Although the user-defined function may return scalar numbers, fixed-dimension vectors of numbers, or categorical strings, it may not mix range types. For the purposes of Label and Index (which can only collect aggregators of a single type), bags with different ranges are different types.
Factory produces mutable org.dianahep.histogrammar.Bagging and immutable org.dianahep.histogrammar.Bagged objects.
Split a quantity into equally spaced bins between a low and high threshold and fill exactly one bin per datum.
Split a quantity into equally spaced bins between a low and high threshold and fill exactly one bin per datum.
When composed with org.dianahep.histogrammar.Count, this produces a standard histogram:
Bin.ing(100, 0, 10, fill_x, Count.ing())
and when nested, it produces a two-dimensional histogram:
Bin.ing(100, 0, 10, fill_x, Bin.ing(100, 0, 10, fill_y, Count.ing()))
Combining with org.dianahep.histogrammar.Deviate produces a physicist's "profile plot:"
Bin.ing(100, 0, 10, fill_x, Deviate.ing(fill_y))
and so on.
Factory produces mutable org.dianahep.histogrammar.Binning and immutable org.dianahep.histogrammar.Binned objects.
Accumulate aggregators of different types, indexed by i0 through i9.
Accumulate aggregators of different types, indexed by i0 through i9. Every sub-aggregator is filled with every input datum.
This primitive provides an anonymous collection of aggregators of different types, usually for gluing together various statistics. For instance, if the following associates a sum of weights to every bin in a histogram,
Bin.ing(100, 0, 1, {d: Datum => d.x}, Sum.ing({d: Datum => d.weight}))
the following would associate the sum of weights and the sum of squared weights to every bin:
Bin.ing(100, 0, 1, {d: Datum => d.x}, Branch.ing(Sum.ing({d: Datum => d.weight}), Sum.ing({d: Datum => d.weight*d.weight})))
Branch is a basic building block for complex aggregators. The limitation to ten branches, indexed from i0 to i9, is a concession to type inference in statically typed languages. It is not a fundamental limit, but the type-metaprogramming becomes increasingly complex as branches are added. Error messages may be convoluted as the compiler presents internals of the type-metaprogramming in response to a user's simple mistake.
Therefore, individual implementations may allow more than ten branches, but the Histogrammar standard only requires ten.
To collect an unlimited number of aggregators of the same type without naming them, use org.dianahep.histogrammar.Index. To collect aggregators of the same type with string-based labels, use org.dianahep.histogrammar.Label. To collect aggregators of different types with string-based labels, use org.dianahep.histogrammar.UntypedLabel.
Factory produces mutable org.dianahep.histogrammar.Branching and immutable org.dianahep.histogrammar.Branched objects.
Note: there is nothing intrinsic about the limit of 10 items. The data themselves are stored in a linked list (in value space and type space) and index fields i0
through i9
are added implicitly to lists of type-length 2 through 10, respectively. Longer lists can be created by adding more implicit methods.
To create a Branched
, do Branch.ed(entries, h1, h2, h3, ...)
.
To create a Branching
, do Branch(h1, h2, h3, ...)
.
Split a given quantity by its categorical value and fill only one category per datum.
Split a given quantity by its categorical value and fill only one category per datum.
A bar chart may be thought of as a histogram with string-valued (categorical) bins, so this is the equivalent of org.dianahep.histogrammar.Bin for bar charts. The order of the strings is deferred to the visualization stage.
Unlike org.dianahep.histogrammar.SparselyBin, this aggregator has the potential to use unlimited memory. A large number of distinct categories can generate many unwanted bins.
Factory produces mutable org.dianahep.histogrammar.Categorizing and immutable org.dianahep.histogrammar.Categorized objects.
Split a quantity into bins defined by irregularly spaced bin centers, with exactly one sub-aggregator filled per datum (the closest one).
Split a quantity into bins defined by irregularly spaced bin centers, with exactly one sub-aggregator filled per datum (the closest one).
Unlike irregular bins defined by explicit ranges, irregular bins defined by bin centers are guaranteed to fully partition the space with no gaps and no overlaps. It could be viewed as cluster scoring in one dimension.
Factory produces mutable org.dianahep.histogrammar.CentrallyBinning and immutable org.dianahep.histogrammar.CentrallyBinned objects.
Count entries by accumulating the sum of all observed weights or a sum of transformed weights (e.g.
Count entries by accumulating the sum of all observed weights or a sum of transformed weights (e.g. sum of squares of weights).
An optional transform
function can be applied to the weights before summing. To accumulate the sum of squares of weights, use {x: Double => x*x}
, for instance. This is unlike any other primitive's quantity
function in that its domain is the weights (always double), not data (any type).
Factory produces mutable org.dianahep.histogrammar.Counting and immutable org.dianahep.histogrammar.Counted objects.
Accumulate the weighted mean and weighted variance of a given quantity.
Accumulate the weighted mean and weighted variance of a given quantity.
The variance is computed around the mean, not zero.
Uses the numerically stable weighted mean and weighted variance algorithms described in Tony Finch, "Incremental calculation of weighted mean and variance" Univeristy of Cambridge Computing Service, 2009.
Factory produces mutable org.dianahep.histogrammar.Deviating and immutable org.dianahep.histogrammar.Deviated objects.
Entry point for constructing containers from JSON and centralized registry of container types.
Entry point for constructing containers from JSON and centralized registry of container types.
Containers filled in Python or on remote sites are serialized as JSON that the Factory
object can reconstruct. Reconstructed containers are fixed (immutable, cannot aggregate), but can be merged with the +
operator. (Click on the "o" in a circle in the upper-left to see the Factory
trait's documentation, which explains the difference.)
To do this, the Factory
object must dispatch JSON to the appropriate container for interpretation. It therefore manages a global registry of container types (concrete instances of the Factory
trait). General users are not expected to add to this registry, but they could if they want to.
Accumulate two aggregators, one containing only entries that pass a given selection (numerator) and another that contains all entries (denominator).
Accumulate two aggregators, one containing only entries that pass a given selection (numerator) and another that contains all entries (denominator).
The aggregator may be a simple org.dianahep.histogrammar.Count to measure the efficiency of a cut, a org.dianahep.histogrammar.Bin to plot a turn-on curve, or anything else to be tested with and without a cut.
As a side effect of NaN values returning false for any comparison, a NaN return value from the selection is treated as a failed cut (the denominator is filled but the numerator is not).
Factory produces mutable org.dianahep.histogrammar.Fractioning and immutable org.dianahep.histogrammar.Fractioned objects.
Convenience function for creating a conventional histogram.
Accumulate any number of aggregators of the same type in a list.
Accumulate any number of aggregators of the same type in a list. Every sub-aggregator is filled with every input datum.
This primitive provides an anonymous collection of aggregators (unless the integer index is taken to have special meaning, but generally such bookkeeping should be encoded in strings). Indexes can be nested to create two-dimensional ordinal grids of aggregators. (Use org.dianahep.histogrammar.Bin if the space is to have a metric interpretation.)
Note that all sub-aggregators within an Index must have the same type (e.g. histograms of different binnings, but all histograms). To collect objects of different types, still indexed by integer, use org.dianahep.histogrammar.Branch.
To collect aggregators of the same type with string-based labels, use org.dianahep.histogrammar.Label. To collect aggregators of different types with string-based labels, use org.dianahep.histogrammar.UntypedLabel.
Factory produces mutable org.dianahep.histogrammar.Indexing and immutable org.dianahep.histogrammar.Indexed objects.
Accumulate a suite of aggregators, each between two thresholds, filling exactly one per datum.
Accumulate a suite of aggregators, each between two thresholds, filling exactly one per datum.
This is a variation on org.dianahep.histogrammar.Stack, which fills N + 1
aggregators with N
successively tighter cut thresholds. IrregularlyBin fills N + 1
aggregators in the non-overlapping intervals between N
thresholds.
IrregularlyBin is also similar to org.dianahep.histogrammar.CentrallyBin, in that they both partition a space into irregular subdomains with no gaps and no overlaps. However, CentrallyBin is defined by bin centers and IrregularlyBin is defined by bin edges, the first and last of which are at negative and positive infinity.
Factory produces mutable org.dianahep.histogrammar.IrregularlyBinning and immutable org.dianahep.histogrammar.IrregularlyBinned objects.
Accumulate any number of aggregators of the same type and label them with strings.
Accumulate any number of aggregators of the same type and label them with strings. Every sub-aggregator is filled with every input datum.
This primitive simulates a directory of aggregators. For sub-directories, nest collections within the Label collection.
Note that all sub-aggregators within a Label must have the same type (e.g. histograms of different binnings, but all histograms). To collect objects of different types with string-based look-up keys, use org.dianahep.histogrammar.UntypedLabel.
To collect aggregators of the same type without naming them, use org.dianahep.histogrammar.Index. To collect aggregators of different types without naming them, use org.dianahep.histogrammar.Branch.
In strongly typed languages, the restriction to a single type allows nested objects to be extracted without casting.
Factory produces mutable org.dianahep.histogrammar.Labeling and immutable org.dianahep.histogrammar.Labeled objects.
Find the maximum value of a given quantity.
Find the maximum value of a given quantity. If no data are observed, the result is NaN.
Factory produces mutable org.dianahep.histogrammar.Maximizing and immutable org.dianahep.histogrammar.Maximized objects.
Find the minimum value of a given quantity.
Find the minimum value of a given quantity. If no data are observed, the result is NaN.
Factory produces mutable org.dianahep.histogrammar.Minimizing and immutable org.dianahep.histogrammar.Minimized objects.
Convenience function for creating binwise averages.
Convenience function for creating a physicist's "profile plot," which is a Profile with variances.
Filter or weight data according to a given selection.
Filter or weight data according to a given selection.
This primitive is a basic building block, intended to be used in conjunction with anything that needs a user-defined cut. In particular, a standard histogram often has a custom selection, and this can be built by nesting Select -> Bin -> Count.
Select also resembles org.dianahep.histogrammar.Fraction, but without the denominator
.
The efficiency of a cut in a Select aggregator named x
is simply x.cut.entries / x.entries
(because all aggregators have an entries
member).
Factory produces mutable org.dianahep.histogrammar.Selecting and immutable org.dianahep.histogrammar.Selected (sic) objects.
Split a quantity into equally spaced bins, creating them whenever their entries
would be non-zero.
Split a quantity into equally spaced bins, creating them whenever their entries
would be non-zero. Exactly one sub-aggregator is filled per datum.
Use this when you have a distribution of known scale (bin width) but unknown domain (lowest and highest bin index).
Unlike fixed-domain binning, this aggregator has the potential to use unlimited memory. A large number of distinct outliers can generate many unwanted bins.
Like fixed-domain binning, the bins are indexed by integers, though they are 64-bit and may be negative. Bin indexes below -(2**63 - 1)
are put in the -(2**63 - 1)
are bin and indexes above (2**63 - 1)
are put in the (2**63 - 1)
bin.
Factory produces mutable org.dianahep.histogrammar.SparselyBinning and immutable org.dianahep.histogrammar.SparselyBinned objects.
Convenience function for creating a sparsely binned histogram.
Convenience function for creating sparsely binned binwise averages.
Convenience function for creating a physicist's sparsely binned "profile plot," which is a Profile with variances.
Accumulates a suite of aggregators, each filtered with a tighter selection on the same quantity.
Accumulates a suite of aggregators, each filtered with a tighter selection on the same quantity.
This is a generalization of org.dianahep.histogrammar.Fraction, which fills two aggregators, one with a cut, the other without. Stack fills N + 1
aggregators with N
successively tighter cut thresholds. The first is always filled (like the denominator of Fraction), the second is filled if the computed quantity exceeds its threshold, the next is filled if the computed quantity exceeds a higher threshold, and so on.
The thresholds are presented in increasing order and the computed value must be greater than or equal to a threshold to fill the corresponding bin, and therefore the number of entries in each filled bin is greatest in the first and least in the last.
Although this aggregation could be visualized as a stack of histograms, stacked histograms usually represent a different thing: data from different sources, rather than different cuts on the same source. For example, it is common to stack Monte Carlo samples from different backgrounds to show that they add up to the observed data. The Stack aggregator does not make plots of this type because aggregation trees in Histogrammar draw data from exactly one source.
To make plots from different sources in Histogrammar, one must perform separate aggregation runs. It may then be convenient to stack the results of those runs as though they were created with a Stack aggregation, so that plotting code can treat both cases uniformly. For this reason, Stack has an alternate constructor to build a Stack manually from distinct aggregators, even if those aggregators came from different aggregation runs.
Factory produces mutable org.dianahep.histogrammar.Stacking and immutable org.dianahep.histogrammar.Stacked objects.
Accumulate the (weighted) sum of a given quantity, calculated from the data.
Accumulate the (weighted) sum of a given quantity, calculated from the data.
Sum differs from org.dianahep.histogrammar.Count in that it computes a quantity on the spot, rather than percolating a product of weight metadata from nested primitives. Also unlike weights, the sum can add both positive and negative quantities (weights are always non-negative).
Factory produces mutable org.dianahep.histogrammar.Summing and immutable org.dianahep.histogrammar.Summed objects.
Convenience function for creating a conventional, two-dimensional histogram.
Convenience function for creating a sparsely binned, two-dimensional histogram.
Accumulate any number of aggregators of any type and label them with strings.
Accumulate any number of aggregators of any type and label them with strings. Every sub-aggregator is filled with every input datum.
This primitive simulates a directory of aggregators. For sub-directories, nest collections within the UntypedLabel.
Note that sub-aggregators within an UntypedLabel may have different types. In strongly typed languages, this flexibility poses a problem: nested objects must be type-cast before they can be used. To collect objects of the same type with string-based look-up keys, use org.dianahep.histogrammar.Label.
To collect aggregators of the same type without naming them, use org.dianahep.histogrammar.Index. To collect aggregators of different types without naming them, use org.dianahep.histogrammar.Branch.
Factory produces mutable org.dianahep.histogrammar.UntypedLabeling and immutable org.dianahep.histogrammar.UntypedLabeled objects.
Note: the compiler cannot predict the type of data that is drawn from this collection, so it must be cast with as
.
Methods for drawing familiar combinations of containers, such as histograms, in ASCII art.
Help function for interactive use.
Help function for interactive use. Used to discover container types.
Provides support for parsing and stringifying JSON.
Provides support for parsing and stringifying JSON.
This module is a new implementation; it does not depend on packages such as Jackson. This choice was to provide the following features:
fromJsonFragment
methods"-inf"
, "inf"
, "nan"
as numbers, rather than stringsNone
, rather than raising exceptions.
Default weighting function that always returns 1.0.
Supporting functions, mostly called by those in org.dianahep.histogrammar.
Main library for Histogrammar.
Defines all types for the general user, including implicits to construct Histogrammar-specific types from Scala basic types.
A general user is expected to
import org.dianahep.histogrammar._
to bring all of these implicits into scope.