source: trunk/MagicSoft/Mars/mjoptim/MJOptimizeBase.h@ 8644

Last change on this file since 8644 was 8643, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 1.8 KB
Line 
1#ifndef MARS_MJOptimizeBase
2#define MARS_MJOptimizeBase
3
4#ifndef MARS_MJob
5#include "MJob.h"
6#endif
7
8class MTask;
9class MFilter;
10
11class MJOptimizeBase : public MJob
12{
13protected:
14 Int_t fDebug;
15 Bool_t fEnableWeights;
16
17 TList fRules;
18
19 TList fPreCuts;
20 TList fTrainCuts;
21 TList fTestCuts;
22 TList fPreTasks;
23 TList fPostTasks;
24
25 void AddCut(TList &l, const char *rule);
26 void AddPar(TList &l, const char *rule, const char *name);
27 void Add(TList &l, MTask *f);
28
29public:
30 MJOptimizeBase() : fDebug(-1), fEnableWeights(kFALSE)
31 {
32 }
33
34 void AddPreTask(MTask *t) { Add(fPreTasks, t); }
35 void AddPreTask(const char *rule,
36 const char *name="MWeight") { AddPar(fPreTasks, rule, name); }
37
38 void AddPostTask(MTask *t) { Add(fPostTasks, t); }
39 void AddPostTask(const char *rule,
40 const char *name="MWeight") { AddPar(fPostTasks, rule, name); }
41
42 void SetDebug(Bool_t b=kTRUE) { fDebug = b; }
43
44 void SetWeights(const char *rule) { if (fEnableWeights) return; fEnableWeights=kTRUE; AddPostTask(rule); }
45 void SetWeights(MTask *t) { if (fEnableWeights) return; fEnableWeights=kTRUE; AddPostTask(t); }
46
47 void AddPreCut(const char *rule) { AddCut(fPreCuts, rule); }
48 void AddPreCut(MFilter *f) { Add(fPreCuts, (MTask*)(f)); }
49
50 void AddTrainCut(const char *rule) { AddCut(fTrainCuts, rule); }
51 void AddTrainCut(MFilter *f) { Add(fTrainCuts, (MTask*)(f)); }
52
53 void AddTestCut(const char *rule) { AddCut(fTestCuts, rule); }
54 void AddTestCut(MFilter *f) { Add(fTestCuts, (MTask*)(f)); }
55
56 Int_t AddParameter(const char *rule);
57
58 ClassDef(MJOptimizeBase, 0)//Base class for all optimizations and trainings
59};
60
61#endif
Note: See TracBrowser for help on using the repository browser.