FairRoot/PandaRoot
PndDrcRecoLookupMap.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndDrcRecoLookupMap header file -----
3 // ----- Created 30/09/11 by Maria Patsyuk -----
4 // ----- -----
5 // ----- -----
6 // -------------------------------------------------------------------------
7 
16 #ifndef PNDDRCRECOLOOKUPMAP_H
17 #define PNDDRCRECOLOOKUPMAP_H
18 
19 #include "FairTask.h"
20 #include "TClonesArray.h"
21 #include "PndMCTrack.h"
22 #include "PndDrcHit.h"
23 #include "PndDrcPDHit.h"
24 #include "PndStack.h"
25 #include "FairBaseParSet.h"
26 #include "PndGeoDrcPar.h"
27 #include "TString.h"
28 #include <string>
29 #include "PndDrcDigiPar.h"
30 #include "PndDrcDigi.h"
31 #include "PndGeoHandling.h"
32 
33 #include "TH1.h"
34 #include "TH2.h"
35 #include "TTree.h"
36 #include "TGraph2D.h"
37 #include "TColor.h"
38 #include "TStyle.h"
39 #include "TLine.h"
40 #include "TPolyLine.h"
41 
42 #ifndef ROOT_TParticlePDG
43 #include "TParticlePDG.h"
44 #endif
45 #ifndef ROOT_TDatabasePDG
46 #include "TDatabasePDG.h"
47 #endif
48 
49 class PndDrcRecoLookupMap : public FairTask {
50 
51 public:
52 
55 
58 
60  virtual ~PndDrcRecoLookupMap();
61 
62  virtual InitStatus Init();
63 
65  virtual void Exec(Option_t* option);
66 
68  virtual void Finish();
69 
70  void SetHistoWidth(double wid=0.01){fWidth = wid;} // 0.01
71  void SetNSigma(double nsig = 3.){fNSigma = nsig;}
72  void SetMagneticField(double mag = 0.){fB = mag;} // [Tesla]
73  void SetOutputFile(TString outName = "PndDrcRecoLookupMap_output.root"){fOutputName = outName;}
74 
75  void SetPlotStyle()
76  {
77  const Int_t NRGBs = 5;
78  const Int_t NCont = 255;
79 
80  Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
81  Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
82  Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
83  Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
84  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
85  gStyle->SetNumberContours(NCont);
86  }
87 
89  {
90  // drawing of detector layout
91  Double_t theta = (180. - 2*fGeo->PipehAngle())/ fGeo->BBoxNum()/180.*3.1415; //[rad]
92  //std::cout<<"-I- DrawLayout: theta = "<<theta<<std::endl;
93  Double_t rad_out=102.6; //104.0; // PD outer radius
94  Double_t rad_in=49.15; //50.53; // PD inner radius
95  Double_t rp_out=rad_out/cos(theta);
96  Double_t rp_in=rad_in/cos(theta);
97  Double_t xout[4], yout[4], xin[4], yin[4];
98  for(Int_t i=0; i<4; i++){
99  xout[i]=rp_out*cos(2.0*(i-1)*theta);
100  yout[i]=rp_out*sin(2.0*(i-1)*theta);
101  xin[i]=rp_in*cos(2.0*(i-1)*theta);
102  yin[i]=rp_in*sin(2.0*(i-1)*theta);
103  TLine *l1 =new TLine(xout[i],yout[i],xin[i],yin[i]);
104  l1->Draw("same");
105  }
106  TPolyLine *p1 =new TPolyLine(4,xout,yout);
107  p1->SetFillColor(kYellow);
108  p1->Draw("same");
109  TPolyLine *p2 =new TPolyLine(4,xin,yin);
110  p2->SetFillColor(0);
111  p2->Draw("same");
112  //--------------------------
113  }
114 
115 protected:
116 
117 
118 private:
119 
120  void ProcessPhotonHit();
121  void ProcessPhotonMC();
122  void WriteToFile();
123  void CreateHisto();
124  void DrawHisto();
125  void ProcessBarHit();
126 
127  // parameters:
140 
141  // look up table
142  virtual void SetParContainers();
144 
145  Double_t InBarCoordSyst(TVector3, TVector3 *, TVector3 *, TVector3 *, TVector3 *);
147  Int_t NumberOfBounces(TVector3, TVector3, Int_t);
149  Double_t CherenkovPhi(TVector3, TVector3, Double_t *, Double_t *);
150  Double_t RecoAmbigTime(TVector3, TVector3,Double_t *, Bool_t);
151  void DrawBarBox(TVector3, TVector3, TVector3, TVector3);
152  Int_t fDetectorID;
153 
154  TClonesArray* fBarPointArray; // DRC MC points in the bars
155  TClonesArray* fPDPointArray; // DRC points in the photon detector
156  TClonesArray* fHitArray; // DRC Hits in the bars
157  TClonesArray* fPDHitArray; // DRC Hits in the photon detector
158  TClonesArray* fMCArray; // DRC Hits in the photon detector
159  TClonesArray *fDigiArray;
160 
161  //TClonesArray* fChPhoArray; // output array of PndChPho
162  TClonesArray *fDrcLutInfoArray;
163 
164  TList* fHistoList;
165 
168 
170  void SetDefaultParameters();
171 
173  Int_t fVerbose;
174 
175  Int_t nevents;
176 
181 
186 
187  TVector3 fnX1;
188  TVector3 fnY1;
189 
200  TVector3 fPMo;
201  TVector3 fPMoB;
202  TVector3 fPphoInit;
203  TVector3 fkBar;
205  Int_t fBarId;
206 
208 
209  // look up parameters
210  Int_t NHitPix;
211  Int_t NPixPar;
212  Int_t NAmb;
213 
219  TVector3 fPphoB; // kBar
220  TVector3 fStartVertex;
221  TVector3 fPphoPD;
223 
224  // vertices of hit BarBox
225  TVector3 fBBver1;
226  TVector3 fBBver2;
227  TVector3 fBBver3;
228  TVector3 fBBver4;
229 
230  std::vector<TH1F*> PhiThetaPoints;
231  std::vector<TH1F*> PhiThetaPointsCut;
232  std::vector<TH1F*> PhiThetaPointsWeight;
233  std::vector<TH1F*> NboPoints;
234  TH2F* fMapHist;
235  TH2F* fSigHist;
236  TH2F* fCheHist;
237  TH2F* fkBarXHist;
238  TH2F* fkBarYHist;
239 
240  // time resolution
241  TF1* timeres;
242 
243  TH1D* fhPDTime;
244  TH2D* fhPDHits;
245  TH1F* fhDiff;
246 
247  TH2F* fhRecoT1;
248  TH1F* fhCHreal;
249  TH1F* fhLam;
250 
251  TH2F* fhNboLam;
252 
253 ClassDef(PndDrcRecoLookupMap,1)
254 
255 };
256 
257 #endif
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
TClonesArray * fPDPointArray
Double_t BBoxNum()
Definition: PndGeoDrc.h:136
Int_t i
Definition: run_full.C:25
PndGeoDrc * fGeo
Basic geometry data of barrel DRC.
#define verbose
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
Double_t RecoAmbigTime(TVector3, TVector3, Double_t *, Bool_t)
Double_t SectorNum(Double_t, Double_t)
void SetNSigma(double nsig=3.)
std::vector< TH1F * > PhiThetaPointsCut
std::vector< TH1F * > PhiThetaPoints
void SetHistoWidth(double wid=0.01)
Double_t PipehAngle()
Definition: PndGeoDrc.h:139
void SetOutputFile(TString outName="PndDrcRecoLookupMap_output.root")
PndDrcDigiPar * fDigiPar
Class to access the naming information of the MVD.
TClonesArray * fDrcLutInfoArray
std::vector< TH1F * > PhiThetaPointsWeight
Double_t
virtual void Exec(Option_t *option)
TClonesArray * fBarPointArray
Double_t InBarCoordSyst(TVector3, TVector3 *, TVector3 *, TVector3 *, TVector3 *)
TPad * p2
Definition: hist-t7.C:117
TClonesArray * fPDHitArray
int nsig
Definition: toy_core.C:46
Digitization Parameter Class for DIRC barrel part.
Definition: PndDrcDigiPar.h:29
virtual InitStatus Init()
Double_t FindOutPoint(Double_t, Double_t, Double_t, Double_t *, Bool_t)
TPad * p1
Definition: hist-t7.C:116
PndGeoHandling * fGeoH
virtual void SetParContainers()
void DrawBarBox(TVector3, TVector3, TVector3, TVector3)
void SetMagneticField(double mag=0.)
std::vector< TH1F * > NboPoints
Int_t NumberOfBounces(TVector3, TVector3, Int_t)
Double_t CherenkovPhi(TVector3, TVector3, Double_t *, Double_t *)