CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
l1t::TriggerSystem Class Reference

#include <TriggerSystem.h>

Public Member Functions

void addDaq (const char *daq, const char *role, const char *crate)
 
void addMask (const char *id, const char *procOrRoleOrDaq)
 
void addParameter (const char *id, const char *procOrRole, const char *type, const char *value, const char *delim=",")
 
void addProcessor (const char *processor, const char *role, const char *crate, const char *slot)
 
void addTable (const char *id, const char *procOrRole, const char *columns, const char *types, const std::vector< std::string > &rows, const char *delim)
 
void configureSystemFromFiles (const char *hwCfgFile, const char *topCfgFile, const char *key)
 
void disableProcOrRoleOrDaq (const char *procOrRoleOrDaq)
 
const std::map< std::string,
Mask > & 
getMasks (const char *processor) const
 
const std::map< std::string,
Parameter > & 
getParameters (const char *processor) const
 
const std::map< std::string,
std::string > & 
getProcToRoleAssignment (void) const noexcept
 
const std::map< std::string,
std::set< std::string > > & 
getRoleToProcsAssignment (void) const noexcept
 
bool isMasked (const char *proccessor, const char *id) const
 
bool isProcEnabled (const char *proccessor) const
 
void setConfigured (bool state=true) noexcept
 
void setLogStream (std::ostream *s) const noexcept
 
void setSystemId (const char *id) noexcept
 
std::string systemId (void) const noexcept
 
 TriggerSystem (void)
 
 ~TriggerSystem (void)
 

Private Attributes

std::map< std::string,
std::set< std::string > > 
crateForProcs
 
std::map< std::string,
std::string > 
daqttcToCrate
 
std::map< std::string,
std::string > 
daqttcToRole
 
bool isConfigured
 
std::ostream * logs
 
std::map< std::string, bool > procEnabled
 
std::map< std::string,
std::map< std::string, Mask > > 
procMasks
 
std::map< std::string,
std::map< std::string,
Parameter > > 
procParameters
 
std::map< std::string,
std::string > 
procToRole
 
std::map< std::string,
std::string > 
procToSlot
 
std::map< std::string,
std::set< std::string > > 
roleForDaqttcs
 
std::map< std::string,
std::set< std::string > > 
roleForProcs
 
std::string sysId
 

Detailed Description

Definition at line 14 of file TriggerSystem.h.

Constructor & Destructor Documentation

l1t::TriggerSystem::TriggerSystem ( void  )
inline

Definition at line 77 of file TriggerSystem.h.

References isConfigured, and logs.

77  {
78  isConfigured = false;
79  logs = nullptr;
80  }
std::ostream * logs
Definition: TriggerSystem.h:34
l1t::TriggerSystem::~TriggerSystem ( void  )
inline

Definition at line 82 of file TriggerSystem.h.

82 {}

Member Function Documentation

void l1t::TriggerSystem::addDaq ( const char *  daq,
const char *  role,
const char *  crate 
)

Definition at line 43 of file TriggerSystem.cc.

Referenced by l1t::XmlConfigParser::readHwDescription().

43  {
44  auto d2r = daqttcToRole.find(daq);
45  if (d2r != daqttcToRole.end() && d2r->second != role)
46  throw runtime_error("DAQttc: '" + string(daq) + "' already exists but with different role: " + d2r->second);
47  else {
48  daqttcToRole[daq] = role;
49  daqttcToCrate[daq] = crate;
50  roleForDaqttcs[role].insert(daq);
51  }
52  }
std::map< std::string, std::set< std::string > > roleForDaqttcs
Definition: TriggerSystem.h:26
std::map< std::string, std::string > daqttcToRole
Definition: TriggerSystem.h:21
std::map< std::string, std::string > daqttcToCrate
Definition: TriggerSystem.h:22
void l1t::TriggerSystem::addMask ( const char *  id,
const char *  procOrRoleOrDaq 
)

Definition at line 179 of file TriggerSystem.cc.

References gpuClustering::id, and ValidateTausOnZEEFastSim_cff::proc.

Referenced by l1t::XmlConfigParser::readContext().

179  {
180  // first try to locate a processor with name matching the procOrRoleOrDaq argument
181  auto processor = procMasks.find(procOrRoleOrDaq);
182  if (processor != procMasks.end()) {
183  // processor found -> apply settings to this processor
184  auto mask = processor->second.find(id);
185  if (mask != processor->second.end()) {
186  // setting with this id already exists -> always take the latest value
187  //if( logs)
188  // *logs << "Warning: overriding already existing " << id
189  // << " = (" << setting->second.getType() << ") " << setting->second.getValue()
190  // << " with new value (" << type << ") " << value << endl;
191  mask->second = Mask(id, procOrRoleOrDaq);
192  } else
193  processor->second.insert(make_pair(string(id), Mask(id, procOrRoleOrDaq)));
194  // let's run a consistency check
195  auto p2r = procToRole.find(procOrRoleOrDaq);
196  if (p2r == procToRole.end())
197  if (logs)
198  *logs << "Warning: TriggerSystem object doesn't yet assign "
199  << " a role to the processor " << procOrRoleOrDaq << endl;
200  return;
201  }
202 
203  // if we've got here, the procOrRoleOrDaq argument may have meaning of role
204  auto role = roleForProcs.find(procOrRoleOrDaq);
205  if (role != roleForProcs.end()) {
206  // apply setting on all of the processors for this role
207  for (auto &proc : role->second) {
208  auto processor = procMasks.find(proc);
209  if (processor != procMasks.end()) {
210  // processor found -> apply settings to this processor
211  // unless the setting with such id already exists
212  auto mask = processor->second.find(id);
213  if (mask == processor->second.end())
214  processor->second.insert(make_pair(string(id), Mask(id, procOrRoleOrDaq)));
215  } else {
216  // here, copy constructor creates no overhead over the move constructor, whould that be defined
217  procMasks.insert(make_pair(proc, map<string, Mask>({{id, Mask(id, procOrRoleOrDaq)}})));
218  }
219  }
220  return;
221  }
222 
223  // if we've got here, the procOrRoleOrDaq argument the only choise left is daqttc configuration
224  // that, in turn, can again be a daqttc processor or daqttc role
225  // in either case, for daq we do not have any independent configuration apart from the mask status
226  // and the slot location of the processor that is masked (sitting, of course, in the same crate)
227  auto d2c = daqttcToCrate.find(procOrRoleOrDaq);
228  if (d2c != daqttcToCrate.end()) {
229  // now, as we know crate of this daqttc, look for the crate's processors that match the id name
230  size_t idLen = strlen(id);
231  string slot = id + (idLen > 2 ? idLen - 2 : 0); // last two digits of the port comptise the slot #
232  auto processors = crateForProcs.find(d2c->second);
233  if (processors != crateForProcs.end()) {
234  for (auto &proc : processors->second)
235  if (procToSlot[proc] == slot)
236  procEnabled[proc] = false;
237  } else if (logs)
238  *logs << "Warning: no processors in daqttc crate for " << procOrRoleOrDaq << " ... do nothing" << endl;
239  return;
240  }
241 
242  // so, finally, this is daqttc role
243  auto r2d = roleForDaqttcs.find(procOrRoleOrDaq);
244  if (r2d != roleForDaqttcs.end()) {
245  for (auto &daq : r2d->second) {
246  auto processors = crateForProcs.find(daq);
247  if (processors != crateForProcs.end()) {
248  for (auto &proc : processors->second)
249  procEnabled[proc] = false;
250  } else if (logs)
251  *logs << "Warning: no processors in daqttc crate " << d2c->second << " for " << procOrRoleOrDaq
252  << " ... do nothing" << endl;
253  return;
254  }
255  }
256 
257  // if we ever reach here, we've ran out of options
258  throw runtime_error("Processor/DAQ or Role '" + string(procOrRoleOrDaq) + "' was not found in the map for masking");
259  }
uint16_t *__restrict__ id
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
std::map< std::string, std::set< std::string > > roleForDaqttcs
Definition: TriggerSystem.h:26
std::map< std::string, std::string > procToSlot
Definition: TriggerSystem.h:19
std::ostream * logs
Definition: TriggerSystem.h:34
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
std::map< std::string, bool > procEnabled
Definition: TriggerSystem.h:20
std::map< std::string, std::string > daqttcToCrate
Definition: TriggerSystem.h:22
void l1t::TriggerSystem::addParameter ( const char *  id,
const char *  procOrRole,
const char *  type,
const char *  value,
const char *  delim = "," 
)

Definition at line 54 of file TriggerSystem.cc.

References eostools::move(), ValidateTausOnZEEFastSim_cff::proc, and createJobs::tmp.

Referenced by metTools.AddMETCollection::__init__(), trackTools.MakeAODTrackCandidates::__init__(), coreTools.RunOnData::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), tauTools.AddTauCollection::__init__(), trackTools.MakeTrackCandidates::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), trigTools.SwitchOnTriggerMatchingStandAlone::__init__(), trigTools.SwitchOnTriggerMatchEmbedding::__init__(), jetTools.AddJetCollection::__init__(), jetTools.SwitchJetCollection::__init__(), jetTools.UpdateJetCollection::__init__(), jetTools.AddJetID::__init__(), jetTools.SetTagInfos::__init__(), and l1t::XmlConfigParser::readContext().

55  {
56  // some tables forget to specify delimeter and we get an empty string here
57  // force the "," default delimeter
58  if (strlen(delim) == 0)
59  delim = ",";
60 
61  // first try to locate a processor with name matching the procOrRole argument
62  auto processor = procParameters.find(procOrRole);
63  if (processor != procParameters.end()) {
64  // processor found -> apply settings to this processor
65  auto setting = processor->second.find(id);
66  if (setting != processor->second.end()) {
67  // setting with this id already exists -> always take the latest value
68  // if( logs )
69  // *logs << "Warning: overriding already existing " << id
70  // << " = (" << setting->second.getType() << ") " << setting->second.getValue()
71  // << " with new value (" << type << ") " << value << endl;
72  setting->second = Parameter(id, procOrRole, type, value, delim);
73  } else
74  processor->second.insert(make_pair(string(id), Parameter(id, procOrRole, type, value, delim)));
75  // let's run a consistency check
76  auto p2r = procToRole.find(procOrRole);
77  if (p2r == procToRole.end())
78  if (logs)
79  *logs << "Warning: TriggerSystem object doesn't yet assign "
80  << " a role to the processor " << procOrRole << endl;
81  return;
82  }
83 
84  // if we've got here, the procOrRole argument must have meaning of role,
85  // throw exception otherwise
86  auto role = roleForProcs.find(procOrRole);
87  if (role != roleForProcs.end()) {
88  // apply setting on all of the processors for this role
89  for (auto &proc : role->second) {
90  auto processor = procParameters.find(proc);
91  if (processor != procParameters.end()) {
92  // processor found -> apply settings to this processor
93  // unless the setting with such id already exists
94  auto setting = processor->second.find(id);
95  if (setting == processor->second.end())
96  processor->second.insert(make_pair(string(id), Parameter(id, procOrRole, type, value, delim)));
97  } else {
98  map<string, Parameter> tmp;
99  tmp.insert(make_pair(id, Parameter(id, procOrRole, type, value)));
100  procParameters.insert(make_pair(proc, std::move(tmp)));
101  // construct with brace-initialization, although better looking, cannot use move constructor:
102  //procParameters.insert(
103  // make_pair(proc, map<string,Parameter>( {{id,Parameter(id,procOrRole,type,value)}} ) )
104  //);
105  }
106  }
107  } else
108  throw runtime_error("Processor or Role '" + string(procOrRole) + "' was not found");
109  }
std::map< std::string, std::string > procToRole
Definition: TriggerSystem.h:18
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:29
def move
Definition: eostools.py:511
std::ostream * logs
Definition: TriggerSystem.h:34
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
tmp
align.sh
Definition: createJobs.py:716
void l1t::TriggerSystem::addProcessor ( const char *  processor,
const char *  role,
const char *  crate,
const char *  slot 
)

Definition at line 26 of file TriggerSystem.cc.

Referenced by L1TGlobalPrescalesVetosESProducer::L1TGlobalPrescalesVetosESProducer(), L1TMuonOverlapFwVersionOnlineProd::newObject(), L1TGlobalPrescalesVetosOnlineProd::newObject(), L1TCaloParamsOnlineProd::newObject(), and l1t::XmlConfigParser::readHwDescription().

26  {
27  // every processor must have a single defined role
28  auto p2r = procToRole.find(processor);
29  if (p2r != procToRole.end() && p2r->second != role)
30  throw std::runtime_error("Processor: '" + string(processor) + "' already exists but with different role: '" +
31  p2r->second + "'");
32  else {
33  procEnabled[processor] = true;
34  procToRole[processor] = role;
35  procToSlot[processor] = slot;
36  procParameters.insert(make_pair(string(processor), std::map<std::string, Parameter>()));
37  procMasks.insert(make_pair(string(processor), std::map<std::string, Mask>()));
38  roleForProcs[role].insert(processor);
39  crateForProcs[crate].insert(processor);
40  }
41  }
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
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:29
std::map< std::string, std::string > procToSlot
Definition: TriggerSystem.h:19
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
std::map< std::string, bool > procEnabled
Definition: TriggerSystem.h:20
void l1t::TriggerSystem::addTable ( const char *  id,
const char *  procOrRole,
const char *  columns,
const char *  types,
const std::vector< std::string > &  rows,
const char *  delim 
)

Definition at line 111 of file TriggerSystem.cc.

References eostools::move(), ValidateTausOnZEEFastSim_cff::proc, and createJobs::tmp.

Referenced by l1t::XmlConfigParser::readContext().

116  {
117  // some tables forget to specify delimeter and we get an empty string here
118  // force the "," default delimeter
119  if (strlen(delim) == 0)
120  delim = ",";
121 
122  // first try to locate a processor with name matching the procOrRole argument
123  auto processor = procParameters.find(procOrRole);
124  if (processor != procParameters.end()) {
125  // processor found -> apply settings to this processor
126  auto setting = processor->second.find(id);
127  if (setting != processor->second.end())
128  // setting with this id already exists -> always take latest value
129  setting->second = Parameter(id, procOrRole, types, columns, rows, delim);
130  else
131  processor->second.insert(make_pair(string(id), Parameter(id, procOrRole, types, columns, rows, delim)));
132  // let's run a consistency check
133  auto p2r = procToRole.find(procOrRole);
134  if (p2r == procToRole.end())
135  if (logs)
136  *logs << "Warning: TriggerSystem object doesn't yet assign "
137  << " a role to the processor " << procOrRole << endl;
138  return;
139  }
140 
141  // if we've got here, the procOrRole argument must have meaning of role,
142  // throw exception otherwise
143  auto role = roleForProcs.find(procOrRole);
144  if (role != roleForProcs.end()) {
145  // apply setting on all of the processors for this role
146  for (auto &proc : role->second) {
147  auto processor = procParameters.find(proc);
148  if (processor != procParameters.end()) {
149  // processor found -> apply settings to this processor
150  // unless the setting with such id already exists
151  auto setting = processor->second.find(id);
152  if (setting == processor->second.end())
153  processor->second.insert(make_pair(string(id), Parameter(id, procOrRole, types, columns, rows, delim)));
154  } else {
155  map<string, Parameter> tmp;
156  tmp.insert(make_pair(id, Parameter(id, procOrRole, types, columns, rows, delim)));
157  procParameters.insert(make_pair(proc, std::move(tmp)));
158  // construct with brace-initialization, although better looking, cannot use move constructor:
159  //procParameters.insert(
160  // make_pair(proc, map<string,Parameter>( {{id,Parameter(id,procOrRole,types,columns,rows,delim)}} ) )
161  //);
162  }
163  }
164  } else
165  throw runtime_error("Processor or Role '" + string(procOrRole) + "' was not found");
166  }
std::map< std::string, std::string > procToRole
Definition: TriggerSystem.h:18
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:29
def move
Definition: eostools.py:511
std::ostream * logs
Definition: TriggerSystem.h:34
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
tuple columns
Definition: mps_check.py:244
tmp
align.sh
Definition: createJobs.py:716
void l1t::TriggerSystem::configureSystemFromFiles ( const char *  hwCfgFile,
const char *  topCfgFile,
const char *  key 
)

Definition at line 8 of file TriggerSystem.cc.

References l1t::XmlConfigParser::buildGlobalDoc(), l1t::XmlConfigParser::readContexts(), l1t::XmlConfigParser::readDOMFromFile(), and l1t::XmlConfigParser::readRootElement().

Referenced by L1TMuonBarrelParamsESProducer::L1TMuonBarrelParamsESProducer(), and L1TMuonGlobalParamsESProducer::L1TMuonGlobalParamsESProducer().

8  {
9  // read hw description xml
10  // this will set the sysId
11  {
12  XmlConfigParser xmlRdr;
13  xmlRdr.readDOMFromFile(hwCfgFile);
14  xmlRdr.readRootElement(*this);
15  }
16  // read configuration xml files
17  {
18  XmlConfigParser xmlRdr;
19  xmlRdr.readDOMFromFile(topCfgFile);
20  xmlRdr.buildGlobalDoc(key, topCfgFile);
21  xmlRdr.readContexts(key, sysId, *this);
22  }
23  isConfigured = true;
24  }
std::string sysId
Definition: TriggerSystem.h:16
tuple key
prepare the HTCondor submission files and eventually submit them
void l1t::TriggerSystem::disableProcOrRoleOrDaq ( const char *  procOrRoleOrDaq)

Definition at line 282 of file TriggerSystem.cc.

References ValidateTausOnZEEFastSim_cff::proc.

Referenced by l1t::XmlConfigParser::readContext(), and l1t::XmlConfigParser::readHwDescription().

282  {
283  // follow the standard search steps to identify if the argument is processor or role or daqttc processor/role
284 
285  // the argument is simply a processor's name
286  auto processor = procEnabled.find(procOrRoleOrDaq);
287  if (processor != procEnabled.end()) {
288  processor->second = false;
289  return;
290  }
291 
292  // role
293  auto role = roleForProcs.find(procOrRoleOrDaq);
294  if (role != roleForProcs.end()) {
295  // apply setting on all of the processors for this role
296  for (auto &proc : role->second)
297  // by design procEnabled must have every single processor for every role
298  procEnabled[proc] = false;
299  return;
300  }
301 
302  // the whole daq of a crate is disables -> disable all of the processors in the crate
303  auto d2c = daqttcToCrate.find(procOrRoleOrDaq);
304  if (d2c != daqttcToCrate.end()) {
305  auto processors = crateForProcs.find(d2c->second);
306  if (processors != crateForProcs.end()) {
307  for (auto &proc : processors->second)
308  // by design procEnabled must have every single processor for every crate
309  procEnabled[proc] = false;
310  } else if (logs)
311  *logs << "Warning: no processors in daqttc crate for " << procOrRoleOrDaq << " ... do nothing" << endl;
312  return;
313  }
314 
315  // so, finally, this is daqttc role
316  auto r2d = roleForDaqttcs.find(procOrRoleOrDaq);
317  if (r2d != roleForDaqttcs.end()) {
318  for (auto &daq : r2d->second) {
319  auto d2c = daqttcToCrate.find(daq);
320  if (d2c != daqttcToCrate.end()) {
321  auto processors = crateForProcs.find(d2c->second);
322  if (processors != crateForProcs.end()) {
323  for (auto &proc : processors->second)
324  procEnabled[proc] = false;
325  } else if (logs)
326  *logs << "Warning: no processors in daqttc crate " << d2c->second << " for " << procOrRoleOrDaq
327  << " ... do nothing" << endl;
328  } else if (logs)
329  *logs << "Warning: daqttc " << daq << " has no crate "
330  << " ... do nothing" << endl;
331  return;
332  }
333  }
334 
335  // if we ever reach here, we've ran out of options
336  throw runtime_error("Processor/DAQ or Role '" + string(procOrRoleOrDaq) + "' was not found");
337  }
std::map< std::string, std::set< std::string > > crateForProcs
Definition: TriggerSystem.h:24
std::map< std::string, std::set< std::string > > roleForDaqttcs
Definition: TriggerSystem.h:26
std::ostream * logs
Definition: TriggerSystem.h:34
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
std::map< std::string, bool > procEnabled
Definition: TriggerSystem.h:20
std::map< std::string, std::string > daqttcToCrate
Definition: TriggerSystem.h:22
const map< string, Mask > & l1t::TriggerSystem::getMasks ( const char *  processor) const

Definition at line 261 of file TriggerSystem.cc.

261  {
262  if (!isConfigured)
263  throw std::runtime_error("TriggerSystem is not configured yet. First call the configureSystem method");
264 
265  auto processor = procMasks.find(p);
266  if (processor == procMasks.end())
267  throw std::runtime_error("Processor '" + string(p) + "' was not found in the configuration");
268 
269  return processor->second;
270  }
std::map< std::string, std::map< std::string, Mask > > procMasks
Definition: TriggerSystem.h:31
const map< string, Parameter > & l1t::TriggerSystem::getParameters ( const char *  processor) const

Definition at line 168 of file TriggerSystem.cc.

Referenced by L1TMuonBarrelParamsHelper::configFromDB(), L1TMuonEndCapObjectKeysOnlineProd::fillObjectKeys(), L1TGlobalPrescalesVetosESProducer::L1TGlobalPrescalesVetosESProducer(), L1TMuonGlobalParamsHelper::loadFromOnline(), L1TMuonEndCapParamsOnlineProd::newObject(), L1TMuonOverlapFwVersionOnlineProd::newObject(), L1TGlobalPrescalesVetosOnlineProd::newObject(), and L1TCaloParamsOnlineProd::newObject().

168  {
169  if (!isConfigured)
170  throw runtime_error("TriggerSystem is not configured yet. First call the configureSystem method");
171 
172  auto processor = procParameters.find(p);
173  if (processor == procParameters.end())
174  throw runtime_error("Processor '" + string(p) + "' was not found in the configuration");
175 
176  return processor->second;
177  }
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:29
const std::map<std::string, std::string>& l1t::TriggerSystem::getProcToRoleAssignment ( void  ) const
inlinenoexcept

Definition at line 60 of file TriggerSystem.h.

References procToRole.

Referenced by L1TMuonBarrelParamsHelper::configFromDB(), and L1TMuonGlobalParamsHelper::loadFromOnline().

60 { return procToRole; }
std::map< std::string, std::string > procToRole
Definition: TriggerSystem.h:18
const std::map<std::string, std::set<std::string> >& l1t::TriggerSystem::getRoleToProcsAssignment ( void  ) const
inlinenoexcept

Definition at line 61 of file TriggerSystem.h.

References roleForProcs.

61  {
62  return roleForProcs;
63  }
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
bool l1t::TriggerSystem::isMasked ( const char *  proccessor,
const char *  id 
) const

Definition at line 272 of file TriggerSystem.cc.

References visualization-live-secondInstance_cfg::m.

Referenced by L1TMuonGlobalParamsHelper::loadFromOnline().

272  {
273  const std::map<std::string, Mask> &m = getMasks(p);
274 
275  auto mask = m.find(id);
276  if (mask == m.end())
277  return false;
278 
279  return true;
280  }
const std::map< std::string, Mask > & getMasks(const char *processor) const
bool l1t::TriggerSystem::isProcEnabled ( const char *  proccessor) const

Definition at line 339 of file TriggerSystem.cc.

339  {
340  if (!isConfigured)
341  throw std::runtime_error("TriggerSystem is not configured yet. First call the configureSystem method");
342 
343  auto processor = procEnabled.find(p);
344  if (processor == procEnabled.end())
345  throw runtime_error("Processor '" + string(p) + "' not found");
346 
347  return processor->second;
348  }
std::map< std::string, bool > procEnabled
Definition: TriggerSystem.h:20
void l1t::TriggerSystem::setConfigured ( bool  state = true)
inlinenoexcept
void l1t::TriggerSystem::setLogStream ( std::ostream *  s) const
inlinenoexcept

Definition at line 75 of file TriggerSystem.h.

References logs, and alignCSCRings::s.

75 { logs = s; }
std::ostream * logs
Definition: TriggerSystem.h:34
void l1t::TriggerSystem::setSystemId ( const char *  id)
inlinenoexcept

Definition at line 72 of file TriggerSystem.h.

References gpuClustering::id, and sysId.

Referenced by l1t::XmlConfigParser::readHwDescription().

72 { sysId = id; }
uint16_t *__restrict__ id
std::string sysId
Definition: TriggerSystem.h:16
std::string l1t::TriggerSystem::systemId ( void  ) const
inlinenoexcept

Definition at line 71 of file TriggerSystem.h.

References sysId.

Referenced by l1t::XmlConfigParser::readContext().

71 { return sysId; }
std::string sysId
Definition: TriggerSystem.h:16

Member Data Documentation

std::map<std::string, std::set<std::string> > l1t::TriggerSystem::crateForProcs
private

Definition at line 24 of file TriggerSystem.h.

std::map<std::string, std::string> l1t::TriggerSystem::daqttcToCrate
private

Definition at line 22 of file TriggerSystem.h.

std::map<std::string, std::string> l1t::TriggerSystem::daqttcToRole
private

Definition at line 21 of file TriggerSystem.h.

bool l1t::TriggerSystem::isConfigured
private

Definition at line 33 of file TriggerSystem.h.

Referenced by setConfigured(), and TriggerSystem().

std::ostream* l1t::TriggerSystem::logs
mutableprivate

Definition at line 34 of file TriggerSystem.h.

Referenced by setLogStream(), and TriggerSystem().

std::map<std::string, bool> l1t::TriggerSystem::procEnabled
private

Definition at line 20 of file TriggerSystem.h.

std::map<std::string, std::map<std::string, Mask> > l1t::TriggerSystem::procMasks
private

Definition at line 31 of file TriggerSystem.h.

std::map<std::string, std::map<std::string, Parameter> > l1t::TriggerSystem::procParameters
private

Definition at line 29 of file TriggerSystem.h.

std::map<std::string, std::string> l1t::TriggerSystem::procToRole
private

Definition at line 18 of file TriggerSystem.h.

Referenced by getProcToRoleAssignment().

std::map<std::string, std::string> l1t::TriggerSystem::procToSlot
private

Definition at line 19 of file TriggerSystem.h.

std::map<std::string, std::set<std::string> > l1t::TriggerSystem::roleForDaqttcs
private

Definition at line 26 of file TriggerSystem.h.

std::map<std::string, std::set<std::string> > l1t::TriggerSystem::roleForProcs
private

Definition at line 23 of file TriggerSystem.h.

Referenced by getRoleToProcsAssignment().

std::string l1t::TriggerSystem::sysId
private

Definition at line 16 of file TriggerSystem.h.

Referenced by setSystemId(), and systemId().