ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConf::HLTPrescaleSet Class Reference

HLT chain configuration information. More...

#include <HLTPrescaleSet.h>

Inheritance diagram for TrigConf::HLTPrescaleSet:
Collaboration diagram for TrigConf::HLTPrescaleSet:

Public Types

typedef std::unordered_map< unsigned int, HLTPrescaleScalingMap_t

Public Member Functions

 HLTPrescaleSet ()
 default constructor
virtual ~HLTPrescaleSet () override=default
 destructor
HLTPrescalesetPrescale (const HLTPrescale &sc, unsigned int chain_counter, HLTLevel level=HLT)
const HLTPrescalegetPrescale (unsigned int chain_counter, HLTLevel level=HLT) const
bool hasPrescale (unsigned int counter, TrigConf::HLTLevel level=HLT) const
HLTPrescalethePrescale (unsigned int chain_counter, HLTLevel level)
const ScalingMap_tgetPrescales (HLTLevel level) const
size_t size (HLTLevel level=HLT) const
void reset ()
void print (const std::string &indent="", unsigned int detail=1) const override
 print the prescale set
void setIOV (uint32_t start_run, uint32_t start_lb, uint32_t end_run, uint32_t end_lb)
 sets the IOV of the prescale set
void setIOV (uint64_t start, uint64_t end)
void getIOV (uint32_t &start_run, uint32_t &start_lb, uint32_t &end_run, uint32_t &end_lb) const
 gets the IOV of the prescale set
bool isValid (uint32_t run, uint32_t lb) const
 checks if run/lb are in the current IOV
std::string __str__ () const override
int superMasterTableId () const
unsigned int smk () const
unsigned int id () const
const std::string & name () const
const std::string & comment () const
unsigned int version () const
void setSuperMasterTableId (int id)
void setSMK (int id)
void setId (unsigned int id)
void setName (const std::string &name)
void setVersion (unsigned int version)
void setComment (const std::string &c)
void printNameIdV (const std::string &indent="") const

Protected Member Functions

std::ostream & indent (std::ostream &o, int lvl, int size) const

Private Attributes

std::array< ScalingMap_t, 3 > m_scalers
uint64_t m_iovstart
uint64_t m_iovend
unsigned int m_smk
unsigned int m_id
std::string m_name
unsigned int m_version
std::string m_comment

Friends

std::ostream & operator<< (std::ostream &, const TrigConf::HLTPrescaleSet &)

Detailed Description

HLT chain configuration information.

Definition at line 31 of file HLTPrescaleSet.h.

Member Typedef Documentation

◆ ScalingMap_t

typedef std::unordered_map<unsigned int, HLTPrescale> TrigConf::HLTPrescaleSet::ScalingMap_t

Definition at line 34 of file HLTPrescaleSet.h.

Constructor & Destructor Documentation

◆ HLTPrescaleSet()

TrigConf::HLTPrescaleSet::HLTPrescaleSet ( )

default constructor

Definition at line 16 of file HLTPrescaleSet.cxx.

16 :
17 m_iovstart(0),
18 m_iovend(0)
19{}

◆ ~HLTPrescaleSet()

virtual TrigConf::HLTPrescaleSet::~HLTPrescaleSet ( )
overridevirtualdefault

destructor

Member Function Documentation

◆ __str__()

string HLTPrescaleSet::__str__ ( ) const
overridevirtual

Reimplemented from TrigConf::TrigConfData.

Definition at line 169 of file HLTPrescaleSet.cxx.

169 {
170 stringstream s;
171 s << *this;
172 return s.str();
173}

◆ comment()

const std::string & TrigConf::TrigConfData::comment ( ) const
inlineinherited

Definition at line 23 of file TrigConfData.h.

23{return m_comment;}

◆ getIOV()

void TrigConf::HLTPrescaleSet::getIOV ( uint32_t & start_run,
uint32_t & start_lb,
uint32_t & end_run,
uint32_t & end_lb ) const

gets the IOV of the prescale set

Definition at line 80 of file HLTPrescaleSet.cxx.

80 {
81 start_lb = m_iovstart & 0xFFFFFFFF;
82 start_run = m_iovstart>>32;
83 end_lb = m_iovend & 0xFFFFFFFF;
84 end_run = m_iovend>>32;
85}

◆ getPrescale()

const TrigConf::HLTPrescale & TrigConf::HLTPrescaleSet::getPrescale ( unsigned int chain_counter,
HLTLevel level = HLT ) const

Definition at line 42 of file HLTPrescaleSet.cxx.

42 {
43 const ScalingMap_t& map = m_scalers[static_cast<unsigned int>(level)];
44 ScalingMap_t::const_iterator s = map.find(chain_counter);
45 if(s==map.end()) {
46 cerr << "HLTPrescaleSet::getPrescale: chain counter " << chain_counter << " in level " << level << " has no prescales" << endl;
47 throw std::runtime_error("HLTPrescaleSet::getPrescale: chain has no prescales defined");
48 }
49 return s->second;
50}
std::array< ScalingMap_t, 3 > m_scalers
std::unordered_map< unsigned int, HLTPrescale > ScalingMap_t

◆ getPrescales()

const ScalingMap_t & TrigConf::HLTPrescaleSet::getPrescales ( HLTLevel level) const
inline

Definition at line 50 of file HLTPrescaleSet.h.

50{ return m_scalers[static_cast<unsigned int>(level)]; }

◆ hasPrescale()

bool TrigConf::HLTPrescaleSet::hasPrescale ( unsigned int counter,
TrigConf::HLTLevel level = HLT ) const

Definition at line 35 of file HLTPrescaleSet.cxx.

35 {
36 const ScalingMap_t& map_for_level = m_scalers[static_cast<unsigned int>(level)];
37 return !map_for_level.empty() && map_for_level.count(counter)>0;
38}

◆ id()

unsigned int TrigConf::TrigConfData::id ( ) const
inlineinherited

Definition at line 21 of file TrigConfData.h.

21{return m_id;}

◆ indent()

std::ostream & TrigConfData::indent ( std::ostream & o,
int lvl,
int size ) const
protectedinherited

Definition at line 23 of file TrigConfData.cxx.

23 {
24 int width = lvl*size;
25 if(width==0) return o;
26 o << setw(lvl*size) << " ";
27 return o;
28}
const double width

◆ isValid()

bool TrigConf::HLTPrescaleSet::isValid ( uint32_t run,
uint32_t lb ) const

checks if run/lb are in the current IOV

Definition at line 89 of file HLTPrescaleSet.cxx.

89 {
90 unsigned long long iovtime = run;
91 iovtime <<= 32;
92 iovtime += lb;
93
94 return iovtime >= m_iovstart && iovtime<m_iovend; // m_iovend is not part of the IOV
95}
int lb
Definition globals.cxx:23

◆ name()

const std::string & TrigConf::TrigConfData::name ( ) const
inlineinherited

Definition at line 22 of file TrigConfData.h.

22{return m_name;}

◆ print()

void TrigConf::HLTPrescaleSet::print ( const std::string & indent = "",
unsigned int detail = 1 ) const
overridevirtual

print the prescale set

Implements TrigConf::TrigConfData.

Definition at line 105 of file HLTPrescaleSet.cxx.

105 {
106 if(detail>=1) {
107 cout << indent << "HLTPrescaleSet "; printNameIdV();
108 cout << indent << " L2 scalers " << size(L2) << endl
109 << indent << " EF scalers " << size(EF) << endl
110 << indent << " HLT scalers " << size(HLT) << endl;
111 if(detail>=3) {
112 cout.unsetf(ios_base::floatfield);
113 for(unsigned int i=L2; i<=HLT; i++) {
115 if(size(level)==0) continue;
116 if(level!=HLT)
117 cout << indent << " " << (level==L2?"L2":"EF") << " prescales:" << endl;
118
119 const ScalingMap_t& map = m_scalers[static_cast<unsigned int>(level)];
120
121 for(uint cc=0; cc<8192;cc++) {
122 auto s_iter = map.find(cc);
123 if(s_iter==map.end()) continue;
124 const HLTPrescale& s = s_iter->second;
125 cout << indent << " Chain counter: " << setw(4) << cc
126 << ", prescale: " << setw(4) << s.prescale()
127 << ", pass-through: " << setw(4) << s.pass_through();
128 if( s.getRerunPrescales().size()>0 ) {
129 cout << ", rerun prescales: ";
130 for( HLTPrescale::PrescaleMap_t::value_type ps: s.getRerunPrescales())
131 cout << ps.first << ": " << ps.second << ", ";
132 }
133 if( s.getStreamPrescales().size()>0 ) {
134 cout << ", stream prescales: ";
135 for( HLTPrescale::PrescaleMap_t::value_type str_ps: s.getStreamPrescales())
136 cout << str_ps.first << ": " << str_ps.second << ", ";
137 }
138 cout << endl;
139 }
140 }
141 }
142 }
143}
unsigned int uint
size_t size(HLTLevel level=HLT) const
std::ostream & indent(std::ostream &o, int lvl, int size) const
void printNameIdV(const std::string &indent="") const

◆ printNameIdV()

void TrigConfData::printNameIdV ( const std::string & indent = "") const
inherited

Definition at line 31 of file TrigConfData.cxx.

31 {
32 cout << indent << name();
33 if(id()>0 || version()>0)
34 cout << " (id=" << id() << "/v=" << version() << ")";
35 cout << endl;
36 if(comment()!="")
37 cout << indent << "Comment: " << comment() << endl;
38}
unsigned int id() const
const std::string & name() const
const std::string & comment() const
unsigned int version() const

◆ reset()

void TrigConf::HLTPrescaleSet::reset ( )

Definition at line 99 of file HLTPrescaleSet.cxx.

99 {
100 for(unsigned int i = 0; i<3; ++i )
101 m_scalers[i].clear();
102}

◆ setComment()

void TrigConf::TrigConfData::setComment ( const std::string & c)
inlineinherited

Definition at line 32 of file TrigConfData.h.

◆ setId()

void TrigConf::TrigConfData::setId ( unsigned int id)
inlineinherited

Definition at line 29 of file TrigConfData.h.

29{ m_id=id; }

◆ setIOV() [1/2]

void TrigConf::HLTPrescaleSet::setIOV ( uint32_t start_run,
uint32_t start_lb,
uint32_t end_run,
uint32_t end_lb )

sets the IOV of the prescale set

Definition at line 65 of file HLTPrescaleSet.cxx.

65 {
66 m_iovstart = start_run; m_iovstart <<= 32; m_iovstart += start_lb;
67 m_iovend = end_run; m_iovend <<= 32; m_iovend += end_lb;
68}

◆ setIOV() [2/2]

void TrigConf::HLTPrescaleSet::setIOV ( uint64_t start,
uint64_t end )

◆ setName()

void TrigConf::TrigConfData::setName ( const std::string & name)
inlineinherited

Definition at line 30 of file TrigConfData.h.

30{ m_name = name;}

◆ setPrescale()

TrigConf::HLTPrescale & TrigConf::HLTPrescaleSet::setPrescale ( const HLTPrescale & sc,
unsigned int chain_counter,
HLTLevel level = HLT )

Definition at line 22 of file HLTPrescaleSet.cxx.

22 {
23 ScalingMap_t& map = m_scalers[static_cast<unsigned int>(level)];
24 ScalingMap_t::iterator s = map.find(chain_counter);
25 if(s==map.end()) {
26 s = map.insert(ScalingMap_t::value_type(chain_counter, sc)).first;
27 } else {
28 s->second = sc;
29 }
30 return s->second;
31}
static Double_t sc

◆ setSMK()

void TrigConf::TrigConfData::setSMK ( int id)
inlineinherited

Definition at line 28 of file TrigConfData.h.

28{m_smk=id;}

◆ setSuperMasterTableId()

void TrigConf::TrigConfData::setSuperMasterTableId ( int id)
inlineinherited

Definition at line 27 of file TrigConfData.h.

27{m_smk=id;}

◆ setVersion()

void TrigConf::TrigConfData::setVersion ( unsigned int version)
inlineinherited

Definition at line 31 of file TrigConfData.h.

◆ size()

size_t TrigConf::HLTPrescaleSet::size ( HLTLevel level = HLT) const
inline

Definition at line 52 of file HLTPrescaleSet.h.

52{ return m_scalers[static_cast<unsigned int>(level)].size(); }

◆ smk()

unsigned int TrigConf::TrigConfData::smk ( ) const
inlineinherited

Definition at line 20 of file TrigConfData.h.

20{return m_smk;}

◆ superMasterTableId()

int TrigConf::TrigConfData::superMasterTableId ( ) const
inlineinherited

Definition at line 19 of file TrigConfData.h.

19{return (int)m_smk;}

◆ thePrescale()

TrigConf::HLTPrescale & TrigConf::HLTPrescaleSet::thePrescale ( unsigned int chain_counter,
HLTLevel level )

Definition at line 53 of file HLTPrescaleSet.cxx.

53 {
54 ScalingMap_t& map = m_scalers[static_cast<unsigned int>(level)];
55 ScalingMap_t::iterator s = map.find(chain_counter);
56 if(s==map.end())
57 s = map.insert(ScalingMap_t::value_type(chain_counter, HLTPrescale())).first;
58
59 return s->second;
60}

◆ version()

unsigned int TrigConf::TrigConfData::version ( ) const
inlineinherited

Definition at line 24 of file TrigConfData.h.

24{return m_version;}

◆ operator<<

std::ostream & operator<< ( std::ostream & ,
const TrigConf::HLTPrescaleSet &  )
friend

Member Data Documentation

◆ m_comment

std::string TrigConf::TrigConfData::m_comment
privateinherited

Definition at line 48 of file TrigConfData.h.

◆ m_id

unsigned int TrigConf::TrigConfData::m_id
privateinherited

Definition at line 45 of file TrigConfData.h.

◆ m_iovend

uint64_t TrigConf::HLTPrescaleSet::m_iovend
private

Definition at line 75 of file HLTPrescaleSet.h.

◆ m_iovstart

uint64_t TrigConf::HLTPrescaleSet::m_iovstart
private

Definition at line 74 of file HLTPrescaleSet.h.

◆ m_name

std::string TrigConf::TrigConfData::m_name
privateinherited

Definition at line 46 of file TrigConfData.h.

◆ m_scalers

std::array<ScalingMap_t, 3> TrigConf::HLTPrescaleSet::m_scalers
private

Definition at line 72 of file HLTPrescaleSet.h.

◆ m_smk

unsigned int TrigConf::TrigConfData::m_smk
privateinherited

Definition at line 44 of file TrigConfData.h.

◆ m_version

unsigned int TrigConf::TrigConfData::m_version
privateinherited

Definition at line 47 of file TrigConfData.h.


The documentation for this class was generated from the following files: