New directory for the VMC tests (Ivana, Eva)
[u/mrichter/AliRoot.git] / TRD / qaRec / AliTRDpidRefMakerNN.h
1 #ifndef ALITRDPIDREFMAKERNN_H
2 #define ALITRDPIDREFMAKERNN_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliTRDpidRefMakerNN.h 27496 2008-07-22 08:35:45Z cblume $ */
7
8 //////////////////////////////////////////////////////
9 //
10 // Task to build PID reference tree for the training
11 // of neural networs for the TRD PID
12 //
13 // Authors: Alex Wilk    <wilka@uni-muenster.de>
14 //          Markus Heide <mheide@uni-muenster.de>
15 //
16 ///////////////////////////////////////////////////////
17
18 /* #ifndef ALITRDRECOTASK_H */
19 /* #include "AliTRDrecoTask.h" */
20 /* #endif */
21
22 /* #ifndef ALIPID_H */
23 /* #include "AliPID.h" */
24 /* #endif */
25
26 /* #ifndef ALITRDCALPID_H */
27 /* #include "../Cal/AliTRDCalPID.h" */
28 /* #endif */
29
30 /* #ifndef ALITRDGEOMETRY_H */
31 /* #include "../AliTRDgeometry.h" */
32 /* #endif */
33
34 #ifndef ALITRDPIDREFMAKER_H
35 #include "AliTRDpidRefMaker.h"
36 #endif
37
38 /* class TTree; */
39 /* class TObjArray; */
40 /* class TEventList; */
41 /* class TMultiLayerPerceptron; */
42 /* class AliPID; */
43 /* class AliTRDtrackV1; */
44 /* class AliTRDReconstructor; */
45
46 /* class AliTRDpidRefMakerNN : public AliTRDrecoTask */
47
48 class TEventList;
49 class TMultiLayerPerceptron;
50 class AliTRDpidRefMakerNN : public AliTRDpidRefMaker
51 {
52
53 public:
54   enum ETRDpidRefMakerNNgraph {
55     kGraphTrain = 0
56     ,kGraphTest = 1
57   };
58
59   enum ETRDpidRefMakerNNmoni {
60     kMoniTrain = 50
61   };
62
63   AliTRDpidRefMakerNN();
64
65   virtual ~AliTRDpidRefMakerNN();
66   
67   void    CreateOutputObjects();
68   Int_t   GetEpochs() const {return fEpochs;};
69   Int_t   GetMinTrain() const {return fMinTrain;};
70   Int_t   GetTrainMomBin() const {return fTrainMomBin;};
71
72   Bool_t  PostProcess();
73
74   void    SetEpochs(Int_t epochs) {fEpochs = epochs;};
75   void    SetMinTrain(Int_t mintrain) {fMinTrain = mintrain;};
76   void    SetTrainMomBin(Int_t trainmombin) {fTrainMomBin = trainmombin;};
77   void    SetDate(Int_t date) {fDate = date;};
78   void    SetDoTraining(Bool_t train) {fDoTraining = train;};
79   void    SetContinueTraining(Bool_t continTrain) {fContinueTraining = continTrain;};
80   void    SetTrainPath(Int_t path) {fTrainPath = path;};
81   void    LoadFile(const Char_t *InFileNN);
82   void    SetScaledEdx(Float_t s) {fScale = s;};
83
84   void    MakeTrainingLists();                                 // build the training and the test list
85   void    MonitorTraining(Int_t mombin);                       // monitor training process
86
87 protected:
88   void MakeRefs(Int_t mombin);                         // train the neural networks for a given momentum bin
89
90 private:
91   AliTRDpidRefMakerNN(const AliTRDpidRefMakerNN&);              // not implemented
92   AliTRDpidRefMakerNN& operator=(const AliTRDpidRefMakerNN&);   // not implemented
93
94   TEventList *fTrain[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer];          // Training list for each momentum 
95   TEventList *fTest[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer];           // Test list for each momentum 
96   TMultiLayerPerceptron *fNet[AliTRDgeometry::kNlayer]; // artificial neural network
97
98   Int_t         fTrainMomBin;              // momentum bin for the training
99   Int_t         fEpochs;                   // Number of epochs for the training of the NNs
100   Int_t         fMinTrain;                 // minimum of events needed for training
101   Int_t         fDate;                     // date stamp for training of the NNs
102   Bool_t        fDoTraining;               // checks if training will be done
103   Bool_t        fContinueTraining;         // checks if training from an older run should be continued
104   Int_t         fTrainPath;                // sets the path for continuing the training
105
106   Float_t fScale;
107
108   ClassDef(AliTRDpidRefMakerNN, 2); // TRD reference  maker for NN
109 };
110
111 #endif