Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HistMacro_Tracking_p3.C
Go to the documentation of this file.
1 // hnamepath: /Independent/Hist_DetectorPID/CDC/dEdxVsP_Amp_q-
2 // hnamepath: /Independent/Hist_DetectorPID/CDC/dEdxVsP_Amp_q+
3 // hnamepath: /Independent/Hist_DetectorPID/FDC/dEdxVsP_q-
4 // hnamepath: /Independent/Hist_DetectorPID/FDC/dEdxVsP_q+
5 
6 {
7  //Goto Path
8  TDirectory *locInitDirectory = gDirectory;
9  TDirectory *locDirectory = (TDirectory*)gDirectory->FindObjectAny("Hist_DetectorPID");
10  if(!locDirectory)
11  return;
12  locDirectory->cd();
13 
14  //Get Histograms
15  gDirectory->cd("CDC");
16  TH2I* locHist_CDCdEdXVsP_QMinus = (TH2I*)gDirectory->Get("dEdXVsP_Amp_q-"); //q-
17  TH2I* locHist_CDCdEdXVsP_QPlus = (TH2I*)gDirectory->Get("dEdXVsP_Amp_q+"); //q+
18  gDirectory->cd("../FDC");
19  TH2I* locHist_FDCdEdXVsP_QMinus = (TH2I*)gDirectory->Get("dEdXVsP_q-"); //q-
20  TH2I* locHist_FDCdEdXVsP_QPlus = (TH2I*)gDirectory->Get("dEdXVsP_q+"); //q+
21 
22  //Get/Make Canvas
23  TCanvas *locCanvas = NULL;
24  if(TVirtualPad::Pad() == NULL)
25  locCanvas = new TCanvas("Tracking_p3", "Tracking_p3", 1200, 800); //for testing
26  else
27  locCanvas = gPad->GetCanvas();
28  locCanvas->Divide(2, 2);
29 
30  //Draw
31  locCanvas->cd(1);
32  gPad->SetTicks();
33  gPad->SetGrid();
34  if(locHist_CDCdEdXVsP_QPlus != NULL)
35  {
36  locHist_CDCdEdXVsP_QPlus->GetXaxis()->SetRangeUser(0.0, 6.0);
37  locHist_CDCdEdXVsP_QPlus->GetXaxis()->SetTitleSize(0.05);
38  locHist_CDCdEdXVsP_QPlus->GetYaxis()->SetTitleSize(0.05);
39  locHist_CDCdEdXVsP_QPlus->GetXaxis()->SetLabelSize(0.05);
40  locHist_CDCdEdXVsP_QPlus->GetYaxis()->SetLabelSize(0.05);
41  locHist_CDCdEdXVsP_QPlus->Draw("COLZ");
42  }
43 
44  locCanvas->cd(2);
45  gPad->SetTicks();
46  gPad->SetGrid();
47  if(locHist_CDCdEdXVsP_QMinus != NULL)
48  {
49  locHist_CDCdEdXVsP_QMinus->GetXaxis()->SetRangeUser(0.0, 6.0);
50  locHist_CDCdEdXVsP_QMinus->GetXaxis()->SetTitleSize(0.05);
51  locHist_CDCdEdXVsP_QMinus->GetYaxis()->SetTitleSize(0.05);
52  locHist_CDCdEdXVsP_QMinus->GetXaxis()->SetLabelSize(0.05);
53  locHist_CDCdEdXVsP_QMinus->GetYaxis()->SetLabelSize(0.05);
54  locHist_CDCdEdXVsP_QMinus->Draw("COLZ");
55  }
56 
57  locCanvas->cd(3);
58  gPad->SetTicks();
59  gPad->SetGrid();
60  if(locHist_FDCdEdXVsP_QPlus != NULL)
61  {
62  locHist_FDCdEdXVsP_QPlus->GetXaxis()->SetTitleSize(0.05);
63  locHist_FDCdEdXVsP_QPlus->GetYaxis()->SetTitleSize(0.05);
64  locHist_FDCdEdXVsP_QPlus->GetXaxis()->SetLabelSize(0.05);
65  locHist_FDCdEdXVsP_QPlus->GetYaxis()->SetLabelSize(0.05);
66  locHist_FDCdEdXVsP_QPlus->Draw("COLZ");
67  }
68 
69  locCanvas->cd(4);
70  gPad->SetTicks();
71  gPad->SetGrid();
72  if(locHist_FDCdEdXVsP_QMinus != NULL)
73  {
74  locHist_FDCdEdXVsP_QMinus->GetXaxis()->SetTitleSize(0.05);
75  locHist_FDCdEdXVsP_QMinus->GetYaxis()->SetTitleSize(0.05);
76  locHist_FDCdEdXVsP_QMinus->GetXaxis()->SetLabelSize(0.05);
77  locHist_FDCdEdXVsP_QMinus->GetYaxis()->SetLabelSize(0.05);
78  locHist_FDCdEdXVsP_QMinus->Draw("COLZ");
79  }
80 }
81 
TDirectory * locDirectory
TH2I * locHist_FDCdEdXVsP_QPlus
TH2I * locHist_FDCdEdXVsP_QMinus
TDirectory * locInitDirectory
TCanvas * locCanvas
TH2I * locHist_CDCdEdXVsP_QPlus
TH2I * locHist_CDCdEdXVsP_QMinus