1 #ifndef PhysicsTools_MVATrainer_TrainerMonitoring_h
2 #define PhysicsTools_MVATrainer_TrainerMonitoring_h
9 #include <boost/shared_ptr.hpp>
10 #include <boost/type_traits.hpp>
11 #include <boost/mpl/bool.hpp>
12 #include <boost/mpl/or.hpp>
17 #include <TDirectory.h>
20 namespace PhysicsTools {
57 template<
typename T,
typename T1>
64 template<
typename T,
typename T1,
typename T2>
66 T *
obj =
new T(a1, a2);
71 template<
typename T,
typename T1,
typename T2,
typename T3>
73 T *
obj =
new T(a1, a2, a3);
78 template<
typename T,
typename T1,
typename T2,
typename T3,
81 T *
obj =
new T(a1, a2, a3, a4);
86 template<
typename T,
typename T1,
typename T2,
typename T3,
87 typename T4,
typename T5>
89 T *
obj =
new T(a1, a2, a3, a4, a5);
94 template<
typename T,
typename T1,
typename T2,
typename T3,
95 typename T4,
typename T5,
typename T6>
97 T *
obj =
new T(a1, a2, a3, a4, a5, a6);
102 template<
typename T,
typename T1,
typename T2,
typename T3,
103 typename T4,
typename T5,
typename T6,
typename T7>
105 T *
obj =
new T(a1, a2, a3, a4, a5, a6, a7);
106 this->
reg(name, obj);
110 template<
typename T,
typename T1,
typename T2,
typename T3,
111 typename T4,
typename T5,
typename T6,
typename T7,
114 T *
obj =
new T(a1, a2, a3, a4, a5, a6, a7, a8);
115 this->
reg(name, obj);
119 template<
typename T,
typename T1,
typename T2,
typename T3,
120 typename T4,
typename T5,
typename T6,
typename T7,
121 typename T8,
typename T9>
123 T *
obj =
new T(a1, a2, a3, a4, a5, a6, a7, a8, a9);
124 this->
reg(name, obj);
142 std::map<std::string, boost::shared_ptr<Object> >
data;
155 virtual void write(TDirectory *
dir) = 0;
165 Object(name), object(object) {}
170 dir->WriteObjectAny(
object.
get(),
171 TClass::GetClass(
typeid(
T)),
181 std::map<std::string, boost::shared_ptr<Module> >
modules;
185 template<
typename T,
bool B>
191 {
object->SetDirectory(0); }
199 boost::is_base_of<TH1, T>,
200 boost::is_base_of<TTree, T> >());
201 this->
book(name,
object);
206 #endif // PhysicsTools_MVATrainer_TrainerMonitoring_h