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 238 of file StreamSchedule.cc.

Member Typedef Documentation

◆ AliasInfo

Definition at line 240 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 242 of file StreamSchedule.cc.

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

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

References aliasMap_.

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

277 { 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 279 of file StreamSchedule.cc.

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

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

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

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

Referenced by ConditionalTaskHelper().

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

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

Referenced by conditionalModuleBranches(), and ConditionalTaskHelper().