CbmRoot
CbmRichTrainAnnElectrons.h
Go to the documentation of this file.
1 
10 #ifndef CbmRichTrainAnnElectrons_H
11 #define CbmRichTrainAnnElectrons_H
12 
13 #include "FairTask.h"
14 #include "TCanvas.h"
15 #include "TH2D.h"
16 #include <string>
17 #include <vector>
18 
19 //class TH1;
20 //class TH1D;
21 //class TH2D;
22 class TClonesArray;
23 
24 
25 using namespace std;
26 
36 public:
37  Double_t fAaxis;
38  Double_t fBaxis;
39  Double_t fPhi;
40  Double_t fRadAngle;
41  Double_t fChi2;
42  Double_t fRadPos;
43  Double_t fNofHits;
44  Double_t fDistance;
45  Double_t fMomentum;
46 };
47 
48 
57 class CbmRichTrainAnnElectrons : public FairTask {
58 
59 public:
64 
68  virtual ~CbmRichTrainAnnElectrons();
69 
73  virtual InitStatus Init();
74 
78  virtual void Exec(Option_t* option);
79 
83  virtual void FinishTask();
84 
85 private:
86  Int_t fEventNum;
87  TClonesArray* fRichHits;
88  TClonesArray* fRichRings;
89  TClonesArray* fRichPoints;
90  TClonesArray* fMCTracks;
91  TClonesArray* fRichRingMatches;
92  TClonesArray* fRichProj;
93  TClonesArray* fStsTrackMatches;
94  TClonesArray* fGlobalTracks;
95  TClonesArray* fStsTracks;
96 
98  Double_t fQuota;
99  UInt_t fMaxNofTrainSamples; // maximum number of train samples for ANN
100 
103  Double_t fAnnCut;
104  // ANN outputs
105  // [0] = electrons; [1] = pions
106  vector<TH1D*> fhAnnOutput;
107  vector<TH1D*> fhCumProb;
108 
109  // Data for ANN input
110  // [0] = electrons, [1] = pions
111  vector<vector<RingElectronParam>> fRElIdParams;
112 
113  vector<TCanvas*> fCanvas;
114  string fOutputDir;
115 
116  // difference between electrons and pions
117  // [0] = is electron; [1] = is pion
118  vector<TH1D*> fhAaxis; //major half axis
119  vector<TH1D*> fhBaxis; //minor half axis
120  // vector<TH1D*> fhAaxisCor; // major half axis after correction
121  // vector<TH1D*> fhBaxisCor; //minor half axis after correction
122  vector<TH1D*>
123  fhDistTrueMatch; // distance between ring center and track projection for true matches
124  vector<TH1D*>
125  fhDistMisMatch; // distance between ring center and track projection for wrong matches
126  vector<TH1D*> fhNofHits; // number of hits in ring
127  vector<TH1D*> fhChi2; // chi2 of the fit
128  vector<TH1D*>
129  fhRadPos; // radial position of a ring onto the photodetector plane
130  vector<TH2D*> fhAaxisVsMom; // major half axis vs. momentum
131  vector<TH2D*> fhBaxisVsMom; // minor half axis vs. momentum
132  vector<TH2D*> fhPhiVsRadAng; // ellipse rotation angle vs. radial angle
133 
134  vector<TH1*> fHists; // Store pointer for all histograms
135 
139  void DiffElandPi();
140 
144  void TrainAndTestAnn();
145 
149  void Draw(Option_t* = "");
150 
151  TCanvas*
152  CreateCanvas(const string& name, const string& title, int width, int height);
153 
154  void SaveCanvasToImage();
155 
156 
161 
166 
167  ClassDef(CbmRichTrainAnnElectrons, 1)
168 };
169 
170 #endif
CbmRichTrainAnnElectrons::fNofPiLikeEl
Int_t fNofPiLikeEl
Definition: CbmRichTrainAnnElectrons.h:101
RingElectronParam::fPhi
Double_t fPhi
Definition: CbmRichTrainAnnElectrons.h:39
CbmRichTrainAnnElectrons::fhAaxis
vector< TH1D * > fhAaxis
Definition: CbmRichTrainAnnElectrons.h:118
CbmRichTrainAnnElectrons::fhCumProb
vector< TH1D * > fhCumProb
Definition: CbmRichTrainAnnElectrons.h:107
CbmRichTrainAnnElectrons::fhPhiVsRadAng
vector< TH2D * > fhPhiVsRadAng
Definition: CbmRichTrainAnnElectrons.h:132
RingElectronParam::fRadPos
Double_t fRadPos
Definition: CbmRichTrainAnnElectrons.h:42
RingElectronParam::fBaxis
Double_t fBaxis
Definition: CbmRichTrainAnnElectrons.h:38
CbmRichTrainAnnElectrons::fMinNofHitsInRichRing
Int_t fMinNofHitsInRichRing
Definition: CbmRichTrainAnnElectrons.h:97
CbmRichTrainAnnElectrons::fRichProj
TClonesArray * fRichProj
Definition: CbmRichTrainAnnElectrons.h:92
CbmRichTrainAnnElectrons::fNofElLikePi
Int_t fNofElLikePi
Definition: CbmRichTrainAnnElectrons.h:102
CbmRichTrainAnnElectrons::operator=
CbmRichTrainAnnElectrons & operator=(const CbmRichTrainAnnElectrons &)
Assignment operator.
CbmRichTrainAnnElectrons::fhDistMisMatch
vector< TH1D * > fhDistMisMatch
Definition: CbmRichTrainAnnElectrons.h:125
RingElectronParam::fChi2
Double_t fChi2
Definition: CbmRichTrainAnnElectrons.h:41
CbmRichTrainAnnElectrons::fMaxNofTrainSamples
UInt_t fMaxNofTrainSamples
Definition: CbmRichTrainAnnElectrons.h:99
CbmRichTrainAnnElectrons::fHists
vector< TH1 * > fHists
Definition: CbmRichTrainAnnElectrons.h:134
CbmRichTrainAnnElectrons::fhDistTrueMatch
vector< TH1D * > fhDistTrueMatch
Definition: CbmRichTrainAnnElectrons.h:123
RingElectronParam
Input Parameters for ANN for electron identification in RICH.
Definition: CbmRichTrainAnnElectrons.h:35
RingElectronParam::fNofHits
Double_t fNofHits
Definition: CbmRichTrainAnnElectrons.h:43
RingElectronParam::fMomentum
Double_t fMomentum
Definition: CbmRichTrainAnnElectrons.h:45
CbmRichTrainAnnElectrons::fhNofHits
vector< TH1D * > fhNofHits
Definition: CbmRichTrainAnnElectrons.h:126
CbmRichTrainAnnElectrons::fMCTracks
TClonesArray * fMCTracks
Definition: CbmRichTrainAnnElectrons.h:90
CbmRichTrainAnnElectrons::fRichRings
TClonesArray * fRichRings
Definition: CbmRichTrainAnnElectrons.h:88
CbmRichTrainAnnElectrons::fAnnCut
Double_t fAnnCut
Definition: CbmRichTrainAnnElectrons.h:103
CbmRichTrainAnnElectrons::fOutputDir
string fOutputDir
Definition: CbmRichTrainAnnElectrons.h:114
CbmRichTrainAnnElectrons::CbmRichTrainAnnElectrons
CbmRichTrainAnnElectrons(const CbmRichTrainAnnElectrons &)
Copy constructor.
RingElectronParam::fRadAngle
Double_t fRadAngle
Definition: CbmRichTrainAnnElectrons.h:40
CbmRichTrainAnnElectrons::fhAaxisVsMom
vector< TH2D * > fhAaxisVsMom
Definition: CbmRichTrainAnnElectrons.h:130
RingElectronParam::fDistance
Double_t fDistance
Definition: CbmRichTrainAnnElectrons.h:44
CbmRichTrainAnnElectrons::fQuota
Double_t fQuota
Definition: CbmRichTrainAnnElectrons.h:98
CbmRichTrainAnnElectrons::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmRichTrainAnnElectrons.h:91
CbmRichTrainAnnElectrons::fRElIdParams
vector< vector< RingElectronParam > > fRElIdParams
Definition: CbmRichTrainAnnElectrons.h:111
CbmRichTrainAnnElectrons::fhAnnOutput
vector< TH1D * > fhAnnOutput
Definition: CbmRichTrainAnnElectrons.h:106
CbmRichTrainAnnElectrons::fhBaxis
vector< TH1D * > fhBaxis
Definition: CbmRichTrainAnnElectrons.h:119
CbmRichTrainAnnElectrons::fRichHits
TClonesArray * fRichHits
Definition: CbmRichTrainAnnElectrons.h:87
CbmRichTrainAnnElectrons::fhRadPos
vector< TH1D * > fhRadPos
Definition: CbmRichTrainAnnElectrons.h:129
CbmRichTrainAnnElectrons::fStsTracks
TClonesArray * fStsTracks
Definition: CbmRichTrainAnnElectrons.h:95
CbmRichTrainAnnElectrons
Train ANN for electron identification in RICH.
Definition: CbmRichTrainAnnElectrons.h:57
CbmRichTrainAnnElectrons::fEventNum
Int_t fEventNum
Definition: CbmRichTrainAnnElectrons.h:86
CbmRichTrainAnnElectrons::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmRichTrainAnnElectrons.h:94
CbmRichTrainAnnElectrons::fCanvas
vector< TCanvas * > fCanvas
Definition: CbmRichTrainAnnElectrons.h:113
CbmRichTrainAnnElectrons::fStsTrackMatches
TClonesArray * fStsTrackMatches
Definition: CbmRichTrainAnnElectrons.h:93
CbmRichTrainAnnElectrons::fRichPoints
TClonesArray * fRichPoints
Definition: CbmRichTrainAnnElectrons.h:89
CbmRichTrainAnnElectrons::fhChi2
vector< TH1D * > fhChi2
Definition: CbmRichTrainAnnElectrons.h:127
RingElectronParam::fAaxis
Double_t fAaxis
Definition: CbmRichTrainAnnElectrons.h:37
CbmRichTrainAnnElectrons::fhBaxisVsMom
vector< TH2D * > fhBaxisVsMom
Definition: CbmRichTrainAnnElectrons.h:131