26 #include "PhysicsTools/MVAComputer/interface/ProcessRegistry.icc"
37 namespace PhysicsTools {
40 : computer(computer), inputVars(
Calibration::
convert(calib->inputVars)), nInputVars(inputVars.bits()) {}
58 if (ctx != config.
ctx) {
63 if (config.
loop && !ctx)
64 config.
loop =
nullptr;
65 else if (!config.
loop && ctx)
70 for (std::vector<Variable::Flags>::const_iterator iter = flags.begin(); iter != flags.end(); ++iter)
88 std::unique_ptr<PhysicsTools::VarProcessor::Dummy>
tmp{
97 <<
"Caught exception when building processor: " << name <<
" message: " << std::endl
98 << e.
what() << std::endl;
114 std::vector<double> &
deriv)
const {
121 unsigned int size = 0;
123 size += (iter++).
size();
124 bool empty = matrix.empty();
125 assert(size != 0 || empty);
126 unsigned int out = empty ? 0 : (matrix.size() /
size);
128 if (matrix.size() != out * size || (out > 1 && (int)out != outConf[out_] - outConf[0]))
130 <<
"Derivative matrix implausible size in " <<
typeid(*this).name() <<
"." << std::endl;
133 if (!matrix.empty()) {
137 for (
unsigned int i = 0;
i <
out;
i++) {
138 for (
unsigned int j = 0;
j <
size;
j++)
142 std::cout <<
"----------------" << std::endl;
145 std::cout <<
"======= in = " << in <<
", size = " << size <<
", out = " << out <<
", matrix = " << matrix.size()
149 unsigned int sz = (outConf[out_] -
in) * in;
150 unsigned int oldSz = deriv.size();
154 double *
begin = &deriv.front() + (outConf[0] - in +
offset) * in;
155 double *
end = begin + out *
in;
156 if (begin < &deriv.front() + oldSz)
162 double *m0 = &matrix.front();
168 int *curConf = conf + cur();
169 unsigned int pos = *curConf;
171 std::cout <<
" -> cur = " << cur() <<
", pos = " << pos << std::endl;
173 if (loop && curConf >= loop) {
178 unsigned int n = loop ? (curConf[1] - curConf[0]) : 1;
179 for (
unsigned int j = 0;
j <
n; m0++,
j++, pos++) {
181 std::cout <<
" multip " << j << std::endl;
188 const double *
q = &deriv.front() + (pos -
in) * in;
189 for (
const double *
m = m0; p <
end;
m +=
size, q -=
in)
190 for (
unsigned int k = 0;
k <
in;
k++)
196 for (
const double *
m = m0; p <
end;
m +=
size, p +=
in)
203 std::cout <<
"================" << std::endl;
204 for (
const double *
p = &deriv.front();
p != &deriv.front() + deriv.size();) {
205 for (
unsigned int j = 0;
j <
in;
j++)
209 std::cout <<
"================" << std::endl;
222 registerProcess(
char const *,
Log< level::Error, false > LogError
static std::string const input
edmplugin::PluginFactory< PhysicsTools::VarProcessor::PluginFunctionPrototype > VPPluginFactory
char const * what() const noexceptoverride
#define EDM_REGISTER_PLUGINFACTORY(_factory_, _category_)
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
std::string typeDemangle(char const *mangledName)
tuple config
parse the configuration file
tuple size
Write out results.