ATLAS Offline Software
Loading...
Searching...
No Matches
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
10class RatesGroup; //fwd
11
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);
39
40 RatesTrigger(const RatesTrigger&) = delete;
41
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 double getTotalPrescaleWeight() const;
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.
138
140
141};
142
143#endif //> !RATESANALYSIS_RATESTRIGGER_H
144
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
ExtrapStrat_t
Extrapolation strategy to apply to each emulated trigger.
@ kLINEAR
Scale trigger linearly with luminosity.
Used to calculate the rate for a group of RatesTrigger objects at L1 or the HLT.
Definition RatesGroup.h:29
bool doHistograms() const
If histogramming was enabled in this rates object.
RatesHistoBase(const std::string &name, IMessageSvc *msgSvc, const bool doHistograms=true)
bool m_seedsFromRandom
Does this trigger seed from a random trigger?
const std::string & getSeedName() const
Get the name of the seed of this trigger.
double m_ratesActive
bool m_active
Was the trigger active?
void setUniqueGroup(const RatesGroup *unique)
If I have a group which is calculating my unique rate.
bool getPassed() const
If the trigger passed in the event.
const double m_expressPrescale
My express stream prescale factor, gets applied on top of the regular prescale.
const std::string m_seed
My seed, "" if no seed.
double m_rateAccumulator
Weighted events passed.
size_t m_CPSID
If I'm in a coherent prescale group, my group's ID (hash of the group name)
bool getActive() const
If the trigger passed in the event.
const ExtrapStrat_t m_extrapolationStrategy
How this trigger is to scale with luminosity.
void setPassed(const bool passed=true, const bool active=true, const bool unbiasedEvent=false)
Set the pass/fail bool.
const std::string m_name
My name.
double getCoherentFactor() const
Get the lowest common prescale factor of all triggers in my CPS group.
const std::string printConfig() const
Prints the RatesTrigger's configuration.
double getSeedPrescale() const
Get the prescale of the seed of this trigger.
void setSeedsFromRandom(const bool i)
Set if this trigger is to behave as if it seeds from a random L1 item.
const RatesGroup * m_uniqueGroup
Pointer to the group which is calculating my unique rate.
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)
size_t getHash() const
Get the hash of the name of this trigger.
size_t getSeedHash() const
double m_rateExpressAccumulator2
Weighted express stream events squared.
const size_t m_nameHash
Hash of my name.
virtual const std::string printRate(const double ratesDenominator) const
Prints the RatesTrigger's rate.
void setCoherentFactor(const double lowestCommonPrescale)
If i'm in a CPS group, set the lowest commons PS factor of the group.
double m_ratesActive2
bool getDisabled() const
If I or my seed were prescaled out.
RatesTrigger & operator=(const RatesTrigger &)=delete
const std::string printExpressRate(const double ratesDenominator) const
Prints the RatesTrigger's express rate.
const double m_totalPrescaleWeightExpress
Equal to 1/m_seedPrescale*m_prescale*m_expressPrescale.
virtual void reset()
If I was used in an event, reset me.
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...
double m_coherentFactor
If I'm in a coherent prescale group, the prescale of the lowest non-disabled chain in the group.
const double m_totalPrescaleWeight
Equal to 1/m_seedPrescale*m_prescale.
virtual void execute(const WeightingValuesSummary_t &weights)
Execute trigger rate emulation.
double getPrescale(const bool includeExpress=false) const
Gets the triggers prescale.
bool m_pass
Did the trigger pass or not?
void setPassedAndExecute(const bool passed, const bool active, const WeightingValuesSummary_t &weights)
Set the pass/fail bool and immediately call execute.
double m_rateExpressAccumulator
Weighted express stream events.
double m_rateAccumulator2
Weighted events passed squared.
const double m_seedPrescale
const size_t m_seedHash
Has of my seed name.
size_t getCPSID() const
Get the hash of my CPS group name.
RatesTrigger(const RatesTrigger &)=delete
const double m_prescale
My prescale factor.
double getTotalPrescaleWeight() const
const std::string & getName() const
Get the name of this trigger.
Structure to hold per-event weights for distribution.