icecube.production_histograms.histograms.expression_histogram module¶
- class icecube.production_histograms.histograms.expression_histogram.ExpressionHistogram(xmin, xmax, nbins, name, expression)¶
Bases:
Histogram
This class makes is easy to generate histograms by taking a python expression that’s used to calculate the value to be histogrammed.
This expression is passed directly to the built-in function ‘eval’ where frame, I3Units, and everything in the python math library is available.
So ‘log10(frame[“SomeParticle”].energy/I3Units.GeV)’ is a valid expression.
Users typically should not use this class directly, but instead one of its derived classes like PhysicsHistogram or DAQHistogram.
You have to specify several things on construction. - xmin : Minimum x value. - xmax : Maximum x value. - nbins : Number of bins. - name : Histogram name.
- expressionThis expression is passed directly to the python
built-in fuction ‘eval’ which returns the value to be histogrammed. NB: ‘frame’ is available.
So ‘log10(frame[“MyParticle”].energy/I3Units.GeV)’ is perfectly valid.