CMS 3D CMS Logo

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

List of all members.

Public Types

typedef
VarProcessor::Registry::Registry
< Interceptor,
Calibration::Interceptor
Registry

Public Member Functions

virtual void configure (ConfIterator iter, unsigned int n)
 virtual configure method, implemented in actual processor
virtual void eval (ValueIterator iter, unsigned int n) const
 virtual evaluation method, implemented in actual processor
 Interceptor (const char *name, const Calibration::Interceptor *calib, const MVAComputer *computer)
virtual ~Interceptor ()

Private Attributes

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

Detailed Description

Definition at line 26 of file Interceptor.cc.


Member Typedef Documentation

typedef VarProcessor::Registry::Registry<Interceptor, Calibration::Interceptor> PhysicsTools::Interceptor::Registry

Reimplemented from PhysicsTools::VarProcessor.

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.

                                                      :
        VarProcessor(name, calib, computer),
        interceptor(const_cast<Calibration::Interceptor*>(calib)),
        values(0)
{
}
PhysicsTools::Interceptor::~Interceptor ( ) [virtual]

Definition at line 55 of file Interceptor.cc.

References values.

{
        delete[] values;
}

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.

{
        std::vector<Variable::Flags> flags;
        for(ConfIterator iter2 = iter; iter2; iter2++)
                flags.push_back(*iter2);

        flags = interceptor->configure(computer, n, flags);
        if (flags.size() != n)
                return;

        for(unsigned int i = 0; i < n; i++)
                iter++(flags[i]);

        iter << Variable::FLAG_NONE;

        values = new std::vector<double>[n];
}
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.

{
        std::vector<double> *var = values;

        for(unsigned int i = 0; i < n; i++) {
                var->resize(iter.size());
                std::copy(iter.begin(), iter.end(), var->begin());
                iter++;
                var++;
        }

        interceptor->intercept(values);

        iter(0.0);
}

Member Data Documentation

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(), and ~Interceptor().