5#ifndef RATESANALYSIS_RATESHISTOBASE_H
6#define RATESANALYSIS_RATESHISTOBASE_H 1
11#include "GaudiKernel/ServiceHandle.h"
16#include <unordered_map>
103 static bool isZero(
double v) {
return abs(v) < std::numeric_limits<double>::min(); }
104 static bool isNotPositive(
double v) {
return v < std::numeric_limits<double>::min(); }
RatesBinIdentifier_t
Lables a bin in a histogram.
@ kPASS_RAW_BIN
Bin used to store the raw total events in which the trigger passed.
@ kEXPRESS_BIN
Bin used to store the express rate.
@ kPASS_WEIGHTED_AND_BIN
Bin used to store the total rate (AND)
@ kPASS_WEIGHTED_OR_BIN
Bin used to store the total rate (OR)
@ kACTIVE_RAW_BIN
Bin used to store the raw total events in which the trigger was active.
@ kACTIVE_WEIGHTED_BIN
Bin used to store the weighted events in which the trigger was active.
@ kUNIQUE_BIN
Bin used to store data needed to get the unique rate.
@ kNRATES_BINS
Must always come last.
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
@ kMU_SCALING
Scale trigger linearly but only in the change in <mu>
@ kBUNCH_SCALING
Scale trigger linearly but only in the number of bunches.
@ kLINEAR
Scale trigger linearly with luminosity.
@ kNONE
Do not scale this trigger for changes in luminosity.
@ kEXPO_MU
Scale trigger linearly in bunches and exponentially in mu.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const
void setDataName(const std::string &newName)
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
void setRateVsTrainName(const std::string &newName)
void clearTrainHist()
In some jobs we don't want to do the rates vs.
RatesHistoBase & operator=(const RatesHistoBase &)=delete
StatusCode giveDataHist(const ServiceHandle< ITHistSvc > &svc, const std::string &name)
std::unique_ptr< TH1 > m_rateVsMu
Histogram of rate as a fn.
bool doHistograms() const
If histogramming was enabled in this rates object.
TH1 * m_rateVsTrainCachedPtr
Cached, non-owning pointer.
RatesHistoBase(const std::string &name, IMessageSvc *msgSvc, const bool doHistograms=true)
virtual ~RatesHistoBase()
StatusCode giveTrainHist(const ServiceHandle< ITHistSvc > &svc, const std::string &name)
RatesHistoBase(const RatesHistoBase &)=delete
StatusCode giveMuHist(const ServiceHandle< ITHistSvc > &svc, const std::string &name)
TH1 * m_rateVsMuCachedPtr
Cached, non-owning pointer.
std::unique_ptr< TH1 > m_data
Histogram of raw rates quantites, for when we need to normalise offline (e.g.
static bool isNotPositive(double v)
void setRateVsMuName(const std::string &newName)
std::unique_ptr< TH1 > m_rateVsTrain
Histogram of rate as a fn.
static bool isZero(double v)
bool m_doHistograms
If histogramming is switched on.
TH1 * m_dataCachedPtr
Cached, non-owning pointer.
std::string m_name
My name.
Structure to hold per-event weights for distribution.
double m_enhancedBiasWeight
A property of the event derived from online enhanced bias prescales.
bool m_isUnbiased
If the event was taken online with a RD trigger.
uint32_t m_distanceInTrain
How far into the bunch train the event was, in bunch crossings.
double m_eventLumi
The instantaneous lumi in cm-2s-1.
const double m_noScaling
Weight for no scaling.
double m_eventMu
The actual number of interactions in the event.
double m_muFactor
What weight needs to be applied to extrapolate rates linear in mu.
double m_expoMuFactor
What weight needs to be applied to extrapolate rates linear in bunches and exponential in mu.
double m_linearLumiFactor
What weight needs to be applied to extrapolate rates linear in mu and bunches.
double m_eventLiveTime
How much wall-time at P1 did this event represent.
double m_bunchFactor
What weight needs to be applied to extrapolate rates linear in number of bunches.
const std::string print()