CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::ConditionalTaskHelper Class Reference

Public Types

using AliasInfo = StreamSchedule::AliasInfo
 

Public Member Functions

std::unordered_multimap< std::string, AliasInfo > const & aliasMap () const
 
std::unordered_multimap< std::string, edm::BranchDescription const * > conditionalModuleBranches (std::unordered_set< std::string > const &conditionalmods) const
 
 ConditionalTaskHelper (ParameterSet &proc_pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, WorkerManager &workerManagerLumisAndEvents, std::vector< std::string > const &trigPathNames)
 

Private Member Functions

void fillAliasMap (ParameterSet const &proc_pset, std::unordered_set< std::string > const &allConditionalMods)
 
void processSwitchEDAliases (ParameterSet const &proc_pset, ProductRegistry &preg, ProcessConfiguration const &processConfiguration, std::unordered_set< std::string > const &allConditionalMods)
 

Private Attributes

std::unordered_multimap< std::string, AliasInfoaliasMap_
 
std::unordered_multimap< std::string, edm::BranchDescription const * > conditionalModsBranches_
 

Detailed Description

Definition at line 261 of file StreamSchedule.cc.

Member Typedef Documentation

◆ AliasInfo

Definition at line 263 of file StreamSchedule.cc.

Constructor & Destructor Documentation

◆ ConditionalTaskHelper()

edm::ConditionalTaskHelper::ConditionalTaskHelper ( ParameterSet proc_pset,
ProductRegistry preg,
PreallocationConfiguration const *  prealloc,
std::shared_ptr< ProcessConfiguration const >  processConfiguration,
WorkerManager workerManagerLumisAndEvents,
std::vector< std::string > const &  trigPathNames 
)
inline

Definition at line 265 of file StreamSchedule.cc.

References conditionalModsBranches_, fillAliasMap(), edm::ParameterSet::getParameter(), hltMonBTagIPClient_cfi::pathName, processSwitchEDAliases(), dumpMFGeometry_cfg::prod, edm::ProductRegistry::productList(), and funct::void.

270  {
271  std::unordered_set<std::string> allConditionalMods;
272  for (auto const& pathName : trigPathNames) {
273  auto const modnames = proc_pset.getParameter<vstring>(pathName);
274 
275  //Pull out ConditionalTask modules
276  auto condRange = findConditionalTaskModulesRange(modnames);
277  if (condRange.first == condRange.second)
278  continue;
279 
280  //the last entry should be ignored since it is required to be "@"
281  allConditionalMods.insert(condRange.first, condRange.second);
282  }
283 
284  for (auto const& cond : allConditionalMods) {
285  //force the creation of the conditional modules so alias check can work
286  (void)getWorker(cond, proc_pset, workerManagerLumisAndEvents, preg, prealloc, processConfiguration);
287  }
288 
289  fillAliasMap(proc_pset, allConditionalMods);
290  processSwitchEDAliases(proc_pset, preg, *processConfiguration, allConditionalMods);
291 
292  //find branches created by the conditional modules
293  for (auto const& prod : preg.productList()) {
294  if (allConditionalMods.find(prod.first.moduleLabel()) != allConditionalMods.end()) {
295  conditionalModsBranches_.emplace(prod.first.moduleLabel(), &prod.second);
296  }
297  }
298  }
vector< string > vstring
Definition: ExoticaDQM.cc:7
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
void processSwitchEDAliases(ParameterSet const &proc_pset, ProductRegistry &preg, ProcessConfiguration const &processConfiguration, std::unordered_set< std::string > const &allConditionalMods)
void fillAliasMap(ParameterSet const &proc_pset, std::unordered_set< std::string > const &allConditionalMods)
std::unordered_multimap< std::string, edm::BranchDescription const * > conditionalModsBranches_

Member Function Documentation

◆ aliasMap()

std::unordered_multimap<std::string, AliasInfo> const& edm::ConditionalTaskHelper::aliasMap ( ) const
inline

Definition at line 300 of file StreamSchedule.cc.

References aliasMap_.

Referenced by edm::StreamSchedule::fillWorkers().

300 { return aliasMap_; }
std::unordered_multimap< std::string, AliasInfo > aliasMap_

◆ conditionalModuleBranches()

std::unordered_multimap<std::string, edm::BranchDescription const*> edm::ConditionalTaskHelper::conditionalModuleBranches ( std::unordered_set< std::string > const &  conditionalmods) const
inline

Definition at line 302 of file StreamSchedule.cc.

References conditionalModsBranches_, mod(), FastTimerService_cff::range, and runTheMatrix::ret.

Referenced by edm::StreamSchedule::fillWorkers().

303  {
304  std::unordered_multimap<std::string, edm::BranchDescription const*> ret;
305  for (auto const& mod : conditionalmods) {
306  auto range = conditionalModsBranches_.equal_range(mod);
307  ret.insert(range.first, range.second);
308  }
309  return ret;
310  }
ret
prodAgent to be discontinued
std::unordered_multimap< std::string, edm::BranchDescription const * > conditionalModsBranches_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ fillAliasMap()

void edm::ConditionalTaskHelper::fillAliasMap ( ParameterSet const &  proc_pset,
std::unordered_set< std::string > const &  allConditionalMods 
)
inlineprivate

Definition at line 313 of file StreamSchedule.cc.

References SiStripOfflineCRack_cfg::alias, aliasMap_, edm::ParameterSet::getParameter(), info(), instance, mod(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ConditionalTaskHelper().

313  {
314  auto aliases = proc_pset.getParameter<std::vector<std::string>>("@all_aliases");
315  std::string const star("*");
316  for (auto const& alias : aliases) {
317  auto info = proc_pset.getParameter<edm::ParameterSet>(alias);
318  auto aliasedToModuleLabels = info.getParameterNames();
319  for (auto const& mod : aliasedToModuleLabels) {
320  if (not mod.empty() and mod[0] != '@' and allConditionalMods.find(mod) != allConditionalMods.end()) {
321  auto aliasVPSet = info.getParameter<std::vector<edm::ParameterSet>>(mod);
322  for (auto const& aliasPSet : aliasVPSet) {
323  std::string type = star;
324  std::string instance = star;
325  std::string originalInstance = star;
326  if (aliasPSet.exists("type")) {
327  type = aliasPSet.getParameter<std::string>("type");
328  }
329  if (aliasPSet.exists("toProductInstance")) {
330  instance = aliasPSet.getParameter<std::string>("toProductInstance");
331  }
332  if (aliasPSet.exists("fromProductInstance")) {
333  originalInstance = aliasPSet.getParameter<std::string>("fromProductInstance");
334  }
335 
336  aliasMap_.emplace(alias, AliasInfo{type, instance, originalInstance, mod});
337  }
338  }
339  }
340  }
341  }
StreamSchedule::AliasInfo AliasInfo
static const TGPicture * info(bool iBackgroundIsBlack)
static PFTauRenderPlugin instance
std::unordered_multimap< std::string, AliasInfo > aliasMap_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ processSwitchEDAliases()

void edm::ConditionalTaskHelper::processSwitchEDAliases ( ParameterSet const &  proc_pset,
ProductRegistry preg,
ProcessConfiguration const &  processConfiguration,
std::unordered_set< std::string > const &  allConditionalMods 
)
inlineprivate

Definition at line 343 of file StreamSchedule.cc.

References aliasMap_, edm::ParameterSet::getParameter(), callgraph::module, edm::detail::processEDAliases(), edm::ProcessConfiguration::processName(), FastTimerService_cff::range, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ConditionalTaskHelper().

346  {
347  auto const& all_modules = proc_pset.getParameter<std::vector<std::string>>("@all_modules");
348  std::vector<std::string> switchEDAliases;
349  for (auto const& module : all_modules) {
350  auto const& mod_pset = proc_pset.getParameter<edm::ParameterSet>(module);
351  if (mod_pset.getParameter<std::string>("@module_type") == "SwitchProducer") {
352  auto const& all_cases = mod_pset.getParameter<std::vector<std::string>>("@all_cases");
353  for (auto const& case_label : all_cases) {
354  auto range = aliasMap_.equal_range(case_label);
355  if (range.first != range.second) {
356  switchEDAliases.push_back(case_label);
357  }
358  }
359  }
360  }
362  switchEDAliases, allConditionalMods, proc_pset, processConfiguration.processName(), preg);
363  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unordered_multimap< std::string, AliasInfo > aliasMap_
void processEDAliases(std::vector< std::string > const &aliasNamesToProcess, std::unordered_set< std::string > const &aliasModulesToProcess, ParameterSet const &proc_pset, std::string const &processName, ProductRegistry &preg)

Member Data Documentation

◆ aliasMap_

std::unordered_multimap<std::string, AliasInfo> edm::ConditionalTaskHelper::aliasMap_
private

Definition at line 365 of file StreamSchedule.cc.

Referenced by aliasMap(), fillAliasMap(), and processSwitchEDAliases().

◆ conditionalModsBranches_

std::unordered_multimap<std::string, edm::BranchDescription const*> edm::ConditionalTaskHelper::conditionalModsBranches_
private

Definition at line 366 of file StreamSchedule.cc.

Referenced by conditionalModuleBranches(), and ConditionalTaskHelper().