CMS 3D CMS Logo

TrigSystem.h
Go to the documentation of this file.
1 #ifndef L1Trigger_L1TCommon_TrigSystem_h
2 #define L1Trigger_L1TCommon_TrigSystem_h
3 
4 #include <vector>
5 #include <string>
6 #include <map>
7 
8 #include "./Setting.h"
9 #include "./Mask.h"
11 
12 namespace l1t{
13 
15 {
16  public:
17  TrigSystem();
18  ~TrigSystem();
19  void configureSystemFromFiles(const std::string& hwCfgFile, const std::string& topCfgFile, const std::string& key);
20  void setHwInfo(/*JSONConfigReader*/);
21  void addProcRole(const std::string& processor, const std::string& role);
22  void addProcSlot(const std::string& processor, const std::string& slot);
23  void addProcCrate(const std::string& processor, const std::string& crate);
24  // void addDaqProcs(const std::string& daq, const std::vector< std::string >& processors);
25  void addDaqRole(const std::string& daq, const std::string& role);
26  void addDaqCrate(const std::string& daq, const std::string& crate);
27  void addSetting(const std::string& type, const std::string& id, const std::string& value, const std::string& procRole, const std::string& delim = "");
28  void addSettingTable(const std::string& id, const std::string& columns, const std::string& types, const std::vector<std::string>& rows, const std::string& procRole, const std::string& delim);
29  void addMask(const std::string& id, const std::string& procRole);
30  void disableDaqProc(const std::string& daqProc);
31  const std::map<std::string, std::string>& getProcRole() { return procRole_; };
32  const std::map<std::string, std::vector<std::string> >& getRoleProcs() { return roleProcs_; };
33  std::map<std::string, Setting> getSettings (const std::string& processor);
34  std::map<std::string, Mask> getMasks(const std::string& proccessor);
35  bool isMasked(const std::string& proccessor, const std::string& id);
36  bool isProcEnabled(const std::string& proccessor);
37  std::string systemId() { return sysId_; };
38  void setSystemId(const std::string id) { sysId_=id; };
39  void setConfigured(const bool state=true) { isConfigured_=state; };
40  //The setPrintAllLogs method should be called BEFORE calling the getters
41  void setPrintAllLogs () { logText_= new std::string(); };
42  private:
43  std::map<std::string, std::string> procRole_;
44  std::map<std::string, int> procSlot_;
45  std::map<std::string, std::vector<std::string> > roleProcs_;
46  std::map<std::string, std::vector<std::string> > crateProcs_;
47  std::map<std::string, std::vector<std::string> > roleDaqttcs_;
48  std::map<std::string, std::string> daqttcRole_;
49  std::map<std::string, std::string> daqttcCrate_;
50  //std::map<std::string, std::vector<std::string> > daqProcs_;
51  std::map<std::string, std::vector<Setting> > procSettings_;
52  std::map<std::string, std::vector<Mask> > procMasks_;
53  std::map<std::string, bool> procEnabled_;
54 
57 
59 
60  //XmlConfigReader _xmlRdr;
61 
62  bool checkIdExistsAndSetSetting_(std::vector<Setting>& vec, const std::string& id, const std::string& value, const std::string& procRole);
63  bool checkIdExistsAndSetSetting_(std::vector<Setting>& vec, const std::string& id, const std::string& columns, const std::string& types, const std::vector<std::string>& rows, const std::string& procRole, const std::string& delim);
64 };
65 
66 }
67 
68 #endif
69 
void disableDaqProc(const std::string &daqProc)
Definition: TrigSystem.cc:340
type
Definition: HCALResponse.h:21
const std::map< std::string, std::string > & getProcRole()
Definition: TrigSystem.h:31
bool isMasked(const std::string &proccessor, const std::string &id)
Definition: TrigSystem.cc:319
std::map< std::string, std::vector< std::string > > roleProcs_
Definition: TrigSystem.h:45
std::map< std::string, std::string > daqttcCrate_
Definition: TrigSystem.h:49
void setPrintAllLogs()
Definition: TrigSystem.h:41
const std::map< std::string, std::vector< std::string > > & getRoleProcs()
Definition: TrigSystem.h:32
delete x;
Definition: CaloConfig.h:22
std::map< std::string, std::string > daqttcRole_
Definition: TrigSystem.h:48
void addMask(const std::string &id, const std::string &procRole)
Definition: TrigSystem.cc:231
void addDaqRole(const std::string &daq, const std::string &role)
Definition: TrigSystem.cc:65
bool isConfigured_
Definition: TrigSystem.h:55
void configureSystemFromFiles(const std::string &hwCfgFile, const std::string &topCfgFile, const std::string &key)
Definition: TrigSystem.cc:19
void addSetting(const std::string &type, const std::string &id, const std::string &value, const std::string &procRole, const std::string &delim="")
Definition: TrigSystem.cc:82
void addProcRole(const std::string &processor, const std::string &role)
Definition: TrigSystem.cc:39
std::map< std::string, std::vector< std::string > > crateProcs_
Definition: TrigSystem.h:46
void addProcCrate(const std::string &processor, const std::string &crate)
Definition: TrigSystem.cc:60
std::string * logText_
Definition: TrigSystem.h:58
bool checkIdExistsAndSetSetting_(std::vector< Setting > &vec, const std::string &id, const std::string &value, const std::string &procRole)
Definition: TrigSystem.cc:194
std::map< std::string, std::vector< std::string > > roleDaqttcs_
Definition: TrigSystem.h:47
void setConfigured(const bool state=true)
Definition: TrigSystem.h:39
std::map< std::string, std::vector< Setting > > procSettings_
Definition: TrigSystem.h:51
std::map< std::string, int > procSlot_
Definition: TrigSystem.h:44
Definition: value.py:1
std::string sysId_
Definition: TrigSystem.h:56
bool isProcEnabled(const std::string &proccessor)
Definition: TrigSystem.cc:367
std::map< std::string, Setting > getSettings(const std::string &processor)
Definition: TrigSystem.cc:179
void addDaqCrate(const std::string &daq, const std::string &crate)
Definition: TrigSystem.cc:77
std::string systemId()
Definition: TrigSystem.h:37
void addProcSlot(const std::string &processor, const std::string &slot)
Definition: TrigSystem.cc:55
std::map< std::string, bool > procEnabled_
Definition: TrigSystem.h:53
void setSystemId(const std::string id)
Definition: TrigSystem.h:38
std::map< std::string, std::vector< Mask > > procMasks_
Definition: TrigSystem.h:52
std::map< std::string, Mask > getMasks(const std::string &proccessor)
Definition: TrigSystem.cc:304
std::map< std::string, std::string > procRole_
Definition: TrigSystem.h:41
void addSettingTable(const std::string &id, const std::string &columns, const std::string &types, const std::vector< std::string > &rows, const std::string &procRole, const std::string &delim)
Definition: TrigSystem.cc:131