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
l1t::TriggerSystem::addMask
void addMask(const char *id, const char *procOrRoleOrDaq)
Definition: TriggerSystem.cc:179
l1t::TriggerSystem::setSystemId
void setSystemId(const char *id) noexcept
Definition: TriggerSystem.h:72
l1t::TriggerSystem::procMasks
std::map< std::string, std::map< std::string, Mask > > procMasks
Definition: TriggerSystem.h:31
l1t::TriggerSystem::procToRole
std::map< std::string, std::string > procToRole
Definition: TriggerSystem.h:18
l1t::TriggerSystem::procEnabled
std::map< std::string, bool > procEnabled
Definition: TriggerSystem.h:20
l1t::TriggerSystem::addProcessor
void addProcessor(const char *processor, const char *role, const char *crate, const char *slot)
Definition: TriggerSystem.cc:26
l1t::TriggerSystem::isProcEnabled
bool isProcEnabled(const char *proccessor) const
Definition: TriggerSystem.cc:339
l1t::TriggerSystem::getProcToRoleAssignment
const std::map< std::string, std::string > & getProcToRoleAssignment(void) const noexcept
Definition: TriggerSystem.h:60
l1t::TriggerSystem
Definition: TriggerSystem.h:14
l1t::TriggerSystem::roleForDaqttcs
std::map< std::string, std::set< std::string > > roleForDaqttcs
Definition: TriggerSystem.h:26
l1t::TriggerSystem::addTable
void addTable(const char *id, const char *procOrRole, const char *columns, const char *types, const std::vector< std::string > &rows, const char *delim)
Definition: TriggerSystem.cc:111
alignCSCRings.s
s
Definition: alignCSCRings.py:92
l1t::TriggerSystem::crateForProcs
std::map< std::string, std::set< std::string > > crateForProcs
Definition: TriggerSystem.h:24
l1t::TriggerSystem::isMasked
bool isMasked(const char *proccessor, const char *id) const
Definition: TriggerSystem.cc:272
l1t::TriggerSystem::disableProcOrRoleOrDaq
void disableProcOrRoleOrDaq(const char *procOrRoleOrDaq)
Definition: TriggerSystem.cc:282
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::TriggerSystem::procToSlot
std::map< std::string, std::string > procToSlot
Definition: TriggerSystem.h:19
l1t
delete x;
Definition: CaloConfig.h:22
l1t::TriggerSystem::isConfigured
bool isConfigured
Definition: TriggerSystem.h:33
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
l1t::TriggerSystem::configureSystemFromFiles
void configureSystemFromFiles(const char *hwCfgFile, const char *topCfgFile, const char *key)
Definition: TriggerSystem.cc:8
value
Definition: value.py:1
Mask.h
l1t::TriggerSystem::getRoleToProcsAssignment
const std::map< std::string, std::set< std::string > > & getRoleToProcsAssignment(void) const noexcept
Definition: TriggerSystem.h:61
l1t::TriggerSystem::logs
std::ostream * logs
Definition: TriggerSystem.h:34
types
types
Definition: AlignPCLThresholds_PayloadInspector.cc:30
l1t::TriggerSystem::daqttcToCrate
std::map< std::string, std::string > daqttcToCrate
Definition: TriggerSystem.h:22
l1t::TriggerSystem::daqttcToRole
std::map< std::string, std::string > daqttcToRole
Definition: TriggerSystem.h:21
l1t::TriggerSystem::getParameters
const std::map< std::string, Parameter > & getParameters(const char *processor) const
Definition: TriggerSystem.cc:168
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
l1t::TriggerSystem::sysId
std::string sysId
Definition: TriggerSystem.h:16
mps_check.columns
columns
Definition: mps_check.py:244
l1t::TriggerSystem::addParameter
void addParameter(const char *id, const char *procOrRole, const char *type, const char *value, const char *delim=",")
Definition: TriggerSystem.cc:54
Parameter.h
l1t::TriggerSystem::procParameters
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:29
l1t::TriggerSystem::getMasks
const std::map< std::string, Mask > & getMasks(const char *processor) const
Definition: TriggerSystem.cc:261
l1t::TriggerSystem::~TriggerSystem
~TriggerSystem(void)
Definition: TriggerSystem.h:82
l1t::TriggerSystem::setConfigured
void setConfigured(bool state=true) noexcept
Definition: TriggerSystem.h:74
l1t::TriggerSystem::roleForProcs
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
l1t::TriggerSystem::addDaq
void addDaq(const char *daq, const char *role, const char *crate)
Definition: TriggerSystem.cc:43
l1t::TriggerSystem::setLogStream
void setLogStream(std::ostream *s) const noexcept
Definition: TriggerSystem.h:75
postprocess-scan-build.rows
rows
Definition: postprocess-scan-build.py:20
crabWrapper.key
key
Definition: crabWrapper.py:19
l1t::TriggerSystem::systemId
std::string systemId(void) const noexcept
Definition: TriggerSystem.h:71
l1t::TriggerSystem::TriggerSystem
TriggerSystem(void)
Definition: TriggerSystem.h:77