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 
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> > roleForDaqttcs; // map of roles, each describing a set of DAQ/TTC boards
26 
27  std::map<std::string, std::map<std::string,Parameter> > procParameters; // setting objects found in the configuration for a given processor
28  std::map<std::string, std::map<std::string,Mask> > procMasks; // mask objects found in the configuration for a given processor
29 
30  bool isConfigured; // lock allowing access to the system
31  mutable std::ostream *logs; // print processing logs unless is set to a null pointer
32 
33 public:
34  void configureSystemFromFiles(const char *hwCfgFile,
35  const char *topCfgFile,
36  const char *key);
37 
38  void addProcessor(const char *processor, const char *role, const char *crate, const char *slot); // must have all parameters
39 
40  void addDaq(const char *daq, const char *role, const char *crate);
41 
42  void addParameter(const char *id,
43  const char *procOrRole,
44  const char *type,
45  const char *value,
46  const char *delim=","
47  );
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 
57  void addMask(const char *id, const char *procOrRoleOrDaq);
58 
59  void disableProcOrRoleOrDaq(const char *procOrRoleOrDaq);
60 
61  const std::map<std::string, std::string>& getProcToRoleAssignment (void) const noexcept { return procToRole; }
62  const std::map<std::string, std::set<std::string> >& getRoleToProcsAssignment(void) const noexcept { return roleForProcs; }
63 
64  const std::map<std::string, Parameter>& getParameters(const char *processor) const ;
65  const std::map<std::string, Mask>& getMasks (const char *processor) const ;
66 
67  bool isMasked (const char *proccessor, const char *id) const ;
68  bool isProcEnabled(const char *proccessor) const ;
69 
70  std::string systemId(void) const noexcept { return sysId; }
71  void setSystemId(const char *id) noexcept { sysId = id; }
72 
73  void setConfigured(bool state=true) noexcept { isConfigured = state; }
74  void setLogStream(std::ostream *s) const noexcept { logs = s; }
75 
77  isConfigured = false;
78  logs = nullptr;
79  }
80 
82 };
83 
84 } // end of l1t namespace
85 
86 #endif
87 
88 
void addDaq(const char *daq, const char *role, const char *crate)
type
Definition: HCALResponse.h:21
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:73
const std::map< std::string, Mask > & getMasks(const char *processor) const
void setSystemId(const char *id) noexcept
Definition: TriggerSystem.h:71
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
std::string sysId
Definition: TriggerSystem.h:16
std::map< std::string, std::set< std::string > > roleForDaqttcs
Definition: TriggerSystem.h:25
const std::map< std::string, std::string > & getProcToRoleAssignment(void) const noexcept
Definition: TriggerSystem.h:61
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::map< std::string, Mask > > procMasks
Definition: TriggerSystem.h:28
std::map< std::string, std::string > procToSlot
Definition: TriggerSystem.h:19
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:31
bool isMasked(const char *proccessor, const char *id) const
#define noexcept
std::string systemId(void) const noexcept
Definition: TriggerSystem.h:70
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
const std::map< std::string, Parameter > & getParameters(const char *processor) const
std::map< std::string, bool > procEnabled
Definition: TriggerSystem.h:20
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
const std::map< std::string, std::set< std::string > > & getRoleToProcsAssignment(void) const noexcept
Definition: TriggerSystem.h:62
void addParameter(const char *id, const char *procOrRole, const char *type, const char *value, const char *delim=",")
void setLogStream(std::ostream *s) const noexcept
Definition: TriggerSystem.h:74
bool isProcEnabled(const char *proccessor) const
void disableProcOrRoleOrDaq(const char *procOrRoleOrDaq)
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:27