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

◆ DerivContext()

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

Definition at line 156 of file MVAComputer.h.

156 : n_(0) {}

Member Function Documentation

◆ conf()

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

Definition at line 169 of file MVAComputer.h.

169 { return &conf_.front(); }

Referenced by eval().

◆ eval()

void PhysicsTools::MVAComputer::DerivContext::eval ( const VarProcessor proc,
int *  outConf,
double *  output,
int *  loop,
VarProcessor::LoopCtx ctx,
unsigned int  offset,
unsigned int  out 
) const

◆ n()

unsigned int PhysicsTools::MVAComputer::DerivContext::n ( ) const
inline

Definition at line 170 of file MVAComputer.h.

170 { return n_; }

Referenced by eval().

◆ output()

double PhysicsTools::MVAComputer::DerivContext::output ( unsigned int  output,
std::vector< double > &  derivs 
) const

Definition at line 275 of file MVAComputer.cc.

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  }

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

Referenced by eval().

◆ values()

double* PhysicsTools::MVAComputer::DerivContext::values ( ) const
inline

Definition at line 168 of file MVAComputer.h.

168 { return &values_.front(); }

Referenced by eval().

Member Data Documentation

◆ conf_

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

Definition at line 174 of file MVAComputer.h.

◆ deriv_

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

Definition at line 173 of file MVAComputer.h.

Referenced by eval().

◆ n_

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

Definition at line 175 of file MVAComputer.h.

◆ values_

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

Definition at line 172 of file MVAComputer.h.

filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
PhysicsTools::MVAComputer::DerivContext::deriv_
std::vector< double > deriv_
Definition: MVAComputer.h:173
pos
Definition: PixelAliasList.h:18
PhysicsTools::MVAComputer::DerivContext::conf_
std::vector< int > conf_
Definition: MVAComputer.h:174
PhysicsTools::MVAComputer::DerivContext::values_
std::vector< double > values_
Definition: MVAComputer.h:172
ValidateTausOnZEEFastSim_cff.proc
proc
Definition: ValidateTausOnZEEFastSim_cff.py:6
heppy_loop.loop
loop
Definition: heppy_loop.py:28
PhysicsTools::MVAComputer::DerivContext::values
double * values() const
Definition: MVAComputer.h:168
PhysicsTools::MVAComputer::DerivContext::output
double output(unsigned int output, std::vector< double > &derivs) const
Definition: MVAComputer.cc:275
PhysicsTools::MVAComputer::DerivContext::conf
int * conf() const
Definition: MVAComputer.h:169
PhysicsTools::MVAComputer::DerivContext::n
unsigned int n() const
Definition: MVAComputer.h:170
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
PhysicsTools::MVAComputer::DerivContext::n_
unsigned int n_
Definition: MVAComputer.h:175