ATLAS Offline Software
Loading...
Searching...
No Matches
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
21namespace 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 ***************************************************************************/
34 public:
41 void add(Monitored::IMonitoredVariable& variable);
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
void add(Monitored::IMonitoredVariable &variable)
Add a new monitored variable.
void increaseCapacity(std::size_t value, bool owned=false)
Increase the internal capacity.
Monitored::Group build(const ToolHandle< GenericMonitoringTool > &tool) const
Build the monitored group.
std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > m_references
References to monitored variables.
std::vector< std::unique_ptr< Monitored::IMonitoredVariable > > m_ptrs
Any monitored variables that we own directly.
void add(T &&variable)
Add a new monitored variable.
Group of local monitoring quantities and retain correlation when filling histograms
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...