ATLAS Offline Software
DiffStruct.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 #ifndef TrigConf_DiffStruct
6 #define TrigConf_DiffStruct
7 
8 #include <unordered_map>
9 
10 #include <string>
11 #include <vector>
12 
13 namespace TrigConf {
14  class DiffStruct {
15  public:
16  DiffStruct(const std::string& tagname, const std::string& name="");
17  ~DiffStruct();
18 
19  void check(const std::string& attname, const std::string& lval, const std::string& rval);
20  void check(const std::string& attname, int lval, int rval);
21  void check(const std::string& attname, unsigned int lval, unsigned int rval);
22  void check(const std::string& attname, float lval, float rval);
23  void check(const std::string& attname, bool lval, bool rval);
24 
25  void addSub(DiffStruct* sub);
26  void addRightOnlySub(const std::string& tagname, const std::string& name);
27  void addLeftOnlySub(const std::string& tagname, const std::string& name);
28 
29  bool empty() const;
30 
31  void writeXML(std::ofstream & xmlfile, const std::string& prefix="") const;
32 
33  struct AttDiff {
34  AttDiff(const std::string& attname_, const std::string& lval_, const std::string& rval_) : attname(attname_), lval(lval_), rval(rval_) {}
35  std::string attname;
36  std::string lval;
37  std::string rval;
38  };
39  std::string tagname;
40  std::string name;
41  std::vector<AttDiff> attdiffs;
42  std::vector<DiffStruct*> subs;
43  typedef std::unordered_map<std::string, std::string> OnlyMap_t;
46 
47 
48  };
49 }
50 
51 #endif
TrigConf::DiffStruct::rightonly
OnlyMap_t rightonly
Definition: DiffStruct.h:44
TrigConf::DiffStruct::AttDiff
Definition: DiffStruct.h:33
TrigConf::DiffStruct::writeXML
void writeXML(std::ofstream &xmlfile, const std::string &prefix="") const
Definition: DiffStruct.cxx:76
TrigConf::DiffStruct::DiffStruct
DiffStruct(const std::string &tagname, const std::string &name="")
Definition: DiffStruct.cxx:14
TrigConf::DiffStruct::AttDiff::attname
std::string attname
Definition: DiffStruct.h:35
TrigConf::DiffStruct
Definition: DiffStruct.h:14
TrigConf::DiffStruct::addRightOnlySub
void addRightOnlySub(const std::string &tagname, const std::string &name)
Definition: DiffStruct.cxx:60
TrigConf::DiffStruct::OnlyMap_t
std::unordered_map< std::string, std::string > OnlyMap_t
Definition: DiffStruct.h:43
TrigConf::DiffStruct::check
void check(const std::string &attname, const std::string &lval, const std::string &rval)
Definition: DiffStruct.cxx:26
TrigConf::DiffStruct::tagname
std::string tagname
Definition: DiffStruct.h:39
TrigConf::DiffStruct::AttDiff::rval
std::string rval
Definition: DiffStruct.h:37
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::DiffStruct::~DiffStruct
~DiffStruct()
Definition: DiffStruct.cxx:19
TrigConf::DiffStruct::addSub
void addSub(DiffStruct *sub)
Definition: DiffStruct.cxx:55
TrigConf::DiffStruct::leftonly
OnlyMap_t leftonly
Definition: DiffStruct.h:45
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::DiffStruct::AttDiff::AttDiff
AttDiff(const std::string &attname_, const std::string &lval_, const std::string &rval_)
Definition: DiffStruct.h:34
TrigConf::DiffStruct::name
std::string name
Definition: DiffStruct.h:40
TrigConf::DiffStruct::empty
bool empty() const
Definition: DiffStruct.cxx:70
TrigConf::DiffStruct::AttDiff::lval
std::string lval
Definition: DiffStruct.h:36
tagname
Definition: tagname.h:29
TrigConf::DiffStruct::subs
std::vector< DiffStruct * > subs
Definition: DiffStruct.h:42
TrigConf::DiffStruct::addLeftOnlySub
void addLeftOnlySub(const std::string &tagname, const std::string &name)
Definition: DiffStruct.cxx:65
TrigConf::DiffStruct::attdiffs
std::vector< AttDiff > attdiffs
Definition: DiffStruct.h:41