60 #include "THashTable.h" 77 missingDictionaries.emplace_back(typeID.
className());
84 TypeID const& unwrappedTypeID) {
87 return checkDictionary(missingDictionaries, wrappedName, wrappedTypeWithDict);
94 return checkDictionary(missingDictionaries, wrappedName, wrappedTypeWithDict);
102 missingDictionaries.emplace_back(name);
119 TClass* tClass = TClass::GetClass(typeID.
typeInfo());
123 tClass = TClass::GetClass(typeID.
typeInfo());
126 missingDictionaries.emplace_back(typeID.
className());
130 if (tClass ==
nullptr) {
136 THashTable hashTable;
137 bool recursive =
true;
138 tClass->GetMissingDictionaries(hashTable, recursive);
140 for(
auto const& item : hashTable) {
141 TClass
const*
cl =
static_cast<TClass const*
>(item);
142 missingDictionaries.emplace_back(cl->GetName());
153 missingDictionaries.emplace_back(name);
157 TClass *tClass = typeWithDict.
getClass();
158 if (tClass ==
nullptr) {
159 missingDictionaries.emplace_back(name);
163 THashTable hashTable;
164 bool recursive =
true;
165 tClass->GetMissingDictionaries(hashTable, recursive);
169 for(
auto const& item : hashTable) {
170 TClass
const*
cl =
static_cast<TClass const*
>(item);
171 missingDictionaries.emplace_back(cl->GetName());
178 std::vector<std::string>& missingDictionaries,
181 std::sort(missingDictionaries.begin(), missingDictionaries.end());
182 missingDictionaries.erase(
std::unique(missingDictionaries.begin(), missingDictionaries.end()), missingDictionaries.end());
184 std::ostringstream ostr;
185 for(
auto const& item : missingDictionaries) {
186 ostr <<
" " << item <<
"\n";
188 exception <<
"No data dictionary found for the following classes:\n\n" 189 << ostr.str() <<
"\n" 190 <<
"Most likely each dictionary was never generated, but it may\n" 191 <<
"be that it was generated in the wrong package. Please add\n" 192 <<
"(or move) the specification \'<class name=\"whatever\"/>\' to\n" 193 <<
"the appropriate classes_def.xml file along with any other\n" 194 <<
"information needed there. For example, if this class has any\n" 195 <<
"transient members, you need to specify them in classes_def.xml.\n" 196 <<
"Also include the class header in classes.h\n";
198 if (!context.empty()) {
205 std::vector<std::string>
empty;
211 std::vector<std::string>& producedTypes) {
216 if (!producedTypes.empty()) {
217 std::sort(producedTypes.begin(), producedTypes.end());
218 producedTypes.erase(
std::unique(producedTypes.begin(), producedTypes.end()), producedTypes.end());
220 std::ostringstream ostr;
221 for(
auto const& item : producedTypes) {
222 ostr <<
" " << item <<
"\n";
224 exception <<
"\nA type listed above might or might not be the same as a\n" 225 <<
"type declared by a producer module with the function \'produces\'.\n" 226 <<
"Instead it might be the type of a data member, base class,\n" 227 <<
"wrapped type, or other object needed by a produced type. Below\n" 228 <<
"is some additional information which lists the types declared\n" 229 <<
"to be produced by a producer module that are associated with\n" 230 <<
"the types whose dictionaries were not found:\n\n" 231 << ostr.str() <<
"\n";
239 std::vector<std::string>& producedTypes,
240 std::vector<std::string>& branchNames,
241 bool fromStreamerSource) {
247 if (!producedTypes.empty()) {
248 std::sort(producedTypes.begin(), producedTypes.end());
249 producedTypes.erase(
std::unique(producedTypes.begin(), producedTypes.end()), producedTypes.end());
251 std::ostringstream ostr;
252 for(
auto const& item : producedTypes) {
253 ostr <<
" " << item <<
"\n";
255 if (fromStreamerSource) {
256 exception <<
"\nA type listed above might or might not be the same as a\n" 257 <<
"type stored in the Event. Instead it might be the type of\n" 258 <<
"a data member, base class, wrapped type, or other object\n" 259 <<
"needed by a stored type. Below is some additional information\n" 260 <<
"which lists the stored types associated with the types whose\n" 261 <<
"dictionaries were not found:\n\n" 262 << ostr.str() <<
"\n";
264 exception <<
"\nA type listed above might or might not be the same as a\n" 265 <<
"type stored in the Event (or Lumi or Run). Instead it might\n" 266 <<
"be the type of a data member, base class, wrapped type, or\n" 267 <<
"other object needed by a stored type. Below is some additional\n" 268 <<
"information which lists the stored types associated with the\n" 269 <<
"types whose dictionaries were not found:\n\n" 270 << ostr.str() <<
"\n";
274 if (!branchNames.empty()) {
276 std::sort(branchNames.begin(), branchNames.end());
277 branchNames.erase(
std::unique(branchNames.begin(), branchNames.end()), branchNames.end());
279 std::ostringstream ostr;
280 for(
auto const& item : branchNames) {
281 ostr <<
" " << item <<
"\n";
283 if (fromStreamerSource) {
284 exception <<
"Missing dictionaries are associated with these branch names:\n\n" 285 << ostr.str() <<
"\n";
287 exception <<
"Missing dictionaries are associated with these branch names:\n\n" 288 << ostr.str() <<
"\n" 289 <<
"If you do not need these branches and they are not produced\n" 290 <<
"in the current process, an alternate solution to adding\n" 291 <<
"dictionaries is to drop these branches on input using the\n" 292 <<
"inputCommands parameter of the PoolSource.";
300 std::set<std::string>& producedTypes,
301 bool consumedWithView) {
306 if (!producedTypes.empty()) {
308 std::ostringstream ostr;
309 for(
auto const& item : producedTypes) {
310 ostr <<
" " << item <<
"\n";
312 if (consumedWithView) {
313 exception <<
"\nThe list of types above was generated while checking for\n" 314 <<
"dictionaries related to products declared to be consumed\n" 315 <<
"using a View. They will be either the type or a base class\n" 316 <<
"of the type declared in a consumes declaration as the template\n" 317 <<
"parameter of a View. Below is some additional information\n" 318 <<
"which lists the type of the template parameter of the View.\n" 319 <<
"(It will be the same type unless the missing dictionary is\n" 320 <<
"for a base type):\n\n" 321 << ostr.str() <<
"\n";
323 exception <<
"\nThe list of types above was generated while checking for\n" 324 <<
"dictionaries related to products declared to be consumed.\n" 325 <<
"A type listed above might or might not be a type declared\n" 326 <<
"to be consumed. Instead it might be the type of a data member,\n" 327 <<
"base class, wrapped type or other object needed by a consumed\n" 328 <<
"type. Below is some additional information which lists\n" 329 <<
"the types declared to be consumed by a module and which\n" 330 <<
"are associated with the types whose dictionaries were not\n" 332 << ostr.str() <<
"\n";
342 std::vector<TypeWithDict>& baseTypes) {
349 if (!typeWithDict.isClass()) {
354 bool returnValue =
true;
355 for (
auto const& basex : bases) {
370 baseTypes.push_back(baseType);
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
bool public_base_classes(std::vector< std::string > &missingDictionaries, TypeID const &typeID, std::vector< TypeWithDict > &baseTypes)
const std::type_info & typeInfo() const
static TypeWithDict byName(std::string const &name)
bool invalidTypeInfo() const
TClass * getClass() const
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
def unique(seq, keepstr=True)
bool checkClassDictionaries(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
std::type_info const & typeInfo() const
TypeWithDict typeOf() const
base
Make Sure CMSSW is Setup ##.
std::string wrappedClassName(std::string const &iFullName)
bool search_all(ForwardSequence const &s, Datum const &d)
void addContext(std::string const &context)
void addToMissingDictionariesException(edm::Exception &exception, std::vector< std::string > &missingDictionaries, std::string const &context)
std::string const & className() const
bool hasDictionary(std::type_info const &)
bool checkDictionaryOfWrappedType(std::vector< std::string > &missingDictionaries, TypeID const &unwrappedTypeID)