43 if ( it->second.compare(processor) == 0 && it->first.compare(role) != 0 )
44 throw std::runtime_error (
"Processor: " + processor +
" already exists but with different role");
57 procSlot_[processor] = atoi(slot.c_str());
69 if ( it->first.compare(daq) == 0 && it->second.compare(role) != 0 )
70 throw std::runtime_error (
"DAQttc: " + daq +
" already exists but with different role");
84 bool applyOnRole, foundRoleProc(
false);
98 throw std::runtime_error (
"Processor or Role " + procRole +
" was not found in the map");
112 bool SettingAlreadyExist(
false);
115 if (is->getId().compare(
id) == 0)
117 SettingAlreadyExist =
true;
121 if (!SettingAlreadyExist)
133 bool applyOnRole, foundRoleProc(
false);
138 foundRoleProc =
true;
143 foundRoleProc =
true;
146 throw std::runtime_error (
"Processor or Role " + procRole +
" was not found in the map");
160 bool SettingAlreadyExist(
false);
163 if (is->getId().compare(
id) == 0)
165 SettingAlreadyExist =
true;
169 if (!SettingAlreadyExist)
182 throw std::runtime_error(
"TrigSystem is not configured yet. First call the configureSystem method");
184 throw std::runtime_error (
"Processor " + processor +
" was not found in the TrigSystem object list");
186 std::map<std::string, Setting> Settings;
187 std::vector<Setting> vecSettings =
procSettings_.at(processor);
188 for(
auto it=vecSettings.begin(); it!=vecSettings.end(); ++it)
189 Settings.insert(std::pair<std::string, Setting>(it->getId(), *it));
197 for(
auto it = vec.begin(); it != vec.end(); ++it)
199 if (it->getId().compare(
id) == 0)
203 it->setProcRole(procRole);
213 for(
auto it = vec.begin(); it != vec.end(); ++it)
215 if (it->getId().compare(
id) == 0)
219 it->resetTableRows();
222 for(
auto ir=rows.begin(); ir!=rows.end(); ++ir)
233 bool applyOnRole(
false), foundRoleProc(
false);
238 foundRoleProc =
true;
243 foundRoleProc =
true;
247 if (!applyOnRole && foundRoleProc)
250 else if (applyOnRole && foundRoleProc)
256 bool MaskAlreadyExist(
false);
259 if (is->getId().compare(
id) == 0)
261 MaskAlreadyExist =
true;
265 if (!MaskAlreadyExist)
274 else if (!applyOnRole && !foundRoleProc)
280 if (
procSlot_[*it] == atoi(
id.substr(11,2).c_str()) )
291 if (
procSlot_[*itt] == atoi(
id.substr(11,2).c_str()) )
300 throw std::runtime_error (
"Processor/DAQ or Role " + procRole +
" was not found in the map for masking");
307 throw std::runtime_error(
"TrigSystem is not configured yet. First call the configureSystem method");
309 throw std::runtime_error (
"Processor " + processor +
" was not found in the TrigSystem object list");
311 std::map<std::string, Mask> Masks;
312 std::vector<Mask> vecMasks=
procMasks_.at(processor);
313 for(
auto it=vecMasks.begin(); it!=vecMasks.end(); ++it)
314 Masks.insert(std::pair<std::string, Mask>(it->getId(), *it));
323 throw std::runtime_error(
"TrigSystem is not configured yet. First call the configureSystem method");
326 std::vector<Mask> vecMasks=
procMasks_.at(processor);
327 for(
auto it=vecMasks.begin(); it!=vecMasks.end(); ++it)
329 if (it->getId() == id)
336 edm::LogInfo (
"l1t::TrigSystem::isMasked") <<
"Returning " << isMasked <<
" for processor " << processor <<
" and port " << id;
343 throw std::runtime_error(
"Cannot Mask daq/processor " + daqProc +
"! Not found in the system.");
370 throw std::runtime_error(
"TrigSystem is not configured yet. First call the configureSystem method");
372 edm::LogInfo (
"l1t::TrigSystem::isProcEnabled") <<
"Returning " <<
procEnabled_[processor] <<
" for processor " << processor;
void disableDaqProc(const std::string &daqProc)
void readDOMFromFile(const std::string &fName, xercesc::DOMDocument *&doc)
bool isMasked(const std::string &proccessor, const std::string &id)
std::map< std::string, std::vector< std::string > > roleProcs_
std::map< std::string, std::string > daqttcCrate_
void readRootElement(TrigSystem &aTrigSystem, const std::string &sysId="")
std::map< std::string, std::string > daqttcRole_
void addMask(const std::string &id, const std::string &procRole)
void addDaqRole(const std::string &daq, const std::string &role)
void configureSystemFromFiles(const std::string &hwCfgFile, const std::string &topCfgFile, const std::string &key)
void addSetting(const std::string &type, const std::string &id, const std::string &value, const std::string &procRole, const std::string &delim="")
std::vector< std::string > str2VecStr_(const std::string &aStr, const std::string &delim)
void addProcRole(const std::string &processor, const std::string &role)
std::map< std::string, std::vector< std::string > > crateProcs_
void buildGlobalDoc(const std::string &key, const std::string &topPath="")
void addProcCrate(const std::string &processor, const std::string &crate)
bool checkIdExistsAndSetSetting_(std::vector< Setting > &vec, const std::string &id, const std::string &value, const std::string &procRole)
std::map< std::string, std::vector< std::string > > roleDaqttcs_
std::map< std::string, std::vector< Setting > > procSettings_
std::map< std::string, int > procSlot_
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
bool isProcEnabled(const std::string &proccessor)
void readContexts(const std::string &key, const std::string &sysId, TrigSystem &aTrigSystem)
std::map< std::string, Setting > getSettings(const std::string &processor)
void addDaqCrate(const std::string &daq, const std::string &crate)
void addProcSlot(const std::string &processor, const std::string &slot)
std::map< std::string, bool > procEnabled_
volatile std::atomic< bool > shutdown_flag false
std::map< std::string, std::vector< Mask > > procMasks_
std::map< std::string, Mask > getMasks(const std::string &proccessor)
std::map< std::string, std::string > procRole_
void addSettingTable(const std::string &id, const std::string &columns, const std::string &types, const std::vector< std::string > &rows, const std::string &procRole, const std::string &delim)