30 void checkDicts(BranchDescription
const& productDesc) {
31 if(productDesc.transient()) {
48 anyProductProduced_(
false),
52 eventNextIndexValue_(0),
53 lumiNextIndexValue_(0),
54 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();
75 missingDictionaries_.clear();
89 checkDicts(productDesc);
90 std::pair<ProductList::iterator, bool>
ret =
94 <<
"The process name " << productDesc.
processName() <<
" was previously used on these products.\n"
95 <<
"Please modify the configuration file to use a distinct process name.\n";
108 std::pair<ProductList::iterator, bool>
ret =
126 iter->second.merge(productDesc);
135 if(it->second.branchType() == brType) {
142 std::shared_ptr<ProductHolderIndexHelper>
const&
153 if(initializeLookupInfo) {
163 <<
"cannot modify the ProductRegistry because it is frozen\n";
171 <<
"cannot read the ProductRegistry because it is not yet frozen\n";
179 std::vector<std::string>
181 std::vector<std::string>
result;
185 result.push_back(product.second.branchName());
190 std::vector<BranchDescription const*>
192 std::vector<BranchDescription const*>
result;
196 result.push_back(&product.second);
203 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";
250 j->second.merge(i->second);
259 return differences.str();
265 auto const&
key = product.first;
266 auto const& desc = product.second;
273 std::map<TypeID, TypeID> containedTypeMap;
280 auto const&
key = product.first;
281 auto const& desc = product.second;
285 if(desc.produced()) {
291 if(!
bool(desc.unwrappedType())) {
292 missingDicts.insert(
TypeID(desc.unwrappedType().typeInfo()));
293 }
else if(!
bool(desc.wrappedType())) {
294 missingDicts.insert(
TypeID(desc.wrappedType().typeInfo()));
296 TypeID wrappedTypeID(desc.wrappedType().typeInfo());
297 TypeID typeID(desc.unwrappedType().typeInfo());
299 auto const& iter = containedTypeMap.find(typeID);
300 if(iter != containedTypeMap.end()) {
301 containedTypeID = iter->second;
304 containedTypeMap.emplace(typeID, containedTypeID);
308 desc.moduleLabel().c_str(),
309 desc.productInstanceName().c_str(),
310 desc.processName().c_str(),
325 for(
auto const& product : productList_) {
326 auto const& desc = product.second;
342 return itFind->second;
347 os << product.second <<
"\n-----\n";
void setProductProduced(BranchType branchType)
std::shared_ptr< ProductHolderIndexHelper > eventProductLookup_
ProductHolderIndex & nextIndexValue(BranchType branchType)
std::vector< TypeID > & missingDictionariesForUpdate()
void throwIfNotFrozen() const
TypeID getContainedTypeFromWrapper(TypeID const &wrappedtypeID, std::string const &className)
std::vector< std::string > allBranchNames() const
void checkClassDictionaries(TypeID const &type, bool recursive=true)
std::map< BranchKey, BranchDescription > ProductList
ProductHolderIndex indexFrom(BranchID const &iID) const
std::shared_ptr< ProductHolderIndexHelper > lumiProductLookup_
bool anyProducts(BranchType const brType) const
std::shared_ptr< ProductHolderIndexHelper > const & productLookup(BranchType branchType) const
std::string const & processName() const
ProductHolderIndex eventNextIndexValue_
void initializeLookupTables()
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)
std::shared_ptr< ProductHolderIndexHelper > runProductLookup_
virtual void addCalled(BranchDescription const &, bool iFromListener)
ProductList const & productList() const
std::string const & moduleLabel() const
std::set< TypeID > TypeSet
ConstProductList & constProductList()
bool combinable(BranchDescription const &a, BranchDescription const &b)
ProductHolderIndex lumiNextIndexValue_
std::vector< BranchDescription const * > allBranchDescriptions() const
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
boost::array< bool, NumBranchTypes > productProduced_
BranchID const & branchID() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
void setFrozen(bool initializeLookupInfo=true)
void freezeIt(bool frozen=true)
void print(std::ostream &os) const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
ProductHolderIndex runNextIndexValue_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
std::vector< std::pair< std::string, std::string > > aliasToOriginal_
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
void throwIfFrozen() const
void updateConstProductRegistry()
void updateFromInput(ProductList const &other)
std::map< BranchID, ProductHolderIndex > branchIDToIndex_
volatile std::atomic< bool > shutdown_flag false
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
void copyProduct(BranchDescription const &productdesc)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)