CMS 3D CMS Logo

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 76 of file TriggerSystem.h.

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

Definition at line 81 of file TriggerSystem.h.

81 {}

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:25
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 hcalTTPDigis_cfi::id, RecoTauDiscriminantConfiguration::mask, and proc.

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

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

Referenced by editorTools.UserCodeTool::__init__(), coreTools.RunOnData::__init__(), metTools.AddMETCollection::__init__(), HiCoreTools.RestrictInputToAOD::__init__(), trackTools.MakeAODTrackCandidates::__init__(), runJetUncertainties.RunJetUncertainties::__init__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__init__(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool::__init__(), editorTools.ChangeSource::__init__(), cmsswVersionTools.PickRelValInputFiles::__init__(), HiCoreTools.RemoveMCMatching::__init__(), coreTools.RemoveMCMatching::__init__(), trackTools.MakePATTrackCandidates::__init__(), trigTools.SwitchOnTrigger::__init__(), HiCoreTools.RemoveAllPATObjectsBut::__init__(), HiCoreTools.RemoveSpecificPATObjects::__init__(), trigTools.SwitchOnTriggerStandAlone::__init__(), trackTools.MakeTrackCandidates::__init__(), tauTools.AddTauCollection::__init__(), trigTools.SwitchOnTriggerMatching::__init__(), HiCoreTools.RemoveCleaning::__init__(), HiCoreTools.AddCleaning::__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().

54  {
55  // some tables forget to specify delimeter and we get an empty string here
56  // force the "," default delimeter
57  if( strlen(delim) == 0 ) delim = ",";
58 
59  // first try to locate a processor with name matching the procOrRole argument
60  auto processor = procParameters.find(procOrRole);
61  if( processor != procParameters.end() ){
62  // processor found -> apply settings to this processor
63  auto setting = processor->second.find(id);
64  if( setting != processor->second.end() ){
65  // setting with this id already exists -> always take the latest value
66  // if( logs )
67  // *logs << "Warning: overriding already existing " << id
68  // << " = (" << setting->second.getType() << ") " << setting->second.getValue()
69  // << " with new value (" << type << ") " << value << endl;
70  setting->second = Parameter(id,procOrRole,type,value,delim);
71  } else
72  processor->second.insert(
73  make_pair(string(id), Parameter(id,procOrRole,type,value,delim))
74  );
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(
97  make_pair(string(id), Parameter(id,procOrRole,type,value,delim))
98  );
99  } else {
100  map<string,Parameter> tmp;
101  tmp.insert( make_pair(id, Parameter(id,procOrRole,type,value)) );
102  procParameters.insert( make_pair(proc, std::move(tmp)) );
103  // construct with brace-initialization, although better looking, cannot use move constructor:
104  //procParameters.insert(
105  // make_pair(proc, map<string,Parameter>( {{id,Parameter(id,procOrRole,type,value)}} ) )
106  //);
107  }
108  }
109  } else
110  throw runtime_error("Processor or Role '" + string(procOrRole) + "' was not found");
111 }
type
Definition: HCALResponse.h:21
TrainProcessor *const proc
Definition: MVATrainer.cc:101
std::map< std::string, std::string > procToRole
Definition: TriggerSystem.h:18
Definition: value.py:1
std::ostream * logs
Definition: TriggerSystem.h:31
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
def move(src, dest)
Definition: eostools.py:510
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:27
void l1t::TriggerSystem::addProcessor ( const char *  processor,
const char *  role,
const char *  crate,
const char *  slot 
)

Definition at line 27 of file TriggerSystem.cc.

References edm::eventsetup::heterocontainer::insert().

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

27  {
28  // every processor must have a single defined role
29  auto p2r = procToRole.find(processor);
30  if( p2r != procToRole.end() && p2r->second != role )
31  throw std::runtime_error("Processor: '" + string(processor) + "' already exists but with different role: '" + 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::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, Mask > > procMasks
Definition: TriggerSystem.h:28
std::map< std::string, std::string > procToSlot
Definition: TriggerSystem.h:19
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
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::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:27
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 113 of file TriggerSystem.cc.

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

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

113  {
114  // some tables forget to specify delimeter and we get an empty string here
115  // force the "," default delimeter
116  if( strlen(delim) == 0 ) delim = ",";
117 
118  // first try to locate a processor with name matching the procOrRole argument
119  auto processor = procParameters.find(procOrRole);
120  if( processor != procParameters.end() ){
121  // processor found -> apply settings to this processor
122  auto setting = processor->second.find(id);
123  if( setting != processor->second.end() )
124  // setting with this id already exists -> always take latest value
125  setting->second = Parameter(id,procOrRole,types,columns,rows,delim);
126  else
127  processor->second.insert(
128  make_pair(string(id), Parameter(id,procOrRole,types,columns,rows,delim))
129  );
130  // let's run a consistency check
131  auto p2r = procToRole.find(procOrRole);
132  if( p2r == procToRole.end() )
133  if( logs )
134  *logs << "Warning: TriggerSystem object doesn't yet assign "
135  << " a role to the processor " << procOrRole << endl;
136  return;
137  }
138 
139  // if we've got here, the procOrRole argument must have meaning of role,
140  // throw exception otherwise
141  auto role = roleForProcs.find(procOrRole);
142  if( role != roleForProcs.end() ){
143  // apply setting on all of the processors for this role
144  for(auto &proc : role->second){
145  auto processor = procParameters.find( proc );
146  if( processor != procParameters.end() ){
147  // processor found -> apply settings to this processor
148  // unless the setting with such id already exists
149  auto setting = processor->second.find(id);
150  if( setting == processor->second.end() )
151  processor->second.insert(
152  make_pair(string(id), Parameter(id,procOrRole,types,columns,rows,delim))
153  );
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 }
TrainProcessor *const proc
Definition: MVATrainer.cc:101
std::map< std::string, std::string > procToRole
Definition: TriggerSystem.h:18
std::ostream * logs
Definition: TriggerSystem.h:31
std::map< std::string, std::set< std::string > > roleForProcs
Definition: TriggerSystem.h:23
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
def move(src, dest)
Definition: eostools.py:510
std::map< std::string, std::map< std::string, Parameter > > procParameters
Definition: TriggerSystem.h:27
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
void l1t::TriggerSystem::disableProcOrRoleOrDaq ( const char *  procOrRoleOrDaq)

Definition at line 291 of file TriggerSystem.cc.

References proc.

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

291  {
292  // follow the standard search steps to identify if the argument is processor or role or daqttc processor/role
293 
294  // the argument is simply a processor's name
295  auto processor = procEnabled.find(procOrRoleOrDaq);
296  if( processor != procEnabled.end() ){
297  processor->second = false;
298  return;
299  }
300 
301  // role
302  auto role = roleForProcs.find(procOrRoleOrDaq);
303  if( role != roleForProcs.end() ){
304  // apply setting on all of the processors for this role
305  for(auto &proc : role->second)
306  // by design procEnabled must have every single processor for every role
307  procEnabled[proc] = false;
308  return;
309  }
310 
311  // the whole daq of a crate is disables -> disable all of the processors in the crate
312  auto d2c = daqttcToCrate.find(procOrRoleOrDaq);
313  if( d2c != daqttcToCrate.end() ){
314  auto processors = crateForProcs.find(d2c->second);
315  if( processors != crateForProcs.end() ){
316  for(auto &proc : processors->second)
317  // by design procEnabled must have every single processor for every crate
318  procEnabled[proc] = false;
319  } else
320  if( logs )
321  *logs << "Warning: no processors in daqttc crate for "
322  << procOrRoleOrDaq << " ... do nothing" << endl;
323  return;
324  }
325 
326  // so, finally, this is daqttc role
327  auto r2d = roleForDaqttcs.find(procOrRoleOrDaq);
328  if( r2d != roleForDaqttcs.end() ){
329  for(auto &daq : r2d->second){
330  auto d2c = daqttcToCrate.find(daq);
331  if( d2c != daqttcToCrate.end() ){
332  auto processors = crateForProcs.find(d2c->second);
333  if( processors != crateForProcs.end() ){
334  for(auto &proc : processors->second)
335  procEnabled[proc] = false;
336  } else
337  if( logs )
338  *logs << "Warning: no processors in daqttc crate " << d2c->second
339  << " for " << procOrRoleOrDaq << " ... do nothing" << endl;
340  } else
341  if( logs )
342  *logs << "Warning: daqttc " << daq << " has no crate "
343  << " ... do nothing" << endl;
344  return;
345  }
346  }
347 
348  // if we ever reach here, we've ran out of options
349  throw runtime_error("Processor/DAQ or Role '" + string(procOrRoleOrDaq) + "' was not found");
350 }
TrainProcessor *const proc
Definition: MVATrainer.cc:101
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:25
std::ostream * logs
Definition: TriggerSystem.h:31
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 271 of file TriggerSystem.cc.

Referenced by getRoleToProcsAssignment(), and L1TMuonGlobalParamsHelper::loadFromOnline().

271  {
272  if( !isConfigured )
273  throw std::runtime_error("TriggerSystem is not configured yet. First call the configureSystem method");
274 
275  auto processor = procMasks.find(p);
276  if( processor == procMasks.end() )
277  throw std::runtime_error("Processor '" + string(p) + "' was not found in the configuration");
278 
279  return processor->second;
280 }
std::map< std::string, std::map< std::string, Mask > > procMasks
Definition: TriggerSystem.h:28
const map< string, Parameter > & l1t::TriggerSystem::getParameters ( const char *  processor) const

Definition at line 168 of file TriggerSystem.cc.

Referenced by L1TMuonBarrelParamsHelper::configFromDB(), getRoleToProcsAssignment(), L1TGlobalPrescalesVetosESProducer::L1TGlobalPrescalesVetosESProducer(), L1TMuonGlobalParamsHelper::loadFromOnline(), L1TMuonEndcapParamsOnlineProd::newObject(), L1TCaloParamsOnlineProd::newObject(), and L1TGlobalPrescalesVetosOnlineProd::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:27
const std::map<std::string, std::string>& l1t::TriggerSystem::getProcToRoleAssignment ( void  ) const
inlinenoexcept

Definition at line 61 of file TriggerSystem.h.

References procToRole.

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

61 { 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 62 of file TriggerSystem.h.

References getMasks(), getParameters(), isMasked(), isProcEnabled(), and roleForProcs.

62 { return roleForProcs; }
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 282 of file TriggerSystem.cc.

References funct::m, and RecoTauDiscriminantConfiguration::mask.

Referenced by getRoleToProcsAssignment(), and L1TMuonGlobalParamsHelper::loadFromOnline().

282  {
283  const std::map<std::string, Mask>& m = getMasks(p);
284 
285  auto mask = m.find(id);
286  if( mask == m.end() ) return false;
287 
288  return true;
289 }
const std::map< std::string, Mask > & getMasks(const char *processor) const
bool l1t::TriggerSystem::isProcEnabled ( const char *  proccessor) const

Definition at line 352 of file TriggerSystem.cc.

Referenced by getRoleToProcsAssignment().

352  {
353  if( !isConfigured )
354  throw std::runtime_error("TriggerSystem is not configured yet. First call the configureSystem method");
355 
356  auto processor = procEnabled.find(p);
357  if( processor == procEnabled.end() )
358  throw runtime_error("Processor '" + string(p) + "' not found");
359 
360  return processor->second;
361 }
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 74 of file TriggerSystem.h.

References alignCSCRings::s.

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

Definition at line 71 of file TriggerSystem.h.

References hcalTTPDigis_cfi::id.

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

std::string l1t::TriggerSystem::systemId ( void  ) const
inlinenoexcept

Definition at line 70 of file TriggerSystem.h.

References sysId.

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

70 { 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 30 of file TriggerSystem.h.

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

Definition at line 31 of file TriggerSystem.h.

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 28 of file TriggerSystem.h.

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

Definition at line 27 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 25 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 systemId().