PandaRoot
DrawHits.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 // ----- DrawHits header file -----
15 // ----- Created 19/10/09 by Dipanwita Dutta -----
16 // ----- -----
17 // ----- -----
18 // -------------------------------------------------------------------------
19 
28 #ifndef PNDDRCHITANA_H
29 #define PNDDRCHITANA_H
30 
31 #include "FairTask.h"
32 #include "TClonesArray.h"
33 #include "PndMCTrack.h"
34 #include "PndDrcHit.h"
35 #include "PndDrcPDHit.h"
36 #include "PndStack.h"
37 #include "FairBaseParSet.h"
38 #include "PndGeoDrcPar.h"
39 #include "TString.h"
40 #include <string>
41 
42 #include "TH1.h"
43 #include "TH2.h"
44 #include "TTree.h"
45 #include "TGraph2D.h"
46 
47 #include "TColor.h"
48 #include "TStyle.h"
49 
50 #ifndef ROOT_TParticlePDG
51 #include "TParticlePDG.h"
52 #endif
53 #ifndef ROOT_TDatabasePDG
54 #include "TDatabasePDG.h"
55 #endif
56 
57 class DrawHits : public FairTask {
58 
59  public:
61  DrawHits();
62 
64  DrawHits(Int_t verbose);
65 
67  virtual ~DrawHits();
68 
69  virtual InitStatus Init();
70 
72  virtual void Exec(Option_t *option);
73 
75  virtual void Finish();
76 
78  void RotBarCoordinate(TVector3 &vector, Int_t barID);
79 
80  void SetTreeName(TString str) { fTreeName = str; }
81 
82  protected:
83  private:
84  void ProcessPhotonHit();
85  void ProcessPhotonMC();
86  void WriteToFile();
87  void CreateHisto();
88  void DrawHisto();
89  void ProcessBarHit();
90 
91  Int_t fDetectorID;
92  Double_t fMass;
93  Double_t fThetaC, fErrThetaC;
94  Int_t fRefIndex;
95 
96  TClonesArray *fBarPointArray; // DRC MC points in the bars
97  TClonesArray *fPDPointArray; // DRC points in the photon detector
98  TClonesArray *fHitArray; // DRC Hits in the bars
99  TClonesArray *fPDHitArray; // DRC Hits in the photon detector
100  TClonesArray *fMCArray; // DRC Hits in the photon detector
101  TList *fHistoList;
102 
103  PndGeoDrcPar *fPar;
104 
105  PndGeoDrc *fGeo;
106 
108  void SetDefaultParameters();
109 
111  Int_t fVerbose;
112 
113  /* nice plits*/
114  void SetPlotStyle()
115  {
116  const Int_t NRGBs = 5;
117  const Int_t NCont = 255;
118 
119  Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
120  Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
121  Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
122  Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
123  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
124  gStyle->SetNumberContours(NCont);
125  }
126 
127  Bool_t InsideBar(Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Double_t);
128 
129  Int_t nevents;
130 
131  /* tree and its variables */
132  Double_t xmcp;
133  Double_t ymcp;
134  Double_t zmcp;
135  Double_t pxmc;
136  Double_t pymc;
137  Double_t pzmc;
138  Float_t xhit;
139  Float_t yhit;
140  Double_t zhit;
141  Double_t thit;
142  Double_t xbar;
143  Double_t ybar;
144  Double_t zbar;
145  Double_t pxMo;
146  Double_t pyMo;
147  Double_t pzMo;
148  Double_t pxPho;
149  Double_t pyPho;
150  Double_t pzPho;
151  Double_t xEnt;
152  Double_t yEnt;
153  Double_t zEnt;
154  Double_t lam;
155 
156  Double_t fPhiRot;
157  TVector3 fStartVertex;
158  Double_t fPx;
159  Double_t fPy;
160  Double_t fPz;
161  Double_t fXcross;
162  Double_t fYcross;
163  TVector3 fPphoB;
164  Double_t fkxBar;
165  Double_t fkyBar;
166  Double_t fkzBar;
167 
168  TString fTreeName;
169  TTree *phoTree;
170  std::vector<TH1F *> histos;
171  TH1F *currh;
172  TGraph2D *map;
173  TGraph2D *pop;
174  TVector3 fPMo;
175 
176  TH1D *fhThetaC;
177  TH2D *fhThetaCMass;
178  TH2D *fhMomAng;
179  TH2D *fhThetaCMomK;
180  TH2D *fhThetaCMomP;
181  TH2D *fhThetaCMomM;
182  TH2D *fhThetaCMomE;
183 
184  TH1F *fhPhoTheta;
185  TH2F *fhPDPlane;
186  TH1D *fhCHrealMC;
187  TH1D *fhCHreal;
188  TH2D *fhCHlam;
189  TH2D *fhCHlamMC;
190  TH2D *fhCHlamE;
191 
192  TH2F *fhHitsD;
193 
194  TH1D *fhLambda;
195  TH2D *fhXYPDHit;
196  TH1D *fhLambdaMC;
197  TH2D *fhXYPDMCPt;
198  TH1D *fhPDTime;
199 
200  TH2D *fhXYPDHitKp;
201  TH2D *fhXYPDHitKn;
202  TH2D *fhXYPDHitpip;
203  TH2D *fhXYPDHitpin;
204  TH2D *fhXYPDHitmp;
205  TH2D *fhXYPDHitmn;
206 
207  TH2D *fhXYPDMCPtKp;
208  TH2D *fhXYPDMCPtKn;
209  TH2D *fhXYPDMCPtpip;
210  TH2D *fhXYPDMCPtpin;
211  TH2D *fhXYPDMCPtmp;
212  TH2D *fhXYPDMCPtmn;
213  ClassDef(DrawHits, 1)
214 };
215 
216 #endif
virtual void Exec(Option_t *option)
void RotBarCoordinate(TVector3 &vector, Int_t barID)
virtual InitStatus Init()
virtual ~DrawHits()
void SetTreeName(TString str)
Definition: DrawHits.h:80
virtual void Finish()