709 assert(0 != psetTree);
710 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
712 IdToBlobs* pIdToBlob = &idToBlob;
714 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
715 psetTree->GetEntry(
i);
716 psm_.insert(idToBlob);
747 for(ParameterSetMap::const_iterator
i =
psm_.begin(), iEnd =
psm_.end();
i != iEnd; ++
i) {
756 for(edm::ProcessHistoryMap::const_iterator
i = phm.begin(),
e = phm.end();
i !=
e; ++
i) {
757 phv_.push_back(
i->second);
758 for(edm::ProcessConfigurationVector::const_iterator
j =
i->second.begin(),
f =
i->second.end();
j !=
f; ++
j) {
769 std::map<edm::BranchID, std::set<edm::ParentageID> > perProductParentage;
773 if(0 == parentageTree) {
774 std::cerr <<
"ERROR, no Parentage tree available so can not show dependencies/n";
782 std::vector<edm::ParentageID> orderedParentageIDs;
783 orderedParentageIDs.reserve(parentageTree->GetEntries());
788 parentageTree->GetEntry(
i);
790 orderedParentageIDs.push_back(parentageBuffer.
id());
795 if(0 == eventMetaTree) {
798 if(0 == eventMetaTree) {
806 if(0!=storedProvBranch) {
807 std::vector<edm::StoredProductProvenance>
info;
808 std::vector<edm::StoredProductProvenance>* pInfo = &
info;
809 storedProvBranch->SetAddress(&pInfo);
810 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
811 storedProvBranch->GetEntry(
i);
812 for(std::vector<edm::StoredProductProvenance>::const_iterator it = info.begin(), itEnd = info.end();
815 perProductParentage[bid].insert(orderedParentageIDs[it->parentageIDIndex_]);
821 if (0 != productProvBranch) {
822 std::vector<edm::ProductProvenance>
info;
823 std::vector<edm::ProductProvenance>* pInfo = &
info;
824 productProvBranch->SetAddress(&pInfo);
825 for(Long64_t
i = 0, numEntries = eventMetaTree->GetEntries();
i <
numEntries; ++
i) {
826 productProvBranch->GetEntry(
i);
827 for(std::vector<edm::ProductProvenance>::const_iterator it = info.begin(), itEnd = info.end();
829 perProductParentage[it->branchID()].insert(it->parentageID());
833 std::cerr <<
" ERROR, could not find provenance information so can not show dependencies\n";
843 std::map<edm::BranchID, std::set<edm::BranchID> > parentToChildren;
847 for (
auto const& itParentageSet : perProductParentage) {
849 for (
auto const& itParentageID : itParentageSet.second) {
852 for(std::vector<edm::BranchID>::const_iterator itBranch = parentage->
parents().begin(), itEndBranch = parentage->
parents().end();
853 itBranch != itEndBranch;
855 parentToChildren[*itBranch].insert(childBranchID);
858 std::cerr <<
" ERROR:parentage info not in registry ParentageID=" << itParentageID << std::endl;
868 std::cout <<
"---------Producers with data in file---------" << std::endl;
875 std::map<edm::BranchID, std::string> branchIDToBranchName;
877 for(edm::ProductRegistry::ProductList::const_iterator it =
885 branchIDToBranchName[it->second.branchID()] = it->second.branchName();
891 for(std::map<edm::ProcessConfigurationID, edm::ParameterSetID>::const_iterator
892 itId = it->second.parameterSetIDs().begin(),
893 itIdEnd = it->second.parameterSetIDs().end();
899 moduleToIdBranches[std::make_pair(it->second.processName(), it->second.moduleLabel())][s.str()].push_back(it->second);
904 for(ModuleToIdBranches::const_iterator it = moduleToIdBranches.begin(),
905 itEnd = moduleToIdBranches.end();
908 std::ostringstream sout;
909 sout <<
"Module: " << it->first.second <<
" " << it->first.first << std::endl;
910 std::set<edm::BranchID> allBranchIDsForLabelAndProcess;
912 for(IdToBranches::const_iterator itIdBranch = idToBranches.begin(),
913 itIdBranchEnd = idToBranches.end();
914 itIdBranch != itIdBranchEnd;
916 sout <<
" PSet id:" << itIdBranch->first << std::endl;
918 sout <<
" products: {" << std::endl;
920 std::set<edm::BranchID> branchIDs;
921 for(std::vector<edm::BranchDescription>::const_iterator itBranch = itIdBranch->second.begin(),
922 itBranchEnd = itIdBranch->second.end();
923 itBranch != itBranchEnd;
926 sout <<
" " << itBranch->branchName() << std::endl;
928 branchIDs.insert(itBranch->branchID());
929 allBranchIDsForLabelAndProcess.insert(itBranch->branchID());
931 sout <<
" }" << std::endl;
933 ParameterSetMap::const_iterator itpsm =
psm_.find(psid);
934 if(
psm_.end() == itpsm) {
936 errorLog_ <<
"No ParameterSetID for " << psid << std::endl;
939 sout <<
" parameters: ";
945 sout <<
" dependencies: {" << std::endl;
946 std::set<edm::ParentageID> parentageIDs;
947 for(std::set<edm::BranchID>::const_iterator itBranch = branchIDs.begin(), itBranchEnd = branchIDs.end();
948 itBranch != itBranchEnd;
952 std::set<edm::ParentageID>
const&
temp = perProductParentage[*itBranch];
953 parentageIDs.insert(temp.begin(), temp.end());
955 for(std::set<edm::ParentageID>::const_iterator itParentID = parentageIDs.begin(), itEndParentID = parentageIDs.end();
956 itParentID != itEndParentID;
960 for(std::vector<edm::BranchID>::const_iterator itBranch = parentage->
parents().begin(), itEndBranch = parentage->
parents().end();
961 itBranch != itEndBranch;
963 sout <<
" " << branchIDToBranchName[*itBranch] << std::endl;
966 sout <<
" ERROR:parentage info not in registry ParentageID=" << *itParentID << std::endl;
969 if(parentageIDs.empty()) {
970 sout <<
" no dependencies recorded (event may not contain data from this module)" << std::endl;
972 sout <<
" }" << std::endl;
976 sout <<
" extendedAncestors: {" << std::endl;
977 std::set<edm::BranchID> ancestorBranchIDs;
978 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
979 addAncestors(branchID, ancestorBranchIDs, sout, perProductParentage);
981 for (
auto const& ancestorBranchID : ancestorBranchIDs) {
982 sout <<
" " << branchIDToBranchName[ancestorBranchID] <<
"\n";
984 sout <<
" }" << std::endl;
988 sout <<
" extendedDescendants: {" << std::endl;
989 std::set<edm::BranchID> descendantBranchIDs;
990 for (
auto const& branchID : allBranchIDsForLabelAndProcess) {
991 addDescendants(branchID, descendantBranchIDs, sout, parentToChildren);
993 for (
auto const& descendantBranchID : descendantBranchIDs) {
994 sout <<
" " << branchIDToBranchName[descendantBranchID] <<
"\n";
996 sout <<
" }" << std::endl;
998 bool foundMatch =
true;
1000 for (
auto const& stringToFind :
findMatch_) {
1001 if (sout.str().find(stringToFind) == std::string::npos) {
1012 std::cout <<
"---------Other Modules---------" << std::endl;
1017 std::cout <<
"---------EventSetup---------" << std::endl;
1022 std::cout <<
"---------Top Level PSets---------" << std::endl;
std::stringstream errorLog_
std::string const & idToParameterSetBlobsBranchName()
std::string const & BranchTypeToMetaDataTreeName(BranchType const &branchType)
std::string const & parentageTreeName()
static ThreadSafeRegistry * instance()
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
bool getMapped(key_type const &k, value_type &result) const
HistoryNode historyGraph_
ProcessHistoryRegistry::collection_type ProcessHistoryMap
void dumpEventFilteringParameterSets_(TFile *file)
bool insertMapped(value_type const &v)
edm::ProcessHistoryVector phv_
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
std::string const & parameterSetsTreeName()
void setID(ParameterSetID const &id) const
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
std::vector< BranchID > const & parents() const
ProductList const & productList() const
std::string const & processHistoryMapBranchName()
bool extendedDescendants_
std::map< std::pair< std::string, std::string >, IdToBranches > ModuleToIdBranches
Long64_t numEntries(TFile *hdl, std::string const &trname)
ProcessHistoryRegistry::vector_type ProcessHistoryVector
std::string const & BranchTypeToBranchEntryInfoBranchName(BranchType const &branchType)
std::string const & metaDataTreeName()
std::string const & BranchTypeToProductTreeName(BranchType const &branchType)
std::unique_ptr< TFile > inputFile_
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
std::string const & parentageBranchName()
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 & processConfigurationBranchName()
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
std::string const & moduleDescriptionMapBranchName()