CMS 3D CMS Logo

EdmProvDump.cc
Go to the documentation of this file.
18 
22 
23 #include "TError.h"
24 #include "TFile.h"
25 #include "TTree.h"
26 
27 #include "boost/program_options.hpp"
28 
29 #include <cassert>
30 #include <iostream>
31 #include <memory>
32 #include <map>
33 #include <set>
34 #include <sstream>
35 #include <vector>
36 
37 typedef std::map<std::string, std::vector<edm::BranchDescription>> IdToBranches;
38 typedef std::map<std::pair<std::string, std::string>, IdToBranches> ModuleToIdBranches;
39 
40 static std::ostream& prettyPrint(std::ostream& oStream,
41  edm::ParameterSet const& iPSet,
42  std::string const& iIndent,
43  std::string const& iIndentDelta);
44 
45 static std::string const triggerResults = std::string("TriggerResults");
46 static std::string const triggerPaths = std::string("@trigger_paths");
47 static std::string const source = std::string("source");
48 static std::string const input = std::string("@main_input");
49 
50 namespace {
51  typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> ParameterSetMap;
52 
53  class HistoryNode {
54  public:
55  HistoryNode() : config_(), simpleId_(0) {}
56 
57  HistoryNode(edm::ProcessConfiguration const& iConfig, unsigned int iSimpleId)
58  : config_(iConfig), simpleId_(iSimpleId) {}
59 
60  void addChild(HistoryNode const& child) { children_.push_back(child); }
61 
62  edm::ParameterSetID const& parameterSetID() const { return config_.parameterSetID(); }
63 
64  std::string const& processName() const { return config_.processName(); }
65 
66  std::size_t size() const { return children_.size(); }
67 
68  HistoryNode* lastChildAddress() { return &children_.back(); }
69 
70  typedef std::vector<HistoryNode>::const_iterator const_iterator;
71  typedef std::vector<HistoryNode>::iterator iterator;
72 
73  iterator begin() { return children_.begin(); }
74  iterator end() { return children_.end(); }
75 
76  const_iterator begin() const { return children_.begin(); }
77  const_iterator end() const { return children_.end(); }
78 
79  void print(std::ostream& os) const {
80  os << config_.processName() << " '" << config_.passID() << "' '" << config_.releaseVersion() << "' [" << simpleId_
81  << "] (" << config_.parameterSetID() << ")" << std::endl;
82  }
83 
84  void printHistory(std::string const& iIndent = std::string(" ")) const;
85  void printEventSetupHistory(ParameterSetMap const& iPSM,
86  std::vector<std::string> const& iFindMatch,
87  std::ostream& oErrorLog) const;
88  void printOtherModulesHistory(ParameterSetMap const& iPSM,
89  ModuleToIdBranches const&,
90  std::vector<std::string> const& iFindMatch,
91  std::ostream& oErrorLog) const;
92  void printTopLevelPSetsHistory(ParameterSetMap const& iPSM,
93  std::vector<std::string> const& iFindMatch,
94  std::ostream& oErrorLog) const;
95 
96  edm::ProcessConfigurationID configurationID() const { return config_.id(); }
97 
98  static bool sort_;
99 
100  private:
102  std::vector<HistoryNode> children_;
103  unsigned int simpleId_;
104  };
105 
106  std::ostream& operator<<(std::ostream& os, HistoryNode const& node) {
107  node.print(os);
108  return os;
109  }
110  bool HistoryNode::sort_ = false;
111 } // namespace
112 
113 std::ostream& operator<<(std::ostream& os, edm::ProcessHistory& iHist) {
114  std::string const indentDelta(" ");
115  std::string indent = indentDelta;
116  for (auto const& process : iHist) {
117  os << indent << process.processName() << " '" << process.passID() << "' '" << process.releaseVersion() << "' ("
118  << process.parameterSetID() << ")" << std::endl;
119  indent += indentDelta;
120  }
121  return os;
122 }
123 
124 void HistoryNode::printHistory(std::string const& iIndent) const {
125  std::string const indentDelta(" ");
126  const std::string& indent = iIndent;
127  for (auto const& item : *this) {
128  std::cout << indent << item;
129  item.printHistory(indent + indentDelta);
130  }
131 }
132 
134  std::string const& iCompName,
135  edm::ParameterSet const& iProcessConfig,
136  std::string const& iProcessName) {
137  std::ostringstream result;
138  edm::ParameterSet const& pset = iProcessConfig.getParameterSet(iCompName);
139  std::string name(pset.getParameter<std::string>("@module_label"));
140  if (name.empty()) {
141  name = pset.getParameter<std::string>("@module_type");
142  }
143 
144  result << iType << ": " << name << " " << iProcessName << "\n"
145  << " parameters: ";
146  prettyPrint(result, pset, " ", " ");
147  return result.str();
148 }
149 
150 void HistoryNode::printEventSetupHistory(ParameterSetMap const& iPSM,
151  std::vector<std::string> const& iFindMatch,
152  std::ostream& oErrorLog) const {
153  for (auto const& itH : *this) {
154  //Get ParameterSet for process
155  ParameterSetMap::const_iterator itFind = iPSM.find(itH.parameterSetID());
156  if (itFind == iPSM.end()) {
157  oErrorLog << "No ParameterSetID for " << itH.parameterSetID() << std::endl;
158  } else {
159  edm::ParameterSet processConfig(itFind->second.pset());
160  std::vector<std::string> sourceStrings, moduleStrings;
161  //get the sources
162  std::vector<std::string> sources = processConfig.getParameter<std::vector<std::string>>("@all_essources");
163  for (auto& itM : sources) {
164  std::string retValue = eventSetupComponent("ESSource", itM, processConfig, itH.processName());
165  bool foundMatch = true;
166  if (!iFindMatch.empty()) {
167  for (auto const& stringToFind : iFindMatch) {
168  if (retValue.find(stringToFind) == std::string::npos) {
169  foundMatch = false;
170  break;
171  }
172  }
173  }
174  if (foundMatch) {
175  sourceStrings.push_back(std::move(retValue));
176  }
177  }
178  //get the modules
179  std::vector<std::string> modules = processConfig.getParameter<std::vector<std::string>>("@all_esmodules");
180  for (auto& itM : modules) {
181  std::string retValue = eventSetupComponent("ESModule", itM, processConfig, itH.processName());
182  bool foundMatch = true;
183  if (!iFindMatch.empty()) {
184  for (auto const& stringToFind : iFindMatch) {
185  if (retValue.find(stringToFind) == std::string::npos) {
186  foundMatch = false;
187  break;
188  }
189  }
190  }
191  if (foundMatch) {
192  moduleStrings.push_back(std::move(retValue));
193  }
194  }
195  if (sort_) {
196  std::sort(sourceStrings.begin(), sourceStrings.end());
197  std::sort(moduleStrings.begin(), moduleStrings.end());
198  }
199  std::copy(sourceStrings.begin(), sourceStrings.end(), std::ostream_iterator<std::string>(std::cout, "\n"));
200  std::copy(moduleStrings.begin(), moduleStrings.end(), std::ostream_iterator<std::string>(std::cout, "\n"));
201  }
202  itH.printEventSetupHistory(iPSM, iFindMatch, oErrorLog);
203  }
204 }
205 
207  edm::ParameterSet const& iProcessConfig,
208  std::string const& iProcessName) {
209  std::ostringstream result;
210  edm::ParameterSet const& pset = iProcessConfig.getParameterSet(iCompName);
211  std::string label(pset.getParameter<std::string>("@module_label"));
212 
213  result << "Module: " << label << " " << iProcessName << "\n"
214  << " parameters: ";
215  prettyPrint(result, pset, " ", " ");
216  return result.str();
217 }
218 
219 void HistoryNode::printOtherModulesHistory(ParameterSetMap const& iPSM,
220  ModuleToIdBranches const& iModules,
221  std::vector<std::string> const& iFindMatch,
222  std::ostream& oErrorLog) const {
223  for (auto const& itH : *this) {
224  //Get ParameterSet for process
225  ParameterSetMap::const_iterator itFind = iPSM.find(itH.parameterSetID());
226  if (itFind == iPSM.end()) {
227  oErrorLog << "No ParameterSetID for " << itH.parameterSetID() << std::endl;
228  } else {
229  edm::ParameterSet processConfig(itFind->second.pset());
230  std::vector<std::string> moduleStrings;
231  //get all modules
232  std::vector<std::string> modules = processConfig.getParameter<std::vector<std::string>>("@all_modules");
233  for (auto& itM : modules) {
234  //if we didn't already handle this from the branches
235  if (iModules.end() == iModules.find(std::make_pair(itH.processName(), itM))) {
236  std::string retValue(nonProducerComponent(itM, processConfig, itH.processName()));
237  bool foundMatch = true;
238  if (!iFindMatch.empty()) {
239  for (auto const& stringToFind : iFindMatch) {
240  if (retValue.find(stringToFind) == std::string::npos) {
241  foundMatch = false;
242  break;
243  }
244  }
245  }
246  if (foundMatch) {
247  moduleStrings.push_back(std::move(retValue));
248  }
249  }
250  }
251  if (sort_) {
252  std::sort(moduleStrings.begin(), moduleStrings.end());
253  }
254  std::copy(moduleStrings.begin(), moduleStrings.end(), std::ostream_iterator<std::string>(std::cout, "\n"));
255  }
256  itH.printOtherModulesHistory(iPSM, iModules, iFindMatch, oErrorLog);
257  }
258 }
259 
260 static void appendToSet(std::set<std::string>& iSet, std::vector<std::string> const& iFrom) {
261  for (auto const& n : iFrom) {
262  iSet.insert(n);
263  }
264 }
265 
267  edm::ParameterSet const& iProcessConfig,
268  std::string const& iProcessName) {
269  std::ostringstream result;
270  edm::ParameterSet const& pset = iProcessConfig.getParameterSet(iName);
271 
272  result << "PSet: " << iName << " " << iProcessName << "\n"
273  << " parameters: ";
274  prettyPrint(result, pset, " ", " ");
275  return result.str();
276 }
277 
278 void HistoryNode::printTopLevelPSetsHistory(ParameterSetMap const& iPSM,
279  std::vector<std::string> const& iFindMatch,
280  std::ostream& oErrorLog) const {
281  for (auto const& itH : *this) {
282  //Get ParameterSet for process
283  ParameterSetMap::const_iterator itFind = iPSM.find(itH.parameterSetID());
284  if (itFind == iPSM.end()) {
285  oErrorLog << "No ParameterSetID for " << itH.parameterSetID() << std::endl;
286  } else {
287  edm::ParameterSet processConfig(itFind->second.pset());
288  //Need to get the names of PSets which are used by the framework (e.g. names of modules)
289  std::set<std::string> namesToExclude;
290  appendToSet(namesToExclude, processConfig.getParameter<std::vector<std::string>>("@all_modules"));
291  appendToSet(namesToExclude, processConfig.getParameter<std::vector<std::string>>("@all_sources"));
292  appendToSet(namesToExclude, processConfig.getParameter<std::vector<std::string>>("@all_loopers"));
293  //appendToSet(namesToExclude,processConfig.getParameter<std::vector<std::string> >("@all_subprocesses"));//untracked
294  appendToSet(namesToExclude, processConfig.getParameter<std::vector<std::string>>("@all_esmodules"));
295  appendToSet(namesToExclude, processConfig.getParameter<std::vector<std::string>>("@all_essources"));
296  appendToSet(namesToExclude, processConfig.getParameter<std::vector<std::string>>("@all_esprefers"));
297  if (processConfig.existsAs<std::vector<std::string>>("all_aliases")) {
298  appendToSet(namesToExclude, processConfig.getParameter<std::vector<std::string>>("@all_aliases"));
299  }
300 
301  std::vector<std::string> allNames{};
302  processConfig.getParameterSetNames(allNames);
303 
304  std::vector<std::string> results;
305  for (auto const& name : allNames) {
306  if (name.empty() || '@' == name[0] || namesToExclude.find(name) != namesToExclude.end()) {
307  continue;
308  }
309  std::string retValue = topLevelPSet(name, processConfig, itH.processName());
310 
311  bool foundMatch = true;
312  if (!iFindMatch.empty()) {
313  for (auto const& stringToFind : iFindMatch) {
314  if (retValue.find(stringToFind) == std::string::npos) {
315  foundMatch = false;
316  break;
317  }
318  }
319  }
320  if (foundMatch) {
321  results.push_back(std::move(retValue));
322  }
323  }
324  if (sort_) {
325  std::sort(results.begin(), results.end());
326  }
327  std::copy(results.begin(), results.end(), std::ostream_iterator<std::string>(std::cout, "\n"));
328  }
329  itH.printTopLevelPSetsHistory(iPSM, iFindMatch, oErrorLog);
330  }
331 }
332 
333 namespace {
334  std::unique_ptr<TFile> makeTFileWithLookup(std::string const& filename) {
335  // See if it is a logical file name.
336  std::unique_ptr<edm::SiteLocalConfig> slcptr =
337  std::make_unique<edm::service::SiteLocalConfigService>(edm::ParameterSet());
338  auto slc = std::make_shared<edm::serviceregistry::ServiceWrapper<edm::SiteLocalConfig>>(std::move(slcptr));
340  edm::ServiceRegistry::Operate operate(slcToken);
341  std::string override;
342  std::vector<std::string> fileNames;
343  fileNames.push_back(filename);
344  edm::InputFileCatalog catalog(fileNames, override, true);
345  if (catalog.fileNames(0)[0] == filename) {
346  throw cms::Exception("FileNotFound", "RootFile::RootFile()")
347  << "File " << filename << " was not found or could not be opened.\n";
348  }
349  // filename is a valid LFN.
350  std::unique_ptr<TFile> result(TFile::Open(catalog.fileNames(0)[0].c_str()));
351  if (!result.get()) {
352  throw cms::Exception("FileNotFound", "RootFile::RootFile()")
353  << "File " << fileNames[0] << " was not found or could not be opened.\n";
354  }
355  return result;
356  }
357 
358  // Open the input file, returning the TFile object that represents it.
359  // The returned unique_ptr will not be null. The argument must not be null.
360  // We first try the file name as a PFN, so that the catalog and related
361  // services are not loaded unless needed.
362  std::unique_ptr<TFile> makeTFile(std::string const& filename) {
363  gErrorIgnoreLevel = kFatal;
364  std::unique_ptr<TFile> result(TFile::Open(filename.c_str()));
366  if (!result.get()) {
367  // Try again with catalog.
368  return makeTFileWithLookup(filename);
369  }
370  return result;
371  }
372 } // namespace
373 
374 static std::ostream& prettyPrint(std::ostream& os,
375  edm::ParameterSetEntry const& psetEntry,
376  std::string const& iIndent,
377  std::string const& iIndentDelta) {
378  char const* trackiness = (psetEntry.isTracked() ? "tracked" : "untracked");
379  os << "PSet " << trackiness << " = (";
380  prettyPrint(os, psetEntry.pset(), iIndent + iIndentDelta, iIndentDelta);
381  os << ")";
382  return os;
383 }
384 
385 static std::ostream& prettyPrint(std::ostream& os,
386  edm::VParameterSetEntry const& vpsetEntry,
387  std::string const& iIndent,
388  std::string const& iIndentDelta) {
389  std::vector<edm::ParameterSet> const& vps = vpsetEntry.vpset();
390  os << "VPSet " << (vpsetEntry.isTracked() ? "tracked" : "untracked") << " = ({" << std::endl;
391  std::string newIndent = iIndent + iIndentDelta;
393  std::string const between(",\n");
394  for (auto const& item : vps) {
395  os << start << newIndent;
396  prettyPrint(os, item, newIndent, iIndentDelta);
397  start = between;
398  }
399  if (!vps.empty()) {
400  os << std::endl;
401  }
402  os << iIndent << "})";
403  return os;
404 }
405 
406 static std::ostream& prettyPrint(std::ostream& oStream,
407  edm::ParameterSet const& iPSet,
408  std::string const& iIndent,
409  std::string const& iIndentDelta) {
410  std::string newIndent = iIndent + iIndentDelta;
411 
412  oStream << "{" << std::endl;
413  for (auto const& item : iPSet.tbl()) {
414  // indent a bit
415  oStream << newIndent << item.first << ": " << item.second << std::endl;
416  }
417  for (auto const& item : iPSet.psetTable()) {
418  // indent a bit
419  edm::ParameterSetEntry const& pe = item.second;
420  oStream << newIndent << item.first << ": ";
421  prettyPrint(oStream, pe, iIndent, iIndentDelta);
422  oStream << std::endl;
423  }
424  for (auto const& item : iPSet.vpsetTable()) {
425  // indent a bit
426  edm::VParameterSetEntry const& pe = item.second;
427  oStream << newIndent << item.first << ": ";
428  prettyPrint(oStream, pe, newIndent, iIndentDelta);
429  oStream << std::endl;
430  }
431  oStream << iIndent << "}";
432 
433  return oStream;
434 }
435 
437 public:
438  // It is illegal to call this constructor with a null pointer; a
439  // legal C-style string is required.
441  bool showDependencies,
442  bool extendedAncestors,
443  bool extendedDescendants,
444  bool excludeESModules,
445  bool showAllModules,
446  bool showTopLevelPSets,
447  std::vector<std::string> const& findMatch,
448  bool dontPrintProducts,
449  std::string const& dumpPSetID);
450 
451  ProvenanceDumper(ProvenanceDumper const&) = delete; // Disallow copying and moving
452  ProvenanceDumper& operator=(ProvenanceDumper const&) = delete; // Disallow copying and moving
453 
454  // Write the provenenace information to the given stream.
455  void dump();
456  void printErrors(std::ostream& os);
457  int exitCode() const;
458 
459 private:
460  void addAncestors(edm::BranchID const& branchID,
461  std::set<edm::BranchID>& ancestorBranchIDs,
462  std::ostringstream& sout,
463  std::map<edm::BranchID, std::set<edm::ParentageID>>& perProductParentage) const;
464 
465  void addDescendants(edm::BranchID const& branchID,
466  std::set<edm::BranchID>& descendantBranchIDs,
467  std::ostringstream& sout,
468  std::map<edm::BranchID, std::set<edm::BranchID>>& parentToChildren) const;
469 
473  std::stringstream errorLog_;
479  HistoryNode historyGraph_;
487  std::vector<std::string> findMatch_;
490 
491  void work_();
492  void dumpProcessHistory_();
496 };
497 
499  bool showDependencies,
500  bool extendedAncestors,
501  bool extendedDescendants,
502  bool excludeESModules,
503  bool showOtherModules,
504  bool showTopLevelPSets,
505  std::vector<std::string> const& findMatch,
506  bool dontPrintProducts,
507  std::string const& dumpPSetID)
508  : filename_(filename),
509  inputFile_(makeTFile(filename)),
510  exitCode_(0),
511  errorLog_(),
512  errorCount_(0),
513  showDependencies_(showDependencies),
514  extendedAncestors_(extendedAncestors),
515  extendedDescendants_(extendedDescendants),
516  excludeESModules_(excludeESModules),
517  showOtherModules_(showOtherModules),
518  productRegistryPresent_(true),
519  showTopLevelPSets_(showTopLevelPSets),
520  findMatch_(findMatch),
521  dontPrintProducts_(dontPrintProducts),
522  dumpPSetID_(dumpPSetID) {}
523 
525 
526 void ProvenanceDumper::printErrors(std::ostream& os) {
527  if (errorCount_ > 0)
528  os << errorLog_.str() << std::endl;
529 }
530 
531 int ProvenanceDumper::exitCode() const { return exitCode_; }
532 
534  edm::EventSelectionIDVector::size_type num_ids = ids.size();
535  if (num_ids == 0) {
536  std::cout << "No event filtering information is available.\n";
537  std::cout << "------------------------------\n";
538  } else {
539  std::cout << "Event filtering information for " << num_ids << " processing steps is available.\n"
540  << "The ParameterSets will be printed out, "
541  << "with the oldest printed first.\n";
542  for (edm::EventSelectionIDVector::size_type i = 0; i != num_ids; ++i) {
544  }
545  }
546 }
547 
549  TTree* history = dynamic_cast<TTree*>(file->Get(edm::poolNames::eventHistoryTreeName().c_str()));
550  if (history != nullptr) {
551  edm::History h;
552  edm::History* ph = &h;
553 
554  history->SetBranchAddress(edm::poolNames::eventHistoryBranchName().c_str(), &ph);
555  if (history->GetEntry(0) <= 0) {
556  std::cout << "No event filtering information is available; the event history tree has no entries\n";
557  } else {
558  dumpEventFilteringParameterSets(h.eventSelectionIDs());
559  }
560  } else {
561  TTree* events = dynamic_cast<TTree*>(file->Get(edm::poolNames::eventTreeName().c_str()));
562  assert(events != nullptr);
563  TBranch* eventSelectionsBranch = events->GetBranch(edm::poolNames::eventSelectionsBranchName().c_str());
564  if (eventSelectionsBranch == nullptr)
565  return;
567  edm::EventSelectionIDVector* pids = &ids;
568  eventSelectionsBranch->SetAddress(&pids);
569  if (eventSelectionsBranch->GetEntry(0) <= 0) {
570  std::cout << "No event filtering information is available; the event selections branch has no entries\n";
571  } else {
573  }
574  }
575 }
576 
578  std::cout << "ParameterSetID: " << id << '\n';
579  if (id.isValid()) {
580  ParameterSetMap::const_iterator i = psm_.find(id);
581  if (i == psm_.end()) {
582  std::cout << "We are unable to find the corresponding ParameterSet\n";
584  empty.registerIt();
585  if (id == empty.id()) {
586  std::cout << "But it would have been empty anyway\n";
587  }
588  } else {
589  edm::ParameterSet ps(i->second.pset());
590  prettyPrint(std::cout, ps, " ", " ");
591  std::cout << '\n';
592  }
593  } else {
594  std::cout << "This ID is not valid\n";
595  }
596  std::cout << " -------------------------\n";
597 }
598 
600  std::cout << "Processing History:" << std::endl;
601  std::map<edm::ProcessConfigurationID, unsigned int> simpleIDs;
602  for (auto const& ph : phv_) {
603  //loop over the history entries looking for matches
604  HistoryNode* parent = &historyGraph_;
605  for (auto const& pc : ph) {
606  if (parent->size() == 0) {
607  unsigned int id = simpleIDs[pc.id()];
608  if (0 == id) {
609  id = 1;
610  simpleIDs[pc.id()] = id;
611  }
612  parent->addChild(HistoryNode(pc, id));
613  parent = parent->lastChildAddress();
614  } else {
615  //see if this is unique
616  bool isUnique = true;
617  for (auto& child : *parent) {
618  if (child.configurationID() == pc.id()) {
619  isUnique = false;
620  parent = &child;
621  break;
622  }
623  }
624  if (isUnique) {
625  simpleIDs[pc.id()] = parent->size() + 1;
626  parent->addChild(HistoryNode(pc, simpleIDs[pc.id()]));
627  parent = parent->lastChildAddress();
628  }
629  }
630  }
631  }
632  historyGraph_.printHistory();
633 }
634 
636  TTree* meta = dynamic_cast<TTree*>(inputFile_->Get(edm::poolNames::metaDataTreeName().c_str()));
637  assert(nullptr != meta);
638 
639  edm::ProductRegistry* pReg = &reg_;
640  if (meta->FindBranch(edm::poolNames::productDescriptionBranchName().c_str()) != nullptr) {
641  meta->SetBranchAddress(edm::poolNames::productDescriptionBranchName().c_str(), &pReg);
642  } else {
643  productRegistryPresent_ = false;
644  }
645 
646  ParameterSetMap* pPsm = &psm_;
647  if (meta->FindBranch(edm::poolNames::parameterSetMapBranchName().c_str()) != nullptr) {
648  meta->SetBranchAddress(edm::poolNames::parameterSetMapBranchName().c_str(), &pPsm);
649  } else {
650  TTree* psetTree = dynamic_cast<TTree*>(inputFile_->Get(edm::poolNames::parameterSetsTreeName().c_str()));
651  assert(nullptr != psetTree);
652  typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
653  IdToBlobs idToBlob;
654  IdToBlobs* pIdToBlob = &idToBlob;
655  psetTree->SetBranchAddress(edm::poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
656  for (long long i = 0; i != psetTree->GetEntries(); ++i) {
657  psetTree->GetEntry(i);
658  psm_.insert(idToBlob);
659  }
660  }
661 
663  if (meta->FindBranch(edm::poolNames::processHistoryBranchName().c_str()) != nullptr) {
664  meta->SetBranchAddress(edm::poolNames::processHistoryBranchName().c_str(), &pPhv);
665  }
666 
668  edm::ProcessHistoryMap* pPhm = &phm;
669  if (meta->FindBranch(edm::poolNames::processHistoryMapBranchName().c_str()) != nullptr) {
670  meta->SetBranchAddress(edm::poolNames::processHistoryMapBranchName().c_str(), &pPhm);
671  }
672 
673  if (meta->FindBranch(edm::poolNames::moduleDescriptionMapBranchName().c_str()) != nullptr) {
674  if (meta->GetBranch(edm::poolNames::moduleDescriptionMapBranchName().c_str())->GetSplitLevel() != 0) {
675  meta->SetBranchStatus((edm::poolNames::moduleDescriptionMapBranchName() + ".*").c_str(), false);
676  } else {
677  meta->SetBranchStatus(edm::poolNames::moduleDescriptionMapBranchName().c_str(), false);
678  }
679  }
680 
681  meta->GetEntry(0);
682  assert(nullptr != pReg);
683 
685  for (auto const& item : psm_) {
686  edm::ParameterSet pset(item.second.pset());
687  pset.setID(item.first);
688  psetRegistry.insertMapped(pset);
689  }
690 
691  if (!phv_.empty()) {
692  for (auto const& history : phv_) {
693  for (auto const& process : history) {
694  phc_.push_back(process);
695  }
696  }
698  phc_.erase(std::unique(phc_.begin(), phc_.end()), phc_.end());
699 
700  }
701  // backward compatibility
702  else if (!phm.empty()) {
703  for (auto const& history : phm) {
704  phv_.push_back(history.second);
705  for (auto const& process : history.second) {
706  phc_.push_back(process);
707  }
708  }
710  phc_.erase(std::unique(phc_.begin(), phc_.end()), phc_.end());
711  }
712 
713  if (!dumpPSetID_.empty()) {
714  edm::ParameterSetID psetID;
715  try {
717  } catch (cms::Exception const& x) {
718  throw cms::Exception("Command Line Argument")
719  << "Illegal ParameterSetID string. It should contain 32 hexadecimal characters";
720  }
721  dumpParameterSetForID_(psetID);
722  return;
723  }
724 
725  //Prepare the parentage information if requested
726  std::map<edm::BranchID, std::set<edm::ParentageID>> perProductParentage;
727 
729  TTree* parentageTree = dynamic_cast<TTree*>(inputFile_->Get(edm::poolNames::parentageTreeName().c_str()));
730  if (nullptr == parentageTree) {
731  std::cerr << "ERROR, no Parentage tree available so cannot show dependencies, ancestors, or descendants.\n";
732  std::cerr << "Possibly this is not a standard EDM format file. For example, dependency, ancestor, and\n";
733  std::cerr << "descendant options to edmProvDump will not work with nanoAOD format files.\n\n";
734  showDependencies_ = false;
735  extendedAncestors_ = false;
736  extendedDescendants_ = false;
737  } else {
739 
740  std::vector<edm::ParentageID> orderedParentageIDs;
741  orderedParentageIDs.reserve(parentageTree->GetEntries());
742  for (Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
743  edm::Parentage parentageBuffer;
744  edm::Parentage* pParentageBuffer = &parentageBuffer;
745  parentageTree->SetBranchAddress(edm::poolNames::parentageBranchName().c_str(), &pParentageBuffer);
746  parentageTree->GetEntry(i);
747  registry.insertMapped(parentageBuffer);
748  orderedParentageIDs.push_back(parentageBuffer.id());
749  }
750  parentageTree->SetBranchAddress(edm::poolNames::parentageBranchName().c_str(), nullptr);
751 
752  TTree* eventMetaTree =
753  dynamic_cast<TTree*>(inputFile_->Get(edm::BranchTypeToMetaDataTreeName(edm::InEvent).c_str()));
754  if (nullptr == eventMetaTree) {
755  eventMetaTree = dynamic_cast<TTree*>(inputFile_->Get(edm::BranchTypeToProductTreeName(edm::InEvent).c_str()));
756  }
757  if (nullptr == eventMetaTree) {
759  << "' Tree in file so can not show dependencies\n";
760  showDependencies_ = false;
761  extendedAncestors_ = false;
762  extendedDescendants_ = false;
763  } else {
764  TBranch* storedProvBranch =
765  eventMetaTree->GetBranch(edm::BranchTypeToProductProvenanceBranchName(edm::InEvent).c_str());
766 
767  if (nullptr != storedProvBranch) {
768  std::vector<edm::StoredProductProvenance> info;
769  std::vector<edm::StoredProductProvenance>* pInfo = &info;
770  storedProvBranch->SetAddress(&pInfo);
771  for (Long64_t i = 0, numEntries = eventMetaTree->GetEntries(); i < numEntries; ++i) {
772  storedProvBranch->GetEntry(i);
773  for (auto const& item : info) {
774  edm::BranchID bid(item.branchID_);
775  perProductParentage[bid].insert(orderedParentageIDs.at(item.parentageIDIndex_));
776  }
777  }
778  } else {
779  //backwards compatible check
780  TBranch* productProvBranch =
781  eventMetaTree->GetBranch(edm::BranchTypeToBranchEntryInfoBranchName(edm::InEvent).c_str());
782  if (nullptr != productProvBranch) {
783  std::vector<edm::ProductProvenance> info;
784  std::vector<edm::ProductProvenance>* pInfo = &info;
785  productProvBranch->SetAddress(&pInfo);
786  for (Long64_t i = 0, numEntries = eventMetaTree->GetEntries(); i < numEntries; ++i) {
787  productProvBranch->GetEntry(i);
788  for (auto const& item : info) {
789  perProductParentage[item.branchID()].insert(item.parentageID());
790  }
791  }
792  } else {
793  std::cerr << " ERROR, could not find provenance information so can not show dependencies\n";
794  showDependencies_ = false;
795  extendedAncestors_ = false;
796  extendedDescendants_ = false;
797  }
798  }
799  }
800  }
801  }
802 
803  std::map<edm::BranchID, std::set<edm::BranchID>> parentToChildren;
805 
806  if (extendedDescendants_) {
807  for (auto const& itParentageSet : perProductParentage) {
808  edm::BranchID childBranchID = itParentageSet.first;
809  for (auto const& itParentageID : itParentageSet.second) {
810  edm::Parentage const* parentage = registry.getMapped(itParentageID);
811  if (nullptr != parentage) {
812  for (auto const& branch : parentage->parents()) {
813  parentToChildren[branch].insert(childBranchID);
814  }
815  } else {
816  std::cerr << " ERROR:parentage info not in registry ParentageID=" << itParentageID << std::endl;
817  }
818  }
819  }
820  }
821 
823 
825 
827  std::cout << "---------Producers with data in file---------" << std::endl;
828  }
829 
830  //using edm::ParameterSetID as the key does not work
831  // typedef std::map<edm::ParameterSetID, std::vector<edm::BranchDescription> > IdToBranches
832  ModuleToIdBranches moduleToIdBranches;
833  //IdToBranches idToBranches;
834 
835  std::map<edm::BranchID, std::string> branchIDToBranchName;
836 
837  for (auto const& processConfig : phc_) {
838  edm::ParameterSet const* processParameterSet =
839  edm::pset::Registry::instance()->getMapped(processConfig.parameterSetID());
840  if (nullptr == processParameterSet || processParameterSet->empty()) {
841  continue;
842  }
843  for (auto& item : reg_.productListUpdator()) {
844  auto& product = item.second;
845  if (product.processName() != processConfig.processName()) {
846  continue;
847  }
848  //force it to rebuild the branch name
849  product.init();
850  setIsMergeable(product);
851 
853  branchIDToBranchName[product.branchID()] = product.branchName();
854  }
855  /*
856  std::cout << product.branchName()
857  << " id " << product.productID() << std::endl;
858  */
859  std::string moduleLabel = product.moduleLabel();
860  if (moduleLabel == source) {
861  moduleLabel = input;
862  } else if (moduleLabel == triggerResults) {
864  }
865 
866  std::stringstream s;
867 
868  if (processParameterSet->existsAs<edm::ParameterSet>(moduleLabel)) {
869  edm::ParameterSet const& moduleParameterSet = processParameterSet->getParameterSet(moduleLabel);
870  if (!moduleParameterSet.isRegistered()) {
871  edm::ParameterSet moduleParameterSetCopy = processParameterSet->getParameterSet(moduleLabel);
872  moduleParameterSetCopy.registerIt();
873  s << moduleParameterSetCopy.id();
874  } else {
875  s << moduleParameterSet.id();
876  }
877  moduleToIdBranches[std::make_pair(product.processName(), product.moduleLabel())][s.str()].push_back(product);
878  }
879  }
880  }
881 
882  for (auto const& item : moduleToIdBranches) {
883  std::ostringstream sout;
884  sout << "Module: " << item.first.second << " " << item.first.first << std::endl;
885  std::set<edm::BranchID> allBranchIDsForLabelAndProcess;
886  IdToBranches const& idToBranches = item.second;
887  for (auto const& idBranch : idToBranches) {
888  sout << " PSet id:" << idBranch.first << std::endl;
889  if (!dontPrintProducts_) {
890  sout << " products: {" << std::endl;
891  }
892  std::set<edm::BranchID> branchIDs;
893  for (auto const& branch : idBranch.second) {
894  if (!dontPrintProducts_) {
895  sout << " " << branch.branchName() << std::endl;
896  }
897  branchIDs.insert(branch.branchID());
898  allBranchIDsForLabelAndProcess.insert(branch.branchID());
899  }
900  sout << " }" << std::endl;
901  edm::ParameterSetID psid(idBranch.first);
902  ParameterSetMap::const_iterator itpsm = psm_.find(psid);
903  if (psm_.end() == itpsm) {
904  ++errorCount_;
905  errorLog_ << "No ParameterSetID for " << psid << std::endl;
906  exitCode_ = 1;
907  } else {
908  sout << " parameters: ";
909  prettyPrint(sout, edm::ParameterSet((*itpsm).second.pset()), " ", " ");
910  sout << std::endl;
911  }
912  if (showDependencies_) {
913  sout << " dependencies: {" << std::endl;
914  std::set<edm::ParentageID> parentageIDs;
915  for (auto const& branch : branchIDs) {
916  //Save these BranchIDs
917  std::set<edm::ParentageID> const& temp = perProductParentage[branch];
918  parentageIDs.insert(temp.begin(), temp.end());
919  }
920  for (auto const& parentID : parentageIDs) {
921  edm::Parentage const* parentage = registry.getMapped(parentID);
922  if (nullptr != parentage) {
923  for (auto const& branch : parentage->parents()) {
924  sout << " " << branchIDToBranchName[branch] << std::endl;
925  }
926  } else {
927  sout << " ERROR:parentage info not in registry ParentageID=" << parentID << std::endl;
928  }
929  }
930  if (parentageIDs.empty()) {
931  sout << " no dependencies recorded (event may not contain data from this module)" << std::endl;
932  }
933  sout << " }" << std::endl;
934  }
935  } // end loop over PSetIDs
936  if (extendedAncestors_) {
937  sout << " extendedAncestors: {" << std::endl;
938  std::set<edm::BranchID> ancestorBranchIDs;
939  for (auto const& branchID : allBranchIDsForLabelAndProcess) {
940  addAncestors(branchID, ancestorBranchIDs, sout, perProductParentage);
941  }
942  for (auto const& ancestorBranchID : ancestorBranchIDs) {
943  sout << " " << branchIDToBranchName[ancestorBranchID] << "\n";
944  }
945  sout << " }" << std::endl;
946  }
947 
948  if (extendedDescendants_) {
949  sout << " extendedDescendants: {" << std::endl;
950  std::set<edm::BranchID> descendantBranchIDs;
951  for (auto const& branchID : allBranchIDsForLabelAndProcess) {
952  addDescendants(branchID, descendantBranchIDs, sout, parentToChildren);
953  }
954  for (auto const& descendantBranchID : descendantBranchIDs) {
955  sout << " " << branchIDToBranchName[descendantBranchID] << "\n";
956  }
957  sout << " }" << std::endl;
958  }
959  bool foundMatch = true;
960  if (!findMatch_.empty()) {
961  for (auto const& stringToFind : findMatch_) {
962  if (sout.str().find(stringToFind) == std::string::npos) {
963  foundMatch = false;
964  break;
965  }
966  }
967  }
968  if (foundMatch) {
969  std::cout << sout.str() << std::endl;
970  }
971  } // end loop over module label/process
972 
974  std::cout << "---------Other Modules---------" << std::endl;
975  historyGraph_.printOtherModulesHistory(psm_, moduleToIdBranches, findMatch_, errorLog_);
976  } else if (!productRegistryPresent_) {
977  std::cout << "---------All Modules---------" << std::endl;
978  historyGraph_.printOtherModulesHistory(psm_, moduleToIdBranches, findMatch_, errorLog_);
979  }
980 
981  if (!excludeESModules_) {
982  std::cout << "---------EventSetup---------" << std::endl;
983  historyGraph_.printEventSetupHistory(psm_, findMatch_, errorLog_);
984  }
985 
986  if (showTopLevelPSets_) {
987  std::cout << "---------Top Level PSets---------" << std::endl;
988  historyGraph_.printTopLevelPSetsHistory(psm_, findMatch_, errorLog_);
989  }
990  if (errorCount_ != 0) {
991  exitCode_ = 1;
992  }
993 }
994 
996  std::set<edm::BranchID>& ancestorBranchIDs,
997  std::ostringstream& sout,
998  std::map<edm::BranchID, std::set<edm::ParentageID>>& perProductParentage) const {
1000 
1001  std::set<edm::ParentageID> const& parentIDs = perProductParentage[branchID];
1002  for (auto const& parentageID : parentIDs) {
1003  edm::Parentage const* parentage = registry.getMapped(parentageID);
1004  if (nullptr != parentage) {
1005  for (auto const& branch : parentage->parents()) {
1006  if (ancestorBranchIDs.insert(branch).second) {
1007  addAncestors(branch, ancestorBranchIDs, sout, perProductParentage);
1008  }
1009  }
1010  } else {
1011  sout << " ERROR:parentage info not in registry ParentageID=" << parentageID << std::endl;
1012  }
1013  }
1014 }
1015 
1017  std::set<edm::BranchID>& descendantBranchIDs,
1018  std::ostringstream& sout,
1019  std::map<edm::BranchID, std::set<edm::BranchID>>& parentToChildren) const {
1020  for (auto const& childBranchID : parentToChildren[branchID]) {
1021  if (descendantBranchIDs.insert(childBranchID).second) {
1022  addDescendants(childBranchID, descendantBranchIDs, sout, parentToChildren);
1023  }
1024  }
1025 }
1026 
1027 static char const* const kSortOpt = "sort";
1028 static char const* const kSortCommandOpt = "sort,s";
1029 static char const* const kDependenciesOpt = "dependencies";
1030 static char const* const kDependenciesCommandOpt = "dependencies,d";
1031 static char const* const kExtendedAncestorsOpt = "extendedAncestors";
1032 static char const* const kExtendedAncestorsCommandOpt = "extendedAncestors,x";
1033 static char const* const kExtendedDescendantsOpt = "extendedDescendants";
1034 static char const* const kExtendedDescendantsCommandOpt = "extendedDescendants,c";
1035 static char const* const kExcludeESModulesOpt = "excludeESModules";
1036 static char const* const kExcludeESModulesCommandOpt = "excludeESModules,e";
1037 static char const* const kShowAllModulesOpt = "showAllModules";
1038 static char const* const kShowAllModulesCommandOpt = "showAllModules,a";
1039 static char const* const kFindMatchOpt = "findMatch";
1040 static char const* const kFindMatchCommandOpt = "findMatch,f";
1041 static char const* const kDontPrintProductsOpt = "dontPrintProducts";
1042 static char const* const kDontPrintProductsCommandOpt = "dontPrintProducts,p";
1043 static char const* const kShowTopLevelPSetsOpt = "showTopLevelPSets";
1044 static char const* const kShowTopLevelPSetsCommandOpt = "showTopLevelPSets,t";
1045 static char const* const kHelpOpt = "help";
1046 static char const* const kHelpCommandOpt = "help,h";
1047 static char const* const kFileNameOpt = "input-file";
1048 static char const* const kDumpPSetIDOpt = "dumpPSetID";
1049 static char const* const kDumpPSetIDCommandOpt = "dumpPSetID,i";
1050 
1051 int main(int argc, char* argv[]) {
1052  using namespace boost::program_options;
1053 
1054  std::string descString(argv[0]);
1055  descString += " [options] <filename>";
1056  descString += "\nAllowed options";
1057  options_description desc(descString);
1058  desc.add_options()(kHelpCommandOpt, "show help message")(kSortCommandOpt, "alphabetially sort EventSetup components")(
1059  kDependenciesCommandOpt, "print what data each EDProducer is directly dependent upon")(
1060  kExtendedAncestorsCommandOpt, "print what data each EDProducer is dependent upon including indirect dependences")(
1062  "print what data depends on the data each EDProducer produces including indirect dependences")(
1063  kExcludeESModulesCommandOpt, "do not print ES module information")(
1064  kShowAllModulesCommandOpt, "show all modules (not just those that created data in the file)")(
1065  kShowTopLevelPSetsCommandOpt, "show all top level PSets")(
1067  boost::program_options::value<std::vector<std::string>>(),
1068  "show only modules whose information contains the matching string (or all the matching strings, this option can "
1069  "be repeated with different strings)")(kDontPrintProductsCommandOpt, "do not print products produced by module")(
1071  value<std::string>(),
1072  "print the parameter set associated with the parameter set ID string (and print nothing else)");
1073  //we don't want users to see these in the help messages since this
1074  // name only exists since the parser needs it
1075  options_description hidden;
1076  hidden.add_options()(kFileNameOpt, value<std::string>(), "file name");
1077 
1078  //full list of options for the parser
1079  options_description cmdline_options;
1080  cmdline_options.add(desc).add(hidden);
1081 
1082  positional_options_description p;
1083  p.add(kFileNameOpt, -1);
1084 
1085  variables_map vm;
1086  try {
1087  store(command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm);
1088  notify(vm);
1089  } catch (error const& iException) {
1090  std::cerr << iException.what();
1091  return 1;
1092  }
1093 
1094  if (vm.count(kHelpOpt)) {
1095  std::cout << desc << std::endl;
1096  return 0;
1097  }
1098 
1099  if (vm.count(kSortOpt)) {
1100  HistoryNode::sort_ = true;
1101  }
1102 
1103  bool showDependencies = false;
1104  if (vm.count(kDependenciesOpt)) {
1105  showDependencies = true;
1106  }
1107 
1108  bool extendedAncestors = false;
1109  if (vm.count(kExtendedAncestorsOpt)) {
1110  extendedAncestors = true;
1111  }
1112 
1113  bool extendedDescendants = false;
1114  if (vm.count(kExtendedDescendantsOpt)) {
1115  extendedDescendants = true;
1116  }
1117 
1118  bool excludeESModules = false;
1119  if (vm.count(kExcludeESModulesOpt)) {
1120  excludeESModules = true;
1121  }
1122 
1123  bool showAllModules = false;
1124  if (vm.count(kShowAllModulesOpt)) {
1125  showAllModules = true;
1126  }
1127 
1128  bool showTopLevelPSets = false;
1129  if (vm.count(kShowTopLevelPSetsOpt)) {
1130  showTopLevelPSets = true;
1131  }
1132 
1134  if (vm.count(kFileNameOpt)) {
1135  try {
1136  fileName = vm[kFileNameOpt].as<std::string>();
1137  } catch (boost::bad_any_cast const& e) {
1138  std::cout << e.what() << std::endl;
1139  return 2;
1140  }
1141  } else {
1142  std::cout << "Data file not specified." << std::endl;
1143  std::cout << desc << std::endl;
1144  return 2;
1145  }
1146 
1147  std::string dumpPSetID;
1148  if (vm.count(kDumpPSetIDOpt)) {
1149  try {
1150  dumpPSetID = vm[kDumpPSetIDOpt].as<std::string>();
1151  } catch (boost::bad_any_cast const& e) {
1152  std::cout << e.what() << std::endl;
1153  return 2;
1154  }
1155  }
1156 
1157  std::vector<std::string> findMatch;
1158  if (vm.count(kFindMatchOpt)) {
1159  try {
1160  findMatch = vm[kFindMatchOpt].as<std::vector<std::string>>();
1161  } catch (boost::bad_any_cast const& e) {
1162  std::cout << e.what() << std::endl;
1163  return 2;
1164  }
1165  }
1166 
1167  bool dontPrintProducts = false;
1168  if (vm.count(kDontPrintProductsOpt)) {
1169  dontPrintProducts = true;
1170  }
1171 
1172  //silence ROOT warnings about missing dictionaries
1174 
1175  ProvenanceDumper dumper(fileName,
1176  showDependencies,
1177  extendedAncestors,
1178  extendedDescendants,
1179  excludeESModules,
1180  showAllModules,
1181  showTopLevelPSets,
1182  findMatch,
1183  dontPrintProducts,
1184  dumpPSetID);
1185  int exitCode(0);
1186  try {
1187  dumper.dump();
1188  exitCode = dumper.exitCode();
1189  } catch (cms::Exception const& x) {
1190  std::cerr << "cms::Exception caught\n";
1191  std::cerr << x.what() << '\n';
1192  exitCode = 2;
1193  } catch (std::exception& x) {
1194  std::cerr << "std::exception caught\n";
1195  std::cerr << x.what() << '\n';
1196  exitCode = 3;
1197  } catch (...) {
1198  std::cerr << "Unknown exception caught\n";
1199  exitCode = 4;
1200  }
1201 
1202  dumper.printErrors(std::cerr);
1203  return exitCode;
1204 }
edm::ParameterSet::registerIt
ParameterSet const & registerIt()
Definition: ParameterSet.cc:113
edm::poolNames::idToParameterSetBlobsBranchName
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:206
edm::ParameterSetID
Hash< ParameterSetType > ParameterSetID
Definition: ParameterSetID.h:21
kExtendedDescendantsOpt
static char const *const kExtendedDescendantsOpt
Definition: EdmProvDump.cc:1033
edm::pset::Registry::instance
static Registry * instance()
Definition: Registry.cc:12
edm::Parentage::parents
std::vector< BranchID > const & parents() const
Definition: Parentage.h:44
kShowAllModulesCommandOpt
static char const *const kShowAllModulesCommandOpt
Definition: EdmProvDump.cc:1038
cmsBatch.argv
argv
Definition: cmsBatch.py:279
mps_fire.i
i
Definition: mps_fire.py:428
start
Definition: start.py:1
input
static const std::string input
Definition: EdmProvDump.cc:48
ServiceRegistry.h
eventSetupComponent
std::string eventSetupComponent(char const *iType, std::string const &iCompName, edm::ParameterSet const &iProcessConfig, std::string const &iProcessName)
Definition: EdmProvDump.cc:133
kDependenciesCommandOpt
static char const *const kDependenciesCommandOpt
Definition: EdmProvDump.cc:1030
ProvenanceDumper::reg_
edm::ProductRegistry reg_
Definition: EdmProvDump.cc:475
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
ProvenanceDumper::phv_
edm::ProcessHistoryVector phv_
Definition: EdmProvDump.cc:477
kShowTopLevelPSetsOpt
static char const *const kShowTopLevelPSetsOpt
Definition: EdmProvDump.cc:1043
edm::poolNames::eventTreeName
std::string const & eventTreeName()
Definition: BranchType.cc:208
kExcludeESModulesOpt
static char const *const kExcludeESModulesOpt
Definition: EdmProvDump.cc:1035
main
int main(int argc, char *argv[])
Definition: EdmProvDump.cc:1051
IdToBranches
std::map< std::string, std::vector< edm::BranchDescription > > IdToBranches
Definition: EdmProvDump.cc:37
getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition: getEcalConditions_orcoffint2r_cff.py:40
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
ProvenanceDumper::findMatch_
std::vector< std::string > findMatch_
Definition: EdmProvDump.cc:487
edm::setIsMergeable
void setIsMergeable(BranchDescription &)
Definition: setIsMergeable.cc:15
edm::sort_all
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
dir2webdir.argc
argc
Definition: dir2webdir.py:39
propagate_const.h
ProvenanceDumper::printErrors
void printErrors(std::ostream &os)
Definition: EdmProvDump.cc:526
modules
Definition: ZHLTMatchFilter.cc:17
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:178
kExtendedDescendantsCommandOpt
static char const *const kExtendedDescendantsCommandOpt
Definition: EdmProvDump.cc:1034
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
ParameterSetBlob.h
prettyPrint
static std::ostream & prettyPrint(std::ostream &oStream, edm::ParameterSet const &iPSet, std::string const &iIndent, std::string const &iIndentDelta)
Definition: EdmProvDump.cc:406
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParentageRegistry::instance
static ParentageRegistry * instance()
Definition: ParentageRegistry.cc:4
edm::VParameterSetEntry::isTracked
bool isTracked() const
Definition: VParameterSetEntry.h:41
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
edm::poolNames::parameterSetsTreeName
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:204
ModuleToIdBranches
std::map< std::pair< std::string, std::string >, IdToBranches > ModuleToIdBranches
Definition: EdmProvDump.cc:38
Algorithms.h
cms::cuda::assert
assert(be >=bs)
edm::propagate_const::get
constexpr element_type const * get() const
Definition: propagate_const.h:64
ProvenanceDumper::dumpParameterSetForID_
void dumpParameterSetForID_(edm::ParameterSetID const &id)
Definition: EdmProvDump.cc:577
bookConverter.results
results
Definition: bookConverter.py:144
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
CalibrationSummaryClient_cfi.sources
sources
Definition: CalibrationSummaryClient_cfi.py:23
ProvenanceDumper::showTopLevelPSets_
bool showTopLevelPSets_
Definition: EdmProvDump.cc:486
edm::BranchTypeToProductTreeName
std::string const & BranchTypeToProductTreeName(BranchType const &branchType)
Definition: BranchType.cc:93
ProcessHistoryRegistry.h
edm::InputFileCatalog
Definition: InputFileCatalog.h:32
ProvenanceDumper::showOtherModules_
bool showOtherModules_
Definition: EdmProvDump.cc:484
ProductRegistry.h
DDAxes::x
edm::ParameterSet::id
ParameterSetID id() const
Definition: ParameterSet.cc:189
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
edm::ParameterSet::tbl
table const & tbl() const
Definition: ParameterSet.h:233
InputFileCatalog.h
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
kExtendedAncestorsOpt
static char const *const kExtendedAncestorsOpt
Definition: EdmProvDump.cc:1031
kExcludeESModulesCommandOpt
static char const *const kExcludeESModulesCommandOpt
Definition: EdmProvDump.cc:1036
Parentage.h
kFindMatchOpt
static char const *const kFindMatchOpt
Definition: EdmProvDump.cc:1039
kFindMatchCommandOpt
static char const *const kFindMatchCommandOpt
Definition: EdmProvDump.cc:1040
patZpeak.events
events
Definition: patZpeak.py:20
ProvenanceDumper
Definition: EdmProvDump.cc:436
appendToSet
static void appendToSet(std::set< std::string > &iSet, std::vector< std::string > const &iFrom)
Definition: EdmProvDump.cc:260
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
relativeConstraints.error
error
Definition: relativeConstraints.py:53
ProvenanceDumper::exitCode
int exitCode() const
Definition: EdmProvDump.cc:531
kFileNameOpt
static char const *const kFileNameOpt
Definition: EdmProvDump.cc:1047
edm::VParameterSetEntry::vpset
std::vector< ParameterSet > const & vpset() const
returns the VPSet
Definition: VParameterSetEntry.cc:67
edm::BranchTypeToBranchEntryInfoBranchName
std::string const & BranchTypeToBranchEntryInfoBranchName(BranchType const &branchType)
Definition: BranchType.cc:127
ProvenanceDumper::phc_
edm::ProcessConfigurationVector phc_
Definition: EdmProvDump.cc:476
edm::ProductRegistry
Definition: ProductRegistry.h:37
edm::ParameterSetMap
std::map< ParameterSetID, ParameterSetBlob > ParameterSetMap
Definition: ParameterSetConverter.h:39
edm::ParameterSet::psetTable
psettable const & psetTable() const
Definition: ParameterSet.h:236
edm::ServiceToken
Definition: ServiceToken.h:40
edm::ProcessHistoryMap
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap
Definition: ProcessHistoryRegistry.h:15
ProvenanceDumper::errorCount_
int errorCount_
Definition: EdmProvDump.cc:474
ParentageRegistry.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::propagate_const
Definition: propagate_const.h:32
edm::poolNames::parentageBranchName
std::string const & parentageBranchName()
Definition: BranchType.cc:149
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
edm::ProductRegistry::productListUpdator
ProductList & productListUpdator()
Definition: ProductRegistry.h:81
edm::poolNames::processHistoryBranchName
std::string const & processHistoryBranchName()
Definition: BranchType.cc:170
ProductProvenance.h
ProvenanceDumper::inputFile_
edm::propagate_const< std::unique_ptr< TFile > > inputFile_
Definition: EdmProvDump.cc:471
edm::Parentage::id
ParentageID id() const
Definition: Parentage.cc:17
edm::BranchID
Definition: BranchID.h:14
ProvenanceDumper::extendedDescendants_
bool extendedDescendants_
Definition: EdmProvDump.cc:482
mps_fire.end
end
Definition: mps_fire.py:242
source
static const std::string source
Definition: EdmProvDump.cc:47
StoredProductProvenance.h
ProvenanceDumper::extendedAncestors_
bool extendedAncestors_
Definition: EdmProvDump.cc:481
kDumpPSetIDCommandOpt
static char const *const kDumpPSetIDCommandOpt
Definition: EdmProvDump.cc:1049
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
edm::Hash< ParameterSetType >
edm::InEvent
Definition: BranchType.h:11
h
edm::poolNames::parameterSetMapBranchName
std::string const & parameterSetMapBranchName()
Definition: BranchType.cc:161
ProvenanceDumper::psm_
ParameterSetMap psm_
Definition: EdmProvDump.cc:478
edm::poolNames::parentageTreeName
std::string const & parentageTreeName()
Definition: BranchType.cc:147
utils.gErrorIgnoreLevel
gErrorIgnoreLevel
Definition: utils.py:27
ProvenanceDumper::addDescendants
void addDescendants(edm::BranchID const &branchID, std::set< edm::BranchID > &descendantBranchIDs, std::ostringstream &sout, std::map< edm::BranchID, std::set< edm::BranchID >> &parentToChildren) const
Definition: EdmProvDump.cc:1016
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::numEntries
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
edm::Parentage
Definition: Parentage.h:25
ProvenanceDumper::work_
void work_()
Definition: EdmProvDump.cc:635
ProvenanceDumper::productRegistryPresent_
bool productRegistryPresent_
Definition: EdmProvDump.cc:485
kDependenciesOpt
static char const *const kDependenciesOpt
Definition: EdmProvDump.cc:1029
ProvenanceDumper::dontPrintProducts_
bool dontPrintProducts_
Definition: EdmProvDump.cc:488
kDumpPSetIDOpt
static char const *const kDumpPSetIDOpt
Definition: EdmProvDump.cc:1048
edm::poolNames::eventSelectionsBranchName
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:200
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
funct::true
true
Definition: Factorize.h:173
ProvenanceDumper::operator=
ProvenanceDumper & operator=(ProvenanceDumper const &)=delete
edm::ParameterSet
Definition: ParameterSet.h:47
kShowAllModulesOpt
static char const *const kShowAllModulesOpt
Definition: EdmProvDump.cc:1037
ProvenanceDumper::dumpEventFilteringParameterSets_
void dumpEventFilteringParameterSets_(TFile *file)
Definition: EdmProvDump.cc:548
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
edm::poolNames::productDescriptionBranchName
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:155
edm::ParentageRegistry::getMapped
bool getMapped(key_type const &k, value_type &result) const
Definition: ParentageRegistry.cc:9
edm::ParentageRegistry
Definition: ParentageRegistry.h:12
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
kHelpCommandOpt
static char const *const kHelpCommandOpt
Definition: EdmProvDump.cc:1046
edm::BranchTypeToMetaDataTreeName
std::string const & BranchTypeToMetaDataTreeName(BranchType const &branchType)
Definition: BranchType.cc:98
edm::ProcessConfigurationVector
std::vector< ProcessConfiguration > ProcessConfigurationVector
Definition: ProcessConfiguration.h:62
topLevelPSet
static std::string topLevelPSet(std::string const &iName, edm::ParameterSet const &iProcessConfig, std::string const &iProcessName)
Definition: EdmProvDump.cc:266
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
edm::ProcessHistoryVector
std::vector< ProcessHistory > ProcessHistoryVector
Definition: ProcessHistoryRegistry.h:16
ProvenanceDumper::addAncestors
void addAncestors(edm::BranchID const &branchID, std::set< edm::BranchID > &ancestorBranchIDs, std::ostringstream &sout, std::map< edm::BranchID, std::set< edm::ParentageID >> &perProductParentage) const
Definition: EdmProvDump.cc:995
BranchType.h
edm::poolNames::processHistoryMapBranchName
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:167
edm::ParameterSetEntry::isTracked
bool isTracked() const
Definition: ParameterSetEntry.h:41
ProvenanceDumper::excludeESModules_
bool excludeESModules_
Definition: EdmProvDump.cc:483
triggerPaths
static const std::string triggerPaths
Definition: EdmProvDump.cc:46
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
kShowTopLevelPSetsCommandOpt
static char const *const kShowTopLevelPSetsCommandOpt
Definition: EdmProvDump.cc:1044
ProvenanceDumper::dumpProcessHistory_
void dumpProcessHistory_()
Definition: EdmProvDump.cc:599
kSortOpt
static char const *const kSortOpt
Definition: EdmProvDump.cc:1027
ProvenanceDumper::showDependencies_
bool showDependencies_
Definition: EdmProvDump.cc:480
edm::ParameterSet::isRegistered
bool isRegistered() const
Definition: ParameterSet.h:71
edm::pset::Registry::insertMapped
bool insertMapped(value_type const &v, bool forceUpdate=false)
Definition: Registry.cc:32
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
Registry.h
kExtendedAncestorsCommandOpt
static char const *const kExtendedAncestorsCommandOpt
Definition: EdmProvDump.cc:1032
edm::BranchTypeToProductProvenanceBranchName
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
Definition: BranchType.cc:132
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::ParentageRegistry::insertMapped
bool insertMapped(value_type const &v)
Definition: ParentageRegistry.cc:24
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
submitPVValidationJobs.child
child
Definition: submitPVValidationJobs.py:119
edm::ParameterSet::vpsetTable
vpsettable const & vpsetTable() const
Definition: ParameterSet.h:239
tier0.unique
def unique(seq, keepstr=True)
Definition: tier0.py:24
edm::poolNames::metaDataTreeName
std::string const & metaDataTreeName()
Definition: BranchType.cc:152
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
setIsMergeable.h
edm::ServiceRegistry::createContaining
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
Definition: ServiceRegistry.h:99
ProvenanceDumper::dumpEventFilteringParameterSets
void dumpEventFilteringParameterSets(edm::EventSelectionIDVector const &ids)
Definition: EdmProvDump.cc:533
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:246
edm::ParameterSetEntry::pset
ParameterSet const & pset() const
returns the PSet
Definition: ParameterSetEntry.cc:59
ProvenanceDumper::ProvenanceDumper
ProvenanceDumper(std::string const &filename, bool showDependencies, bool extendedAncestors, bool extendedDescendants, bool excludeESModules, bool showAllModules, bool showTopLevelPSets, std::vector< std::string > const &findMatch, bool dontPrintProducts, std::string const &dumpPSetID)
Definition: EdmProvDump.cc:498
kDontPrintProductsOpt
static char const *const kDontPrintProductsOpt
Definition: EdmProvDump.cc:1041
util.rrClient.indent
indent
Definition: rrClient.py:41
edm::VParameterSetEntry
Definition: VParameterSetEntry.h:24
AlcaSiPixelAliHarvester0T_cff.options
options
Definition: AlcaSiPixelAliHarvester0T_cff.py:42
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ProvenanceDumper::exitCode_
int exitCode_
Definition: EdmProvDump.cc:472
edm::History
Definition: History.h:22
Exception.h
edm::ParameterSetEntry
Definition: ParameterSetEntry.h:23
kDontPrintProductsCommandOpt
static char const *const kDontPrintProductsCommandOpt
Definition: EdmProvDump.cc:1042
fwlog::kError
Definition: fwLog.h:35
LaserTracksInput_cfi.fileNames
fileNames
Definition: LaserTracksInput_cfi.py:8
kSortCommandOpt
static char const *const kSortCommandOpt
Definition: EdmProvDump.cc:1028
ParameterSetID.h
edm::poolNames::eventHistoryTreeName
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:212
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
edm::ProcessHistory
Definition: ProcessHistory.h:13
genParticles_cff.map
map
Definition: genParticles_cff.py:11
History.h
command_line.start
start
Definition: command_line.py:167
ParameterSet.h
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::EventSelectionIDVector
std::vector< EventSelectionID > EventSelectionIDVector
Definition: EventSelectionID.h:16
ProvenanceDumper::filename_
std::string filename_
Definition: EdmProvDump.cc:470
child
Definition: simpleInheritance.h:11
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
edm::ServiceRegistry::Operate
Definition: ServiceRegistry.h:40
edm::pset::Registry::getMapped
bool getMapped(key_type const &k, value_type &result) const
Definition: Registry.cc:17
class-composition.parent
parent
Definition: class-composition.py:88
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::ParameterSet::empty
bool empty() const
Definition: ParameterSet.h:201
ProvenanceDumper::dump
void dump()
Definition: EdmProvDump.cc:524
ProvenanceDumper::historyGraph_
HistoryNode historyGraph_
Definition: EdmProvDump.cc:479
edm::ProcessConfiguration
Definition: ProcessConfiguration.h:14
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
kHelpOpt
static char const *const kHelpOpt
Definition: EdmProvDump.cc:1045
edm::pset::Registry
Definition: Registry.h:26
edm::poolNames::moduleDescriptionMapBranchName
std::string const & moduleDescriptionMapBranchName()
Definition: BranchType.cc:164
EventSelectionID.h
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
nonProducerComponent
std::string nonProducerComponent(std::string const &iCompName, edm::ParameterSet const &iProcessConfig, std::string const &iProcessName)
Definition: EdmProvDump.cc:206
edm::poolNames::eventHistoryBranchName
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:197
ProvenanceDumper::errorLog_
std::stringstream errorLog_
Definition: EdmProvDump.cc:473
ProvenanceDumper::dumpPSetID_
std::string dumpPSetID_
Definition: EdmProvDump.cc:489
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
operator<<
std::ostream & operator<<(std::ostream &os, edm::ProcessHistory &iHist)
Definition: EdmProvDump.cc:113
SiteLocalConfigService.h