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