19 using namespace PhysicsTools;
28 ~ProcOptional()
override {}
30 void configure(ConfIterator iter,
unsigned int n)
override;
31 void eval(ValueIterator iter,
unsigned int n)
const override;
32 std::vector<double> deriv(ValueIterator iter,
unsigned int n)
const override;
35 std::vector<double> neutralPos;
41 :
VarProcessor(name, calib, computer), neutralPos(calib->neutralPos) {}
43 void ProcOptional::configure(ConfIterator iter,
unsigned int n) {
44 if (n != neutralPos.size())
48 iter++(Variable::FLAG_OPTIONAL) << Variable::FLAG_NONE;
51 void ProcOptional::eval(ValueIterator iter,
unsigned int n)
const {
52 for (std::vector<double>::const_iterator pos = neutralPos.begin(); pos != neutralPos.end(); pos++, ++iter) {
53 switch (iter.size()) {
61 throw cms::Exception(
"ProcOptional") <<
"Multiple input variables encountered." << std::endl;
66 std::vector<double> ProcOptional::deriv(ValueIterator iter,
unsigned int n)
const {
67 unsigned int size = 0;
68 for (ValueIterator iter2 = iter; iter2; ++iter2)
71 std::vector<double>
result;
73 unsigned int column = 0;
74 for (std::vector<double>::const_iterator pos = neutralPos.begin(); pos != neutralPos.end(); pos++, ++iter) {
75 unsigned int row = result.size();
76 result.resize(row + size);
77 switch (iter.size()) {
81 result[row + column++] = 1.0;
84 throw cms::Exception(
"ProcOptionalError") <<
"Multiple input variables encountered." << std::endl;
tuple size
Write out results.