700 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
702 IdToBlobs* pIdToBlob = &idToBlob;
704 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
705 psetTree->GetEntry(
i);
706 psm_.insert(idToBlob);
733 for(
auto const& item :
psm_) {
735 pset.
setID(item.first);
741 for(
auto const& history :
phv_) {
742 for(
auto const&
process : history) {
751 else if(!phm.empty()) {
752 for(
auto const& history : phm) {
753 phv_.push_back(history.second);
754 for(
auto const&
process : history.second) {
767 throw cms::Exception(
"Command Line Argument") <<
"Illegal ParameterSetID string. It should contain 32 hexadecimal characters";
774 std::map<edm::BranchID, std::set<edm::ParentageID> > perProductParentage;
778 if(
nullptr == parentageTree) {
779 std::cerr <<
"ERROR, no Parentage tree available so can not show dependencies/n";
787 std::vector<edm::ParentageID> orderedParentageIDs;
788 orderedParentageIDs.reserve(parentageTree->GetEntries());
793 parentageTree->GetEntry(
i);
795 orderedParentageIDs.push_back(parentageBuffer.
id());
800 if(0 == eventMetaTree) {
803 if(0 == eventMetaTree) {
811 if(0!=storedProvBranch) {
812 std::vector<edm::StoredProductProvenance>
info;
813 std::vector<edm::StoredProductProvenance>* pInfo = &
info;
814 storedProvBranch->SetAddress(&pInfo);
815 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
816 storedProvBranch->GetEntry(
i);
817 for(
auto const& item : info) {
819 perProductParentage[bid].insert(orderedParentageIDs.at(item.parentageIDIndex_));
825 if (0 != productProvBranch) {
826 std::vector<edm::ProductProvenance>
info;
827 std::vector<edm::ProductProvenance>* pInfo = &
info;
828 productProvBranch->SetAddress(&pInfo);
829 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
830 productProvBranch->GetEntry(
i);
831 for(
auto const& item : info) {
832 perProductParentage[item.branchID()].insert(item.parentageID());
836 std::cerr <<
" ERROR, could not find provenance information so can not show dependencies\n";
846 std::map<edm::BranchID, std::set<edm::BranchID> > parentToChildren;
850 for (
auto const& itParentageSet : perProductParentage) {
852 for (
auto const& itParentageID : itParentageSet.second) {
855 for(
auto const& branch : parentage->
parents()) {
856 parentToChildren[branch].insert(childBranchID);
859 std::cerr <<
" ERROR:parentage info not in registry ParentageID=" << itParentageID << std::endl;
869 std::cout <<
"---------Producers with data in file---------" << std::endl;
876 std::map<edm::BranchID, std::string> branchIDToBranchName;
878 for(
auto const& processConfig :
phc_) {
880 if(
nullptr == processParameterSet || processParameterSet->
empty()) {
884 auto& product = item.second;
885 if(product.processName() != processConfig.processName()) {
892 branchIDToBranchName[product.branchID()] = product.branchName();
899 if(moduleLabel ==
source) {
912 s << moduleParameterSetCopy.
id();
914 s << moduleParameterSet.
id();
916 moduleToIdBranches[std::make_pair(product.processName(), product.moduleLabel())][s.str()].push_back(product);
921 for(
auto const& item : moduleToIdBranches) {
922 std::ostringstream sout;
923 sout <<
"Module: " << item.first.second <<
" " << item.first.first << std::endl;
924 std::set<edm::BranchID> allBranchIDsForLabelAndProcess;
926 for(
auto const& idBranch : idToBranches) {
927 sout <<
" PSet id:" << idBranch.first << std::endl;
929 sout <<
" products: {" << std::endl;
931 std::set<edm::BranchID> branchIDs;
932 for(
auto const& branch : idBranch.second) {
934 sout <<
" " << branch.branchName() << std::endl;
936 branchIDs.insert(branch.branchID());
937 allBranchIDsForLabelAndProcess.insert(branch.branchID());
939 sout <<
" }" << std::endl;
941 ParameterSetMap::const_iterator itpsm = psm_.find(psid);
942 if(psm_.end() == itpsm) {
944 errorLog_ <<
"No ParameterSetID for " << psid << std::endl;
947 sout <<
" parameters: ";
953 sout <<
" dependencies: {" << std::endl;
954 std::set<edm::ParentageID> parentageIDs;
955 for(
auto const& branch : branchIDs) {
958 std::set<edm::ParentageID>
const&
temp = perProductParentage[branch];
959 parentageIDs.insert(temp.begin(), temp.end());
961 for(
auto const& parentID : parentageIDs) {
963 if(
nullptr != parentage) {
964 for(
auto const& branch : parentage->
parents()) {
965 sout <<
" " << branchIDToBranchName[branch] << std::endl;
968 sout <<
" ERROR:parentage info not in registry ParentageID=" << parentID << std::endl;
971 if(parentageIDs.empty()) {
972 sout <<
" no dependencies recorded (event may not contain data from this module)" << std::endl;
974 sout <<
" }" << std::endl;
978 sout <<
" extendedAncestors: {" << std::endl;
979 std::set<edm::BranchID> ancestorBranchIDs;
980 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
981 addAncestors(branchID, ancestorBranchIDs, sout, perProductParentage);
983 for (
auto const& ancestorBranchID : ancestorBranchIDs) {
984 sout <<
" " << branchIDToBranchName[ancestorBranchID] <<
"\n";
986 sout <<
" }" << std::endl;
990 sout <<
" extendedDescendants: {" << std::endl;
991 std::set<edm::BranchID> descendantBranchIDs;
992 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
993 addDescendants(branchID, descendantBranchIDs, sout, parentToChildren);
995 for (
auto const& descendantBranchID : descendantBranchIDs) {
996 sout <<
" " << branchIDToBranchName[descendantBranchID] <<
"\n";
998 sout <<
" }" << std::endl;
1000 bool foundMatch =
true;
1002 for (
auto const& stringToFind :
findMatch_) {
1003 if (sout.str().find(stringToFind) == std::string::npos) {
1014 std::cout <<
"---------Other Modules---------" << std::endl;
1019 std::cout <<
"---------EventSetup---------" << std::endl;
1024 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()