ATLAS Offline Software
MonGroupBuilder.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 /******************************************************************************
6  * @package Trigger/TrigAlgorithms/TrigEFMissingET
7  * @class MonGroupBuilder
8  *
9  * @brief Class to help with building monitoring groups
10  * @author Jon Burr
11  *****************************************************************************/
12 
13 #ifndef TRIGEFMISSINGET_MONGROUPBUILDER_H
14 #define TRIGEFMISSINGET_MONGROUPBUILDER_H 1
15 
17 #include <type_traits>
18 #include <memory>
19 
20 
21 namespace HLT { namespace MET {
22  /****************************************************************************
23  * @class MonGroupBuilder
24  *
25  * Class allowing incremental building of Monitored::Groups.
26  *
27  * Currently, it's only possible to load all members of a single
28  * Monitored::Group simultaneously, i.e. it's not possible to build up the
29  * group a few members at a time. However in these algorithms I found times
30  * where I wanted to monitor several variables at the same time, but trigger
31  * these from different locations.
32  ***************************************************************************/
33  class MonGroupBuilder {
34  public:
42 
50  template <typename T,
51  typename = std::enable_if_t<
52  !std::is_lvalue_reference_v<T> &&
53  std::is_base_of_v<Monitored::IMonitoredVariable, T>>>
54  void add(T&& variable)
55  {
56  m_ptrs.push_back(std::make_unique<T>(std::move(variable) ) );
57  add(*m_ptrs.back() );
58  }
59 
70  const ToolHandle<GenericMonitoringTool>& tool) const;
71 
81  void increaseCapacity(std::size_t value, bool owned=false);
82  private:
84  std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> m_references;
86  std::vector<std::unique_ptr<Monitored::IMonitoredVariable>> m_ptrs;
87  }; //> end class MonGroupBuilder
88 } } //> end namespace HLT::MET
89 
90 #endif //> !TRIGEFMISSINGET_MONGROUPBUILDER_H
Monitored::Group
Group of local monitoring quantities and retain correlation when filling histograms
Definition: MonitoredGroup.h:54
athena.value
value
Definition: athena.py:124
MonitoredGroup.h
HLT::MET::MonGroupBuilder::m_ptrs
std::vector< std::unique_ptr< Monitored::IMonitoredVariable > > m_ptrs
Any monitored variables that we own directly.
Definition: MonGroupBuilder.h:114
Monitored::IMonitoredVariable
Definition: IMonitoredVariable.h:14
HLT::MET::MonGroupBuilder::build
Monitored::Group build(const ToolHandle< GenericMonitoringTool > &tool) const
Build the monitored group.
Definition: MonGroupBuilder.cxx:33
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
python.selection.variable
variable
Definition: selection.py:33
HLT::MET::MonGroupBuilder::add
void add(Monitored::IMonitoredVariable &variable)
Add a new monitored variable.
Definition: MonGroupBuilder.cxx:28
MET
Definition: MET.py:1
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
HLT::MET::MonGroupBuilder::increaseCapacity
void increaseCapacity(std::size_t value, bool owned=false)
Increase the internal capacity.
Definition: MonGroupBuilder.cxx:39
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
HLT::MET::MonGroupBuilder::m_references
std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > m_references
References to monitored variables.
Definition: MonGroupBuilder.h:112