695 assert(0 != psetTree);
696 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
698 IdToBlobs* pIdToBlob = &idToBlob;
700 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
701 psetTree->GetEntry(
i);
702 psm_.insert(idToBlob);
726 assert(
nullptr != pReg);
729 for(
auto const& item :
psm_) {
731 pset.
setID(item.first);
737 for(
auto const& history :
phv_) {
738 for(
auto const&
process : history) {
747 else if(!phm.empty()) {
748 for(
auto const& history : phm) {
749 phv_.push_back(history.second);
750 for(
auto const&
process : history.second) {
759 std::map<edm::BranchID, std::set<edm::ParentageID> > perProductParentage;
763 if(
nullptr == parentageTree) {
764 std::cerr <<
"ERROR, no Parentage tree available so can not show dependencies/n";
772 std::vector<edm::ParentageID> orderedParentageIDs;
773 orderedParentageIDs.reserve(parentageTree->GetEntries());
778 parentageTree->GetEntry(
i);
780 orderedParentageIDs.push_back(parentageBuffer.
id());
785 if(0 == eventMetaTree) {
788 if(0 == eventMetaTree) {
796 if(0!=storedProvBranch) {
797 std::vector<edm::StoredProductProvenance>
info;
798 std::vector<edm::StoredProductProvenance>* pInfo = &
info;
799 storedProvBranch->SetAddress(&pInfo);
800 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
801 storedProvBranch->GetEntry(
i);
802 for(
auto const& item : info) {
804 perProductParentage[bid].insert(orderedParentageIDs[item.parentageIDIndex_]);
810 if (0 != productProvBranch) {
811 std::vector<edm::ProductProvenance>
info;
812 std::vector<edm::ProductProvenance>* pInfo = &
info;
813 productProvBranch->SetAddress(&pInfo);
814 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
815 productProvBranch->GetEntry(
i);
816 for(
auto const& item : info) {
817 perProductParentage[item.branchID()].insert(item.parentageID());
821 std::cerr <<
" ERROR, could not find provenance information so can not show dependencies\n";
831 std::map<edm::BranchID, std::set<edm::BranchID> > parentToChildren;
835 for (
auto const& itParentageSet : perProductParentage) {
837 for (
auto const& itParentageID : itParentageSet.second) {
840 for(
auto const& branch : parentage->
parents()) {
841 parentToChildren[branch].insert(childBranchID);
844 std::cerr <<
" ERROR:parentage info not in registry ParentageID=" << itParentageID << std::endl;
854 std::cout <<
"---------Producers with data in file---------" << std::endl;
861 std::map<edm::BranchID, std::string> branchIDToBranchName;
863 for(
auto const& processConfig :
phc_) {
865 if(
nullptr == processParameterSet || processParameterSet->
empty()) {
869 auto& product = item.second;
870 if(product.processName() != processConfig.processName()) {
877 branchIDToBranchName[product.branchID()] = product.branchName();
884 if(moduleLabel ==
source) {
897 s << moduleParameterSetCopy.
id();
899 s << moduleParameterSet.
id();
901 moduleToIdBranches[std::make_pair(product.processName(), product.moduleLabel())][s.str()].push_back(product);
906 for(
auto const& item : moduleToIdBranches) {
907 std::ostringstream sout;
908 sout <<
"Module: " << item.first.second <<
" " << item.first.first << std::endl;
909 std::set<edm::BranchID> allBranchIDsForLabelAndProcess;
911 for(
auto const& idBranch : idToBranches) {
912 sout <<
" PSet id:" << idBranch.first << std::endl;
914 sout <<
" products: {" << std::endl;
916 std::set<edm::BranchID> branchIDs;
917 for(
auto const& branch : idBranch.second) {
919 sout <<
" " << branch.branchName() << std::endl;
921 branchIDs.insert(branch.branchID());
922 allBranchIDsForLabelAndProcess.insert(branch.branchID());
924 sout <<
" }" << std::endl;
926 ParameterSetMap::const_iterator itpsm = psm_.find(psid);
927 if(psm_.end() == itpsm) {
929 errorLog_ <<
"No ParameterSetID for " << psid << std::endl;
932 sout <<
" parameters: ";
938 sout <<
" dependencies: {" << std::endl;
939 std::set<edm::ParentageID> parentageIDs;
940 for(
auto const& branch : branchIDs) {
943 std::set<edm::ParentageID>
const&
temp = perProductParentage[branch];
944 parentageIDs.insert(temp.begin(), temp.end());
946 for(
auto const& parentID : parentageIDs) {
948 if(
nullptr != parentage) {
949 for(
auto const& branch : parentage->
parents()) {
950 sout <<
" " << branchIDToBranchName[branch] << std::endl;
953 sout <<
" ERROR:parentage info not in registry ParentageID=" << parentID << std::endl;
956 if(parentageIDs.empty()) {
957 sout <<
" no dependencies recorded (event may not contain data from this module)" << std::endl;
959 sout <<
" }" << std::endl;
963 sout <<
" extendedAncestors: {" << std::endl;
964 std::set<edm::BranchID> ancestorBranchIDs;
965 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
966 addAncestors(branchID, ancestorBranchIDs, sout, perProductParentage);
968 for (
auto const& ancestorBranchID : ancestorBranchIDs) {
969 sout <<
" " << branchIDToBranchName[ancestorBranchID] <<
"\n";
971 sout <<
" }" << std::endl;
975 sout <<
" extendedDescendants: {" << std::endl;
976 std::set<edm::BranchID> descendantBranchIDs;
977 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
978 addDescendants(branchID, descendantBranchIDs, sout, parentToChildren);
980 for (
auto const& descendantBranchID : descendantBranchIDs) {
981 sout <<
" " << branchIDToBranchName[descendantBranchID] <<
"\n";
983 sout <<
" }" << std::endl;
985 bool foundMatch =
true;
988 if (sout.str().find(stringToFind) == std::string::npos) {
999 std::cout <<
"---------Other Modules---------" << std::endl;
1004 std::cout <<
"---------EventSetup---------" << std::endl;
1009 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
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
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()