CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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:
25  typedef VarProcessor::Registry::Registry<ProcCount,
26  Calibration::ProcCount> Registry;
27 
28  ProcCount(const char *name,
30  const MVAComputer *computer);
31  virtual ~ProcCount() {}
32 
33  virtual void configure(ConfIterator iter, unsigned int n) override;
34  virtual void eval(ValueIterator iter, unsigned int n) const override;
35 };
36 
37 static ProcCount::Registry registry("ProcCount");
38 
39 ProcCount::ProcCount(const char *name,
41  const MVAComputer *computer) :
42  VarProcessor(name, calib, computer)
43 {
44 }
45 
46 void ProcCount::configure(ConfIterator iter, unsigned int n)
47 {
48  while(iter)
49  iter++(Variable::FLAG_ALL) << Variable::FLAG_NONE;
50 }
51 
52 void ProcCount::eval(ValueIterator iter, unsigned int n) const
53 {
54  while(iter) {
55  unsigned int count = iter.size();
56  iter(count);
57  iter++;
58  }
59 }
60 
61 } // anonymous namespace
template to generate a registry singleton for a type.
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
Main interface class to the generic discriminator computer framework.
Definition: MVAComputer.h:39
static Interceptor::Registry registry("Interceptor")
Common base class for variable processors.
Definition: VarProcessor.h:36