CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProcCount.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: MVAComputer
4 // Class : ProcCount
5 //
6 
7 // Implementation:
8 // Variable processor that returns the number of input variable instances
9 //
10 // Author: Christophe Saout
11 // Created: Fri May 18 20:05 CEST 2007
12 //
13 
15 
18 
19 using namespace PhysicsTools;
20 
21 namespace { // anonymous
22 
23  class ProcCount : public VarProcessor {
24  public:
26 
27  ProcCount(const char *name, const Calibration::ProcCount *calib, const MVAComputer *computer);
28  ~ProcCount() override {}
29 
30  void configure(ConfIterator iter, unsigned int n) override;
31  void eval(ValueIterator iter, unsigned int n) const override;
32  };
33 
34  ProcCount::Registry registry("ProcCount");
35 
36  ProcCount::ProcCount(const char *name, const Calibration::ProcCount *calib, const MVAComputer *computer)
37  : VarProcessor(name, calib, computer) {}
38 
39  void ProcCount::configure(ConfIterator iter, unsigned int n) {
40  while (iter)
41  iter++(Variable::FLAG_ALL) << Variable::FLAG_NONE;
42  }
43 
44  void ProcCount::eval(ValueIterator iter, unsigned int n) const {
45  while (iter) {
46  unsigned int count = iter.size();
47  iter(count);
48  iter++;
49  }
50  }
51 
52 } // anonymous namespace
template to generate a registry singleton for a type.
Main interface class to the generic discriminator computer framework.
Definition: MVAComputer.h:39
Common base class for variable processors.
Definition: VarProcessor.h:36