CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
PhysicsTools::Interceptor Class Reference
Inheritance diagram for PhysicsTools::Interceptor:
PhysicsTools::VarProcessor PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory

Public Types

typedef
VarProcessor::Registry::Registry
< Interceptor,
Calibration::Interceptor
Registry
 
- Public Types inherited from PhysicsTools::VarProcessor
enum  LoopStatus { kStop, kNext, kReset, kSkip }
 
typedef
edmplugin::PluginFactory
< Dummy *()> 
PluginFactory
 

Public Member Functions

virtual void configure (ConfIterator iter, unsigned int n)
 virtual configure method, implemented in actual processor More...
 
virtual void eval (ValueIterator iter, unsigned int n) const
 virtual evaluation method, implemented in actual processor More...
 
 Interceptor (const char *name, const Calibration::Interceptor *calib, const MVAComputer *computer)
 
virtual ~Interceptor ()
 
- Public Member Functions inherited from PhysicsTools::VarProcessor
void configure (ConfigCtx &config)
 called from the discriminator computer to configure processor More...
 
void deriv (double *input, int *conf, double *output, int *outConf, int *loop, unsigned int offset, unsigned int in, unsigned int out, std::vector< double > &deriv) const
 run the processor evaluation pass on this processor and compute derivatives More...
 
void eval (double *input, int *conf, double *output, int *outConf, int *loop, unsigned int offset) const
 run the processor evaluation pass on this processor More...
 
virtual LoopStatus loop (double *output, int *outConf, unsigned int nOutput, unsigned int &nOffset) const
 
virtual ~VarProcessor ()
 
- Public Member Functions inherited from PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory
template<>
VarProcessorcreate (const char *name, const Calibration::VarProcessor *calib, const MVAComputer *parent)
 
template<>
TrainProcessorcreate (const char *, const AtomicId *, MVATrainer *)
 
template<>
TrainProcessorcreate (const char *name, const AtomicId *id, MVATrainer *trainer)
 
template<>
VarProcessorcreate (const char *, const Calibration::VarProcessor *, const MVAComputer *)
 

Private Attributes

Calibration::Interceptorinterceptor
 
std::vector< double > * values
 

Additional Inherited Members

- Static Public Member Functions inherited from PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory
static Base_t * create (const char *name, const CalibBase_t *calib, Parent_t *parent=0)
 
- Protected Types inherited from PhysicsTools::VarProcessor
typedef ProcessRegistry
< VarProcessor,
Calibration::VarProcessor,
const MVAComputer
Registry
 
- Protected Member Functions inherited from PhysicsTools::VarProcessor
virtual ConfigCtx::ContextconfigureLoop (ConfigCtx::Context *ctx, ConfigCtx::iterator begin, ConfigCtx::iterator cur, ConfigCtx::iterator end)
 virtual loop configure method More...
 
virtual std::vector< double > deriv (ValueIterator iter, unsigned int n) const
 virtual derivative evaluation method, implemented in actual processor More...
 
 VarProcessor (const char *name, const Calibration::VarProcessor *calib, const MVAComputer *computer)
 
- Protected Attributes inherited from PhysicsTools::VarProcessor
const MVAComputercomputer
 

Detailed Description

Definition at line 26 of file Interceptor.cc.

Member Typedef Documentation

Definition at line 29 of file Interceptor.cc.

Constructor & Destructor Documentation

PhysicsTools::Interceptor::Interceptor ( const char *  name,
const Calibration::Interceptor calib,
const MVAComputer computer 
)

Definition at line 46 of file Interceptor.cc.

48  :
50  interceptor(const_cast<Calibration::Interceptor*>(calib)),
51  values(0)
52 {
53 }
Calibration::Interceptor * interceptor
Definition: Interceptor.cc:40
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
std::vector< double > * values
Definition: Interceptor.cc:41
const MVAComputer * computer
Definition: VarProcessor.h:297
VarProcessor(const char *name, const Calibration::VarProcessor *calib, const MVAComputer *computer)
Definition: VarProcessor.cc:38
PhysicsTools::Interceptor::~Interceptor ( )
virtual

Definition at line 55 of file Interceptor.cc.

References values.

56 {
57  delete[] values;
58 }
std::vector< double > * values
Definition: Interceptor.cc:41

Member Function Documentation

void PhysicsTools::Interceptor::configure ( ConfIterator  iter,
unsigned int  n 
)
virtual

virtual configure method, implemented in actual processor

Implements PhysicsTools::VarProcessor.

Definition at line 60 of file Interceptor.cc.

References PhysicsTools::VarProcessor::computer, PhysicsTools::Calibration::Interceptor::configure(), PhysicsTools::Variable::FLAG_NONE, flags, i, interceptor, n, and values.

61 {
62  std::vector<Variable::Flags> flags;
63  for(ConfIterator iter2 = iter; iter2; iter2++)
64  flags.push_back(*iter2);
65 
66  flags = interceptor->configure(computer, n, flags);
67  if (flags.size() != n)
68  return;
69 
70  for(unsigned int i = 0; i < n; i++)
71  iter++(flags[i]);
72 
73  iter << Variable::FLAG_NONE;
74 
75  values = new std::vector<double>[n];
76 }
int i
Definition: DBlmapReader.cc:9
Calibration::Interceptor * interceptor
Definition: Interceptor.cc:40
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::vector< double > * values
Definition: Interceptor.cc:41
const MVAComputer * computer
Definition: VarProcessor.h:297
virtual std::vector< PhysicsTools::Variable::Flags > configure(const PhysicsTools::MVAComputer *computer, unsigned int n, const std::vector< PhysicsTools::Variable::Flags > &flags)=0
void PhysicsTools::Interceptor::eval ( ValueIterator  iter,
unsigned int  n 
) const
virtual

virtual evaluation method, implemented in actual processor

Implements PhysicsTools::VarProcessor.

Definition at line 78 of file Interceptor.cc.

References PhysicsTools::VarProcessor::ValueIterator::begin(), filterCSVwithJSON::copy, PhysicsTools::VarProcessor::ValueIterator::end(), i, PhysicsTools::Calibration::Interceptor::intercept(), interceptor, n, PhysicsTools::VarProcessor::ValueIterator::size(), and values.

79 {
80  std::vector<double> *var = values;
81 
82  for(unsigned int i = 0; i < n; i++) {
83  var->resize(iter.size());
84  std::copy(iter.begin(), iter.end(), var->begin());
85  iter++;
86  var++;
87  }
88 
90 
91  iter(0.0);
92 }
int i
Definition: DBlmapReader.cc:9
Calibration::Interceptor * interceptor
Definition: Interceptor.cc:40
virtual double intercept(const std::vector< double > *values) const =0
std::vector< double > * values
Definition: Interceptor.cc:41

Member Data Documentation

Calibration::Interceptor* PhysicsTools::Interceptor::interceptor
private

Definition at line 40 of file Interceptor.cc.

Referenced by configure(), and eval().

std::vector<double>* PhysicsTools::Interceptor::values
private

Definition at line 41 of file Interceptor.cc.

Referenced by configure(), eval(), python.seqvaluedict.seqdict::items(), and ~Interceptor().