ATLAS Offline Software
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 
13 using namespace std;
14 using namespace TrigConf;
15 
16 TrigConf::HLTPrescale::HLTPrescale(float prescale, float pass_through) :
17  m_prescale(prescale),
18  m_pass_through(pass_through)
19 {}
20 
21 
24  m_stream_prescale[streamName] = ps;
25  return *this;
26 }
27 
29 TrigConf::HLTPrescale::setRerunPrescale(const std::string& targetName, float ps) {
30  m_rerun_prescale[targetName] = ps;
31  return *this;
32 }
33 
34 std::pair<bool, float>
35 TrigConf::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 
42 std::pair<bool, float>
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 //________________________________________________________________________________
52 std::ostream&
53 TrigConf::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 
62 string HLTPrescale::__str__() const {
63  stringstream s;
64  s << *this;
65  return s.str();
66 }
TrigConf::HLTPrescale
Definition: HLTPrescale.h:26
TrigConf::operator<<
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
Definition: L1ThresholdBase.cxx:339
HLTChainList.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigConf::HLTPrescale::HLTPrescale
HLTPrescale(float prescale=1, float pass_through=-1)
Definition: HLTPrescale.cxx:16
HLTChain.h
HLTPrescale.h
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::HLTPrescale::__str__
std::string __str__() const
Definition: HLTPrescale.cxx:62
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrigConf::HLTPrescale::getRerunPrescale
std::pair< bool, float > getRerunPrescale(const std::string &targetName) const
Definition: HLTPrescale.cxx:35
TrigConf::HLTPrescale::getStreamPrescale
std::pair< bool, float > getStreamPrescale(const std::string &streamName) const
Definition: HLTPrescale.cxx:43
HLTFrame.h
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
TrigConf::HLTPrescale::setRerunPrescale
HLTPrescale & setRerunPrescale(const std::string &targetName, float ps)
Definition: HLTPrescale.cxx:29
TrigConf::HLTPrescale::setStreamPrescale
HLTPrescale & setStreamPrescale(const std::string &streamName, float ps)
Definition: HLTPrescale.cxx:23
python.compressB64.c
def c
Definition: compressB64.py:93