17#ifndef ATHMONITORALGORITHM_H
18#define ATHMONITORALGORITHM_H
68 virtual StatusCode
execute(
const EventContext& ctx)
const override;
100 void fill(
const ToolHandle<GenericMonitoringTool>& groupHandle,
101 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>&& variables )
const;
116 void fill(
const ToolHandle<GenericMonitoringTool>& groupHandle,
117 const std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>& variables )
const {
118 fill(groupHandle, std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{variables});
127 template <
typename... T>
128 void fill(
const ToolHandle<GenericMonitoringTool>& groupHandle, T&&... variables )
const {
129 fill(groupHandle, std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{std::forward<T>(variables)...});
140 void fill(
const std::string& groupName,
141 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>&& variables )
const;
149 void fill(
const std::string& groupName,
150 const std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>& variables )
const {
151 fill(
getGroup(groupName), std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{variables});
160 template <
typename... T>
161 void fill(
const std::string& groupName, T&&... variables )
const {
162 fill(
getGroup(groupName), std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>{std::forward<T>(variables)...});
245 const ToolHandle<GenericMonitoringTool>&
getGroup(
const std::string& name )
const;
296 virtual float lbAverageLuminosity(
const EventContext& ctx = Gaudi::Hive::currentContext() )
const;
301 virtual float lbLuminosityPerBCID(
const EventContext& ctx = Gaudi::Hive::currentContext() )
const;
306 virtual double lbDuration(
const EventContext& ctx = Gaudi::Hive::currentContext() )
const;
311 virtual float lbAverageLivefraction(
const EventContext& ctx = Gaudi::Hive::currentContext() )
const;
316 virtual float livefractionPerBCID(
const EventContext& ctx = Gaudi::Hive::currentContext() )
const;
321 virtual double lbLumiWeight(
const EventContext& ctx = Gaudi::Hive::currentContext() )
const;
336 virtual StatusCode
parseList(
const std::string& line, std::vector<std::string>&
result )
const;
341 ToolHandleArray<GenericMonitoringTool>
m_tools {
this,
"GMTools",{}};
349 {
this,
"LuminosityCondDataKey",
"LuminosityCondData",
"SG Key of LuminosityCondData object"};
351 {
this,
"LBDurationCondDataKey",
"LBDurationCondData",
"SG Key of LBDurationCondData object"};
353 {
this,
"TrigLiveFractionCondDataKey",
"TrigLiveFractionCondData",
"SG Key of TrigLiveFractionCondData object"};
363 Gaudi::Property<std::string>
m_fileKey {
this,
"FileKey",
""};
364 Gaudi::Property<bool>
m_useLumi {
this,
"EnableLumi",
false};
370 typedef std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>>
MonVarVec_t;
374 const ToolHandle<GenericMonitoringTool>
m_dummy;
378 "EnforceExpressTriggers",
false,
379 "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
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
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.
std::unordered_map< std::string, size_t > m_toolLookupMap
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.
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.
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(const std::string &groupName, const std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &variables) const
Fills a vector 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(const std::string &groupName, T &&... variables) const
Fills a variadic list of variables to a group by name.
virtual double lbLumiWeight(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the average integrated luminosity multiplied by the live fraction.
virtual float lbInteractionsPerCrossing(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate instantaneous number of interactions, i.e.
virtual float lbLuminosityPerBCID(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the instantaneous luminosity per bunch crossing.
virtual float livefractionPerBCID(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the live fraction per bunch crossing ID.
virtual float lbAverageLuminosity(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate average luminosity (in ub-1 s-1 => 10^30 cm-2 s-1).
virtual float lbAverageInteractionsPerCrossing(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the average mu, i.e.
virtual float lbAverageLivefraction(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the average luminosity livefraction.
virtual double lbDuration(const EventContext &ctx=Gaudi::Hive::currentContext()) const
Calculate the duration of the luminosity block (in seconds)
The common trigger namespace for trigger analysis tools.