PandaRoot
PndDrcReco.h
Go to the documentation of this file.
1 // -----------------------------------------
2 // PndDrcReco.h
3 //
4 // Created on: 04.03.2016
5 // Author: R.Dzhygadlo at gsi.de
6 // -----------------------------------------
7 // look-up-table and time imaging reconstruction
8 
9 #ifndef PNDDRCRECO_H
10 #define PNDDRCRECO_H
11 
12 #include "FairTask.h"
13 #include "TClonesArray.h"
14 #include "PndMCTrack.h"
15 #include "PndDrcBarPoint.h"
16 #include "PndDrcEVPoint.h"
17 #include "PndDrcPDPoint.h"
18 #include "PndDrcHit.h"
19 #include "PndDrcPDHit.h"
20 #include "PndDrcDigi.h"
21 #include "PndGeoDrc.h"
22 
23 #include "TString.h"
24 #include "TFile.h"
25 #include "TH1.h"
26 #include "TH2.h"
27 #include "TF1.h"
28 #include "TSpectrum.h"
29 #include "TKey.h"
30 #include "TRandom.h"
31 #include "TCanvas.h"
32 #include "TTree.h"
33 
34 #include "PndDrcTrackInfo.h"
35 #include "PndDrcPhotonInfo.h"
36 #include "PndDrcAmbiguityInfo.h"
37 
38 using std::array;
39 
40 class PndDrcReco : public FairTask {
41 
42  public:
43  PndDrcReco();
44  PndDrcReco(TString outFile, TString lutFile, TString pdfFile, int verbose = 0, double r1 = 0, double r2 = 0);
45 
46  void SetMethod(int var) { fMethod = var; }
47  virtual ~PndDrcReco(){};
48 
49  virtual InitStatus Init();
50 
51  virtual void Exec(Option_t *option);
52 
53  virtual void Finish();
54 
55  private:
56  void DetermineCherenkov(int boxId, int barId);
57  void DetermineBarId(double &boxPhi, int &barId);
58  void LookUpTable(int barId, int sensorId);
59  void TimeImaging(int sensorId);
60  void BuildPdfs(TF1 &pdfuf, TF1 &pdfus, int ch, int barId, TVector3 mom, double posz, bool reflected);
61  void TimeImagingWithAnalyticalPdf(int barId, int ch);
62 
63  double FindPeak();
64  int FindPdg(double mom, double cangle);
65  void CanvasAdd(TString name = "c", int w = 800, int h = 400);
66  void CanvasSave(TString path = "data/reco");
67  PndGeoDrc *fGeo;
68  double fBboxNum, fPipehAngle, fDphi, fBarPhi;
69 
70  TClonesArray *fMCArray; // DRC MCPoints in the photon detector
71  TClonesArray *fBarPointArray;
72  TClonesArray *fEVPointArray;
73  TClonesArray *fPDPointArray; // DRC points in the photon detector
74  TClonesArray *fDigiArray;
75  TClonesArray *fPDHitArray; // DRC Hits in the photon detector
76  TClonesArray *fDrcTrackInfoArray;
77  array<TClonesArray *, 5> fLut;
78 
79  TFile *fFile;
80  TFile *fFileOut;
81  TTree *fTree;
82  TTree *fTreeOut;
83 
84  PndMCTrack *fMCTrack;
85  PndDrcBarPoint *fBarPoint;
86  PndDrcEVPoint *fEVPoint;
87  PndDrcPDPoint *fPDPoint;
88  PndDrcDigi *fDigi;
89  PndDrcPDHit *fPDHit;
90 
91  // Set the parameters to the default values.
92  void SetDefaultParameters();
93 
94  // Verbosity level
95  int fVerbose;
96  int nevents;
97  bool fHist_flag;
98  TString fOutFile;
99  TString fLutFile;
100  TString fPdfFile;
101  TString fCorrFile;
102  int fEvType, fRadType, fLensType;
103  TH1F *fHist, *fHist1, *fHist2;
104  TF1 *fFit;
105  TSpectrum *fSpect;
106 
107  int fMethod;
108  TVector3 fMomInBar;
109  TVector3 fPosInBar;
110  double fTimeInBar;
111  double fTimeHit;
112  double fLenz;
113  double fCriticalAngle;
114  bool fReflected;
115 
116  array<double, 5> fPdg, fMass, fAngle, fSpr, fCangle, fEfficiency, fMissId;
117  array<double, 3> fLikelihood, fSeparation;
118  array<TF1 *, 5> fFunc, fFnph;
119  array<int, 2> fPidLike;
120  array<int, 5> fEvents, fEventsEff, fEventsMis, fHits, fHits1;
121  array<int, 3000> fParticleArray;
122  array<array<int, 5>, 3> fHitsE;
123  array<array<double, 5>, 3> fLk, fNph;
124  array<TH1F *, 5> fhTang, fhTime, fhDiff;
125  array<array<TH1F *, 5>, 3> fhNph, fhLk;
126  array<array<TH1F *, 5>, 800> fhTimeA;
127  array<TH1F *, 9> fhCorr;
128  array<array<array<array<TH1F *, 1100>, 120>, 40>, 5> fhPdf;
129  array<array<array<int, 150>, 50>, 9> fCorr_spr, fCorr_mean;
130  array<array<array<TH1F *, 150>, 40>, 5> fhNphArr;
131 
132  double fMom, fTheta, fPhi;
133  int fMcTrackId, fPidTrue, fPidDist;
134  TVector3 fNx, fNy;
135  double fR1, fR2;
136  bool fStoreCorr;
137  int fBin_mom, fBin_theta;
138 
139  TList *fCanvasList;
140  TCanvas *gg_c;
141 
142  ClassDef(PndDrcReco, 1)
143 };
144 
145 #endif
virtual ~PndDrcReco()
Definition: PndDrcReco.h:47
virtual void Finish()
virtual InitStatus Init()
virtual void Exec(Option_t *option)
void SetMethod(int var)
Definition: PndDrcReco.h:46