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