ATLAS Offline Software
Trigger/TrigConfiguration/TrigConfL1Data/TrigConfL1Data/HelperFunctions.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #include <stdint.h>
7 #include <cstdlib>
8 #include <vector>
9 #include <string>
10 #include <stdexcept>
11 #include <inttypes.h>
12 #include <sys/types.h>
13 
14 namespace TrigConf {
15 
16  class TriggerThreshold;
17  class TriggerItemNode;
18 
19  // like PERL split
20  std::vector<std::string>
21  split(const std::string& line, const std::string& del=" ");
22 
23  // like PERL strip
24  void strip(std::string& str);
25 
26  void replaceTabs(std::string& str);
27 
28  void toLower(std::string&);
29 
30  uint32_t bin2uint(const std::string& binary);
31 
32  std::string uint2bin(uint32_t uinteger, uint16_t width);
33 
34 
35 
36  // builds a tree of TriggerItemNode's and returns top node
37  //
38  // input is:
39  //
40  // logic string like "!(1&2)|3"
42  parse(const std::string& logic,
43  const std::vector<std::string>& conditions,
44  const std::vector<TrigConf::TriggerThreshold*>& thrs);
45 
46  // returns position of corresponding ')' parenthesis
47  //
48  // opening parenthisis is at pos (or before)
49  std::string::size_type
50  findClosingBracket(std::string::size_type pos,
51  const std::string& logic);
52 
53  // builds an TriggerItemNode(OBJ), set's the TriggerThreshold, multiplicity, and InternalTrigger (if applicable)
54  //
55  // condition contains threshold name and multiplicity, or name of internal trigger
56  // threshold is looked for in thrs vector
58  buildObjNode(uint32_t condIdx,
59  const std::vector<std::string>& conditions,
60  const std::vector<TrigConf::TriggerThreshold*>& thrs);
61 
62  std::string insertParenthesis(const std::string& givenlogic);
63 
64 
65 }
TrigConf::findClosingBracket
std::string::size_type findClosingBracket(std::string::size_type pos, const std::string &logic)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:271
TrigConf::parse
std::vector< std::string > parse(std::string names)
Definition: TrigConfHLTData/Root/HLTChain.cxx:117
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConf::bin2uint
uint32_t bin2uint(const std::string &binary)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:314
TrigConf::TriggerItemNode
Definition: TriggerItemNode.h:22
TrigConf::toLower
void toLower(std::string &)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:46
TrigConf::replaceTabs
void replaceTabs(std::string &str)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:39
dq_defect_bulk_create_defects.line
line
Definition: dq_defect_bulk_create_defects.py:27
TrigConf::buildObjNode
TrigConf::TriggerItemNode * buildObjNode(uint32_t condIdx, const std::vector< std::string > &conditions, const std::vector< TrigConf::TriggerThreshold * > &thrs)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:204
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigConf::uint2bin
std::string uint2bin(uint32_t uinteger, uint16_t width)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:325
TrigConf::strip
void strip(std::string &str)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:34
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
TrigConf::split
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:26
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
str
Definition: BTagTrackIpAccessor.cxx:11
TrigConf::insertParenthesis
std::string insertParenthesis(const std::string &givenlogic)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:292