ATLAS Offline Software
Loading...
Searching...
No Matches
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
14namespace 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"
41 TrigConf::TriggerItemNode*
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
57 TrigConf::TriggerItemNode*
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}
const double width
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
std::string uint2bin(uint32_t uinteger, uint16_t width)
std::string insertParenthesis(const std::string &givenlogic)
std::string::size_type findClosingBracket(std::string::size_type pos, const std::string &logic)
std::vector< std::string > split(const std::string &line, const std::string &del=" ")
TrigConf::TriggerItemNode * buildObjNode(uint32_t condIdx, const std::vector< std::string > &conditions, const std::vector< TrigConf::TriggerThreshold * > &thrs)
std::vector< std::string > parse(std::string names)
setEventNumber uint32_t