ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
RatesTrigger Class Reference

Used to calculate the rate for a single trigger at L1 or the HLT. More...

#include <RatesTrigger.h>

Inheritance diagram for RatesTrigger:
Collaboration diagram for RatesTrigger:

Public Member Functions

 RatesTrigger (const std::string &name, IMessageSvc *log, const double prescale=1., const double expressPrescale=-1, const std::string &seedName="", const double seedPrecale=1., const bool doHistograms=true, const ExtrapStrat_t extrapolation=ExtrapStrat_t::kLINEAR)
 Construct new RatesTrigger to enumerate the rate for a single L1 or HLT trigger Provide pass/fail information to RatesGroups which this trigger is part of. More...
 
 ~RatesTrigger ()
 
 RatesTrigger (const RatesTrigger &)=delete
 
RatesTriggeroperator= (const RatesTrigger &)=delete
 
virtual void reset ()
 If I was used in an event, reset me. More...
 
void setSeedsFromRandom (const bool i)
 Set if this trigger is to behave as if it seeds from a random L1 item. More...
 
void setPassed (const bool passed=true, const bool active=true, const bool unbiasedEvent=false)
 Set the pass/fail bool. More...
 
void setPassedAndExecute (const bool passed, const bool active, const WeightingValuesSummary_t &weights)
 Set the pass/fail bool and immediately call execute. More...
 
virtual void execute (const WeightingValuesSummary_t &weights)
 Execute trigger rate emulation. More...
 
size_t getSeedHash () const
 
const std::string & getSeedName () const
 Get the name of the seed of this trigger. More...
 
double getSeedPrescale () const
 Get the prescale of the seed of this trigger. More...
 
size_t getHash () const
 Get the hash of the name of this trigger. More...
 
const std::string & getName () const
 Get the name of this trigger. More...
 
double getPrescale (const bool includeExpress=false) const
 Gets the triggers prescale. More...
 
bool getPassed () const
 If the trigger passed in the event. More...
 
bool getActive () const
 If the trigger passed in the event. More...
 
bool getDisabled () const
 If I or my seed were prescaled out. More...
 
void setUniqueGroup (const RatesGroup *unique)
 If I have a group which is calculating my unique rate. More...
 
void setCoherentFactor (const double lowestCommonPrescale)
 If i'm in a CPS group, set the lowest commons PS factor of the group. More...
 
void setCPS (const std::string &group)
 If I'm in a CPS group, set the group name (I'll keep a copy of the hash) More...
 
size_t getCPSID () const
 Get the hash of my CPS group name. More...
 
double getCoherentFactor () const
 Get the lowest common prescale factor of all triggers in my CPS group. More...
 
const std::string printConfig () const
 Prints the RatesTrigger's configuration. More...
 
virtual const std::string printRate (const double ratesDenominator) const
 Prints the RatesTrigger's rate. More...
 
const std::string printExpressRate (const double ratesDenominator) const
 Prints the RatesTrigger's express rate. More...
 
StatusCode giveMuHist (const ServiceHandle< ITHistSvc > &svc, const std::string &name)
 
StatusCode giveTrainHist (const ServiceHandle< ITHistSvc > &svc, const std::string &name)
 
StatusCode giveDataHist (const ServiceHandle< ITHistSvc > &svc, const std::string &name)
 
void clearTrainHist ()
 In some jobs we don't want to do the rates vs. More...
 
TH1 * getDataHist ()
 
bool doHistograms () const
 If histogramming was enabled in this rates object. More...
 
const std::string & getExtrapolationFactorString (ExtrapStrat_t strat) const
 
double getExtrapolationFactor (const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Static Public Member Functions

static bool isZero (double v)
 
static bool isNotPositive (double v)
 

Protected Attributes

bool m_pass
 Did the trigger pass or not? More...
 
bool m_active
 Was the trigger active? (Did it run) More...
 
bool m_seedsFromRandom
 Does this trigger seed from a random trigger? If so it should only be exposed to unbiased events. More...
 
double m_rateAccumulator
 Weighted events passed. More...
 
double m_rateAccumulator2
 Weighted events passed squared. More...
 
double m_rateExpressAccumulator
 Weighted express stream events. More...
 
double m_rateExpressAccumulator2
 Weighted express stream events squared. More...
 
double m_ratesActive
 
double m_ratesActive2
 
size_t m_CPSID
 If I'm in a coherent prescale group, my group's ID (hash of the group name) More...
 
double m_coherentFactor
 If I'm in a coherent prescale group, the prescale of the lowest non-disabled chain in the group. More...
 
const RatesGroupm_uniqueGroup
 Pointer to the group which is calculating my unique rate. More...
 
const std::string m_name
 My name. More...
 
const std::string m_seed
 My seed, "" if no seed. More...
 
const size_t m_nameHash
 Hash of my name. More...
 
const size_t m_seedHash
 Has of my seed name. More...
 
const double m_prescale
 My prescale factor. More...
 
const double m_expressPrescale
 My express stream prescale factor, gets applied on top of the regular prescale. More...
 
const double m_seedPrescale
 
const double m_totalPrescaleWeight
 Equal to 1/m_seedPrescale*m_prescale. More...
 
const double m_totalPrescaleWeightExpress
 Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale. More...
 
const ExtrapStrat_t m_extrapolationStrategy
 How this trigger is to scale with luminosity. More...
 
bool m_doHistograms
 If histogramming is switched on. More...
 
std::unique_ptr< TH1 > m_rateVsMu
 Histogram of rate as a fn. More...
 
std::unique_ptr< TH1 > m_rateVsTrain
 Histogram of rate as a fn. More...
 
std::unique_ptr< TH1 > m_data
 Histogram of raw rates quantites, for when we need to normalise offline (e.g. More...
 
TH1 * m_rateVsMuCachedPtr
 Cached, non-owning pointer. More...
 
TH1 * m_rateVsTrainCachedPtr
 Cached, non-owning pointer. More...
 
TH1 * m_dataCachedPtr
 Cached, non-owning pointer. More...
 
bool m_givenRateVsMu
 m_rateVsMu has been given to the THistSvc and should not be deleted More...
 
bool m_givenRateVsTrain
 m_rateVsTrain has been given to the THistSvc and should not be deleted More...
 
bool m_givenData
 m_data has been given to the THistSvc and should not be deleted More...
 

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Used to calculate the rate for a single trigger at L1 or the HLT.

Definition at line 15 of file RatesTrigger.h.

Constructor & Destructor Documentation

◆ RatesTrigger() [1/2]

RatesTrigger::RatesTrigger ( const std::string &  name,
IMessageSvc *  log,
const double  prescale = 1.,
const double  expressPrescale = -1,
const std::string &  seedName = "",
const double  seedPrecale = 1.,
const bool  doHistograms = true,
const ExtrapStrat_t  extrapolation = ExtrapStrat_t::kLINEAR 
)

Construct new RatesTrigger to enumerate the rate for a single L1 or HLT trigger Provide pass/fail information to RatesGroups which this trigger is part of.

Parameters
nameName of the trigger
msgSvcReference to message service
prescaleThe prescale of the trigger. Anything < 1 is considered disabled
expressPrescaleIf the trigger is HLT and in the express group, its express prescale. Otherwise set = 0
seedNameThe name of any L1 seed the trigger has, leave blank if L1 item / no L1 seed.
seedPrescaleThe prescale of any L1 seed. Leave = 1 if no L1 seed.
doHistogramsFlag to mint histograms or not
extrapolationThe luminosity extrapolation strategy to be applied to this trigger

Definition at line 8 of file RatesTrigger.cxx.

10  :
12  m_pass(false),
13  m_active(false),
14  m_seedsFromRandom(false),
19  m_CPSID(0),
20  m_coherentFactor(0.),
21  m_uniqueGroup(nullptr),
22  m_name(name),
24  m_nameHash(std::hash<std::string>{}(name)),
25  m_seedHash(std::hash<std::string>{}(seedName)),
26  m_prescale(prescale < 1. ? -1 : prescale),
27  m_expressPrescale(expressPrescale < 1. ? -1 : expressPrescale),
28  m_seedPrescale(seedPrescale < 1. ? -1 : seedPrescale),
31  m_extrapolationStrategy(extrapolation)
32  {}

◆ ~RatesTrigger()

RatesTrigger::~RatesTrigger ( )

Definition at line 34 of file RatesTrigger.cxx.

34 {}

◆ RatesTrigger() [2/2]

RatesTrigger::RatesTrigger ( const RatesTrigger )
delete

Member Function Documentation

◆ clearTrainHist()

void RatesHistoBase::clearTrainHist ( )
inherited

In some jobs we don't want to do the rates vs.

position in train

Definition at line 77 of file RatesHistoBase.cxx.

77  {
78  m_rateVsTrain.reset();
79  m_rateVsTrainCachedPtr = nullptr;
80 }

◆ doHistograms()

bool RatesHistoBase::doHistograms ( ) const
inlineinherited

If histogramming was enabled in this rates object.

Definition at line 99 of file RatesHistoBase.h.

◆ execute()

void RatesTrigger::execute ( const WeightingValuesSummary_t weights)
virtual

Execute trigger rate emulation.

If the trigger passed, add to its rate the effective number of events it is accepting. Also keep track of any express prescale rate

Parameters
weightsSummary of all event weights which may be used by this trigger

Reimplemented in RatesScanTrigger.

Definition at line 54 of file RatesTrigger.cxx.

54  {
55  // Efficiency
56  if (getDisabled()) {
57  return;
58  }
59 
60  const double w_noLScale = m_totalPrescaleWeight * weights.m_enhancedBiasWeight;
61  const double w = w_noLScale * getExtrapolationFactor(weights, m_extrapolationStrategy);
62  const double wExp = m_totalPrescaleWeightExpress * weights.m_enhancedBiasWeight * getExtrapolationFactor(weights, m_extrapolationStrategy);
63 
64  if (m_active) {
65  m_ratesActive += w;
66  m_ratesActive2 += w * w;
67  if (m_dataCachedPtr != nullptr) {
70  }
71  }
72 
73  if (m_pass) {
74  // The vs. mu histogram is a property of the INPUT event so we don't apply any L scaling here
75  if (m_rateVsMuCachedPtr != nullptr) m_rateVsMuCachedPtr->Fill(weights.m_eventMu, w_noLScale);
76  // The vs. position in train is agnostic to INPUT event & TARGET conditions - i.e. the bunch train structure is not
77  // re-weighted in any way. Hence we can apply whatever extrapolation strategy we want here.
78  if (m_rateVsTrainCachedPtr != nullptr) m_rateVsTrainCachedPtr->Fill(weights.m_distanceInTrain, w);
80  m_rateAccumulator2 += w * w;
81  if (m_dataCachedPtr != nullptr) {
84  }
85  if (m_expressPrescale >= 1) {
87  m_rateExpressAccumulator2 += wExp * wExp;
89  }
90  }
91 }

◆ getActive()

bool RatesTrigger::getActive ( ) const

If the trigger passed in the event.

Definition at line 157 of file RatesTrigger.cxx.

157 { return m_active; }

◆ getCoherentFactor()

double RatesTrigger::getCoherentFactor ( ) const

Get the lowest common prescale factor of all triggers in my CPS group.

Definition at line 169 of file RatesTrigger.cxx.

169 { return m_coherentFactor; }

◆ getCPSID()

size_t RatesTrigger::getCPSID ( ) const

Get the hash of my CPS group name.

Definition at line 167 of file RatesTrigger.cxx.

167 { return m_CPSID; }

◆ getDataHist()

TH1 * RatesHistoBase::getDataHist ( )
inherited
Returns
cached, non-owning, histogram pointer or nullptr. Does not cause error

Definition at line 83 of file RatesHistoBase.cxx.

83  {
84  return m_dataCachedPtr; // Caller must be able to deal with nullptr (e.g unique rates groups calling on their trigger)
85 }

◆ getDisabled()

bool RatesTrigger::getDisabled ( ) const

If I or my seed were prescaled out.

Definition at line 159 of file RatesTrigger.cxx.

◆ getExtrapolationFactor()

double RatesHistoBase::getExtrapolationFactor ( const WeightingValuesSummary_t weights,
const ExtrapStrat_t  strat 
) const
inherited

Definition at line 94 of file RatesHistoBase.cxx.

94  {
95  switch (strat) {
96  case kLINEAR: return weights.m_linearLumiFactor;
97  case kEXPO_MU: return weights.m_expoMuFactor;
98  case kBUNCH_SCALING: return weights.m_bunchFactor;
99  case kMU_SCALING: return weights.m_muFactor;
100  case kNONE: return weights.m_noScaling;
101  default: ATH_MSG_ERROR("Error in getExtrapolationFactor. Unknown ExtrapStrat_t ENUM supplied " << strat);
102  }
103  return 0.;
104 }

◆ getExtrapolationFactorString()

const std::string & RatesHistoBase::getExtrapolationFactorString ( ExtrapStrat_t  strat) const
inherited

Definition at line 88 of file RatesHistoBase.cxx.

88  {
89  static const std::vector<std::string> values{"LINEAR_L","LINEAR_BUNCH_EXPO_MU","LINEAR_BUNCHES","LINEAR_MU","NONE"};
90  return values.at(static_cast<size_t>(strat));
91 }

◆ getHash()

size_t RatesTrigger::getHash ( ) const

Get the hash of the name of this trigger.

Definition at line 151 of file RatesTrigger.cxx.

151 { return m_nameHash; }

◆ getName()

const std::string & RatesTrigger::getName ( ) const

Get the name of this trigger.

Definition at line 153 of file RatesTrigger.cxx.

153 { return m_name; }

◆ getPassed()

bool RatesTrigger::getPassed ( ) const

If the trigger passed in the event.

Definition at line 155 of file RatesTrigger.cxx.

155 { return m_pass; }

◆ getPrescale()

double RatesTrigger::getPrescale ( const bool  includeExpress = false) const

Gets the triggers prescale.

Parameters
includeExpressIf true, the items express prescale is added on top of its regular prescale

Definition at line 93 of file RatesTrigger.cxx.

93  {
94  if (includeExpress) return m_prescale * m_expressPrescale;
95  return m_prescale;
96 }

◆ getSeedHash()

size_t RatesTrigger::getSeedHash ( ) const

Definition at line 145 of file RatesTrigger.cxx.

145 { return m_seedHash; }

◆ getSeedName()

const std::string & RatesTrigger::getSeedName ( ) const

Get the name of the seed of this trigger.

Definition at line 147 of file RatesTrigger.cxx.

147 { return m_seed; }

◆ getSeedPrescale()

double RatesTrigger::getSeedPrescale ( ) const

Get the prescale of the seed of this trigger.

Definition at line 149 of file RatesTrigger.cxx.

149 { return m_seedPrescale; }

◆ giveDataHist()

StatusCode RatesHistoBase::giveDataHist ( const ServiceHandle< ITHistSvc > &  svc,
const std::string &  name 
)
inherited

Definition at line 67 of file RatesHistoBase.cxx.

67  {
68  if (!m_data.get()) {
69  ATH_MSG_ERROR("RatesHistoBase::giveDataHist Warning requested histograms when histograming is OFF here.");
70  return StatusCode::FAILURE;
71  }
72  ATH_CHECK( svc->regHist(name, std::move(m_data)) );
73  return StatusCode::SUCCESS;
74 }

◆ giveMuHist()

StatusCode RatesHistoBase::giveMuHist ( const ServiceHandle< ITHistSvc > &  svc,
const std::string &  name 
)
inherited

Definition at line 47 of file RatesHistoBase.cxx.

47  {
48  if (!m_rateVsMu.get()) {
49  ATH_MSG_ERROR("RatesHistoBase::giveMuHist Warning requested histograms when histograming is OFF here.");
50  return StatusCode::FAILURE;
51  }
52  ATH_CHECK( svc->regHist(name, std::move(m_rateVsMu)) );
53  return StatusCode::SUCCESS;
54 }

◆ giveTrainHist()

StatusCode RatesHistoBase::giveTrainHist ( const ServiceHandle< ITHistSvc > &  svc,
const std::string &  name 
)
inherited

Definition at line 57 of file RatesHistoBase.cxx.

57  {
58  if (!m_rateVsTrain.get()) {
59  ATH_MSG_ERROR("RatesHistoBase::giveTrainHist Warning requested histograms when histograming is OFF here.");
60  return StatusCode::FAILURE;
61  }
62  ATH_CHECK( svc->regHist(name, std::move(m_rateVsTrain)) );
63  return StatusCode::SUCCESS;
64 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ isNotPositive()

static bool RatesHistoBase::isNotPositive ( double  v)
inlinestaticinherited

Definition at line 104 of file RatesHistoBase.h.

104 { return v < 1e-10; } //<! Helper fn to check if the value is non positive = trigger is disabled

◆ isZero()

static bool RatesHistoBase::isZero ( double  v)
inlinestaticinherited

Definition at line 103 of file RatesHistoBase.h.

103 { return fabs(v) < 1e-10; } //<! Helper fn

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ operator=()

RatesTrigger& RatesTrigger::operator= ( const RatesTrigger )
delete

◆ printConfig()

const std::string RatesTrigger::printConfig ( ) const

Prints the RatesTrigger's configuration.

Definition at line 98 of file RatesTrigger.cxx.

98  {
99  std::stringstream ss;
100  ss << std::setfill(' ')
101  << "Prescale:" << std::setw(11) << std::left << m_prescale
102  << " xpress:" << std::setw(11) << std::left << m_expressPrescale
103  << " CPSID:" << std::setw(11) << std::left << m_CPSID
104  << " seedPS:" << std::setw(11) << std::left << m_seedPrescale
105  << " : " << (m_seed != "" ? m_seed : "") << (m_seed != "" ? " -> " : "") << m_name;
106  return ss.str();
107 }

◆ printExpressRate()

const std::string RatesTrigger::printExpressRate ( const double  ratesDenominator) const

Prints the RatesTrigger's express rate.

Parameters
ratesDenominatorThe walltime for the run, needed to normalise from integrated weighted counts to a rate.
Returns
The information to be printed

Definition at line 129 of file RatesTrigger.cxx.

129  {
130  std::stringstream ss;
131  ss << std::setfill(' ');
132  ss << "Express Rate: " << std::setw(11) << std::right << m_rateExpressAccumulator/ratesDenominator
133  << " +- " << std::setw(11) << std::left << sqrt(m_rateExpressAccumulator2)/ratesDenominator << " Hz";
134  ss << " : ";
135  ss << m_name << " [PS:" << m_prescale << "] [EXPRESS PS:" << m_expressPrescale << "]";
136  if (m_seed != "") ss << " <- " << m_seed << " [PS:" << m_seedPrescale << "]";
138  return ss.str();
139 }

◆ printRate()

const std::string RatesTrigger::printRate ( const double  ratesDenominator) const
virtual

Prints the RatesTrigger's rate.

Parameters
ratesDenominatorThe walltime for the run, needed to normalise from integrated weighted counts to a rate.
Returns
The information to be printed

Reimplemented in RatesScanTrigger.

Definition at line 109 of file RatesTrigger.cxx.

109  {
110  std::stringstream ss;
111  ss << std::setfill(' ');
112  ss << "Rate: " << std::setw(11) << std::right << m_rateAccumulator/ratesDenominator
113  << " +- " << std::setw(11) << std::left << sqrt(m_rateAccumulator2)/ratesDenominator << " Hz";
114  if (m_uniqueGroup != nullptr) {
115  const double unique = (getDisabled() == true ? 0. : m_uniqueGroup->getUniqueWeight(ratesDenominator));
116  //const double unique = m_uniqueGroup->m_rateAccumulatorOR / ratesDenominator; // For dbg - this is the rate of N-1
117  // Getting the fractional error of refgular rate and applying it to the unique rate
118  const double uniqueErr = (isZero(m_rateAccumulator) ? 0. : (sqrt(m_rateAccumulator2)/m_rateAccumulator) * unique);
119  ss << ", Unique Rate: " << std::setw(11) << std::right << unique
120  << " +- " << std::setw(11) << std::left << uniqueErr << " Hz";
121  }
122  ss << " : ";
123  ss << m_name << " [PS:" << m_prescale << "]";
124  if (m_seed != "") ss << " <- " << m_seed << " [PS:" << m_seedPrescale << "]";
126  return ss.str();
127 }

◆ reset()

void RatesTrigger::reset ( )
virtual

If I was used in an event, reset me.

Reimplemented in RatesScanTrigger.

Definition at line 141 of file RatesTrigger.cxx.

141 { m_pass = false; m_active = false; }

◆ setCoherentFactor()

void RatesTrigger::setCoherentFactor ( const double  lowestCommonPrescale)

If i'm in a CPS group, set the lowest commons PS factor of the group.

Definition at line 163 of file RatesTrigger.cxx.

163 { m_coherentFactor = lowestCommonPrescale; }

◆ setCPS()

void RatesTrigger::setCPS ( const std::string &  group)

If I'm in a CPS group, set the group name (I'll keep a copy of the hash)

Definition at line 165 of file RatesTrigger.cxx.

165 { m_CPSID = std::hash<std::string>{}(group); }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ setPassed()

void RatesTrigger::setPassed ( const bool  passed = true,
const bool  active = true,
const bool  unbiasedEvent = false 
)

Set the pass/fail bool.

Execute needs to be called separately afterwards.

Definition at line 36 of file RatesTrigger.cxx.

36  {
37  if (m_seedsFromRandom == true && unbiasedEvent == false) return;
38  if (m_active && !m_pass) throw std::runtime_error("Cannot pass if not active");
39  m_pass = passed;
40  m_active = active;
41 }

◆ setPassedAndExecute()

void RatesTrigger::setPassedAndExecute ( const bool  passed,
const bool  active,
const WeightingValuesSummary_t weights 
)

Set the pass/fail bool and immediately call execute.

Should only be done once per event.

Parameters
iIf the trigger passed or failed the event @weights Struct of weighting information for the event

Definition at line 43 of file RatesTrigger.cxx.

43  {
44  if (m_seedsFromRandom == true && weights.m_isUnbiased == false) return;
45  if (m_pass == false && m_active == false) { // Protect against two positive calls/event
46  if (m_active && !m_pass) throw std::runtime_error("Cannot pass if not active");
47  m_pass = passed;
48  m_active = active;
50  }
51 }

◆ setSeedsFromRandom()

void RatesTrigger::setSeedsFromRandom ( const bool  i)

Set if this trigger is to behave as if it seeds from a random L1 item.

Definition at line 143 of file RatesTrigger.cxx.

143 { m_seedsFromRandom = i; }

◆ setUniqueGroup()

void RatesTrigger::setUniqueGroup ( const RatesGroup unique)

If I have a group which is calculating my unique rate.

Definition at line 161 of file RatesTrigger.cxx.

161 { m_uniqueGroup = unique; }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_active

bool RatesTrigger::m_active
protected

Was the trigger active? (Did it run)

Definition at line 115 of file RatesTrigger.h.

◆ m_coherentFactor

double RatesTrigger::m_coherentFactor
protected

If I'm in a coherent prescale group, the prescale of the lowest non-disabled chain in the group.

Definition at line 125 of file RatesTrigger.h.

◆ m_CPSID

size_t RatesTrigger::m_CPSID
protected

If I'm in a coherent prescale group, my group's ID (hash of the group name)

Definition at line 124 of file RatesTrigger.h.

◆ m_data

std::unique_ptr<TH1> RatesHistoBase::m_data
protectedinherited

Histogram of raw rates quantites, for when we need to normalise offline (e.g.

grid processing)

Definition at line 112 of file RatesHistoBase.h.

◆ m_dataCachedPtr

TH1* RatesHistoBase::m_dataCachedPtr
protectedinherited

Cached, non-owning pointer.

Definition at line 115 of file RatesHistoBase.h.

◆ m_doHistograms

bool RatesHistoBase::m_doHistograms
protectedinherited

If histogramming is switched on.

Definition at line 109 of file RatesHistoBase.h.

◆ m_expressPrescale

const double RatesTrigger::m_expressPrescale
protected

My express stream prescale factor, gets applied on top of the regular prescale.

Definition at line 134 of file RatesTrigger.h.

◆ m_extrapolationStrategy

const ExtrapStrat_t RatesTrigger::m_extrapolationStrategy
protected

How this trigger is to scale with luminosity.

Definition at line 139 of file RatesTrigger.h.

◆ m_givenData

bool RatesHistoBase::m_givenData
protectedinherited

m_data has been given to the THistSvc and should not be deleted

Definition at line 118 of file RatesHistoBase.h.

◆ m_givenRateVsMu

bool RatesHistoBase::m_givenRateVsMu
protectedinherited

m_rateVsMu has been given to the THistSvc and should not be deleted

Definition at line 116 of file RatesHistoBase.h.

◆ m_givenRateVsTrain

bool RatesHistoBase::m_givenRateVsTrain
protectedinherited

m_rateVsTrain has been given to the THistSvc and should not be deleted

Definition at line 117 of file RatesHistoBase.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_name

const std::string RatesTrigger::m_name
protected

My name.

Definition at line 129 of file RatesTrigger.h.

◆ m_nameHash

const size_t RatesTrigger::m_nameHash
protected

Hash of my name.

Definition at line 131 of file RatesTrigger.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_pass

bool RatesTrigger::m_pass
protected

Did the trigger pass or not?

Definition at line 114 of file RatesTrigger.h.

◆ m_prescale

const double RatesTrigger::m_prescale
protected

My prescale factor.

Definition at line 133 of file RatesTrigger.h.

◆ m_rateAccumulator

double RatesTrigger::m_rateAccumulator
protected

Weighted events passed.

Definition at line 117 of file RatesTrigger.h.

◆ m_rateAccumulator2

double RatesTrigger::m_rateAccumulator2
protected

Weighted events passed squared.

Definition at line 118 of file RatesTrigger.h.

◆ m_rateExpressAccumulator

double RatesTrigger::m_rateExpressAccumulator
protected

Weighted express stream events.

Definition at line 119 of file RatesTrigger.h.

◆ m_rateExpressAccumulator2

double RatesTrigger::m_rateExpressAccumulator2
protected

Weighted express stream events squared.

Definition at line 120 of file RatesTrigger.h.

◆ m_ratesActive

double RatesTrigger::m_ratesActive
protected

Definition at line 121 of file RatesTrigger.h.

◆ m_ratesActive2

double RatesTrigger::m_ratesActive2
protected

Definition at line 122 of file RatesTrigger.h.

◆ m_rateVsMu

std::unique_ptr<TH1> RatesHistoBase::m_rateVsMu
protectedinherited

Histogram of rate as a fn.

of the input event's mu

Definition at line 110 of file RatesHistoBase.h.

◆ m_rateVsMuCachedPtr

TH1* RatesHistoBase::m_rateVsMuCachedPtr
protectedinherited

Cached, non-owning pointer.

Definition at line 113 of file RatesHistoBase.h.

◆ m_rateVsTrain

std::unique_ptr<TH1> RatesHistoBase::m_rateVsTrain
protectedinherited

Histogram of rate as a fn.

of position in bunch train

Definition at line 111 of file RatesHistoBase.h.

◆ m_rateVsTrainCachedPtr

TH1* RatesHistoBase::m_rateVsTrainCachedPtr
protectedinherited

Cached, non-owning pointer.

Definition at line 114 of file RatesHistoBase.h.

◆ m_seed

const std::string RatesTrigger::m_seed
protected

My seed, "" if no seed.

Definition at line 130 of file RatesTrigger.h.

◆ m_seedHash

const size_t RatesTrigger::m_seedHash
protected

Has of my seed name.

Definition at line 132 of file RatesTrigger.h.

◆ m_seedPrescale

const double RatesTrigger::m_seedPrescale
protected

Definition at line 135 of file RatesTrigger.h.

◆ m_seedsFromRandom

bool RatesTrigger::m_seedsFromRandom
protected

Does this trigger seed from a random trigger? If so it should only be exposed to unbiased events.

Definition at line 116 of file RatesTrigger.h.

◆ m_totalPrescaleWeight

const double RatesTrigger::m_totalPrescaleWeight
protected

Equal to 1/m_seedPrescale*m_prescale.

Definition at line 136 of file RatesTrigger.h.

◆ m_totalPrescaleWeightExpress

const double RatesTrigger::m_totalPrescaleWeightExpress
protected

Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale.

Definition at line 137 of file RatesTrigger.h.

◆ m_uniqueGroup

const RatesGroup* RatesTrigger::m_uniqueGroup
protected

Pointer to the group which is calculating my unique rate.

Definition at line 127 of file RatesTrigger.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
RatesTrigger::m_ratesActive
double m_ratesActive
Definition: RatesTrigger.h:121
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
RatesTrigger::m_prescale
const double m_prescale
My prescale factor.
Definition: RatesTrigger.h:133
RatesTrigger::m_active
bool m_active
Was the trigger active? (Did it run)
Definition: RatesTrigger.h:115
kACTIVE_RAW_BIN
@ kACTIVE_RAW_BIN
Bin used to store the raw total events in which the trigger was active.
Definition: RatesHistoBase.h:42
RatesGroup::getUniqueWeight
double getUniqueWeight(const double ratesDenominator) const
Get the unique rate of a unique-rate group For a group being used to get a unique rate,...
Definition: RatesGroup.cxx:178
RatesTrigger::m_name
const std::string m_name
My name.
Definition: RatesTrigger.h:129
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
RatesHistoBase::m_dataCachedPtr
TH1 * m_dataCachedPtr
Cached, non-owning pointer.
Definition: RatesHistoBase.h:115
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
RatesTrigger::m_expressPrescale
const double m_expressPrescale
My express stream prescale factor, gets applied on top of the regular prescale.
Definition: RatesTrigger.h:134
kMU_SCALING
@ kMU_SCALING
Scale trigger linearly but only in the change in <mu>
Definition: RatesHistoBase.h:34
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
RatesTrigger::m_rateExpressAccumulator2
double m_rateExpressAccumulator2
Weighted express stream events squared.
Definition: RatesTrigger.h:120
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
RatesHistoBase::isNotPositive
static bool isNotPositive(double v)
Definition: RatesHistoBase.h:104
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
RatesTrigger::m_coherentFactor
double m_coherentFactor
If I'm in a coherent prescale group, the prescale of the lowest non-disabled chain in the group.
Definition: RatesTrigger.h:125
kPASS_WEIGHTED_OR_BIN
@ kPASS_WEIGHTED_OR_BIN
Bin used to store the total rate (OR)
Definition: RatesHistoBase.h:45
RatesTrigger::m_seedsFromRandom
bool m_seedsFromRandom
Does this trigger seed from a random trigger? If so it should only be exposed to unbiased events.
Definition: RatesTrigger.h:116
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
kLINEAR
@ kLINEAR
Scale trigger linearly with luminosity.
Definition: RatesHistoBase.h:31
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::active
@ active
Definition: Layer.h:48
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
RatesHistoBase::m_data
std::unique_ptr< TH1 > m_data
Histogram of raw rates quantites, for when we need to normalise offline (e.g.
Definition: RatesHistoBase.h:112
RatesHistoBase::getExtrapolationFactor
double getExtrapolationFactor(const WeightingValuesSummary_t &weights, const ExtrapStrat_t strat) const
Definition: RatesHistoBase.cxx:94
kEXPO_MU
@ kEXPO_MU
Scale trigger linearly in bunches and exponentially in mu.
Definition: RatesHistoBase.h:32
RatesTrigger::m_seedHash
const size_t m_seedHash
Has of my seed name.
Definition: RatesTrigger.h:132
RatesHistoBase::m_rateVsMu
std::unique_ptr< TH1 > m_rateVsMu
Histogram of rate as a fn.
Definition: RatesHistoBase.h:110
RatesHistoBase::m_rateVsTrain
std::unique_ptr< TH1 > m_rateVsTrain
Histogram of rate as a fn.
Definition: RatesHistoBase.h:111
RatesTrigger::m_CPSID
size_t m_CPSID
If I'm in a coherent prescale group, my group's ID (hash of the group name)
Definition: RatesTrigger.h:124
kBUNCH_SCALING
@ kBUNCH_SCALING
Scale trigger linearly but only in the number of bunches.
Definition: RatesHistoBase.h:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
RatesTrigger::m_uniqueGroup
const RatesGroup * m_uniqueGroup
Pointer to the group which is calculating my unique rate.
Definition: RatesTrigger.h:127
kEXPRESS_BIN
@ kEXPRESS_BIN
Bin used to store the express rate.
Definition: RatesHistoBase.h:47
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
RatesHistoBase::m_rateVsTrainCachedPtr
TH1 * m_rateVsTrainCachedPtr
Cached, non-owning pointer.
Definition: RatesHistoBase.h:114
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
RatesHistoBase::RatesHistoBase
RatesHistoBase(const std::string &name, IMessageSvc *msgSvc, const bool doHistograms=true)
Definition: RatesHistoBase.cxx:10
RatesTrigger::getDisabled
bool getDisabled() const
If I or my seed were prescaled out.
Definition: RatesTrigger.cxx:159
RatesHistoBase::m_rateVsMuCachedPtr
TH1 * m_rateVsMuCachedPtr
Cached, non-owning pointer.
Definition: RatesHistoBase.h:113
RatesTrigger::m_rateAccumulator
double m_rateAccumulator
Weighted events passed.
Definition: RatesTrigger.h:117
RatesTrigger::m_rateExpressAccumulator
double m_rateExpressAccumulator
Weighted express stream events.
Definition: RatesTrigger.h:119
RatesHistoBase::isZero
static bool isZero(double v)
Definition: RatesHistoBase.h:103
RatesTrigger::m_rateAccumulator2
double m_rateAccumulator2
Weighted events passed squared.
Definition: RatesTrigger.h:118
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
RatesTrigger::m_ratesActive2
double m_ratesActive2
Definition: RatesTrigger.h:122
weights
Definition: herwig7_interface.h:44
RatesTrigger::m_totalPrescaleWeightExpress
const double m_totalPrescaleWeightExpress
Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale.
Definition: RatesTrigger.h:137
RatesTrigger::execute
virtual void execute(const WeightingValuesSummary_t &weights)
Execute trigger rate emulation.
Definition: RatesTrigger.cxx:54
python.PyAthena.v
v
Definition: PyAthena.py:154
RatesHistoBase::doHistograms
bool doHistograms() const
If histogramming was enabled in this rates object.
Definition: RatesHistoBase.h:99
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition: DVL_algorithms.h:135
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
RatesTrigger::m_pass
bool m_pass
Did the trigger pass or not?
Definition: RatesTrigger.h:114
RatesTrigger::m_seedPrescale
const double m_seedPrescale
Definition: RatesTrigger.h:135
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
kPASS_RAW_BIN
@ kPASS_RAW_BIN
Bin used to store the raw total events in which the trigger passed.
Definition: RatesHistoBase.h:44
RatesTrigger::m_extrapolationStrategy
const ExtrapStrat_t m_extrapolationStrategy
How this trigger is to scale with luminosity.
Definition: RatesTrigger.h:139
ValidateEBMenu.seedName
seedName
Definition: ValidateEBMenu.py:100
RatesTrigger::m_seed
const std::string m_seed
My seed, "" if no seed.
Definition: RatesTrigger.h:130
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
kACTIVE_WEIGHTED_BIN
@ kACTIVE_WEIGHTED_BIN
Bin used to store the weighted events in which the trigger was active.
Definition: RatesHistoBase.h:43
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
RatesTrigger::m_nameHash
const size_t m_nameHash
Hash of my name.
Definition: RatesTrigger.h:131
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
RatesTrigger::m_totalPrescaleWeight
const double m_totalPrescaleWeight
Equal to 1/m_seedPrescale*m_prescale.
Definition: RatesTrigger.h:136
RatesHistoBase::getExtrapolationFactorString
const std::string & getExtrapolationFactorString(ExtrapStrat_t strat) const
Definition: RatesHistoBase.cxx:88
kNONE
@ kNONE
Do not scale this trigger for changes in luminosity.
Definition: RatesHistoBase.h:35