17#ifndef ATHMONITORALGORITHM_H
18#define ATHMONITORALGORITHM_H
72 virtual StatusCode
execute(
const EventContext& ctx)
const override;
104 void fill(
const ToolHandle<GenericMonitoringTool>& groupHandle,
105 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>&& variables )
const;
120 void fill(
const ToolHandle<GenericMonitoringTool>& groupHandle,
121 const std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>& variables )
const {
122 fill(groupHandle, std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{variables});
133 template <
typename... T>
134 void fill(
const ToolHandle<GenericMonitoringTool>& groupHandle, T&&... variables )
const {
135 fill(groupHandle, std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{std::forward<T>(variables)...});
146 void fill( std::string_view groupName,
147 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>&& variables )
const;
155 void fill( std::string_view groupName,
156 const std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>& variables )
const {
157 fill(
getGroup(groupName), std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{variables});
168 template <
typename S,
typename... T>
169 requires std::convertible_to<S, std::string_view>
170 void fill( S&& groupName, T&&... variables )
const {
171 fill(
getGroup(std::forward<S>(groupName)), std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{std::forward<T>(variables)...});
254 const ToolHandle<GenericMonitoringTool>&
getGroup( std::string_view name )
const;
315 virtual double lbDuration(
const EventContext& ctx )
const;
330 virtual double lbLumiWeight(
const EventContext& ctx )
const;
345 virtual StatusCode
parseList(
const std::string& line, std::vector<std::string>& result )
const;
350 ToolHandleArray<GenericMonitoringTool>
m_tools {
this,
"GMTools",{}};
358 {
this,
"LuminosityCondDataKey",
"LuminosityCondData",
"SG Key of LuminosityCondData object"};
360 {
this,
"LBDurationCondDataKey",
"LBDurationCondData",
"SG Key of LBDurationCondData object"};
362 {
this,
"TrigLiveFractionCondDataKey",
"TrigLiveFractionCondData",
"SG Key of TrigLiveFractionCondData object"};
372 Gaudi::Property<std::string>
m_fileKey {
this,
"FileKey",
""};
373 Gaudi::Property<bool>
m_useLumi {
this,
"EnableLumi",
false};
379 typedef std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>
MonVarVec_t;
381 std::unordered_map<std::string, size_t, CxxUtils::TransparentStringHash, std::equal_to<>>
m_toolLookupMap;
383 const ToolHandle<GenericMonitoringTool>
m_dummy;
387 "EnforceExpressTriggers",
false,
388 "Requires that matched triggers made the event enter the express stream"};
Hold luminosity block duration data produced from /TRIGGER/LUMI/LBLB.
Hold luminosity data produced by LuminosityCondAlg.
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid from which a ReadHandle is made.
Hold live fraction data produced by TrigLiveFractionCondAlg.
virtual StatusCode fillHistograms(const EventContext &ctx) const =0
adds event to the monitoring histograms
Gaudi::Property< int > m_detailLevel
Sets the level of detail used in the monitoring.
bool trigChainsArePassed(const std::vector< std::string > &vTrigNames) const
Check whether triggers are passed.
Environment_t environment() const
Accessor functions for the environment.
AthMonitorAlgorithm::DataType_t m_dataType
Instance of the DataType_t enum.
DataType_t dataTypeStringToEnum(const std::string &str) const
Convert the data type string from the python configuration to an enum object.
Environment_t envStringToEnum(const std::string &str) const
Convert the environment string from the python configuration to an enum object.
Gaudi::Property< std::string > m_triggerChainString
Trigger chain string pulled from the job option and parsed into a vector.
Gaudi::Property< bool > m_useLumi
Allows use of various luminosity functions.
virtual StatusCode parseList(const std::string &line, std::vector< std::string > &result) const
Parse a string into a vector.
virtual StatusCode initialize() override
initialize
DataType_t dataType() const
Accessor functions for the data type.
Environment_t
Specifies the processing environment.
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
const ToolHandle< GenericMonitoringTool > & getGroup(std::string_view name) const
Get a specific monitoring tool from the tool handle array.
std::vector< std::string > m_vTrigChainNames
Vector of trigger chain names parsed from trigger chain string.
Gaudi::Property< float > m_defaultLBDuration
Default duration of one lumi block.
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.).
const ToolHandle< GenericMonitoringTool > m_dummy
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Tool to tell whether a specific trigger is passed.
std::unordered_map< std::string, size_t, CxxUtils::TransparentStringHash, std::equal_to<> > m_toolLookupMap
DataType_t
Specifies what type of input data is being monitored.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadCondHandleKey< TrigLiveFractionCondData > m_trigLiveFractionDataKey
virtual ~AthMonitorAlgorithm()
Destructor.
Gaudi::Property< bool > m_enforceExpressTriggers
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
SG::ReadCondHandleKey< LBDurationCondData > m_lbDurationDataKey
std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > MonVarVec_t
ToolHandleArray< IDQFilterTool > m_DQFilterTools
Array of Data Quality filter tools.
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Key for retrieving EventInfo from StoreGate.
AthMonitorAlgorithm::Environment_t m_environment
Instance of the Environment_t enum.
Gaudi::Property< std::string > m_environmentStr
Environment string pulled from the job option and converted to enum.
Gaudi::Property< std::string > m_dataTypeStr
DataType string pulled from the job option and converted to enum.
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey
virtual StatusCode execute(const EventContext &ctx) const override
Applies filters and trigger requirements.
Gaudi::Property< std::string > m_fileKey
Internal Athena name for file.
An algorithm that can be simultaneously executed in multiple threads.
Property holding a SG store/key/clid from which a ReadHandle is made.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, T &&... variables) const
Fills a variadic list of variables to a group by reference.
void fill(S &&groupName, T &&... variables) const
Fills a variadic list of variables to a group by name.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, const std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &variables) const
Fills a vector of variables to a group by reference.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
void fill(std::string_view groupName, const std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &variables) const
Fills a vector of variables to a group by name.
virtual float lbLuminosityPerBCID(const EventContext &ctx) const
Calculate the instantaneous luminosity per bunch crossing.
virtual float lbAverageLuminosity(const EventContext &ctx) const
Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
virtual float lbAverageLivefraction(const EventContext &ctx) const
Calculate the average luminosity livefraction.
virtual float lbInteractionsPerCrossing(const EventContext &ctx) const
Calculate instantaneous number of interactions, i.e.
virtual float lbAverageInteractionsPerCrossing(const EventContext &ctx) const
Calculate the average mu, i.e.
virtual double lbLumiWeight(const EventContext &ctx) const
Calculate the average integrated luminosity multiplied by the live fraction.
virtual double lbDuration(const EventContext &ctx) const
Calculate the duration of the luminosity block (in seconds).
virtual float livefractionPerBCID(const EventContext &ctx) const
Calculate the live fraction per bunch crossing ID.
The common trigger namespace for trigger analysis tools.