ex)
root[0] hn()
root[1] gH1->Draw("COLZH")
root[2] gH1->Fit("pol1","","COLZ",-0.1,0.1)
|
ex)
root[0] hn()
root[1] gethist(11)->Draw("COLZH")
root[2] gethist(11)->Fit("pol1","","COLZ",-0.1,0.1)
|
DrawのオプションはCOLZHとしておけば一次元でも二次元でもanapawっぽい図になる .rootrc rootlogon.C 軸のprecision 文字の大きさ センタリング 505,510 canvasを1:1にする。 |
Unix.*.Root.UseTTFonts: true |
#ifndef __CINT__
#include "TROOT.h"
#include "TSystem.h"
#endif
void rootlogon()
{
//Base Style
// gROOT->SetStyle("Plain");
gROOT->SetStyle("Modern");
// gROOT->SetStyle("Classic");
//Force Style
// gStyle->SetNumberContours(20);
gStyle->SetHistFillColor(7);
gStyle->SetHistFillStyle(3002);
gStyle->SetHistLineColor(kBlue);
gStyle->SetFuncColor(kRed);
gStyle->SetFuncWidth(3);
gStyle->SetCanvasColor(0);
gStyle->SetCanvasDefH(600);
gStyle->SetCanvasDefW(600);
gStyle->SetPadBorderMode(1);
gStyle->SetPadRightMargin(0.15);
gStyle->SetPadLeftMargin(0.16);
gStyle->SetPadTopMargin(0.14);
gStyle->SetPadBottomMargin(0.14);
gStyle->SetPadGridX(1);
gStyle->SetPadGridY(1);
gStyle->SetFrameLineWidth(2);
gStyle->SetGridStyle(3);
gStyle->SetGridColor(16);
gStyle->SetTitleFillColor(0);
gStyle->SetTitleStyle(0);
gStyle->SetTitleY(0.93);
// gStyle->SetTitleXOffset(1.);
gStyle->SetTitleXOffset(1.5);
gStyle->SetTitleYOffset(2.0);
gStyle->SetTitleAlign(22);
gStyle->SetStatColor(0);
gStyle->SetStatStyle(0);
// gStyle->SetStatStyle(1001);
gStyle->SetStatX(0.848);
gStyle->SetStatY(0.86);
gStyle->SetStatW(0.3); // SetOptFit(0)で1Dで縦の幅がおかしくなるのを解決できる
// gStyle->SetStatH(0.3);
// gStyle->SetStatW(0.2*1.8);
// gStyle->SetStatFontSize(0.02);
gStyle->SetPalette(1);
// gStyle->SetOptLogz(1);
// gStyle->SetOptDate(1);
gStyle->SetStripDecimals(kFALSE);
if(0){
gStyle->SetOptTitle(1);
gStyle->SetOptFit(1);
gStyle->SetOptStat(1111111);
}else{
gStyle->SetOptTitle(0);
gStyle->SetOptFit(0);
gStyle->SetOptStat(0);
}
gStyle->SetLabelFont(132,"XYZ");
gStyle->SetLabelSize(0.04, "XYZ");
gStyle->SetLabelOffset(0.015, "XY");
gStyle->SetTitleFont(132,"XYZ");
gStyle->SetTitleFont(132,"");
gStyle->SetTextFont(132);
gStyle->SetStatFont(132);
}
|
TLegend *leg = new TLegend(0.2,0.73,0.6,0.8,NULL,"NDC");
leg->SetTextFont(132);
leg->SetTextSize(0.04);
leg->AddEntry(hist1,"NEUT","lp");
leg->AddEntry(hist2,"VETO","lp");
leg->SetBorderSize(0);
leg->SetFillColor(0);
hist1->Draw("COLZH");
hist2->Draw("COLZHsame");
leg->Draw("same");
|
clear();
fetch("root/hime_inclxx.root");
ht(3);
chbin(2,2);
mami(0,100);
histtune(";Time of Flight (ns);Pulse Height (MeVee)",510,510,510);
htp();
redrawframe();
print("hime_inclxx_tof_ph.eps");
|
void histtune(const char* title, int nxdiv, int nydiv, int nzdiv, double xmin, double xmax, double ymin, double ymax)
{
TH1* hist = gH1;
if(!hist) return;
hist->SetTitle(title);
hist->GetXaxis()->SetNdivisions(nxdiv);
hist->GetYaxis()->SetNdivisions(nydiv);
hist->GetZaxis()->SetNdivisions(nzdiv);
hist->GetXaxis()->CenterTitle(1);
hist->GetYaxis()->CenterTitle(1);
if(xmin < xmax){
hist->GetXaxis()->SetLimits(xmin,xmax);
}
if(ymin < ymax){
hist->SetMaximum(ymax);
hist->SetMinimum(ymin);
}
// if(hist->GetDimension() == 1){
// hist->Draw("COLZHHIST");
// }else{
// hist->Draw("COLZH");
// }
hist->Draw();
ReDrawFrame();
}
void TArtSimpleFunction::ReDrawFrame()
{
if(!gPad) return;
TFrame* frame = gPad->GetFrame();
frame->SetFillStyle(0);
frame->Draw("same");
}
|
histd->SetTitleOffset(hist2->GetTitleOffset("X"),"X");
|
valgrind --error-limit=no --leak-check=yes --show-reachable=no ./macros/test/test_program 2> var.log |
valgrind --error-limit=no --leak-check=yes --show-reachable=no root -l 2> var.log |
TARGET = test_program
ROOTCFLAGS = $(shell root-config --cflags)
ROOTLIBS = $(shell root-config --libs)
CFLAGS = -I$(TARTSYS)/include -L$(TARTSYS)/lib -lanaroot -lanaanaloop -lXMLParser -g
GXX = g++
all: $(TARGET)
$(TARGET): $(TARGET).C
$(CXX) $(CFLAGS) $(ROOTCFLAGS) $(ROOTLIBS) -o $@ $^
clean:
rm -f $(TARGET)
|
#include "TAlEncExample.hh"
#include "TArtAlias.hh"
#include "TArtAnaLoopManager.hh"
#include "TSystem.h"
int main(int argc, char *argv[]){
book(new TAlEncExample, "ana/shift.ana");
push("ridf/sm_dayone/sdaq02/dayone0321.ridf");
start();
gSystem->Sleep(10000);
end();
}
|
http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=10778 |
linux --prefix=/usr/local --enable-minuit2 --enable-glite --enable-dcache --enable-memstat --enable-xml --enable-xrootd --enable-tmva --enable-reflex --enable-castor |