Making Models:
The "models" which describe sources (additive models) and modifiers (multiplicative, convolution, etc) are represented by Component objects with subtypes AddComponent, MulComponent, ConComponent, MixComponent etc. These differ by implementing the notion of "calculating" differently. The class Model represents a sum of one or more ComponentGroup objects, which in turn consists of one or more Component objects together with an expression that retains how they are to be combined. The Composite implementation allows the calculation/combination procedure to proceed recursively by combining [i.e. calculating, then multiplying, convolving, mixing, etc expressions such as
phabs(powerlaw + gaussian)]
ComponentGroups into single Component type objects that are then summed for the model. As a result, XSPEC12 can compute more complex expressions – and is also able to express model calculation by
abstract high level code, which is a definite advantage for future developers. The cost is a little overhead to the job of calculating models.
