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