Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HistMacro_TAGMTimes.C
Go to the documentation of this file.
1 // hnamepath: /TAGM_TW/adc_rf_all
2 // hnamepath: /TAGM_TW/tdc_adc_all
3 // hnamepath: /TAGM_TW/t_adc_all
4 {
5  //Goto Path
6  TDirectory *locDirectory = (TDirectory*)gDirectory->FindObjectAny("TAGM_TW");
7  //TDirectory *locDirectory = (TDirectory*)gDirectory->FindObjectAny("st_Tresolution");
8  if(!locDirectory)
9  return;
10  locDirectory->cd();
11 
12  //Get Histograms
13  TH2I* TAGM_ADC_RF_Times = (TH2I*)gDirectory->Get("adc_rf_all");
14  TH2I* TAGM_TDC_ADC_Times = (TH2I*)gDirectory->Get("tdc_adc_all");
15  TH2I* TAGM_T_ADC_Times = (TH2I*)gDirectory->Get("t_adc_all");
16 
17  //Get/Make Canvas
18  TCanvas *locCanvas = NULL;
19  if(TVirtualPad::Pad() == NULL)
20  locCanvas = new TCanvas("TAGM_TW", "TAGM_TW", 1200, 600); //for testing
21  else
22  locCanvas = gPad->GetCanvas();
23  locCanvas->Divide(3,1);
24 
25  //Draw
26  locCanvas->cd(1);
27  gPad->SetTicks();
28  gPad->SetGrid();
29  if(TAGM_ADC_RF_Times != NULL)
30  {
31  TAGM_ADC_RF_Times->SetStats(0);
32  //TAGM_ADC_RF_Times->SetTitle("Corrected Time vs. Z - Sector 3");
33  //TAGM_ADC_RF_Times->GetYaxis()->SetTitle("Corrected Time - RF Time (ns)");
34  TAGM_ADC_RF_Times->Draw("COLZ");
35  locCanvas->Update();
36  }
37  else{
38  TPaveText *text = new TPaveText(0.1, 0.4, 0.9, 0.6);
39  text->AddText("No TAGM Hits!");
40  text->Draw();
41  }
42 
43  locCanvas->cd(2);
44  gPad->SetTicks();
45  gPad->SetGrid();
46  if(TAGM_TDC_ADC_Times != NULL)
47  {
48  TAGM_TDC_ADC_Times->SetStats(0);
49  //TAGM_TDC_ADC_Times->SetTitle("Corrected Time vs. Z - Sector 3");
50  //TAGM_TDC_ADC_Times->GetYaxis()->SetTitle("Corrected Time - RF Time (ns)");
51  TAGM_TDC_ADC_Times->Draw("COLZ");
52  locCanvas->Update();
53  }
54  else{
55  TPaveText *text = new TPaveText(0.1, 0.4, 0.9, 0.6);
56  text->AddText("No TAGM Hits!");
57  text->Draw();
58  }
59 
60  locCanvas->cd(3);
61  gPad->SetTicks();
62  gPad->SetGrid();
63  if(TAGM_T_ADC_Times != NULL)
64  {
65  TAGM_T_ADC_Times->SetStats(0);
66  //TAGM_T_ADC_Times->SetTitle("Corrected Time vs. Z - Sector 3");
67  //TAGM_T_ADC_Times->GetYaxis()->SetTitle("Corrected Time - RF Time (ns)");
68  TAGM_T_ADC_Times->Draw("COLZ");
69  locCanvas->Update();
70  }
71  else{
72  TPaveText *text = new TPaveText(0.1, 0.4, 0.9, 0.6);
73  text->AddText("No TAGM Hits!");
74  text->Draw();
75  }
76 
77 
78 
79 }
80 
TH2I * TAGM_T_ADC_Times
TH2I * TAGM_TDC_ADC_Times
TDirectory * locDirectory
TCanvas * locCanvas
char text[100]
TH2I * TAGM_ADC_RF_Times