]>
Commit | Line | Data |
---|---|---|
1ee39b3a | 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 | ||
1ee39b3a | 18 | #ifndef ALITRDPIDREFMAKER_H |
19 | #include "AliTRDpidRefMaker.h" | |
20 | #endif | |
21 | ||
1ee39b3a | 22 | class TEventList; |
23 | class TMultiLayerPerceptron; | |
24 | class AliTRDpidRefMakerNN : public AliTRDpidRefMaker | |
25 | { | |
26 | ||
27 | public: | |
28 | enum ETRDpidRefMakerNNgraph { | |
9ec5bce7 | 29 | kGraphTrain = 1 |
30 | ,kGraphTest = 2 | |
1ee39b3a | 31 | }; |
32 | ||
33 | enum ETRDpidRefMakerNNmoni { | |
34 | kMoniTrain = 50 | |
35 | }; | |
36 | ||
9ec5bce7 | 37 | enum ETRDpidRefMakerNNsteer{ |
38 | kMaxStat = 20000 // maximum statistics/PID bin | |
39 | ,kMinStat = 50 // minimum statistics/PID bin | |
40 | }; | |
1ee39b3a | 41 | AliTRDpidRefMakerNN(); |
42 | ||
43 | virtual ~AliTRDpidRefMakerNN(); | |
44 | ||
45 | void CreateOutputObjects(); | |
46 | Int_t GetEpochs() const {return fEpochs;}; | |
47 | Int_t GetMinTrain() const {return fMinTrain;}; | |
48 | Int_t GetTrainMomBin() const {return fTrainMomBin;}; | |
49 | ||
50 | Bool_t PostProcess(); | |
51 | ||
52 | void SetEpochs(Int_t epochs) {fEpochs = epochs;}; | |
53 | void SetMinTrain(Int_t mintrain) {fMinTrain = mintrain;}; | |
54 | void SetTrainMomBin(Int_t trainmombin) {fTrainMomBin = trainmombin;}; | |
55 | void SetDate(Int_t date) {fDate = date;}; | |
56 | void SetDoTraining(Bool_t train) {fDoTraining = train;}; | |
57 | void SetContinueTraining(Bool_t continTrain) {fContinueTraining = continTrain;}; | |
58 | void SetTrainPath(Int_t path) {fTrainPath = path;}; | |
9ec5bce7 | 59 | Bool_t LoadFile(const Char_t *InFileNN); |
1ee39b3a | 60 | void SetScaledEdx(Float_t s) {fScale = s;}; |
61 | ||
9ec5bce7 | 62 | void MakeTrainingLists(Int_t mombin = 0); // build the training and the test list |
1ee39b3a | 63 | void MonitorTraining(Int_t mombin); // monitor training process |
64 | ||
65 | protected: | |
66 | void MakeRefs(Int_t mombin); // train the neural networks for a given momentum bin | |
67 | ||
68 | private: | |
69 | AliTRDpidRefMakerNN(const AliTRDpidRefMakerNN&); // not implemented | |
70 | AliTRDpidRefMakerNN& operator=(const AliTRDpidRefMakerNN&); // not implemented | |
71 | ||
9ec5bce7 | 72 | TEventList *fTrain[AliTRDCalPID::kNMom]; // Training list for each momentum |
73 | TEventList *fTest[AliTRDCalPID::kNMom]; // Test list for each momentum | |
74 | TMultiLayerPerceptron *fNet; // artificial neural network | |
1ee39b3a | 75 | |
76 | Int_t fTrainMomBin; // momentum bin for the training | |
77 | Int_t fEpochs; // Number of epochs for the training of the NNs | |
78 | Int_t fMinTrain; // minimum of events needed for training | |
79 | Int_t fDate; // date stamp for training of the NNs | |
80 | Bool_t fDoTraining; // checks if training will be done | |
81 | Bool_t fContinueTraining; // checks if training from an older run should be continued | |
82 | Int_t fTrainPath; // sets the path for continuing the training | |
83 | ||
9ec5bce7 | 84 | Float_t fScale; |
85 | Int_t fLy; // TRD layer | |
86 | Int_t fNtrkl; // No. tracklets | |
87 | TTree *fTrainData[AliTRDCalPID::kNMom]; | |
88 | TFile *fRef; | |
1ee39b3a | 89 | |
9ec5bce7 | 90 | ClassDef(AliTRDpidRefMakerNN, 3); // TRD reference maker for NN |
1ee39b3a | 91 | }; |
92 | ||
93 | #endif |