Skip to content

Repetition of wrapper methods #19

@spaulaus

Description

@spaulaus

Trace, EventProcessor and DetectorDriver all have wrapper methods for the plotting commands. In all cases the code is identical.

virtual void plot(int dammId, double val1, double val2 = -1,
                  double val3 = -1, const char* name="h") const {
    histo.Plot(dammId, val1, val2, val3, name);
}
virtual void DeclareHistogram1D(int dammId, int xSize, const char* title) {
    histo.DeclareHistogram1D(dammId, xSize, title);
}
virtual void DeclareHistogram2D(int dammId, int xSize, int ySize,
                                const char* title) {
    histo.DeclareHistogram2D(dammId, xSize, ySize, title);
}

I propose we clean this up by making the Plots class a singleton, which prevents us from making 3 copies of this class with exactly the same name. I have not yet figured out how to define the wrapper functions in a clean way. We could possibly define it in the Globals header in a "plotting" namespace?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions