ATLAS Offline Software
RatesTrigger.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef RATESANALYSIS_RATESTRIGGER_H
6 #define RATESANALYSIS_RATESTRIGGER_H 1
7 
8 #include "RatesHistoBase.h"
9 
10 class RatesGroup; //fwd
11 
15 class RatesTrigger : public RatesHistoBase {
16  public:
17 
30  RatesTrigger(const std::string& name,
31  IMessageSvc* log,
32  const double prescale = 1.,
33  const double expressPrescale = -1,
34  const std::string& seedName = "",
35  const double seedPrecale = 1.,
36  const bool doHistograms = true,
37  const ExtrapStrat_t extrapolation = ExtrapStrat_t::kLINEAR);
38  ~RatesTrigger();
39 
40  RatesTrigger(const RatesTrigger&) = delete;
41 
42  RatesTrigger& operator=(const RatesTrigger&) = delete;
43 
44  virtual void reset();
45 
46  void setSeedsFromRandom(const bool i);
47 
48  void setPassed(const bool passed = true, const bool active = true, const bool unbiasedEvent = false);
49 
55  void setPassedAndExecute(const bool passed, const bool active, const WeightingValuesSummary_t& weights);
56 
62  virtual void execute(const WeightingValuesSummary_t& weights);
63 
64  size_t getSeedHash() const; //<! Get the hash of the name of the seed of this trigger.
65 
66  const std::string& getSeedName() const;
67 
68  double getSeedPrescale() const;
69 
70  size_t getHash() const;
71 
72  const std::string& getName() const;
73 
78  double getPrescale(const bool includeExpress = false) const;
79 
80  bool getPassed() const;
81 
82  bool getActive() const;
83 
84  bool getDisabled() const;
85 
86  void setUniqueGroup(const RatesGroup* unique);
87 
88  void setCoherentFactor(const double lowestCommonPrescale);
89 
90  void setCPS(const std::string& group);
91 
92  size_t getCPSID() const;
93 
94  double getCoherentFactor() const;
95 
96  const std::string printConfig() const;
97 
103  virtual const std::string printRate(const double ratesDenominator) const;
104 
110  const std::string printExpressRate(const double ratesDenominator) const;
111 
112  protected:
113 
114  bool m_pass;
115  bool m_active;
121  double m_ratesActive; // Active events
122  double m_ratesActive2; // Active events squared
123 
124  size_t m_CPSID;
126 
128 
129  const std::string m_name;
130  const std::string m_seed;
131  const size_t m_nameHash;
132  const size_t m_seedHash;
133  const double m_prescale;
134  const double m_expressPrescale;
135  const double m_seedPrescale; //<! My seed's prescale, 1 if no seed.
136  const double m_totalPrescaleWeight;
138 
140 
141 };
142 
143 #endif //> !RATESANALYSIS_RATESTRIGGER_H
144 
RatesTrigger::setPassedAndExecute
void setPassedAndExecute(const bool passed, const bool active, const WeightingValuesSummary_t &weights)
Set the pass/fail bool and immediately call execute.
Definition: RatesTrigger.cxx:45
RatesTrigger::m_ratesActive
double m_ratesActive
Definition: RatesTrigger.h:121
RatesTrigger::getHash
size_t getHash() const
Get the hash of the name of this trigger.
Definition: RatesTrigger.cxx:153
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
RatesTrigger::m_name
const std::string m_name
My name.
Definition: RatesTrigger.h:129
RatesTrigger::getSeedHash
size_t getSeedHash() const
Definition: RatesTrigger.cxx:147
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
WeightingValuesSummary_t
Structure to hold per-event weights for distribution.
Definition: RatesHistoBase.h:55
RatesTrigger::m_expressPrescale
const double m_expressPrescale
My express stream prescale factor, gets applied on top of the regular prescale.
Definition: RatesTrigger.h:134
RatesTrigger::getActive
bool getActive() const
If the trigger passed in the event.
Definition: RatesTrigger.cxx:159
RatesTrigger::printExpressRate
const std::string printExpressRate(const double ratesDenominator) const
Prints the RatesTrigger's express rate.
Definition: RatesTrigger.cxx:131
RatesTrigger::m_rateExpressAccumulator2
double m_rateExpressAccumulator2
Weighted express stream events squared.
Definition: RatesTrigger.h:120
RatesTrigger::setUniqueGroup
void setUniqueGroup(const RatesGroup *unique)
If I have a group which is calculating my unique rate.
Definition: RatesTrigger.cxx:163
ExtrapStrat_t
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
Definition: RatesHistoBase.h:30
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
RatesTrigger
Used to calculate the rate for a single trigger at L1 or the HLT.
Definition: RatesTrigger.h:15
RatesGroup
Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT.
Definition: RatesGroup.h:29
RatesTrigger::printRate
virtual const std::string printRate(const double ratesDenominator) const
Prints the RatesTrigger's rate.
Definition: RatesTrigger.cxx:111
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
kLINEAR
@ kLINEAR
Scale trigger linearly with luminosity.
Definition: RatesHistoBase.h:31
RatesTrigger::setSeedsFromRandom
void setSeedsFromRandom(const bool i)
Set if this trigger is to behave as if it seeds from a random L1 item.
Definition: RatesTrigger.cxx:145
RatesTrigger::reset
virtual void reset()
If I was used in an event, reset me.
Definition: RatesTrigger.cxx:143
Trk::active
@ active
Definition: Layer.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:85
RatesTrigger::setCPS
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)
Definition: RatesTrigger.cxx:167
RatesTrigger::m_seedHash
const size_t m_seedHash
Has of my seed name.
Definition: RatesTrigger.h:132
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
RatesHistoBase.h
RatesTrigger::operator=
RatesTrigger & operator=(const RatesTrigger &)=delete
RatesTrigger::m_uniqueGroup
const RatesGroup * m_uniqueGroup
Pointer to the group which is calculating my unique rate.
Definition: RatesTrigger.h:127
RatesTrigger::getCPSID
size_t getCPSID() const
Get the hash of my CPS group name.
Definition: RatesTrigger.cxx:169
RatesTrigger::getDisabled
bool getDisabled() const
If I or my seed were prescaled out.
Definition: RatesTrigger.cxx:161
RatesTrigger::m_rateAccumulator
double m_rateAccumulator
Weighted events passed.
Definition: RatesTrigger.h:117
RatesTrigger::RatesTrigger
RatesTrigger(const RatesTrigger &)=delete
RatesHistoBase
Basic base class for any common functionality between RatesTrigger and RatesGroup This means that eve...
Definition: RatesHistoBase.h:84
RatesTrigger::m_rateExpressAccumulator
double m_rateExpressAccumulator
Weighted express stream events.
Definition: RatesTrigger.h:119
RatesTrigger::m_rateAccumulator2
double m_rateAccumulator2
Weighted events passed squared.
Definition: RatesTrigger.h:118
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
RatesTrigger::m_ratesActive2
double m_ratesActive2
Definition: RatesTrigger.h:122
weights
Definition: herwig7_interface.h:38
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:56
RatesTrigger::setPassed
void setPassed(const bool passed=true, const bool active=true, const bool unbiasedEvent=false)
Set the pass/fail bool.
Definition: RatesTrigger.cxx:38
RatesTrigger::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 inf...
Definition: RatesTrigger.cxx:8
RatesHistoBase::doHistograms
bool doHistograms() const
If histogramming was enabled in this rates object.
Definition: RatesHistoBase.h:99
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
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RatesTrigger::getCoherentFactor
double getCoherentFactor() const
Get the lowest common prescale factor of all triggers in my CPS group.
Definition: RatesTrigger.cxx:171
RatesTrigger::getPrescale
double getPrescale(const bool includeExpress=false) const
Gets the triggers prescale.
Definition: RatesTrigger.cxx:95
RatesTrigger::setCoherentFactor
void setCoherentFactor(const double lowestCommonPrescale)
If i'm in a CPS group, set the lowest commons PS factor of the group.
Definition: RatesTrigger.cxx:165
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::getSeedPrescale
double getSeedPrescale() const
Get the prescale of the seed of this trigger.
Definition: RatesTrigger.cxx:151
RatesTrigger::~RatesTrigger
~RatesTrigger()
Definition: RatesTrigger.cxx:36
RatesTrigger::m_seed
const std::string m_seed
My seed, "" if no seed.
Definition: RatesTrigger.h:130
RatesTrigger::getName
const std::string & getName() const
Get the name of this trigger.
Definition: RatesTrigger.cxx:155
RatesTrigger::m_nameHash
const size_t m_nameHash
Hash of my name.
Definition: RatesTrigger.h:131
RatesTrigger::m_totalPrescaleWeight
const double m_totalPrescaleWeight
Equal to 1/m_seedPrescale*m_prescale.
Definition: RatesTrigger.h:136
RatesTrigger::getSeedName
const std::string & getSeedName() const
Get the name of the seed of this trigger.
Definition: RatesTrigger.cxx:149
RatesTrigger::getPassed
bool getPassed() const
If the trigger passed in the event.
Definition: RatesTrigger.cxx:157
RatesTrigger::printConfig
const std::string printConfig() const
Prints the RatesTrigger's configuration.
Definition: RatesTrigger.cxx:100