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  void removeAllSpaces(std::string&);
31 
32  uint32_t bin2uint(const std::string& binary);
33 
34  std::string uint2bin(uint32_t uinteger, uint16_t width);
35 
36 
37 
38  // builds a tree of TriggerItemNode's and returns top node
39  //
40  // input is:
41  //
42  // logic string like "!(1&2)|3"
44  parse(const std::string& logic,
45  const std::vector<std::string>& conditions,
46  const std::vector<TrigConf::TriggerThreshold*>& thrs);
47 
48  // returns position of corresponding ')' parenthesis
49  //
50  // opening parenthisis is at pos (or before)
51  std::string::size_type
52  findClosingBracket(std::string::size_type pos,
53  const std::string& logic);
54 
55  // builds an TriggerItemNode(OBJ), set's the TriggerThreshold, multiplicity, and InternalTrigger (if applicable)
56  //
57  // condition contains threshold name and multiplicity, or name of internal trigger
58  // threshold is looked for in thrs vector
60  buildObjNode(uint32_t condIdx,
61  const std::vector<std::string>& conditions,
62  const std::vector<TrigConf::TriggerThreshold*>& thrs);
63 
64  std::string insertParenthesis(const std::string& givenlogic);
65 
66 
67 }
TrigConf::findClosingBracket
std::string::size_type findClosingBracket(std::string::size_type pos, const std::string &logic)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:278
checkFileSG.line
line
Definition: checkFileSG.py:75
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:321
TrigConf::TriggerItemNode
Definition: TriggerItemNode.h:22
TrigConf::toLower
void toLower(std::string &)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:53
TrigConf::replaceTabs
void replaceTabs(std::string &str)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:46
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:211
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:88
TrigConf::uint2bin
std::string uint2bin(uint32_t uinteger, uint16_t width)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:332
TrigConf::strip
void strip(std::string &str)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:35
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TrigConf::split
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:27
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:299
TrigConf::removeAllSpaces
void removeAllSpaces(std::string &)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:40