28 void checkDicts(BranchDescription
const& productDesc) {
29 if(productDesc.transient()) {
47 anyProductProduced_(
false),
51 eventNextIndexValue_(0),
52 lumiNextIndexValue_(0),
53 runNextIndexValue_(0),
57 missingDictionaries_() {
64 constProductList_.clear();
65 for(
bool& isProduced : productProduced_) isProduced =
false;
66 anyProductProduced_ =
false;
70 eventNextIndexValue_ = 0;
71 lumiNextIndexValue_ = 0;
72 runNextIndexValue_ = 0;
74 branchIDToIndex_.clear();
76 missingDictionaries_.clear();
90 checkDicts(productDesc);
91 std::pair<ProductList::iterator, bool>
ret =
95 <<
"The process name " << productDesc.
processName() <<
" was previously used on these products.\n"
96 <<
"Please modify the configuration file to use a distinct process name.\n";
109 std::pair<ProductList::iterator, bool>
ret =
125 assert(
combinable(iter->second, productDesc));
126 iter->second.merge(productDesc);
135 if(it->second.branchType() == brType) {
142 boost::shared_ptr<ProductHolderIndexHelper>
const&
153 if(initializeLookupInfo) {
162 <<
"cannot modify the ProductRegistry because it is frozen\n";
170 <<
"cannot read the ProductRegistry because it is not yet frozen\n";
178 std::vector<std::string>
180 std::vector<std::string>
result;
184 result.push_back(product.second.branchName());
189 std::vector<BranchDescription const*>
191 std::vector<BranchDescription const*>
result;
195 result.push_back(&product.second);
202 for(
auto const& product : other) {
219 std::ostringstream differences;
221 ProductRegistry::ProductList::iterator
j =
productList_.begin();
222 ProductRegistry::ProductList::iterator
s =
productList_.end();
223 ProductRegistry::ProductList::const_iterator
i = other.
productList().begin();
224 ProductRegistry::ProductList::const_iterator
e = other.
productList().end();
227 while(j != s || i != e) {
228 if(j != s && j->second.produced()) {
231 }
else if(j == s || (i != e && i->first < j->first)) {
232 if(i->second.present()) {
233 differences <<
"Branch '" << i->second.branchName() <<
"' is in file '" << fileName <<
"'\n";
234 differences <<
" but not in previous files.\n";
241 }
else if(i == e || (j != s && j->first < i->first)) {
243 differences <<
"Branch '" << j->second.branchName() <<
"' is in previous files\n";
244 differences <<
" but not in file '" << fileName <<
"'.\n";
248 std::string difs =
match(j->second, i->second, fileName, parametersMustMatch);
259 return differences.str();
265 auto const&
key = product.first;
266 auto const& desc = product.second;
278 auto const&
key = product.first;
279 auto const& desc = product.second;
283 if(desc.produced()) {
291 if(!
bool(type) || !bool(wrappedType)) {
292 missingDicts.insert(desc.className());
296 desc.moduleLabel().c_str(),
297 desc.productInstanceName().c_str(),
298 desc.processName().c_str());
312 for(
auto const& product : productList_) {
313 auto const& desc = product.second;
329 return itFind->second;
334 os << product.second <<
"\n-----\n";
unsigned short BranchListIndex
static TypeWithDict byName(std::string const &className)
boost::shared_ptr< ProductHolderIndexHelper > lumiProductLookup_
void setProductProduced(BranchType branchType) const
ConstProductList & constProductList() const
void throwIfNotFrozen() const
std::vector< std::string > allBranchNames() const
std::map< BranchKey, BranchDescription > ProductList
ProductHolderIndex indexFrom(BranchID const &iID) const
bool anyProducts(BranchType const brType) const
std::string const & processName() const
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode parametersMustMatch=BranchDescription::Permissive, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName, BranchDescription::MatchMode m)
ProductHolderIndex eventNextIndexValue_
unsigned int ProductHolderIndex
ProductList::size_type size() const
ProductHolderIndex const & getNextIndexValue(BranchType branchType) const
void addLabelAlias(BranchDescription const &productdesc, std::string const &labelAlias, std::string const &instanceAlias)
virtual void addCalled(BranchDescription const &, bool iFromListener)
boost::shared_ptr< ProductHolderIndexHelper > const & productLookup(BranchType branchType) const
ProductList const & productList() const
const T & max(const T &a, const T &b)
std::vector< std::string > & missingDictionaries() const
bool combinable(BranchDescription const &a, BranchDescription const &b)
std::set< std::string > StringSet
void checkDictionaries(std::string const &name, bool noComponents=false)
ProductHolderIndex lumiNextIndexValue_
std::vector< BranchDescription const * > allBranchDescriptions() const
boost::array< bool, NumBranchTypes > productProduced_
BranchID const & branchID() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
void print(std::ostream &os) const
ProductHolderIndex runNextIndexValue_
void setFrozen(bool initializeLookupInfo=true) const
void initializeLookupTables() const
boost::shared_ptr< ProductHolderIndexHelper > runProductLookup_
std::string wrappedClassName(std::string const &iFullName)
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
void throwIfFrozen() const
void updateConstProductRegistry()
void updateFromInput(ProductList const &other)
boost::shared_ptr< ProductHolderIndexHelper > eventProductLookup_
std::map< BranchID, ProductHolderIndex > branchIDToIndex_
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
ProductHolderIndex & nextIndexValue(BranchType branchType) const
void copyProduct(BranchDescription const &productdesc)
EventID const & max(EventID const &lh, EventID const &rh)