30 #include <boost/thread.hpp>
32 #include <Reflex/Reflex.h>
38 namespace PhysicsTools {
43 static const char prefix[] =
"PhysicsTools::Calibration::";
44 std::string
type = ROOT::Reflex::Tools::Demangle(
typeid(*
this));
45 if (type.size() <=
sizeof prefix - 1 ||
46 type.substr(0,
sizeof prefix - 1) !=
prefix)
48 <<
"getInstanceName failed for "
49 <<
typeid(*this).name() <<
"." << std::endl;
51 return type.substr(
sizeof prefix - 1);
64 boost::mutex::scoped_lock scoped_lock(mutex);
74 inputSet(orig.inputSet),
78 for(std::vector<VarProcessor*>::const_iterator iter =
86 for(std::vector<VarProcessor*>::iterator iter =
processors.begin();
98 for(std::vector<VarProcessor*>::iterator iter =
processors.begin();
103 for(std::vector<VarProcessor*>::const_iterator iter =
122 ROOT::Reflex::Type::ByTypeInfo(
typeid(*proc));
124 ROOT::Reflex::CONST & ROOT::Reflex::REFERENCE);
125 if (!type.Name().size())
127 <<
"Calibration class " <<
typeid(*proc).name()
128 <<
" not registered with ROOT::Reflex."
131 ROOT::Reflex::Object
obj =
132 ROOT::Reflex::Object(baseType, const_cast<void*>(
133 static_cast<const void*>(proc))).CastObject(type);
136 for(ROOT::Reflex::Member_Iterator iter = type.FunctionMember_Begin();
137 iter != type.FunctionMember_End(); iter++) {
139 if (!iter->IsConstructor() ||
140 ctor.FunctionParameterSize() != 1 ||
141 ctor.FunctionParameterAt(0).Id() != refType.Id())
144 ROOT::Reflex::Object
copy = type.Construct(ctor,
145 ROOT::Reflex::Tools::MakeVector<void*>(obj.Address()));
147 processors.push_back(static_cast<VarProcessor*>(copy.Address()));
152 <<
"Calibration class " <<
typeid(*proc).name()
153 <<
" has no copy ctor registered with ROOT::Reflex."
160 return ++nextCacheId;
178 public std::unary_function<const std::string&, bool> {
180 inline Comparator(
const std::string &
label) : label(label) {}
184 {
return entry.first ==
label; }
192 std::vector<Entry>::const_iterator
pos =
198 <<
"Calibration record " << label
199 <<
" not found in MVAComputerContainer." << std::endl;
static boost::mutex mutex
TrainProcessor *const proc
std::pair< std::string, MonitorElement * > entry