CbmRoot
Loading...
Searching...
No Matches
CbmRichTrainAnnElectrons.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2017 UGiessen/JINR-LIT, Giessen/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev, Semen Lebedev [committer] */
4
14#ifndef CbmRichTrainAnnElectrons_H
15#define CbmRichTrainAnnElectrons_H
16
17#include "FairTask.h"
18#include "TCanvas.h"
19#include "TH2D.h"
20
21#include <string>
22#include <vector>
23
24//class TH1;
25//class TH1D;
26//class TH2D;
27class TClonesArray;
28
29
30using namespace std;
31
41 public:
42 Double_t fAaxis;
43 Double_t fBaxis;
44 Double_t fPhi;
45 Double_t fRadAngle;
46 Double_t fChi2;
47 Double_t fRadPos;
48 Double_t fNofHits;
49 Double_t fDistance;
50 Double_t fMomentum;
51};
52
53
62class CbmRichTrainAnnElectrons : public FairTask {
63
64 public:
69
74
78 virtual InitStatus Init();
79
83 virtual void Exec(Option_t* option);
84
88 virtual void FinishTask();
89
90 private:
91 Int_t fEventNum;
92 TClonesArray* fRichHits;
93 TClonesArray* fRichRings;
94 TClonesArray* fRichPoints;
95 TClonesArray* fMCTracks;
96 TClonesArray* fRichRingMatches;
97 TClonesArray* fRichProj;
98 TClonesArray* fStsTrackMatches;
99 TClonesArray* fGlobalTracks;
100 TClonesArray* fStsTracks;
101
103 Double_t fQuota;
104 UInt_t fMaxNofTrainSamples; // maximum number of train samples for ANN
105
108 Double_t fAnnCut;
109 // ANN outputs
110 // [0] = electrons; [1] = pions
111 vector<TH1D*> fhAnnOutput;
112 vector<TH1D*> fhCumProb;
113
114 // Data for ANN input
115 // [0] = electrons, [1] = pions
116 vector<vector<RingElectronParam>> fRElIdParams;
117
118 vector<TCanvas*> fCanvas;
120
121 // difference between electrons and pions
122 // [0] = is electron; [1] = is pion
123 vector<TH1D*> fhAaxis; //major half axis
124 vector<TH1D*> fhBaxis; //minor half axis
125 // vector<TH1D*> fhAaxisCor; // major half axis after correction
126 // vector<TH1D*> fhBaxisCor; //minor half axis after correction
127 vector<TH1D*> fhDistTrueMatch; // distance between ring center and track projection for true matches
128 vector<TH1D*> fhDistMisMatch; // distance between ring center and track projection for wrong matches
129 vector<TH1D*> fhNofHits; // number of hits in ring
130 vector<TH1D*> fhChi2; // chi2 of the fit
131 vector<TH1D*> fhRadPos; // radial position of a ring onto the photodetector plane
132 vector<TH2D*> fhAaxisVsMom; // major half axis vs. momentum
133 vector<TH2D*> fhBaxisVsMom; // minor half axis vs. momentum
134 vector<TH2D*> fhPhiVsRadAng; // ellipse rotation angle vs. radial angle
135
136 vector<TH1*> fHists; // Store pointer for all histograms
137
141 void DiffElandPi();
142
146 void TrainAndTestAnn();
147
151 void Draw(Option_t* = "");
152
153 TCanvas* CreateCanvas(const string& name, const string& title, int width, int height);
154
155 void SaveCanvasToImage();
156
157
162
167
168 ClassDef(CbmRichTrainAnnElectrons, 1)
169};
170
171#endif
Train ANN for electron identification in RICH.
virtual void FinishTask()
Inherited from FairTask.
virtual InitStatus Init()
Inherited from FairTask.
void Draw(Option_t *="")
Draw results.
CbmRichTrainAnnElectrons(const CbmRichTrainAnnElectrons &)
Copy constructor.
TCanvas * CreateCanvas(const string &name, const string &title, int width, int height)
CbmRichTrainAnnElectrons & operator=(const CbmRichTrainAnnElectrons &)
Assignment operator.
virtual void Exec(Option_t *option)
Inherited from FairTask.
vector< vector< RingElectronParam > > fRElIdParams
void TrainAndTestAnn()
Train and test ANN.
CbmRichTrainAnnElectrons()
Default constructor.
void DiffElandPi()
Fill input parameters for ANN in array and histograms.
virtual ~CbmRichTrainAnnElectrons()
Destructor.
Input Parameters for ANN for electron identification in RICH.
Hash for CbmL1LinkKey.