]>
Commit | Line | Data |
---|---|---|
28efdace | 1 | #ifndef ALITRDPIDREFMAKER_H |
2 | #define ALITRDPIDREFMAKER_H | |
3 | ||
4 | ////////////////////////////////////////////////////// | |
5 | // | |
6 | // Task to build PID reference tree for the training | |
7 | // of neural networs for the TRD PID | |
8 | // | |
aea8dd24 | 9 | // Authors: Alex Wilk <wilka@uni-muenster.de> |
10 | // Markus Heide <mheide@uni-muenster.de> | |
28efdace | 11 | // |
12 | /////////////////////////////////////////////////////// | |
13 | ||
14 | #ifndef ALITRDRECOTASK_H | |
15 | #include "AliTRDrecoTask.h" | |
16 | #endif | |
17 | ||
5d6dc395 | 18 | #ifndef ALIPID_H |
19 | #include "AliPID.h" | |
20 | #endif | |
21 | ||
22 | #ifndef ALITRDGEOMETRY_H | |
23 | #include "AliTRDgeometry.h" | |
24 | #endif | |
25 | ||
aea8dd24 | 26 | class TTree; |
27 | class TEventList; | |
28 | class TMultiLayerPerceptron; | |
29 | class AliPID; | |
28efdace | 30 | class AliTRDtrackV1; |
31 | class AliTRDReconstructor; | |
32 | class AliTRDpidRefMaker : public AliTRDrecoTask | |
33 | { | |
34 | ||
aea8dd24 | 35 | public: |
36 | enum { | |
37 | k006 = 0 | |
38 | ,k008 = 1 | |
39 | ,k010 = 2 | |
40 | ,k015 = 3 | |
41 | ,k020 = 4 | |
42 | ,k030 = 5 | |
43 | ,k040 = 6 | |
44 | ,k050 = 7 | |
45 | ,k060 = 8 | |
46 | ,k080 = 9 | |
47 | ,k100 = 10 | |
48 | ,kAll = 11 | |
49 | }; | |
50 | ||
82719f10 | 51 | enum { |
52 | kGraphTrain = 0 | |
53 | ,kGraphTest = 1 | |
54 | }; | |
55 | ||
aea8dd24 | 56 | enum { |
57 | kMoniTrain = 50 | |
58 | }; | |
59 | ||
28efdace | 60 | AliTRDpidRefMaker(); |
aea8dd24 | 61 | AliTRDpidRefMaker(const Char_t *InFileNN, const Char_t *InFileLQ); |
62 | /* AliTRDpidRefMaker(const Char_t *InFileNN, const Char_t *InFileLQ, AliTRDCalMomentumBin bin = kAll); */ | |
28efdace | 63 | virtual ~AliTRDpidRefMaker(); |
64 | ||
65 | void CreateOutputObjects(); | |
66 | void Exec(Option_t *option); | |
67 | void GetRefFigure(Int_t ifig, Int_t &first, Int_t &last, Option_t *opt); | |
aea8dd24 | 68 | Int_t GetEpochs() {return fEpochs;}; |
69 | Int_t GetMinTrain() {return fMinTrain;}; | |
70 | Int_t GetTrainMomBin() {return fTrainMomBin;}; | |
71 | ||
28efdace | 72 | Bool_t PostProcess(); |
28efdace | 73 | |
aea8dd24 | 74 | void SetEpochs(Int_t epochs) {fEpochs = epochs;}; |
75 | void SetMinTrain(Int_t mintrain) {fMinTrain = mintrain;}; | |
76 | void SetTrainMomBin(Int_t trainmombin) {fTrainMomBin = trainmombin;}; | |
82719f10 | 77 | void SetDate(Int_t date) {fDate = date;}; |
78 | void SetDoTraining(Bool_t train) {fDoTraining = train;}; | |
79 | void LoadFiles(const Char_t *InFileNN, const Char_t *InFileLQ); | |
28efdace | 80 | |
aea8dd24 | 81 | void Terminate(Option_t *); |
82 | ||
82719f10 | 83 | void MakeTrainingLists(); // build the training and the test list |
84 | void MonitorTraining(Int_t mombin); // monitor training process | |
85 | void LoadContainer(const Char_t *InFileCont); | |
86 | void CreateGraphs(); | |
87 | ||
aea8dd24 | 88 | private: |
89 | AliTRDpidRefMaker(const AliTRDpidRefMaker&); // not implemented | |
90 | AliTRDpidRefMaker& operator=(const AliTRDpidRefMaker&); // not implemented | |
28efdace | 91 | |
aea8dd24 | 92 | void GetV0info(AliTRDtrackV1 *TRDtrack, Float_t *v0pdg); // get the v0 information |
82719f10 | 93 | /* void MakeTrainingLists(); // build the training and the test list */ |
aea8dd24 | 94 | void TrainNetworks(Int_t mombin); // train the neural networks for a given momentum bin |
95 | void BuildLQRefs(Int_t mombin); // build the 2dim histos for a given momentum bin | |
82719f10 | 96 | /* void MonitorTraining(Int_t mombin); // monitor training process */ |
28efdace | 97 | |
98 | AliTRDReconstructor *fReconstructor; //! reconstructor needed for recalculation the PID | |
aea8dd24 | 99 | TTree *fNN; // NN data |
100 | TTree *fLQ; // LQ data | |
5d6dc395 | 101 | TEventList *fTrain[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer]; // Training list for each momentum |
102 | TEventList *fTest[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer]; // Test list for each momentum | |
103 | TMultiLayerPerceptron *fNet[AliTRDgeometry::kNlayer]; // artificial neural network | |
aea8dd24 | 104 | /* TMultiLayerPerceptron *fNet[AliTRDCalPID::kNMom][AliTRDCalPID::kNPlane]; // artificial neural network */ |
105 | ||
106 | Int_t fLayer; // TRD layer index | |
107 | Int_t fTrainMomBin; // momentum bin for the training | |
108 | Int_t fEpochs; // Number of epochs for the training of the NNs | |
109 | Int_t fMinTrain; // minimum of events needed for training | |
110 | Int_t fDate; // date stamp for training of the NNs | |
111 | Float_t fMom; // momentum | |
112 | Float_t *fdEdx[10]; // dEdx array | |
113 | Float_t fv0pid[AliPID::kSPECIES]; // pid from v0s | |
82719f10 | 114 | Bool_t fDoTraining; // checks if training will be done |
28efdace | 115 | |
116 | ClassDef(AliTRDpidRefMaker, 1); // TRD reference maker for NN | |
117 | }; | |
118 | ||
119 | #endif |