CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
PhysicsTools::MVAComputer::DerivContext Struct Reference

#include <MVAComputer.h>

Public Member Functions

int * conf () const
 
 DerivContext ()
 
void eval (const VarProcessor *proc, int *outConf, double *output, int *loop, VarProcessor::LoopCtx &ctx, 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 155 of file MVAComputer.h.

Constructor & Destructor Documentation

PhysicsTools::MVAComputer::DerivContext::DerivContext ( )
inline

Member Function Documentation

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

Definition at line 169 of file MVAComputer.h.

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

Definition at line 170 of file MVAComputer.h.

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

Definition at line 275 of file MVAComputer.cc.

References filterCSVwithJSON::copy, PhysicsTools::MVAComputer::evalInternal(), and PhysicsTools::MVAComputer::output.

275  {
276  derivs.clear();
277  derivs.reserve(n_);
278 
279  int pos = conf_[output];
280  if (pos >= (int)n_)
281  std::copy(&deriv_.front() + n_ * (pos - n_), &deriv_.front() + n_ * (pos - n_ + 1), std::back_inserter(derivs));
282  else {
283  derivs.resize(n_);
284  derivs[pos] = 1.;
285  }
286 
287  return values_[pos];
288  }
double output(unsigned int output, std::vector< double > &derivs) const
Definition: MVAComputer.cc:275
double* PhysicsTools::MVAComputer::DerivContext::values ( ) const
inline

Definition at line 168 of file MVAComputer.h.

168 { return &values_.front(); }

Member Data Documentation

std::vector<int> PhysicsTools::MVAComputer::DerivContext::conf_
mutable

Definition at line 174 of file MVAComputer.h.

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

Definition at line 173 of file MVAComputer.h.

unsigned int PhysicsTools::MVAComputer::DerivContext::n_

Definition at line 175 of file MVAComputer.h.

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

Definition at line 172 of file MVAComputer.h.