700 assert(0 != psetTree);
701 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
703 IdToBlobs* pIdToBlob = &idToBlob;
705 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
706 psetTree->GetEntry(
i);
707 psm_.insert(idToBlob);
731 assert(
nullptr != pReg);
734 for(
auto const& item :
psm_) {
736 pset.
setID(item.first);
742 for(
auto const& history :
phv_) {
743 for(
auto const&
process : history) {
752 else if(!phm.empty()) {
753 for(
auto const& history : phm) {
754 phv_.push_back(history.second);
755 for(
auto const&
process : history.second) {
768 throw cms::Exception(
"Command Line Argument") <<
"Illegal ParameterSetID string. It should contain 32 hexadecimal characters";
775 std::map<edm::BranchID, std::set<edm::ParentageID> > perProductParentage;
779 if(
nullptr == parentageTree) {
780 std::cerr <<
"ERROR, no Parentage tree available so can not show dependencies/n";
788 std::vector<edm::ParentageID> orderedParentageIDs;
789 orderedParentageIDs.reserve(parentageTree->GetEntries());
794 parentageTree->GetEntry(
i);
796 orderedParentageIDs.push_back(parentageBuffer.
id());
801 if(0 == eventMetaTree) {
804 if(0 == eventMetaTree) {
812 if(0!=storedProvBranch) {
813 std::vector<edm::StoredProductProvenance>
info;
814 std::vector<edm::StoredProductProvenance>* pInfo = &
info;
815 storedProvBranch->SetAddress(&pInfo);
816 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
817 storedProvBranch->GetEntry(
i);
818 for(
auto const& item : info) {
820 perProductParentage[bid].insert(orderedParentageIDs[item.parentageIDIndex_]);
826 if (0 != productProvBranch) {
827 std::vector<edm::ProductProvenance>
info;
828 std::vector<edm::ProductProvenance>* pInfo = &
info;
829 productProvBranch->SetAddress(&pInfo);
830 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
831 productProvBranch->GetEntry(
i);
832 for(
auto const& item : info) {
833 perProductParentage[item.branchID()].insert(item.parentageID());
837 std::cerr <<
" ERROR, could not find provenance information so can not show dependencies\n";
847 std::map<edm::BranchID, std::set<edm::BranchID> > parentToChildren;
851 for (
auto const& itParentageSet : perProductParentage) {
853 for (
auto const& itParentageID : itParentageSet.second) {
856 for(
auto const& branch : parentage->
parents()) {
857 parentToChildren[branch].insert(childBranchID);
860 std::cerr <<
" ERROR:parentage info not in registry ParentageID=" << itParentageID << std::endl;
870 std::cout <<
"---------Producers with data in file---------" << std::endl;
877 std::map<edm::BranchID, std::string> branchIDToBranchName;
879 for(
auto const& processConfig :
phc_) {
881 if(
nullptr == processParameterSet || processParameterSet->
empty()) {
885 auto& product = item.second;
886 if(product.processName() != processConfig.processName()) {
893 branchIDToBranchName[product.branchID()] = product.branchName();
900 if(moduleLabel ==
source) {
913 s << moduleParameterSetCopy.
id();
915 s << moduleParameterSet.
id();
917 moduleToIdBranches[std::make_pair(product.processName(), product.moduleLabel())][s.str()].push_back(product);
922 for(
auto const& item : moduleToIdBranches) {
923 std::ostringstream sout;
924 sout <<
"Module: " << item.first.second <<
" " << item.first.first << std::endl;
925 std::set<edm::BranchID> allBranchIDsForLabelAndProcess;
927 for(
auto const& idBranch : idToBranches) {
928 sout <<
" PSet id:" << idBranch.first << std::endl;
930 sout <<
" products: {" << std::endl;
932 std::set<edm::BranchID> branchIDs;
933 for(
auto const& branch : idBranch.second) {
935 sout <<
" " << branch.branchName() << std::endl;
937 branchIDs.insert(branch.branchID());
938 allBranchIDsForLabelAndProcess.insert(branch.branchID());
940 sout <<
" }" << std::endl;
942 ParameterSetMap::const_iterator itpsm = psm_.find(psid);
943 if(psm_.end() == itpsm) {
945 errorLog_ <<
"No ParameterSetID for " << psid << std::endl;
948 sout <<
" parameters: ";
954 sout <<
" dependencies: {" << std::endl;
955 std::set<edm::ParentageID> parentageIDs;
956 for(
auto const& branch : branchIDs) {
959 std::set<edm::ParentageID>
const&
temp = perProductParentage[branch];
960 parentageIDs.insert(temp.begin(), temp.end());
962 for(
auto const& parentID : parentageIDs) {
964 if(
nullptr != parentage) {
965 for(
auto const& branch : parentage->
parents()) {
966 sout <<
" " << branchIDToBranchName[branch] << std::endl;
969 sout <<
" ERROR:parentage info not in registry ParentageID=" << parentID << std::endl;
972 if(parentageIDs.empty()) {
973 sout <<
" no dependencies recorded (event may not contain data from this module)" << std::endl;
975 sout <<
" }" << std::endl;
979 sout <<
" extendedAncestors: {" << std::endl;
980 std::set<edm::BranchID> ancestorBranchIDs;
981 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
982 addAncestors(branchID, ancestorBranchIDs, sout, perProductParentage);
984 for (
auto const& ancestorBranchID : ancestorBranchIDs) {
985 sout <<
" " << branchIDToBranchName[ancestorBranchID] <<
"\n";
987 sout <<
" }" << std::endl;
991 sout <<
" extendedDescendants: {" << std::endl;
992 std::set<edm::BranchID> descendantBranchIDs;
993 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
994 addDescendants(branchID, descendantBranchIDs, sout, parentToChildren);
996 for (
auto const& descendantBranchID : descendantBranchIDs) {
997 sout <<
" " << branchIDToBranchName[descendantBranchID] <<
"\n";
999 sout <<
" }" << std::endl;
1001 bool foundMatch =
true;
1003 for (
auto const& stringToFind :
findMatch_) {
1004 if (sout.str().find(stringToFind) == std::string::npos) {
1015 std::cout <<
"---------Other Modules---------" << std::endl;
1020 std::cout <<
"---------EventSetup---------" << std::endl;
1025 std::cout <<
"---------Top Level PSets---------" << std::endl;
std::stringstream errorLog_
std::vector< ProcessHistory > ProcessHistoryVector
void setID(ParameterSetID const &id)
std::string const & idToParameterSetBlobsBranchName()
std::string const & BranchTypeToMetaDataTreeName(BranchType const &branchType)
std::string const & parentageTreeName()
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
ParameterSetID id() const
edm::ProductRegistry reg_
void addAncestors(edm::BranchID const &branchID, std::set< edm::BranchID > &ancestorBranchIDs, std::ostringstream &sout, std::map< edm::BranchID, std::set< edm::ParentageID > > &perProductParentage) const
void dumpParameterSetForID_(edm::ParameterSetID const &id)
HistoryNode historyGraph_
void dumpEventFilteringParameterSets_(TFile *file)
edm::ProcessHistoryVector phv_
std::string const & parameterSetsTreeName()
static std::string const input
std::vector< BranchID > const & parents() const
std::string const & processHistoryMapBranchName()
bool extendedDescendants_
bool getMapped(key_type const &k, value_type &result) const
std::map< std::pair< std::string, std::string >, IdToBranches > ModuleToIdBranches
Long64_t numEntries(TFile *hdl, std::string const &trname)
bool getMapped(key_type const &k, value_type &result) const
std::string const & BranchTypeToBranchEntryInfoBranchName(BranchType const &branchType)
std::string const & metaDataTreeName()
std::string const & BranchTypeToProductTreeName(BranchType const &branchType)
std::unique_ptr< TFile > inputFile_
static std::string const triggerResults
bool isRegistered() const
Hash< ParameterSetType > ParameterSetID
std::string const & parameterSetMapBranchName()
static std::ostream & prettyPrint(std::ostream &oStream, edm::ParameterSet const &iPSet, std::string const &iIndent, std::string const &iIndentDelta)
std::string const & processHistoryBranchName()
std::map< std::string, std::vector< edm::BranchDescription > > IdToBranches
void dumpProcessHistory_()
edm::ProcessConfigurationVector phc_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
ParameterSet const & getParameterSet(std::string const &) const
std::string const & parentageBranchName()
ProductList & productListUpdator()
void addDescendants(edm::BranchID const &branchID, std::set< edm::BranchID > &descendantBranchIDs, std::ostringstream &sout, std::map< edm::BranchID, std::set< edm::BranchID > > &parentToChildren) const
std::vector< std::string > findMatch_
std::map< ParameterSetID, ParameterSetBlob > ParameterSetMap
std::string const & productDescriptionBranchName()
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
bool insertMapped(value_type const &v)
static ParentageRegistry * instance()
static std::string const triggerPaths
ParameterSet const & registerIt()
static std::string const source
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap
std::string const & moduleDescriptionMapBranchName()
bool insertMapped(value_type const &v)
static Registry * instance()