CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ClassFiller.cc
Go to the documentation of this file.
7 #include "Cintex/Cintex.h"
9 
10 
11 #include "TClass.h"
12 #include "G__ci.h"
13 
14 #include <string>
15 #include <set>
16 #include <algorithm>
17 #include <iostream>
18 
19 namespace edm {
20  void loadCap(std::string const& name) {
21  FDEBUG(1) << "Loading dictionary for " << name << "\n";
23  checkDictionaries(name);
24  if (!missingTypes().empty()) {
26  missingTypes().clear();
27  for_all(missing, loadCap);
28  }
29  }
30 
32  FDEBUG(3) << "doing BuildRealData for " << name << "\n";
33  TClass* ttest = TClass::GetClass(name.c_str());
34  if (ttest != 0) {
35  ttest->BuildRealData();
36  } else {
38  << "Could not find TClass for " << name << "\n";
39  }
40  }
41  // ---------------------
42 
44  static bool done = false;
45  if (done == false) {
46  loadCap(std::string("edm::StreamedProduct"));
47  loadCap(std::string("std::vector<edm::StreamedProduct>"));
48  loadCap(std::string("edm::SendEvent"));
49  loadCap(std::string("std::vector<edm::BranchDescription>"));
50  loadCap(std::string("edm::SendJobHeader"));
51  }
52  G__SetCatchException(0);
53  ROOT::Cintex::Cintex::Enable();
54  done=true;
55  }
56 
57  namespace {
58  TClass* getRootClass(std::string const& name) {
59  TClass* tc = TClass::GetClass(name.c_str());
60 
61  // get ROOT TClass for this product
62  // CINT::Type* cint_type = CINT::Type::get(typ_ref);
63  // tc_ = cint_type->rootClass();
64  // TClass* tc = TClass::GetClass(typeid(se));
65  // tc_ = TClass::GetClass("edm::SendEvent");
66 
67  if(tc == 0) {
68  throw edm::Exception(errors::Configuration,"getRootClass")
69  << "could not find TClass for " << name
70  << "\n";
71  }
72 
73  return tc;
74  }
75  }
76 
77  // ---------------------
78  TClass* getTClass(std::type_info const& ti) {
79  TypeID const type(ti);
80  return getRootClass(type.className());
81  }
82 }
type
Definition: HCALResponse.h:21
dictionary missing
Definition: combine.py:4
void doBuildRealData(const std::string &name)
Definition: ClassFiller.cc:31
std::string const & dictionaryPlugInPrefix()
#define FDEBUG(lev)
Definition: DebugMacros.h:18
TClass * getTClass(const std::type_info &ti)
Definition: ClassFiller.cc:78
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
StringSet & missingTypes()
std::set< std::string > StringSet
void checkDictionaries(std::string const &name, bool noComponents=false)
static PluginCapabilities * get()
std::string const & className() const
Definition: TypeID.cc:46
void load(const std::string &iName)
void loadExtraClasses()
Definition: ClassFiller.cc:43
void loadCap(const std::string &name)
Definition: ClassFiller.cc:20