示例#1
0
文件: EpEd.C 项目: zhangzc11/CPTV
void EpEd()
{
  TCanvas *c1 = new TCanvas("c1","multipads",700,700);
  gStyle->SetPadBorderMode(0);
  gStyle->SetOptStat(0);
  gStyle->SetOptTitle(0);
  gStyle->SetFrameLineWidth(1);

  c1->Divide(1,2,0.001,0.000001);


  c1->cd(1);

  gPad->SetTopMargin(0.2);
  gPad->SetBottomMargin(0.0);
  gPad->SetRightMargin(0.15);
  /// Near site
  {
    TFile f("../../data/Sample/P12e_1.5MeV/H/Near.root");
    
    h2dAccSum->GetXaxis()->SetRangeUser(1.3,10);
    h2dAccSum->GetYaxis()->SetRangeUser(1.3,10.5);
    //h2dAccSum->GetZaxis()->SetRangeUser(-20,1.5308177e+03);

    h2dAccSum->GetYaxis()->SetLabelSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleOffset(0.5);
    h2dAccSum->GetZaxis()->SetLabelSize(0.05);
    h2dAccSum->GetZaxis()->SetTitleSize(0.05);

    //h2dAccSum->SetMinimum(0);
    // What is this principle?
    h2dAccSum->DrawCopy("col");
    TExec *ex1 = new TExec("ex1","Pal1();");
    ex1->Draw();
    h2dAccSum->SetContour(500);
    h2dAccSum->DrawCopy("colz same");
    h2dAccSum->DrawCopy("same axis");    


    // top frame is blocked. Now redraw it.
    TLine *line = new TLine;
    line->DrawLine(1.3,10.6, 10.1,10.6);
    line->DrawLine(10.1,10.6, 10.1,1.3);

    TPaveLabel *label = new TPaveLabel(8,8.7,10,10.2,"Near site");
    label->SetFillColor(0);
    label->SetShadowColor(0);
    label->SetTextSize(0.5);
    label->Draw();

    f.Close();
  }

  c1->cd(2);
  gPad->SetTopMargin(0.0);
  gPad->SetRightMargin(0.15);
  gPad->SetBottomMargin(0.2);
  /// Far site
  {
    TFile ff("../../data/Sample/P12e_1.5MeV/H/EH3.root");
    
    h2dAccSum->GetXaxis()->SetRangeUser(1.3,10);
    h2dAccSum->GetYaxis()->SetRangeUser(1.3,10.5);

    h2dAccSum->GetXaxis()->SetLabelSize(0.06);
    h2dAccSum->GetXaxis()->SetTitleSize(0.06);
    h2dAccSum->GetYaxis()->SetLabelSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleSize(0.06);
    h2dAccSum->GetYaxis()->SetTitleOffset(0.5);
    h2dAccSum->GetZaxis()->SetLabelSize(0.05);
    h2dAccSum->GetZaxis()->SetTitleSize(0.05);

    // What is this principle?
    h2dAccSum->DrawCopy("col");
    TExec *ex2 = new TExec("ex2","Pal2();");
    ex2->Draw();
    h2dAccSum->SetContour(500);
    h2dAccSum->DrawCopy("same colz");
    h2dAccSum->DrawCopy("same axis");

    // top frame is blocked. Now redraw it.
    TLine *line = new TLine;
    line->DrawLine(1.3,10.6, 10.1,10.6);
    line->DrawLine(10.1,10.6, 10.1,1.3);

    TPaveLabel *label = new TPaveLabel(8,8.7,10,10.2,"Far site");
    label->SetFillColor(0);
    label->SetShadowColor(0);
    label->SetTextSize(0.5);
    label->Draw();
    ff.Close();
  }

}
示例#2
0
void drawValueBox(double x1, double x2, double x3, int colour)
{

  char optionfile[60];
  std::vector<double> options;
  
  double delta1(0.), delta2(0.), delta3(0.), delta4(0.);
  double tsize(0.7);

  sprintf(optionfile,"./config/drawValueBox.dat");
  
  readData(optionfile,options);
  delta1 = options[0];
  delta2 = options[1];
  delta3 = options[2];
  delta4 = options[3];
  tsize  = options[4];
  
  double xmin = x1 + delta1;
  double xmax = x1 + delta2;
  double ymin = x2 + delta3;
  double ymax = x2 + delta4;

  if ( x1 < 0 && x2 > 0) {
    xmin = x1 - delta1;
    xmax = x1 - delta2;
  } 
  else if ( x1 < 0 && x2 < 0) {
    xmin = x1 - delta1;
    xmax = x1 - delta2;
    ymin = x2 - delta3;
    ymax = x2 - delta4;
  }
  else if ( x1 > 0 && x2 < 0) {
    ymin = x2 - delta3;
    ymax = x2 - delta4;
  }
  else if ( x1 == 0.0 ) {
    xmin = xmin - delta1;
    xmax = xmax ;
  }
  else if ( x2 == 0.0 ) {
    ymin = ymin - delta3;
    ymax = ymax ;
  }
  else {}


  char label[10];
  sprintf(label,"%.1f",float(x3));

  TPaveLabel *box = new TPaveLabel(xmin,ymin,xmax,ymax,label);
  box->SetBorderSize(0);
  box->SetTextFont(42);
  box->SetTextSize(tsize);
  box->SetTextAlign(22);
  box->SetTextColor(colour);
  if (colour == 1) box->SetFillStyle(4000);
  else {
    box->SetFillColor(10);
    box->SetTextColor(colour);
    box->SetBorderSize(1);
  }
  box->Draw("same");
  
  TLine * ln = new TLine(x1,x2,xmin,ymin);
  ln->SetLineWidth(1);
  ln->SetLineStyle(1);
  ln->SetLineColor(14);
  ln->Draw("same");
  
}
示例#3
0
文件: ClassTree.C 项目: alisw/AliRoot
void ClassTree()
{

   TCanvas *ClassTree = new TCanvas("ClassTree", "",186,135,594,449);
   ClassTree->SetHighLightColor(2);
   ClassTree->Range(0,5,20,20);
   ClassTree->SetFillColor(33);
   ClassTree->SetBorderSize(2);
   TLine *line = new TLine(0.5,18.15,4.4,18.15);
   line->Draw();
   line = new TLine(4.4,17.725,4.4,18.575);
   line->Draw();
   
   TPaveLabel *pl = new TPaveLabel(1,17.895,4.205,18.405,"TArray","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,16.875,1,16.875);
   line->Draw();
   
   pl = new TPaveLabel(1,16.62,4.205,17.13,"TAttFill","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,16.025,1,16.025);
   line->Draw();
   
   pl = new TPaveLabel(1,15.77,4.205,16.28,"TAttLine","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,15.175,1,15.175);
   line->Draw();
   
   pl = new TPaveLabel(1,14.92,4.205,15.43,"TAttMarker","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(0.5,9.775,4.4,9.775);
   line->Draw();
   line = new TLine(4.4,7.65,4.4,12.325);
   line->Draw();
   
   pl = new TPaveLabel(1,9.52,4.205,10.03,"TObject","br");
   pl->SetFillColor(5);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,12.325,4.9,12.325);
   line->Draw();
   
   pl = new TPaveLabel(4.9,12.07,8.105,12.58,"AliArrayI","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,11.475,4.9,11.475);
   line->Draw();
   
   pl = new TPaveLabel(4.9,11.22,8.105,11.73,"AliArrayS","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,18.575,4.9,18.575);
   line->Draw();
   
   pl = new TPaveLabel(4.9,18.32,8.105,18.83,"TArrayI","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,17.725,4.9,17.725);
   line->Draw();
   
   pl = new TPaveLabel(4.9,17.47,8.105,17.98,"TArrayS","br");
   pl->SetFillColor(30);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,10.2,8.3,10.2);
   line->Draw();
   
   pl = new TPaveLabel(4.9,9.945,8.105,10.455,"TCollection","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(4.4,7.65,8.3,7.65);
   line->Draw();
   line = new TLine(8.3,6.8,8.3,8.075);
   line->Draw();
   
   pl = new TPaveLabel(4.9,7.395,8.105,7.905,"TNamed","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(8.3,8.075,12.2,8.075);
   line->Draw();
   
   pl = new TPaveLabel(8.8,7.82,12.005,8.33,"AliSegmentArray","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(8.3,10.2,12.2,10.2);
   line->Draw();
   
   pl = new TPaveLabel(8.8,9.945,12.005,10.455,"TSeqCollection","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(8.3,6.8,8.8,6.8);
   line->Draw();
   
   pl = new TPaveLabel(8.8,6.545,12.005,7.055,"TTree","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(12.2,8.075,12.7,8.075);
   line->Draw();
   
   pl = new TPaveLabel(12.7,7.82,15.905,8.33,"AliTPCClustersArray","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(12.2,10.2,16.1,10.2);
   line->Draw();
   
   pl = new TPaveLabel(12.7,9.945,15.905,10.455,"TObjArray","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   line = new TLine(16.1,10.2,16.6,10.2);
   line->Draw();
   
   pl = new TPaveLabel(16.6,9.945,19.805,10.455,"TClonesArray","br");
   pl->SetFillColor(18);
   pl->SetTextSize(0.9);
   pl->Draw();
   
   pl = new TPaveLabel(0.1,19.1,18.2,19.9,"*AliSegmet:*AliSegmentArray:*AliArrayI:*AliArrayS:TTree:*TObjArray","br");
   pl->SetFillColor(42);
   pl->SetTextSize(0.7);
   pl->Draw();
   line = new TLine(11.4041,6.8,14.3025,10.2);
   line->SetLineColor(6);
   line->SetLineStyle(3);
   line->Draw();
   line = new TLine(11.4842,6.8,14.3025,10.2);
   line->SetLineColor(6);
   line->SetLineStyle(3);
   line->Draw();
   line = new TLine(6.5025,12.325,6.5025,18.575);
   line->SetLineColor(4);
   line->SetLineStyle(2);
   line->Draw();
   line = new TLine(6.5025,11.475,6.5025,17.725);
   line->SetLineColor(4);
   line->SetLineStyle(2);
   line->Draw();
   line = new TLine(10.4025,6.8,2.6025,16.025);
   line->SetLineColor(4);
   line->SetLineStyle(2);
   line->Draw();
   line = new TLine(10.4025,6.8,2.6025,16.875);
   line->SetLineColor(4);
   line->SetLineStyle(2);
   line->Draw();
   line = new TLine(10.4025,6.8,2.6025,15.175);
   line->SetLineColor(4);
   line->SetLineStyle(2);
   line->Draw();
   TArrow *arrow = new TArrow(5.43417,10.2,6.5025,10.2,0.008,"|>");
   arrow->SetFillColor(2);
   arrow->SetFillStyle(1001);
   arrow->SetLineColor(2);
   arrow->Draw();
   arrow = new TArrow(6.85861,10.2,2.6025,9.775,0.008,"|>");
   arrow->SetFillColor(2);
   arrow->SetFillStyle(1001);
   arrow->SetLineColor(2);
   arrow->Draw();
   arrow = new TArrow(9.60125,8.075,14.3025,10.2,0.008,"|>");
   arrow->SetFillColor(2);
   arrow->SetFillStyle(1001);
   arrow->SetLineColor(2);
   arrow->Draw();
   arrow = new TArrow(10.1354,8.075,6.5025,12.325,0.008,"|>");
   arrow->SetFillColor(2);
   arrow->SetFillStyle(1001);
   arrow->SetLineColor(2);
   arrow->Draw();
   arrow = new TArrow(11.2037,8.075,10.4025,6.8,0.008,"|>");
   arrow->SetFillColor(2);
   arrow->SetFillStyle(1001);
   arrow->SetLineColor(2);
   arrow->Draw();
   arrow = new TArrow(13.9019,10.2,2.6025,9.775,0.008,"|>");
   arrow->SetFillColor(2);
   arrow->SetFillStyle(1001);
   arrow->SetLineColor(2);
   arrow->Draw();
   arrow = new TArrow(19.2708,10.2,14.3025,10.2,0.008,"|>");
   arrow->SetFillColor(2);
   arrow->SetFillStyle(1001);
   arrow->SetLineColor(2);
   arrow->Draw();
   ClassTree->Modified();
   ClassTree->cd();
}