1 #ifndef ALITRDPIDREFMAKER_H
2 #define ALITRDPIDREFMAKER_H
4 //////////////////////////////////////////////////////
6 // Task to build PID reference tree for the training
7 // of neural networs for the TRD PID
9 // Authors: Alex Wilk <wilka@uni-muenster.de>
10 // Markus Heide <mheide@uni-muenster.de>
12 ///////////////////////////////////////////////////////
14 #ifndef ALITRDRECOTASK_H
15 #include "AliTRDrecoTask.h"
22 #ifndef ALIPIDCALPID_H
23 #include "Cal/AliTRDCalPID.h"
26 #ifndef ALITRDGEOMETRY_H
27 #include "AliTRDgeometry.h"
32 class TMultiLayerPerceptron;
35 class AliTRDReconstructor;
36 class AliTRDpidRefMaker : public AliTRDrecoTask
65 AliTRDpidRefMaker(const Char_t *InFileNN, const Char_t *InFileLQ);
67 virtual ~AliTRDpidRefMaker();
69 void CreateOutputObjects();
70 void Exec(Option_t *option);
71 Int_t GetEpochs() {return fEpochs;};
72 Int_t GetMinTrain() {return fMinTrain;};
73 Int_t GetTrainMomBin() {return fTrainMomBin;};
77 void SetEpochs(Int_t epochs) {fEpochs = epochs;};
78 void SetMinTrain(Int_t mintrain) {fMinTrain = mintrain;};
79 void SetTrainMomBin(Int_t trainmombin) {fTrainMomBin = trainmombin;};
80 void SetDate(Int_t date) {fDate = date;};
81 void SetDoTraining(Bool_t train) {fDoTraining = train;};
82 void SetContinueTraining(Bool_t continTrain) {fContinueTraining = continTrain;};
83 void SetTrainPath(Int_t path) {fTrainPath = path;};
84 void LoadFiles(const Char_t *InFileNN, const Char_t *InFileLQ);
86 void Terminate(Option_t *);
88 void MakeTrainingLists(); // build the training and the test list
89 void MonitorTraining(Int_t mombin); // monitor training process
90 void LoadContainer(const Char_t *InFileCont);
94 AliTRDpidRefMaker(const AliTRDpidRefMaker&); // not implemented
95 AliTRDpidRefMaker& operator=(const AliTRDpidRefMaker&); // not implemented
97 void GetV0info(AliTRDtrackV1 *TRDtrack, Float_t *v0pdg); // get the v0 information
98 void TrainNetworks(Int_t mombin); // train the neural networks for a given momentum bin
99 void BuildLQRefs(Int_t mombin); // build the 2dim histos for a given momentum bin
101 AliTRDReconstructor *fReconstructor; //! reconstructor needed for recalculation the PID
102 TTree *fNN; // NN data
103 TTree *fLQ; // LQ data
104 TEventList *fTrain[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer]; // Training list for each momentum
105 TEventList *fTest[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer]; // Test list for each momentum
106 TMultiLayerPerceptron *fNet[AliTRDgeometry::kNlayer]; // artificial neural network
108 Int_t fLayer; // TRD layer index
109 Int_t fTrainMomBin; // momentum bin for the training
110 Int_t fEpochs; // Number of epochs for the training of the NNs
111 Int_t fMinTrain; // minimum of events needed for training
112 Int_t fDate; // date stamp for training of the NNs
113 Float_t fMom; // momentum
114 Float_t *fdEdx[10]; // dEdx array
115 Float_t fv0pid[AliPID::kSPECIES]; // pid from v0s
116 Bool_t fDoTraining; // checks if training will be done
117 Bool_t fContinueTraining; // checks if training from an older run should be continued
118 Int_t fTrainPath; // sets the path for continuing the training
120 ClassDef(AliTRDpidRefMaker, 1); // TRD reference maker for NN