ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
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 More...
 
virtual ~HLTPrescaleSet () override=default
 destructor More...
 
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 More...
 
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 More...
 
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 More...
 
bool isValid (uint32_t run, uint32_t lb) const
 checks if run/lb are in the current IOV More...
 
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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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 }

◆ 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.

32 { m_comment = c;}

◆ 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 
)

Definition at line 72 of file HLTPrescaleSet.cxx.

72  {
73  m_iovstart = start;
74  m_iovend = end;
75 }

◆ 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 }

◆ 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.

31 { m_version = version;}

◆ 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;}

Friends And Related Function Documentation

◆ 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:
TrigConf::TrigConfData::m_id
unsigned int m_id
Definition: TrigConfData.h:45
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TrigConf::HLTPrescale
Definition: HLTPrescale.h:26
TrigConf::TrigConfData::m_name
std::string m_name
Definition: TrigConfData.h:46
TrigConf::TrigConfData::name
const std::string & name() const
Definition: TrigConfData.h:22
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigConf::L2
@ L2
Definition: HLTLevel.h:12
TrigConf::TrigConfData::comment
const std::string & comment() const
Definition: TrigConfData.h:23
TrigConf::HLTPrescaleSet::m_iovstart
uint64_t m_iovstart
Definition: HLTPrescaleSet.h:74
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
detail
Definition: extract_histogram_tag.cxx:14
TrigConf::HLTPrescaleSet::m_scalers
std::array< ScalingMap_t, 3 > m_scalers
Definition: HLTPrescaleSet.h:72
TrigConf::TrigConfData::m_version
unsigned int m_version
Definition: TrigConfData.h:47
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigConf::HLT
@ HLT
Definition: HLTLevel.h:12
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
TrigConf::EF
@ EF
Definition: HLTLevel.h:12
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigConf::TrigConfData::m_comment
std::string m_comment
Definition: TrigConfData.h:48
TrigConf::TrigConfData::version
unsigned int version() const
Definition: TrigConfData.h:24
TrigConf::HLTLevel
HLTLevel
Definition: HLTLevel.h:12
TrigConf::HLTPrescaleSet::size
size_t size(HLTLevel level=HLT) const
Definition: HLTPrescaleSet.h:52
TrigConf::HLTPrescaleSet::ScalingMap_t
std::unordered_map< unsigned int, HLTPrescale > ScalingMap_t
Definition: HLTPrescaleSet.h:34
TrigConf::counter
Definition: HLTChainList.h:37
TrigConf::TrigConfData::id
unsigned int id() const
Definition: TrigConfData.h:21
TrigConf::TrigConfData::m_smk
unsigned int m_smk
Definition: TrigConfData.h:44
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
DeMoScan.first
bool first
Definition: DeMoScan.py:536
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition: TrigConfData.cxx:23
TrigConf::HLTPrescaleSet::m_iovend
uint64_t m_iovend
Definition: HLTPrescaleSet.h:75
python.compressB64.c
def c
Definition: compressB64.py:93
TrigConf::TrigConfData::printNameIdV
void printNameIdV(const std::string &indent="") const
Definition: TrigConfData.cxx:31
python.handimod.cc
int cc
Definition: handimod.py:523