Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFMacro_BeamBunchPeriod.C
Go to the documentation of this file.
1 // hnamepath: /RF/RF_BeamBunchPeriod/RFBeamBunchPeriod
2 
4 {
5  gDirectory->cd("/"); //return to file base directory
6 
7  //Goto Beam Path
8  TDirectory *locDirectory = (TDirectory*)gDirectory->FindObjectAny("RF");
9  if(!locDirectory)
10  return 0;
11  locDirectory->cd();
12 
13  //Get RF Bunch Period Histograms
14  gDirectory->cd("RF_BeamBunchPeriod");
15  TH1I* locHist_RFBeamBunchPeriod = (TH1I*)gDirectory->Get("RFBeamBunchPeriod");
16 
17  //Get/Make Canvas
18  TCanvas *locCanvas = NULL;
19  if(TVirtualPad::Pad() == NULL)
20  locCanvas = new TCanvas("RF_BeamBunchPeriod", "RF_BeamBunchPeriod", 1200, 800); //for testing
21  else
22  locCanvas = gPad->GetCanvas();
23 
24  //Draw
25  gPad->SetTicks();
26  gPad->SetGrid();
27  if(locHist_RFBeamBunchPeriod != NULL)
28  {
30  locHist->GetXaxis()->SetTitleSize(0.05);
31  locHist->GetYaxis()->SetTitleSize(0.05);
32  locHist->GetXaxis()->SetLabelSize(0.05);
33  locHist->GetYaxis()->SetLabelSize(0.05);
34  locHist->Draw();
35  }
36 
37  return 1;
38 }
TDirectory * locDirectory
int RFMacro_BeamBunchPeriod(void)
TH2D * locHist
TH1 * locHist_RFBeamBunchPeriod
TCanvas * locCanvas