CMS 3D CMS Logo

TriggerSystem.h
Go to the documentation of this file.
1 #ifndef L1Trigger_L1TCommon_l1t_TriggerSystem_h
2 #define L1Trigger_L1TCommon_l1t_TriggerSystem_h
3 
4 #include <vector>
5 #include <string>
6 #include <map>
7 #include <set>
8 
9 #include "Parameter.h"
11 
12 namespace l1t {
13 
14  class TriggerSystem {
15  private:
17 
18  std::map<std::string, std::string> procToRole; // map of processors to their roles
19  std::map<std::string, std::string> procToSlot; // map of processors to their slots in some crate
20  std::map<std::string, bool> procEnabled; // processor is active/disabled (also including daqttc)
21  std::map<std::string, std::string> daqttcToRole; // map of DAQ/TTC boards to their roles
22  std::map<std::string, std::string> daqttcToCrate; // map of DAQ/TTC boards to the crates they sit in
23  std::map<std::string, std::set<std::string> > roleForProcs; // map of roles, each describing a set of processors
24  std::map<std::string, std::set<std::string> > crateForProcs; // map of crates, each containing a set of processors
25  std::map<std::string, std::set<std::string> >
26  roleForDaqttcs; // map of roles, each describing a set of DAQ/TTC boards
27 
28  std::map<std::string, std::map<std::string, Parameter> >
29  procParameters; // setting objects found in the configuration for a given processor
30  std::map<std::string, std::map<std::string, Mask> >
31  procMasks; // mask objects found in the configuration for a given processor
32 
33  bool isConfigured; // lock allowing access to the system
34  mutable std::ostream *logs; // print processing logs unless is set to a null pointer
35 
36  public:
37  void configureSystemFromFiles(const char *hwCfgFile, const char *topCfgFile, const char *key);
38 
39  void addProcessor(const char *processor,
40  const char *role,
41  const char *crate,
42  const char *slot); // must have all parameters
43 
44  void addDaq(const char *daq, const char *role, const char *crate);
45 
46  void addParameter(
47  const char *id, const char *procOrRole, const char *type, const char *value, const char *delim = ",");
48 
49  void addTable(const char *id,
50  const char *procOrRole,
51  const char *columns,
52  const char *types,
53  const std::vector<std::string> &rows,
54  const char *delim);
55 
56  void addMask(const char *id, const char *procOrRoleOrDaq);
57 
58  void disableProcOrRoleOrDaq(const char *procOrRoleOrDaq);
59 
60  const std::map<std::string, std::string> &getProcToRoleAssignment(void) const noexcept { return procToRole; }
61  const std::map<std::string, std::set<std::string> > &getRoleToProcsAssignment(void) const noexcept {
62  return roleForProcs;
63  }
64 
65  const std::map<std::string, Parameter> &getParameters(const char *processor) const;
66  const std::map<std::string, Mask> &getMasks(const char *processor) const;
67 
68  bool isMasked(const char *proccessor, const char *id) const;
69  bool isProcEnabled(const char *proccessor) const;
70 
71  std::string systemId(void) const noexcept { return sysId; }
72  void setSystemId(const char *id) noexcept { sysId = id; }
73 
74  void setConfigured(bool state = true) noexcept { isConfigured = state; }
75  void setLogStream(std::ostream *s) const noexcept { logs = s; }
76 
77  TriggerSystem(void) {
78  isConfigured = false;
79  logs = nullptr;
80  }
81 
82  ~TriggerSystem(void) {}
83  };
84 
85 } // namespace l1t
86 
87 #endif
void addDaq(const char *daq, const char *role, const char *crate)
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:74
const std::map< std::string, std::set< std::string > > & getRoleToProcsAssignment(void) const noexcept
Definition: TriggerSystem.h:61
bool isProcEnabled(const char *proccessor) const
void setSystemId(const char *id) noexcept
Definition: TriggerSystem.h:72
std::map< std::string, std::map< std::string, Mask > > procMasks
Definition: TriggerSystem.h:31
std::map< std::string, std::string > procToRole
Definition: TriggerSystem.h:18
std::map< std::string, std::set< std::string > > crateForProcs
Definition: TriggerSystem.h:24
delete x;
Definition: CaloConfig.h:22
const std::map< std::string, std::string > & getProcToRoleAssignment(void) const noexcept
Definition: TriggerSystem.h:60
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:29
std::string sysId
Definition: TriggerSystem.h:16
std::map< std::string, std::set< std::string > > roleForDaqttcs
Definition: TriggerSystem.h:26
bool isMasked(const char *proccessor, const char *id) const
const std::map< std::string, Parameter > & getParameters(const char *processor) const
void addTable(const char *id, const char *procOrRole, const char *columns, const char *types, const std::vector< std::string > &rows, const char *delim)
std::map< std::string, std::string > daqttcToRole
Definition: TriggerSystem.h:21
std::map< std::string, std::string > procToSlot
Definition: TriggerSystem.h:19
key
prepare the HTCondor submission files and eventually submit them
void addMask(const char *id, const char *procOrRoleOrDaq)
Definition: value.py:1
void configureSystemFromFiles(const char *hwCfgFile, const char *topCfgFile, const char *key)
Definition: TriggerSystem.cc:8
std::ostream * logs
Definition: TriggerSystem.h:34
const std::map< std::string, Mask > & getMasks(const char *processor) const
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
std::map< std::string, bool > procEnabled
Definition: TriggerSystem.h:20
void setLogStream(std::ostream *s) const noexcept
Definition: TriggerSystem.h:75
void addProcessor(const char *processor, const char *role, const char *crate, const char *slot)
std::map< std::string, std::string > daqttcToCrate
Definition: TriggerSystem.h:22
void addParameter(const char *id, const char *procOrRole, const char *type, const char *value, const char *delim=",")
rows
Definition: mysort.py:12
std::string systemId(void) const noexcept
Definition: TriggerSystem.h:71
void disableProcOrRoleOrDaq(const char *procOrRoleOrDaq)