CMS 3D CMS Logo

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::InterceptorRegistry
 
- Public Types inherited from PhysicsTools::VarProcessor
enum  LoopStatus { kStop, kNext, kReset, kSkip }
 
typedef DummyPluginFunctionPrototype()
 

Public Member Functions

virtual void configure (ConfIterator iter, unsigned int n) override
 virtual configure method, implemented in actual processor More...
 
virtual void eval (ValueIterator iter, unsigned int n) const override
 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, LoopCtx &ctx, 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, LoopCtx &loopCtx, unsigned int offset) const
 run the processor evaluation pass on this processor More...
 
virtual LoopStatus loop (double *output, int *outConf, unsigned int nOutput, LoopCtx &ctx, 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 MVAComputerRegistry
 
- 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 25 of file Interceptor.cc.

Member Typedef Documentation

Definition at line 28 of file Interceptor.cc.

Constructor & Destructor Documentation

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

Definition at line 45 of file Interceptor.cc.

47  :
49  interceptor(const_cast<Calibration::Interceptor*>(calib)),
50  values(0)
51 {
52 }
Calibration::Interceptor * interceptor
Definition: Interceptor.cc:39
std::vector< double > * values
Definition: Interceptor.cc:40
const MVAComputer * computer
Definition: VarProcessor.h:320
VarProcessor(const char *name, const Calibration::VarProcessor *calib, const MVAComputer *computer)
Definition: VarProcessor.cc:38
PhysicsTools::Interceptor::~Interceptor ( )
virtual

Definition at line 54 of file Interceptor.cc.

References values.

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

Member Function Documentation

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

virtual configure method, implemented in actual processor

Implements PhysicsTools::VarProcessor.

Definition at line 59 of file Interceptor.cc.

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

60 {
61  std::vector<Variable::Flags> flags;
62  for(ConfIterator iter2 = iter; iter2; iter2++)
63  flags.push_back(*iter2);
64 
65  flags = interceptor->configure(computer, n, flags);
66  if (flags.size() != n)
67  return;
68 
69  for(unsigned int i = 0; i < n; i++)
70  iter++(flags[i]);
71 
72  iter << Variable::FLAG_NONE;
73 
74  values = new std::vector<double>[n];
75 }
Calibration::Interceptor * interceptor
Definition: Interceptor.cc:39
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::vector< double > * values
Definition: Interceptor.cc:40
const MVAComputer * computer
Definition: VarProcessor.h:320
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
overridevirtual

virtual evaluation method, implemented in actual processor

Implements PhysicsTools::VarProcessor.

Definition at line 77 of file Interceptor.cc.

References PhysicsTools::VarProcessor::ValueIterator::begin(), popcon2dropbox::copy(), PhysicsTools::VarProcessor::ValueIterator::end(), mps_fire::i, PhysicsTools::Calibration::Interceptor::intercept(), interceptor, gen::n, PhysicsTools::VarProcessor::ValueIterator::size(), values, and JetChargeProducer_cfi::var.

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

Member Data Documentation

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

Definition at line 39 of file Interceptor.cc.

Referenced by configure(), and eval().

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