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 &workerManager, 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 239 of file StreamSchedule.cc.

Member Typedef Documentation

◆ AliasInfo

Definition at line 241 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 workerManager,
std::vector< std::string > const &  trigPathNames 
)
inline

Definition at line 243 of file StreamSchedule.cc.

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

248  {
249  std::unordered_set<std::string> allConditionalMods;
250  for (auto const& pathName : trigPathNames) {
251  auto const modnames = proc_pset.getParameter<vstring>(pathName);
252 
253  //Pull out ConditionalTask modules
254  auto condRange = findConditionalTaskModulesRange(modnames);
255  if (condRange.first == condRange.second)
256  continue;
257 
258  //the last entry should be ignored since it is required to be "@"
259  allConditionalMods.insert(condRange.first, condRange.second);
260  }
261 
262  for (auto const& cond : allConditionalMods) {
263  //force the creation of the conditional modules so alias check can work
264  (void)getWorker(cond, proc_pset, workerManager, preg, prealloc, processConfiguration);
265  }
266 
267  fillAliasMap(proc_pset, allConditionalMods);
268  processSwitchEDAliases(proc_pset, preg, *processConfiguration, allConditionalMods);
269 
270  //find branches created by the conditional modules
271  for (auto const& prod : preg.productList()) {
272  if (allConditionalMods.find(prod.first.moduleLabel()) != allConditionalMods.end()) {
273  conditionalModsBranches_.emplace(prod.first.moduleLabel(), &prod.second);
274  }
275  }
276  }
vector< string > vstring
Definition: ExoticaDQM.cc:8
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)
Definition: plugin.cc:23
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 278 of file StreamSchedule.cc.

References aliasMap_.

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

278 { 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 280 of file StreamSchedule.cc.

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

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

281  {
282  std::unordered_multimap<std::string, edm::BranchDescription const*> ret;
283  for (auto const& mod : conditionalmods) {
284  auto range = conditionalModsBranches_.equal_range(mod);
285  ret.insert(range.first, range.second);
286  }
287  return ret;
288  }
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 291 of file StreamSchedule.cc.

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

Referenced by ConditionalTaskHelper().

291  {
292  auto aliases = proc_pset.getParameter<std::vector<std::string>>("@all_aliases");
293  std::string const star("*");
294  for (auto const& alias : aliases) {
295  auto info = proc_pset.getParameter<edm::ParameterSet>(alias);
296  auto aliasedToModuleLabels = info.getParameterNames();
297  for (auto const& mod : aliasedToModuleLabels) {
298  if (not mod.empty() and mod[0] != '@' and allConditionalMods.find(mod) != allConditionalMods.end()) {
299  auto aliasVPSet = info.getParameter<std::vector<edm::ParameterSet>>(mod);
300  for (auto const& aliasPSet : aliasVPSet) {
301  std::string type = star;
302  std::string instance = star;
303  std::string originalInstance = star;
304  if (aliasPSet.exists("type")) {
305  type = aliasPSet.getParameter<std::string>("type");
306  }
307  if (aliasPSet.exists("toProductInstance")) {
308  instance = aliasPSet.getParameter<std::string>("toProductInstance");
309  }
310  if (aliasPSet.exists("fromProductInstance")) {
311  originalInstance = aliasPSet.getParameter<std::string>("fromProductInstance");
312  }
313 
314  aliasMap_.emplace(alias, AliasInfo{type, instance, originalInstance, mod});
315  }
316  }
317  }
318  }
319  }
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 321 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().

324  {
325  auto const& all_modules = proc_pset.getParameter<std::vector<std::string>>("@all_modules");
326  std::vector<std::string> switchEDAliases;
327  for (auto const& module : all_modules) {
328  auto const& mod_pset = proc_pset.getParameter<edm::ParameterSet>(module);
329  if (mod_pset.getParameter<std::string>("@module_type") == "SwitchProducer") {
330  auto const& all_cases = mod_pset.getParameter<std::vector<std::string>>("@all_cases");
331  for (auto const& case_label : all_cases) {
332  auto range = aliasMap_.equal_range(case_label);
333  if (range.first != range.second) {
334  switchEDAliases.push_back(case_label);
335  }
336  }
337  }
338  }
340  switchEDAliases, allConditionalMods, proc_pset, processConfiguration.processName(), preg);
341  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 343 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 344 of file StreamSchedule.cc.

Referenced by conditionalModuleBranches(), and ConditionalTaskHelper().