CMS 3D CMS Logo

Public Member Functions | Public Attributes

PhysicsTools::MVAComputer::DerivContext Struct Reference

List of all members.

Public Member Functions

int * conf () const
 DerivContext ()
void eval (const VarProcessor *proc, int *outConf, double *output, int *loop, unsigned int offset, unsigned int out) const
unsigned int n () const
double output (unsigned int output, std::vector< double > &derivs) const
double * values () const

Public Attributes

std::vector< int > conf_
std::vector< double > deriv_
unsigned int n_
std::vector< double > values_

Detailed Description

Definition at line 159 of file MVAComputer.h.


Constructor & Destructor Documentation

PhysicsTools::MVAComputer::DerivContext::DerivContext ( ) [inline]

Definition at line 160 of file MVAComputer.h.

: n_(0) {}

Member Function Documentation

int* PhysicsTools::MVAComputer::DerivContext::conf ( ) const [inline]

Definition at line 170 of file MVAComputer.h.

Referenced by eval().

{ return &conf_.front(); }
void PhysicsTools::MVAComputer::DerivContext::eval ( const VarProcessor proc,
int *  outConf,
double *  output,
int *  loop,
unsigned int  offset,
unsigned int  out 
) const

Definition at line 312 of file MVAComputer.cc.

References conf(), PhysicsTools::VarProcessor::deriv(), deriv_, n(), and values().

{
        proc->deriv(values(), conf(), output, outConf,
                    loop, offset, n(), out, deriv_);
}
unsigned int PhysicsTools::MVAComputer::DerivContext::n ( void  ) const [inline]

Definition at line 171 of file MVAComputer.h.

Referenced by eval().

{ return n_; }
double PhysicsTools::MVAComputer::DerivContext::output ( unsigned int  output,
std::vector< double > &  derivs 
) const

Definition at line 320 of file MVAComputer.cc.

References filterCSVwithJSON::copy, PhysicsTools::MVAComputer::output, and pos.

{
        derivs.clear();
        derivs.reserve(n_);

        int pos = conf_[output];
        if (pos >= (int)n_)
                std::copy(&deriv_.front() + n_ * (pos - n_),
                          &deriv_.front() + n_ * (pos - n_ + 1),
                          std::back_inserter(derivs));
        else {
                derivs.resize(n_);
                derivs[pos] = 1.;
        }

        return values_[pos];
}
double* PhysicsTools::MVAComputer::DerivContext::values ( ) const [inline]

Definition at line 169 of file MVAComputer.h.

Referenced by eval().

{ return &values_.front(); }

Member Data Documentation

Definition at line 175 of file MVAComputer.h.

std::vector<double> PhysicsTools::MVAComputer::DerivContext::deriv_ [mutable]

Definition at line 174 of file MVAComputer.h.

Referenced by eval().

Definition at line 176 of file MVAComputer.h.

std::vector<double> PhysicsTools::MVAComputer::DerivContext::values_ [mutable]

Definition at line 173 of file MVAComputer.h.