ATLAS Offline Software
Loading...
Searching...
No Matches
HLTPrescale.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <iomanip>
6#include <iostream>
7
12
13using namespace std;
14using namespace TrigConf;
15
20
21
23TrigConf::HLTPrescale::setStreamPrescale(const std::string& streamName, float ps) {
24 m_stream_prescale[streamName] = ps;
25 return *this;
26}
27
29TrigConf::HLTPrescale::setRerunPrescale(const std::string& targetName, float ps) {
30 m_rerun_prescale[targetName] = ps;
31 return *this;
32}
33
34std::pair<bool, float>
35TrigConf::HLTPrescale::getRerunPrescale(const std::string& targetName) const {
36 std::unordered_map<std::string, float>::const_iterator i = m_rerun_prescale.find(targetName);
37 bool found = (i!=m_rerun_prescale.end());
38 float ps = found ? i->second : 0;
39 return std::make_pair(found,ps);
40}
41
42std::pair<bool, float>
43TrigConf::HLTPrescale::getStreamPrescale(const std::string& streamName) const {
44 std::unordered_map<std::string, float>::const_iterator i = m_stream_prescale.find(streamName);
45 bool found = i!=m_stream_prescale.end();
46 float ps = found ? i->second : 0;
47 return std::make_pair(found,ps);
48}
49
50
51//________________________________________________________________________________
52std::ostream&
53TrigConf::operator<<(std::ostream & o, const TrigConf::HLTPrescale & c) {
54
55 o << "Prescale: " << setw(4) << c.prescale()
56 << ", pass-through: " << setw(4) << c.pass_through()
57 << endl;
58 return o;
59}
60
61
62string HLTPrescale::__str__() const {
63 stringstream s;
64 s << *this;
65 return s.str();
66}
HLTPrescale & setStreamPrescale(const std::string &streamName, float ps)
PrescaleMap_t m_stream_prescale
Definition HLTPrescale.h:68
float pass_through() const
Definition HLTPrescale.h:53
HLTPrescale(float prescale=1, float pass_through=-1)
HLTPrescale & setRerunPrescale(const std::string &targetName, float ps)
std::string __str__() const
PrescaleMap_t m_rerun_prescale
Definition HLTPrescale.h:67
std::pair< bool, float > getRerunPrescale(const std::string &targetName) const
float prescale() const
Definition HLTPrescale.h:52
std::pair< bool, float > getStreamPrescale(const std::string &streamName) const
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
STL namespace.