CbmRoot
Loading...
Searching...
No Matches
CbmRichTrainAnnElectrons.cxx
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
13
14#include "CbmDrawHist.h"
15#include "CbmGlobalTrack.h"
16#include "CbmMCTrack.h"
17#include "CbmRichRing.h"
18#include "CbmRichUtil.h"
19#include "CbmTrackMatchNew.h"
20#include "CbmUtils.h"
21#include "FairMCPoint.h"
22#include "FairRootManager.h"
23#include "FairTrackParam.h"
24#include "TCanvas.h"
25#include "TClonesArray.h"
26#include "TH1D.h"
27#include "TH2D.h"
28#include "TMultiLayerPerceptron.h"
29#include "TString.h"
30#include "TSystem.h"
31
32#include <boost/assign/list_of.hpp>
33
34#include <cmath>
35#include <iostream>
36#include <string>
37#include <vector>
38
39class CbmStsTrack;
40
41using boost::assign::list_of;
42using std::cout;
43using std::endl;
44using std::fabs;
45using std::string;
46using std::vector;
47
49 : fEventNum(0)
50 ,
51
52 fRichHits(NULL)
53 , fRichRings(NULL)
54 , fRichPoints(NULL)
55 , fMCTracks(NULL)
56 , fRichRingMatches(NULL)
57 , fRichProj(NULL)
58 , fStsTrackMatches(NULL)
59 , fGlobalTracks(NULL)
60 , fStsTracks(NULL)
61 , fMinNofHitsInRichRing(7)
62 , fQuota(0.6)
63 , fMaxNofTrainSamples(5000)
64 , fNofPiLikeEl(0)
65 , fNofElLikePi(0)
66 , fAnnCut(-0.5)
67 , fhAnnOutput()
68 , fhCumProb()
69 , fRElIdParams()
70 , fCanvas()
71 , fOutputDir("results_images_ann/")
72 , fhAaxis()
73 , fhBaxis()
74 ,
75 // fhAaxisCor(),
76 // fhBaxisCor(),
77 fhDistTrueMatch()
78 , fhDistMisMatch()
79 , fhNofHits()
80 , fhChi2()
81 , fhRadPos()
82 , fhAaxisVsMom()
83 , fhBaxisVsMom()
84 , fhPhiVsRadAng()
85 , fHists()
86{
87 fhAaxis.resize(2);
88 fhBaxis.resize(2);
89 // fhAaxisCor.resize(2);
90 // fhBaxisCor.resize(2);
91 fhDistTrueMatch.resize(2);
92 fhDistMisMatch.resize(2);
93 fhNofHits.resize(2);
94 fhChi2.resize(2);
95 fhRadPos.resize(2);
96 fhAaxisVsMom.resize(2);
97 fhBaxisVsMom.resize(2);
98 fhPhiVsRadAng.resize(2);
99 fhAnnOutput.resize(2);
100 fhCumProb.resize(2);
101 fRElIdParams.resize(2);
102 string ss;
103 for (int i = 0; i < 2; i++) {
104 if (i == 0) ss = "Electron";
105 if (i == 1) ss = "Pion";
106 // difference between electrons and pions
107 fhAaxis[i] = new TH1D(string("fhAaxis" + ss).c_str(), "fhAaxis;A axis [cm];Counter", 50, 0., 8.);
108 fHists.push_back(fhAaxis[i]);
109 fhBaxis[i] = new TH1D(string("fhBAxis" + ss).c_str(), "fhBAxis;B axis [cm];Counter", 50, 0., 8.);
110 fHists.push_back(fhBaxis[i]);
111 // fhAaxisCor[i] = new TH1D(string("fhAaxisCor"+ss).c_str(), "fhAaxisCor;A axis [cm];Counter", 30,3,8);
112 // fHists.push_back(fhAaxisCor[i]);
113 // fhBaxisCor[i] = new TH1D(string("fhBAxisCor"+ss).c_str(), "fhBAxisCor;B axis [cm];Counter", 30,3,8);
114 // fHists.push_back(fhBaxisCor[i]);
115 fhDistTrueMatch[i] =
116 new TH1D(string("fhDistTrueMatch" + ss).c_str(), "fhDistTrueMatch;Ring-track distance [cm];Counter", 50, 0., 5.);
117 fHists.push_back(fhDistTrueMatch[i]);
118 fhDistMisMatch[i] =
119 new TH1D(string("fhDistMisMatch" + ss).c_str(), "fhDistMisMatch;Ring-track distance [cm];Counter", 50, 0., 5.);
120 fHists.push_back(fhDistMisMatch[i]);
121 fhNofHits[i] = new TH1D(string("fhNofHits" + ss).c_str(), "fhNofHits;Number of hits;Counter", 50, 0, 50);
122 fHists.push_back(fhNofHits[i]);
123 fhChi2[i] = new TH1D(string("fhChi2" + ss).c_str(), "fhChi2;#Chi^{2};Counter", 100, 0., 1.);
124 fHists.push_back(fhChi2[i]);
125 fhRadPos[i] = new TH1D(string("fhRadPos" + ss).c_str(), "fhRadPos;Radial position [cm];Counter", 150, 0., 150.);
126 fHists.push_back(fhRadPos[i]);
127 fhAaxisVsMom[i] =
128 new TH2D(string("fhAaxisVsMom" + ss).c_str(), "fhAaxisVsMom;P [GeV/c];A axis [cm]", 30, 0, 15, 50, 0, 10);
129 fHists.push_back(fhAaxisVsMom[i]);
130 fhBaxisVsMom[i] =
131 new TH2D(string("fhBAxisVsMom" + ss).c_str(), "fhBAxisVsMom;P [GeV/c];B axis [cm]", 30, 0, 15, 50, 0, 10);
132 fHists.push_back(fhBaxisVsMom[i]);
133 fhPhiVsRadAng[i] = new TH2D(string("fhPhiVsRadAng" + ss).c_str(), "fhPhiVsRadAng;Phi [rad];Radial angle [rad]", 50,
134 -2., 2., 50, 0., 6.3);
135 fHists.push_back(fhPhiVsRadAng[i]);
136 // ANN outputs
137 fhAnnOutput[i] = new TH1D(string("fhAnnOutput" + ss).c_str(), "ANN output;ANN output;CounteĀ©r", 100, -1.2, 1.2);
138 fHists.push_back(fhAnnOutput[i]);
139 fhCumProb[i] =
140 new TH1D(string("fhCumProb" + ss).c_str(), "ANN output;ANN output;Cumulative probability", 100, -1.2, 1.2);
141 fHists.push_back(fhCumProb[i]);
142 }
143}
144
146
148{
149 cout << "InitStatus CbmRichTrainAnnElectrons::Init()" << endl;
150
151 FairRootManager* ioman = FairRootManager::Instance();
152 if (NULL == ioman) {
153 LOG(fatal) << GetName() << "::Init: RootManager not instantised!";
154 }
155
156 //fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
157 //if ( NULL == fRichHits) { LOG(fatal) << GetName() << "::Init: No RichHit array!";}
158
159 fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
160 if (NULL == fRichRings) {
161 LOG(fatal) << GetName() << "::Init: No RichRing array!";
162 }
163
164 //fRichPoints = (TClonesArray*) ioman->GetObject("RichPoint");
165 //if ( NULL == fRichPoints) { LOG(fatal) << GetName() << "::Init: No RichPoint array!";}
166
167 fMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
168 if (NULL == fMCTracks) {
169 LOG(fatal) << GetName() << "::Init: No MCTrack array!";
170 }
171
172 fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
173 if (NULL == fRichRingMatches) {
174 LOG(fatal) << GetName() << "::Init: No RichRingMatch array!";
175 }
176
177 // fRichProj = (TClonesArray*) ioman->GetObject("RichProjection");
178 // if ( NULL == fRichProj) { LOG(fatal) << GetName() << "::Init: No RichProjection array!";}
179
180 fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
181 if (NULL == fStsTrackMatches) {
182 LOG(fatal) << GetName() << "::Init: No track match array!";
183 }
184
185 fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
186 if (NULL == fGlobalTracks) {
187 LOG(fatal) << GetName() << "::Init: No global track array!";
188 }
189
190 fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
191 if (NULL == fStsTracks) {
192 LOG(fatal) << GetName() << "::Init: No STSTrack array!";
193 }
194
195 return kSUCCESS;
196}
197
198void CbmRichTrainAnnElectrons::Exec(Option_t* /*option*/)
199{
200 cout << endl << "-I- CbmRichTrainAnnElectrons, event " << fEventNum << endl;
201 DiffElandPi();
202 fEventNum++;
203 cout << "Nof Electrons = " << fRElIdParams[0].size() << endl;
204 cout << "Nof Pions = " << fRElIdParams[1].size() << endl;
205}
206
208{
209 Int_t nGlTracks = fGlobalTracks->GetEntriesFast();
210
211 for (Int_t iTrack = 0; iTrack < nGlTracks; iTrack++) {
212 CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(iTrack);
213 if (NULL == gTrack) continue;
214 Int_t stsIndex = gTrack->GetStsTrackIndex();
215 if (stsIndex == -1) continue;
216 CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(stsIndex);
217 if (NULL == stsTrack) continue;
218 CbmTrackMatchNew* stsTrackMatch = (CbmTrackMatchNew*) fStsTrackMatches->At(stsIndex);
219 if (NULL == stsTrackMatch) continue;
220 Int_t mcIdSts = stsTrackMatch->GetMatchedLink().GetIndex();
221
222 Int_t richIndex = gTrack->GetRichRingIndex();
223 if (richIndex == -1) continue;
224 CbmRichRing* ring = (CbmRichRing*) fRichRings->At(richIndex);
225 if (NULL == ring) continue;
226 CbmTrackMatchNew* richRingMatch = (CbmTrackMatchNew*) fRichRingMatches->At(richIndex);
227 if (NULL == richRingMatch) continue;
228 Int_t mcIdRich = richRingMatch->GetMatchedLink().GetIndex();
229
230 CbmMCTrack* track = (CbmMCTrack*) fMCTracks->At(mcIdSts);
231 if (NULL == track) continue;
232 Int_t pdg = TMath::Abs(track->GetPdgCode());
233 Int_t motherId = track->GetMotherId();
234 Double_t momentum = track->GetP();
235
236 // Double_t axisACor = ring->GetAaxisCor();
237 // Double_t axisBCor= ring->GetBaxisCor();
238
239 Int_t lFoundHits = richRingMatch->GetNofTrueHits() + richRingMatch->GetNofWrongHits();
240 Double_t lPercTrue = 0;
241 if (lFoundHits >= 3) {
242 lPercTrue = (Double_t) richRingMatch->GetNofTrueHits() / (Double_t) lFoundHits;
243 }
244 Bool_t isTrueFound = (lPercTrue > fQuota);
245
247 p.fAaxis = ring->GetAaxis();
248 p.fBaxis = ring->GetBaxis();
249 p.fPhi = ring->GetPhi();
250 p.fRadAngle = ring->GetRadialAngle();
251 p.fChi2 = ring->GetChi2() / ring->GetNDF();
252 p.fRadPos = ring->GetRadialPosition();
253 p.fNofHits = ring->GetNofHits();
255 p.fMomentum = momentum;
256
257 if (p.fAaxis > 9. || p.fBaxis > 9.) continue;
258
259 // electrons
260 if (pdg == 11 && motherId == -1 && isTrueFound && mcIdSts == mcIdRich && mcIdRich != -1) {
261 fhAaxis[0]->Fill(p.fAaxis);
262 fhBaxis[0]->Fill(p.fBaxis);
263 // fhAaxisCor[0]->Fill(axisACor);
264 // fhBaxisCor[0]->Fill(axisBCor);
265 fhDistTrueMatch[0]->Fill(p.fDistance);
266 fhNofHits[0]->Fill(p.fNofHits);
267 fhChi2[0]->Fill(p.fChi2);
268 fhRadPos[0]->Fill(p.fRadPos);
269 fhAaxisVsMom[0]->Fill(momentum, p.fAaxis);
270 fhBaxisVsMom[0]->Fill(momentum, p.fBaxis);
271 fhPhiVsRadAng[0]->Fill(p.fPhi, p.fRadAngle);
272 fRElIdParams[0].push_back(p);
273 }
274
275 if (pdg == 11 && motherId == -1 && isTrueFound && mcIdSts != mcIdRich && mcIdRich != -1) {
276 fhDistMisMatch[0]->Fill(p.fDistance);
277 }
278
279
280 // pions
281 if (pdg == 211 && mcIdRich != -1) {
282 fhAaxis[1]->Fill(p.fAaxis);
283 fhBaxis[1]->Fill(p.fBaxis);
284 // fhAaxisCor[1]->Fill(axisACor);
285 // fhBaxisCor[1]->Fill(axisBCor);
286 if (mcIdRich == mcIdSts) {
287 fhDistTrueMatch[1]->Fill(p.fDistance);
288 fhAaxisVsMom[1]->Fill(momentum, p.fAaxis);
289 fhBaxisVsMom[1]->Fill(momentum, p.fBaxis);
290 }
291 else {
292 fhDistMisMatch[1]->Fill(p.fDistance);
293 }
294 fhNofHits[1]->Fill(p.fNofHits);
295 fhChi2[1]->Fill(p.fChi2);
296 fhRadPos[1]->Fill(p.fRadPos);
297 fhPhiVsRadAng[1]->Fill(p.fPhi, p.fRadAngle);
298
299 fRElIdParams[1].push_back(p);
300 }
301 } // global tracks
302}
303
305{
306 TTree* simu = new TTree("MonteCarlo", "MontecarloData");
307 Double_t x[9];
308 Double_t xOut;
309
310 simu->Branch("x0", &x[0], "x0/D");
311 simu->Branch("x1", &x[1], "x1/D");
312 simu->Branch("x2", &x[2], "x2/D");
313 simu->Branch("x3", &x[3], "x3/D");
314 simu->Branch("x4", &x[4], "x4/D");
315 simu->Branch("x5", &x[5], "x5/D");
316 simu->Branch("x6", &x[6], "x6/D");
317 simu->Branch("x7", &x[7], "x7/D");
318 simu->Branch("x8", &x[8], "x8/D");
319 simu->Branch("xOut", &xOut, "xOut/D");
320
321 for (int j = 0; j < 2; j++) {
322 for (unsigned int i = 0; i < fRElIdParams[j].size(); i++) {
323 x[0] = fRElIdParams[j][i].fAaxis / 10.;
324 x[1] = fRElIdParams[j][i].fBaxis / 10.;
325 x[2] = (fRElIdParams[j][i].fPhi + 1.57) / 3.14;
326 x[3] = fRElIdParams[j][i].fRadAngle / 6.28;
327 x[4] = fRElIdParams[j][i].fChi2 / 1.2;
328 x[5] = fRElIdParams[j][i].fRadPos / 110.;
329 x[6] = fRElIdParams[j][i].fNofHits / 45.;
330 x[7] = fRElIdParams[j][i].fDistance / 5.;
331 x[8] = fRElIdParams[j][i].fMomentum / 15.;
332
333 for (int k = 0; k < 9; k++) {
334 if (x[k] < 0.0) x[k] = 0.0;
335 if (x[k] > 1.0) x[k] = 1.0;
336 }
337
338 if (j == 0) xOut = 1.;
339 if (j == 1) xOut = -1.;
340 simu->Fill();
341 if (i >= fMaxNofTrainSamples) break;
342 }
343 }
344
345 TMultiLayerPerceptron network("x0,x1,x2,x3,x4,x5,x6,x7,x8:18:xOut", simu, "Entry$+1");
346 //network.LoadWeights("");
347 network.Train(300, "text,update=10");
348 network.DumpWeights("rich_v17a_elid_ann_weights.txt");
349 //network.Export();
350
351 Double_t params[9];
352
353 fNofPiLikeEl = 0;
354 fNofElLikePi = 0;
355
356 for (int j = 0; j < 2; j++) {
357 for (unsigned int i = 0; i < fRElIdParams[j].size(); i++) {
358 params[0] = fRElIdParams[j][i].fAaxis / 10.;
359 params[1] = fRElIdParams[j][i].fBaxis / 10.;
360 params[2] = (fRElIdParams[j][i].fPhi + 1.57) / 3.14;
361 params[3] = fRElIdParams[j][i].fRadAngle / 6.28;
362 params[4] = fRElIdParams[j][i].fChi2 / 1.2;
363 params[5] = fRElIdParams[j][i].fRadPos / 110.;
364 params[6] = fRElIdParams[j][i].fNofHits / 45.;
365 params[7] = fRElIdParams[j][i].fDistance / 5.;
366 params[8] = fRElIdParams[j][i].fMomentum / 15.;
367
368 for (int k = 0; k < 9; k++) {
369 if (params[k] < 0.0) params[k] = 0.0;
370 if (params[k] > 1.0) params[k] = 1.0;
371 }
372
373 Double_t netEval = network.Evaluate(0, params);
374
375 //if (netEval > maxEval) netEval = maxEval - 0.01;
376 // if (netEval < minEval) netEval = minEval + 0.01;
377
378 fhAnnOutput[j]->Fill(netEval);
379 if (netEval >= fAnnCut && j == 1) fNofPiLikeEl++;
380 if (netEval < fAnnCut && j == 0) fNofElLikePi++;
381 }
382 }
383}
384
386{
387 cout << "nof electrons = " << fRElIdParams[0].size() << endl;
388 cout << "nof pions = " << fRElIdParams[1].size() << endl;
389 cout << "Pions like electrons = " << fNofPiLikeEl
390 << ", pi supp = " << (Double_t) fRElIdParams[1].size() / fNofPiLikeEl << endl;
391 cout << "Electrons like pions = " << fNofElLikePi
392 << ", el lost eff = " << 100. * (Double_t) fNofElLikePi / fRElIdParams[0].size() << endl;
393 cout << "ANN cut = " << fAnnCut << endl;
394
395 Double_t cumProbFake = 0.;
396 Double_t cumProbTrue = 0.;
397 Int_t nofFake = (Int_t) fhAnnOutput[1]->GetEntries();
398 Int_t nofTrue = (Int_t) fhAnnOutput[0]->GetEntries();
399 for (Int_t i = 1; i <= fhAnnOutput[1]->GetNbinsX(); i++) {
400 cumProbFake += fhAnnOutput[1]->GetBinContent(i);
401 fhCumProb[1]->SetBinContent(i, (Double_t) cumProbFake / nofFake);
402
403 cumProbTrue += fhAnnOutput[0]->GetBinContent(i);
404 fhCumProb[0]->SetBinContent(i, 1. - (Double_t) cumProbTrue / nofTrue);
405 }
406
408 {
409 // TCanvas* c = CreateCanvas("ann_electrons_ann_output", "ann_electrons_ann_output", 500, 500);
410 CreateCanvas("ann_electrons_ann_output", "ann_electrons_ann_output", 500, 500);
411 DrawH1(list_of(fhAnnOutput[0])(fhAnnOutput[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8,
412 0.99, 0.99);
413 }
414
415 {
416 // TCanvas* c = CreateCanvas("ann_electrons_cum_prob", "ann_electrons_cum_prob", 500, 500);
417 CreateCanvas("ann_electrons_cum_prob", "ann_electrons_cum_prob", 500, 500);
418 DrawH1(list_of(fhCumProb[0])(fhCumProb[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLinear, true, 0.8, 0.8, 0.99,
419 0.99);
420 }
421
422 {
423 int i = 1;
424 TCanvas* c = CreateCanvas("ann_electrons_params_ab", "ann_electrons_params_ab", 1200, 600);
425 c->Divide(2, 1);
426 c->cd(i++);
427 DrawH1(list_of(fhAaxis[0])(fhAaxis[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8, 0.99, 0.99);
428 c->cd(i++);
429 DrawH1(list_of(fhBaxis[0])(fhBaxis[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8, 0.99, 0.99);
430 // c3->cd(c++);
431 // DrawH1(list_of(fhAaxisCor[0])(fhAaxisCor[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8, 0.99, 0.99);
432 // c3->cd(c++);
433 // DrawH1(list_of(fhBaxisCor[0])(fhBaxisCor[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8, 0.99, 0.99);
434 }
435
436 {
437 int i = 1;
438 TCanvas* c = CreateCanvas("ann_electrons_params_1", "ann_electrons_params_1", 1500, 600);
439 c->Divide(3, 1);
440 c->cd(i++);
441 //fhAaxisVsMom[0]->SetLineColor(kRed);
442 //fhAaxisVsMom[1]->SetLineColor(kBlue);
444 //DrawH2(fhAaxisVsMom[0], kLinear, kLinear, kLinear, "same");
445 c->cd(i++);
446 //fhBaxisVsMom[0]->SetLineColor(kRed);
447 //fhBaxisVsMom[1]->SetLineColor(kBlue);
448 //DrawH2(fhBaxisVsMom[1], kLinear, kLinear, kLinear);
450
451 c->cd(i++);
453 list_of("e^{#pm} true match")("e^{#pm} mis match")("#pi^{#pm} true match")("#pi^{#pm} mis match"), kLinear,
454 kLog, true, 0.6, 0.7, 0.99, 0.99);
455 }
456
457 {
458 int i = 1;
459 TCanvas* c = CreateCanvas("ann_electrons_params_2", "ann_electrons_params_2", 1500, 600);
460 c->Divide(3, 1);
461 c->cd(i++);
462 DrawH1(list_of(fhNofHits[0])(fhNofHits[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8, 0.99,
463 0.99);
464 c->cd(i++);
465 DrawH1(list_of(fhChi2[0])(fhChi2[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8, 0.99, 0.99);
466 c->cd(i++);
467 DrawH1(list_of(fhRadPos[0])(fhRadPos[1]), list_of("e^{#pm}")("#pi^{#pm}"), kLinear, kLog, true, 0.8, 0.8, 0.99,
468 0.99);
469 }
470
471 {
472 int i = 1;
473 TCanvas* c = CreateCanvas("ann_electrons_params_2d", "ann_electrons_params_2d", 600, 900);
474 c->Divide(2, 3);
475 c->cd(i++);
477 c->cd(i++);
479 c->cd(i++);
481 c->cd(i++);
483 c->cd(i++);
485 c->cd(i++);
487 }
488
489 // TCanvas* c5 = new TCanvas("ann_electrons_b_vs_mom", "ann_electrons_b_vs_mom", 600, 600);
490 // fhBaxisVsMom[0]->Add(fhBaxisVsMom[1]);
491 // DrawH2(fhBaxisVsMom[0]);
492 //
493 // TCanvas* c6 = new TCanvas("ann_electrons_a_vs_mom", "ann_electrons_a_vs_mom", 600, 600);
494 // fhAaxisVsMom[0]->Add(fhAaxisVsMom[1]);
495 // DrawH2(fhAaxisVsMom[0]);
496}
497
499{
501 Draw();
502
503 for (unsigned int i = 0; i < fHists.size(); i++) {
504 fHists[i]->Scale(1. / fHists[i]->Integral());
505 fHists[i]->Write();
506 }
507
509}
510
511TCanvas* CbmRichTrainAnnElectrons::CreateCanvas(const string& name, const string& title, int width, int height)
512{
513 TCanvas* c = new TCanvas(name.c_str(), title.c_str(), width, height);
514 fCanvas.push_back(c);
515 return c;
516}
517
519{
520 for (unsigned int i = 0; i < fCanvas.size(); i++) {
522 }
523}
524
ClassImp(CbmConverterManager)
void SetDefaultDrawStyle()
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
Helper functions for drawing 1D and 2D histograms and graphs.
@ kLinear
Definition CbmDrawHist.h:69
@ kLog
Definition CbmDrawHist.h:68
Train ANN for electron identification in RICH.
static constexpr size_t size()
Definition KfSimdPseudo.h:2
int32_t GetStsTrackIndex() const
int32_t GetRichRingIndex() const
double GetP() const
Definition CbmMCTrack.h:98
int32_t GetMotherId() const
Definition CbmMCTrack.h:69
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
double GetRadialAngle() const
double GetAaxis() const
Definition CbmRichRing.h:80
int32_t GetNofHits() const
Definition CbmRichRing.h:37
double GetChi2() const
Definition CbmRichRing.h:92
double GetPhi() const
Definition CbmRichRing.h:84
double GetNDF() const
Definition CbmRichRing.h:93
float GetRadialPosition() const
double GetBaxis() const
Definition CbmRichRing.h:81
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.
TCanvas * CreateCanvas(const string &name, const string &title, int width, int height)
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.
static double GetRingTrackDistance(int globalTrackId)
int32_t GetNofWrongHits() const
int32_t GetNofTrueHits() const
Input Parameters for ANN for electron identification in RICH.
void SaveCanvasAsImage(TCanvas *c, const string &dir, const string &option)
Definition CbmUtils.cxx:36