Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Calibration/HLDetectorTiming/HistMacro_TaggerRFAlignment2.C
Go to the documentation of this file.
1 // hnamepath: /HLDetectorTiming/TRACKING/TAGM - RFBunch Time
2 // hnamepath: /HLDetectorTiming/TRACKING/TAGH - RFBunch Time
3 // hnamepath: /HLDetectorTiming/TRACKING/TAGM - RFBunch 1D Time
4 // hnamepath: /HLDetectorTiming/TRACKING/Tagger - RFBunch 1D Time
5 // hnamepath: /HLDetectorTiming/TRACKING/SC - RF Time vs. Sector
6 
7 {
8  //Goto Path
9  TDirectory *locDirectory = (TDirectory*)gDirectory->FindObjectAny("HLDetectorTiming");
10  if(!locDirectory)
11  return;
12  locDirectory->cd();
13 
14  //Get Histograms
15  TH1I* Tagger_RF_1D = (TH1I*)gDirectory->Get("TRACKING/Tagger - RFBunch 1D Time");
16  TH2I* TAGM_RF_1D = (TH2I*)gDirectory->Get("TRACKING/TAGM - RFBunch 1D Time");
17  //TH2I* TAGH_RF_2D = (TH2I*)gDirectory->Get("TRACKING/TAGH - RFBunch Time");
18  TH2I* TAGH_RF_2D = (TH2I*)gDirectory->Get("TRACKING/SC - RF Time vs. Sector");
19  TH2I* TAGM_RF_2D = (TH2I*)gDirectory->Get("TRACKING/TAGM - RFBunch Time");
20 
21  //Get/Make Canvas
22  TCanvas *locCanvas = NULL;
23  if(TVirtualPad::Pad() == NULL)
24  locCanvas = new TCanvas("TaggerRFAlignment", "TaggerRFAlignment", 1200, 800); //for testing
25  else
26  locCanvas = gPad->GetCanvas();
27  locCanvas->Divide(2, 2);
28 
29  //Draw
30  locCanvas->cd(1);
31  gPad->SetTicks();
32  gPad->SetGrid();
33  if(TAGH_RF_2D != NULL)
34  {
35  TAGH_RF_2D->Draw("colz");
36  }
37  else{
38  TPaveText *text = new TPaveText(0.1, 0.4, 0.9, 0.6);
39  text->AddText("No Matched TAGH/RFBunch Times");
40  text->Draw();
41  }
42 
43  locCanvas->cd(2);
44  gPad->SetTicks();
45  gPad->SetGrid();
46  if(TAGM_RF_1D != NULL)
47  {
48  TAGM_RF_1D->Draw("colz");
49  }
50  else{
51  TPaveText *text = new TPaveText(0.1, 0.4, 0.9, 0.6);
52  text->AddText("No Matched TAGM/RFBunch Times");
53  text->Draw();
54  }
55 
56  locCanvas->cd(3);
57  gPad->SetTicks();
58  gPad->SetGrid();
59  if(TAGM_RF_2D != NULL)
60  {
61  TAGM_RF_2D->Draw("colz");
62  }
63  else{
64  TPaveText *text = new TPaveText(0.1, 0.4, 0.9, 0.6);
65  text->AddText("No Matched TAGM/RFBunch Times");
66  text->Draw();
67  }
68 
69  locCanvas->cd(4);
70  gPad->SetTicks();
71  gPad->SetGrid();
72  if(Tagger_RF_1D != NULL)
73  {
74  Tagger_RF_1D->Draw();
75  Tagger_RF_1D->SetFillColor(kGray);
76  }
77  else{
78  TPaveText *text = new TPaveText(0.1, 0.4, 0.9, 0.6);
79  text->AddText("No Matched Tagger/RFBunch Times");
80  text->Draw();
81  }
82 }
83 
TDirectory * locDirectory
TCanvas * locCanvas
char text[100]