|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/ITHistSvc.h"
12 const double thresholdMin,
const double thresholdMax,
const uint32_t thresholdBins,
14 const double prescale,
15 const std::string&
seedName,
const double seedPrescale,
18 m_rateScanHist(nullptr), m_rateScanHistCachedPtr(nullptr), m_thresholdPassed(0), m_behaviour(behaviour)
20 m_rateScanHist = std::make_unique<TH1D>(
"", TString(
name +
";Threshold;Rate [Hz]"), thresholdBins, thresholdMin, thresholdMax);
28 const std::vector<double>& thresholdBinEdged,
30 const double prescale,
31 const std::string&
seedName,
const double seedPrescale,
34 m_rateScanHist(nullptr), m_rateScanHistCachedPtr(nullptr), m_thresholdPassed(0), m_behaviour(behaviour)
36 if (thresholdBinEdged.size() < 2) {
37 ATH_MSG_ERROR(
"Need more than one entry in thresholdBinEdged to define histogram binning.");
40 size_t nBins = thresholdBinEdged.size() - 1;
41 m_rateScanHist = std::make_unique<TH1D>(
"", TString(
name +
";Threshold;Rate [Hz]"),
nBins, thresholdBinEdged.data());
65 return StatusCode::SUCCESS;
97 ss << std::setfill(
' ');
104 ss <<
" Threshold <= " << std::setw(11) << std::left << std::as_const(*m_rateScanHistCachedPtr).GetXaxis()->GetXmin();
106 ss <<
" +- " << std::setw(11) << std::left <<
m_rateScanHistCachedPtr->GetBinError(0)/ratesDenominator <<
" Hz" << std::endl;
109 ss <<
" Threshold <= ";
116 ss <<
" Threshold > " << std::setw(11) << std::left << std::as_const(*m_rateScanHistCachedPtr).GetXaxis()->GetXmax();
122 ss <<
" Threshold < " << std::setw(11) << std::left << std::as_const(*m_rateScanHistCachedPtr).GetXaxis()->GetXmin();
124 ss <<
" +- " << std::setw(11) << std::left <<
m_rateScanHistCachedPtr->GetBinError(0)/ratesDenominator <<
" Hz" << std::endl;
127 ss <<
" Threshold >= ";
134 ss <<
" Threshold >= " << std::setw(11) << std::left << std::as_const(*m_rateScanHistCachedPtr).GetXaxis()->GetXmax();
const double m_prescale
My prescale factor.
TH1 * m_rateScanHistCachedPtr
const std::string m_name
My name.
std::unique_ptr< TH1 > m_rateScanHist
Even if we are not exporting it - we still need this histo.
virtual ~RatesScanTrigger()
Structure to hold per-event weights for distribution.
bool m_isUnbiased
If the event was taken online with a RD trigger.
const std::string printRate(const double ratesDenominator) const override
Prints the RatesScanTrigger's rate (different output to a regular trigger)
RatesScanTrigger(const std::string &name, IMessageSvc *msgSvc, const double thresholdMin, const double thresholdMax, const uint32_t thresholdBins=100, const TriggerBehaviour_t behaviour=kTriggerBelowThreshold, const double prescale=1., const std::string &seedName="", const double seedPrecale=1., const ExtrapStrat_t extrapolation=ExtrapStrat_t::kLINEAR)
Construct new RatesScanTrigger to enumerate the rate for a single L1 or HLT trigger as a function of ...
void execute(const WeightingValuesSummary_t &weights) override
Execute trigger rate emulation.
TriggerBehaviour_t
enum to describe if a trigger should activate for values >= or <= than the thresold
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
@ kTriggerBelowThreshold
Trigger for <= threshold.
Used to calculate the rate for a single trigger at L1 or the HLT.
double m_enhancedBiasWeight
A property of the event derived from online enhanced bias prescales.
bool m_seedsFromRandom
Does this trigger seed from a random trigger? If so it should only be exposed to unbiased events.
double m_thresholdPassed
Analogous to m_pass.
msgSvc
Provide convenience handles for various services.
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
::StatusCode StatusCode
StatusCode definition for legacy code.
void passThreshold(const double t, const bool unbiasedEvent=false)
Sets the threshold the event.
AthROOTErrorHandlerSvc * svc
@ kTriggerAboveThreshold
Trigger for >= threshold.
double GetBinContent(int) const
const double m_seedPrescale
StatusCode giveThresholdHist(const ServiceHandle< ITHistSvc > &svc, const std::string &name)
const ExtrapStrat_t m_extrapolationStrategy
How this trigger is to scale with luminosity.
TriggerBehaviour_t m_behaviour
If we need to be above or below the threshold to cause the trigger to fire.
const std::string m_seed
My seed, "" if no seed.
const double m_totalPrescaleWeight
Equal to 1/m_seedPrescale*m_prescale.
void setPassedAndExecute(const double t, const WeightingValuesSummary_t &weights)
Set the pass threshold and immediately call execute.
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const