ATLAS Offline Software
Public Member Functions | Friends | List of all members
TrigConf::HLTChainList Class Reference

list of all HLT chains in a trigger menu More...

#include <HLTChainList.h>

Inheritance diagram for TrigConf::HLTChainList:
Collaboration diagram for TrigConf::HLTChainList:

Public Member Functions

 HLTChainList ()
 default constructor More...
 
 HLTChainList (const std::vector< HLTChain * > &chainList)
 constructor with configuration data More...
 
 ~HLTChainList ()
 default destructor More...
 
bool addHLTChain (HLTChain *ch)
 adds an HLTChain to the menu More...
 
HLTChainchain (const std::string &chainname) const
 access the chain by name returns null-pointer if chain not found More...
 
HLTChainchain (unsigned int counter, HLTLevel level) const
 access the chain by level and counter More...
 
void print (const std::string &indent="", unsigned int detail=1) const
 accessors to list of chains, for backward compatibility, use HLTChainList directly More...
 
DiffStructcompareTo (const HLTChainList *o) const
 
void applyPrescaleSet (const HLTPrescaleSet *pss)
 set prescales of all chains More...
 
HLTPrescaleSetextractPrescaleSet () const
 extract prescales from all chains More...
 
void setL2LowerChainCounter (const CTPConfig *ctpcfg)
 
void setEFLowerChainCounter ()
 
void clear ()
 

Friends

std::ostream & operator<< (std::ostream &o, const TrigConf::HLTChainList &c)
 

Detailed Description

list of all HLT chains in a trigger menu

Definition at line 56 of file HLTChainList.h.

Constructor & Destructor Documentation

◆ HLTChainList() [1/2]

TrigConf::HLTChainList::HLTChainList ( )

default constructor

Definition at line 21 of file HLTChainList.cxx.

22 {}

◆ HLTChainList() [2/2]

TrigConf::HLTChainList::HLTChainList ( const std::vector< HLTChain * > &  chainList)

constructor with configuration data

Parameters
chainListlist of all HLT chains

Definition at line 25 of file HLTChainList.cxx.

25  {
26  copy(chainList.begin(), chainList.end(), std::inserter(*this, begin()));
27 }

◆ ~HLTChainList()

TrigConf::HLTChainList::~HLTChainList ( )

default destructor

Definition at line 30 of file HLTChainList.cxx.

30  {
31  clear();
32 }

Member Function Documentation

◆ addHLTChain()

bool TrigConf::HLTChainList::addHLTChain ( TrigConf::HLTChain chain)

adds an HLTChain to the menu

Parameters
chchain to be added

Definition at line 42 of file HLTChainList.cxx.

42  {
43  pair<iterator, bool> ins = insert(chain);
44  if(!ins.second)
45  throw runtime_error("Can't insert chain '" + chain->name() + "', because a uniqueness constraint is violated");
46  return ins.second;
47 }

◆ applyPrescaleSet()

void TrigConf::HLTChainList::applyPrescaleSet ( const HLTPrescaleSet pss)

set prescales of all chains

Definition at line 70 of file HLTChainList.cxx.

70  {
71  for(HLTChain *ch: *this) {
72  if(ch->level_enum() == HLTLevel::HLT ) {
73  // merged menu
74  if (pss->hasPrescale( ch->chain_counter(), HLTLevel::HLT ) ) {
75  // merged prescales (Run 2)
76  const HLTPrescale& sc = pss->getPrescale( ch->chain_counter(), HLTLevel::HLT );
77  ch->set_prescales( sc );
78  } else {
79  // prescale set has not been merged yet (LS 1)
80  if(ch->mergeCounter.l2==0 && ch->mergeCounter.ef==0) {
81  throw runtime_error("Merged HLT chain has no info about L2 or EF counter");
82  } else if(ch->mergeCounter.l2==0) {
83  const HLTPrescale& efps = pss->getPrescale( ch->mergeCounter.ef, HLTLevel::EF );
84  ch->set_prescales( efps );
85  } else if(ch->mergeCounter.ef==0) {
86  const HLTPrescale& l2ps = pss->getPrescale( ch->mergeCounter.ef, HLTLevel::L2 );
87  ch->set_prescales( l2ps );
88  } else {
89  const HLTPrescale& l2ps = pss->getPrescale( ch->mergeCounter.l2, HLTLevel::L2 );
90  const HLTPrescale& efps = pss->getPrescale( ch->mergeCounter.ef, HLTLevel::EF );
91  HLTTEUtils::mergeL2EFPrescales( ch, l2ps, efps);
92  }
93  }
94  } else {
95  // menu not merged
96  const HLTPrescale& sc = pss->getPrescale( ch->chain_counter(), str2lvl(ch->level()) );
97  ch->set_prescales( sc );
98  }
99  }
100 }

◆ chain() [1/2]

TrigConf::HLTChain * TrigConf::HLTChainList::chain ( const std::string &  chainname) const

access the chain by name returns null-pointer if chain not found

Definition at line 52 of file HLTChainList.cxx.

52  {
53  const index<name_hash>::type& byname = get<name_hash>();
54  index<name_hash>::type::const_iterator ch = byname.find(name);
55  if(ch == byname.end()) return 0;
56  return *ch;
57 }

◆ chain() [2/2]

TrigConf::HLTChain * TrigConf::HLTChainList::chain ( unsigned int  counter,
HLTLevel  level 
) const

access the chain by level and counter

returns null-pointer if chain not found

Definition at line 61 of file HLTChainList.cxx.

61  {
62  const index<counter>::type& bycounter = get<counter>();
63  index<counter>::type::const_iterator ch = bycounter.find(boost::make_tuple(chaincounter,level));
64  if(ch == bycounter.end()) return 0;
65  return *ch;
66 }

◆ clear()

void TrigConf::HLTChainList::clear ( )

Definition at line 34 of file HLTChainList.cxx.

34  {
35  for(HLTChain* ch : *this) {
36  delete ch;
37  }
39 }

◆ compareTo()

TrigConf::DiffStruct * TrigConf::HLTChainList::compareTo ( const HLTChainList o) const

Definition at line 154 of file HLTChainList.cxx.

154  {
155  DiffStruct * ds = new DiffStruct("CHAIN_LIST");
156  for(HLTChain* ch : *this) {
157  HLTChain *o_ch = o->chain(ch->name());
158  if(o_ch) {
159  ds->addSub( ch->compareTo(o_ch) );
160  } else {
161  ds->addLeftOnlySub( "CHAIN", ch->name() );
162  }
163  }
164  for(HLTChain* o_ch : *o) {
165  const HLTChain *ch = chain(o_ch->name());
166  if(!ch)
167  ds->addRightOnlySub( "CHAIN", o_ch->name() );
168  }
169  if(ds->empty()) {
170  delete ds; ds=0;
171  }
172  return ds;
173 }

◆ extractPrescaleSet()

TrigConf::HLTPrescaleSet * TrigConf::HLTChainList::extractPrescaleSet ( ) const

extract prescales from all chains

Definition at line 104 of file HLTChainList.cxx.

104  {
105  HLTPrescaleSet* pss = new HLTPrescaleSet();
106  for(HLTChain *ch : *this)
107  pss->setPrescale(ch->prescales(), ch->chain_counter(), ch->level_enum());
108  return pss;
109 }

◆ print()

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

accessors to list of chains, for backward compatibility, use HLTChainList directly

print the chain list

Definition at line 177 of file HLTChainList.cxx.

177  {
178  if(detail>=1) {
179  cout << indent << "HLTChainList has " << size() << " chains" << endl;
180  if(detail>=2) {
181  for(HLTChain* ch : *this)
182  ch->print(indent + " ", detail);
183  cout << indent << "- ---------------------------------------------------------- " << endl;
184  }
185  }
186 }

◆ setEFLowerChainCounter()

void TrigConf::HLTChainList::setEFLowerChainCounter ( )

Definition at line 141 of file HLTChainList.cxx.

141  {
142  for(HLTChain *ch : *this) {
143  if(ch->level()!="EF" || ch->lower_chain_name()=="") continue;
144  HLTChain * l2ch = chain(ch->lower_chain_name());
145  if(l2ch==0) {
146  cerr << "ERROR: Did not find lower chain name '" << ch->lower_chain_name() << "' for chain '" << ch->chain_name() << "'" << endl;
147  continue;
148  }
149  ch->set_lower_chain_counter( l2ch->chain_counter() );
150  }
151 }

◆ setL2LowerChainCounter()

void TrigConf::HLTChainList::setL2LowerChainCounter ( const CTPConfig ctpcfg)

Definition at line 115 of file HLTChainList.cxx.

115  {
116  if(ctpcfg==0)
117  throw runtime_error("setL2LowerChainCounter: no CTPConfig object available");
118 
119  const TrigConf::Menu& menu = ctpcfg->menu();
120 
121  std::map<std::string,int> ctpFromName;
122  for(const TriggerItem* item : menu.itemVector())
123  ctpFromName[item->name()] = item->ctpId();
124 
125  for(HLTChain* ch : *this) {
126  if(ch->level() == "EF") continue;
127  std::string low_chain_names = ch->lower_chain_name();
128  TrigConf::removeAllSpaces(low_chain_names);
129  vector<string> low_chain_names_V = split(low_chain_names,",");
130  std::vector<int> lccs;
131  for(const std::string& lowerChainName : low_chain_names_V)
132  lccs.push_back(ctpFromName[lowerChainName]);
133  ch->set_lower_chain_counter(low_chain_names_V.size()==1 ? lccs[0] : -1);
134  ch->set_lower_chain_counters(lccs);
135  }
136 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  o,
const TrigConf::HLTChainList c 
)
friend

The documentation for this class was generated from the following files:
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:260
Trk::L2
@ L2
Definition: AlignModuleList.h:32
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
TrigConf::TrigConfData::name
const std::string & name() const
Definition: TrigConfData.h:22
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
detail
Definition: extract_histogram_tag.cxx:14
TRT_PAI_gasdata::EF
const float EF[NF]
Energy levels for Fluor.
Definition: TRT_PAI_gasdata.h:271
TrigConf::str2lvl
HLTLevel str2lvl(const std::string &level)
Definition: HLTLevel.h:14
trigbs_dumpPrescaleBits.HLTChain
HLTChain
Definition: trigbs_dumpPrescaleBits.py:41
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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
menu
make the sidebar many part of the config
Definition: hcg.cxx:551
TrigConf::Menu
Definition: Menu.h:49
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:36
TrigConf::HLTChainList::chain
HLTChain * chain(const std::string &chainname) const
access the chain by name returns null-pointer if chain not found
Definition: HLTChainList.cxx:52
TrigConf::HLTTEUtils::mergeL2EFPrescales
static void mergeL2EFPrescales(TrigConf::HLTChain *hltchain, const TrigConf::HLTPrescale &l2ps, const TrigConf::HLTPrescale &efps)
Definition: TrigConfHLTData/Root/HLTUtils.cxx:547
TrigConf::HLTChainList::clear
void clear()
Definition: HLTChainList.cxx:34
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
item
Definition: ItemListSvc.h:43
TrigConf::split
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:27
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
menu::menu
menu(node &n)
Definition: hcg.cxx:555
calibdata.copy
bool copy
Definition: calibdata.py:27
TrigConf::removeAllSpaces
void removeAllSpaces(std::string &)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:40