本文整理汇总了C++中TPaletteAxis::SetLabelSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaletteAxis::SetLabelSize方法的具体用法?C++ TPaletteAxis::SetLabelSize怎么用?C++ TPaletteAxis::SetLabelSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaletteAxis
的用法示例。
在下文中一共展示了TPaletteAxis::SetLabelSize方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: repositionPalette
void repositionPalette(std::string name)
{
// Reposition and resize palette
TH2F *h = (TH2F*)gDirectory->GetList()->FindObject(name.c_str());
TPaletteAxis *pal;
pal = (TPaletteAxis*)h->FindObject("palette");
pal->SetX1NDC(0.83);
pal->SetY1NDC(0.14);
pal->SetX2NDC(0.88);
pal->SetY2NDC(0.60);
pal->SetLabelSize(.04);
}
示例2: repositionPalette
void repositionPalette(std::string name)
{
// Reposition and resize palette
TH2F *h = (TH2F*)gDirectory->GetList()->FindObject(name.c_str());
TPaletteAxis *pal;
pal = (TPaletteAxis*)h->FindObject("palette");
if (0==pal)
{
cout << "Palette not found - cannot reposition it" << endl;
return;
}
pal->SetX1NDC(0.83);
pal->SetY1NDC(0.14);
pal->SetX2NDC(0.88);
pal->SetY2NDC(0.60);
pal->SetLabelSize(.04);
cout << "Repo" << endl;
}
示例3: makeplots2D
// Make 2D efficiency plots
void makeplots2D( TH2& eff, TString name) {
gROOT->ProcessLine(".L ~/tdrstyle.C");
setTDRStyle();
const Int_t NRGBs = 5;
const Int_t NCont = 200;
Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
tdrStyle->SetNumberContours(NCont);
if(name.Contains("_Pt")) {
eff.GetXaxis()->SetTitle("p_{T} (GeV/c)");
eff.GetYaxis()->SetTitle("#eta ");
}
if(name.Contains("_Phi")) {
eff.GetXaxis()->SetTitle("#phi ");
eff.GetYaxis()->SetTitle("#eta ");
}
eff.GetYaxis()->SetTitleOffset(1);
tdrStyle->SetPadLeftMargin(0.08);
tdrStyle->SetPadRightMargin(0.1);
TCanvas canvas("canvas",name,600,600);
eff.Draw("colz");
gPad->Update();
TPaletteAxis* palette =
(TPaletteAxis*)eff.GetListOfFunctions()->FindObject("palette");
palette->SetLabelSize(0.02);
canvas.SaveAs(name + TString(".eps"));
canvas.SaveAs(name + TString(".gif"));
canvas.Close();
}
示例4: PlotRakeBunch
//.........这里部分代码省略.........
vmard = 0.0;
vmaru = 0.0;
}
hfactor = hposl-hposr;
char name[16];
sprintf(name,"pad_%i",k);
pad[k] = new TPad(name,"",hposl,vposd,hposr,vposu);
// // cout << Form("%f %f %f %f",hposl,vposd,hposr,vposu) << endl;
// // cout << Form("%f %f %f %f",hmarl,vmard,hmarr,vmaru) << endl;
pad[k]->SetLeftMargin(hmarl);
pad[k]->SetRightMargin(hmarr);
pad[k]->SetBottomMargin(vmard);
pad[k]->SetTopMargin(vmaru);
pad[k]->SetFrameLineWidth(3);
sprintf(name,"hFrame_%i",k);
hFrame[k] = (TH1F*) gROOT->FindObject(name);
if(hFrame[k]) delete hFrame[k];
hFrame[k] = (TH1F*) hX1->Clone(name);
hFrame[k]->Reset();
hFrame[k]->GetXaxis()->CenterTitle();
hFrame[k]->GetYaxis()->CenterTitle();
hFrame[k]->GetZaxis()->CenterTitle();
hFrame[k]->SetLabelFont(42,"xyz");
hFrame[k]->SetTitleFont(42,"xyz");
hFrame[k]->SetNdivisions(505,"xyz");
hFrame[k]->SetTickLength(0.04,"xyz");
hFrame[k]->SetTickLength(0.04*vfactor,"y");
hFrame[k]->GetYaxis()->SetLabelSize(0.04/vfactor);
hFrame[k]->GetYaxis()->SetLabelOffset(0.02);
hFrame[k]->GetYaxis()->SetTitleSize(0.05/vfactor);
hFrame[k]->GetYaxis()->SetTitleOffset(1.2*vfactor);
if(k==0) {
hFrame[k]->GetXaxis()->SetLabelSize(0.08);
hFrame[k]->GetXaxis()->SetLabelOffset(0.02);
hFrame[k]->GetXaxis()->SetTitleSize(0.12);
hFrame[k]->GetXaxis()->SetTitleOffset(1.0);
} else {
hFrame[k]->GetXaxis()->SetLabelSize(0.0);
hFrame[k]->GetXaxis()->SetTitleSize(0.0);
}
}
// Ranges!!
Double_t yMin = 999.9;
Double_t yMax = -999.9;
for(Int_t k=0;k<SNbin;k++) {
if(semittance[k]<yMin)
yMin = semittance[k];
if(semittance[k]>yMax)
yMax = semittance[k];
if(sErms[k]<yMin)
yMin = sErms[k];
if(sErms[k]>yMax)
示例5: PlotChargeFieldFocus2D
//.........这里部分代码省略.........
lMargin + hStep + rMargin, bMargin + 2.*vStep );
pad[1]->SetLeftMargin(1./(lMargin+hStep)*lMargin);
pad[1]->SetRightMargin((1./(rMargin+hStep)*rMargin));
pad[1]->SetBottomMargin(0.0);
pad[1]->SetTopMargin(0.);
pad[1]->Draw();
// bottom plots
pad[2] = new TPad("padb", "padb",0.00, 0.,lMargin+hStep+rMargin,bMargin+vStep);
pad[2]->SetLeftMargin(1./(lMargin+hStep)*lMargin);
pad[2]->SetRightMargin((1./(rMargin+hStep)*rMargin));
pad[2]->SetBottomMargin(1./(bMargin+vStep)*bMargin);
pad[2]->SetTopMargin(0.);
pad[2]->Draw();
// Draw!
pad[0]->cd(); // <---------------------------------------------- Top Plot ---------
if(opt.Contains("logz")) {
pad[0]->SetLogz(1);
} else {
pad[0]->SetLogz(0);
}
pad[0]->SetFrameLineWidth(3);
TH2F *hFrame = (TH2F*) gROOT->FindObject("hFrame1");
if(hFrame) delete hFrame;
hFrame = (TH2F*) hDen2D[0]->Clone("hFrame1");
hFrame->Reset();
hFrame->GetXaxis()->SetLabelOffset(999);
hFrame->GetYaxis()->SetTitleSize(0.075);
hFrame->GetYaxis()->SetTitleOffset(0.65);
hFrame->GetYaxis()->SetLabelSize(0.065);
hFrame->GetYaxis()->SetLabelOffset(0.02);
hFrame->GetYaxis()->SetTickLength(0.02);
hFrame->GetZaxis()->SetTitleSize(0.06);
hFrame->GetZaxis()->SetTitleOffset(0.45);
hFrame->GetZaxis()->SetLabelSize(0.06);
hFrame->GetZaxis()->SetTickLength(0.02);
// hFrame->GetZaxis()->SetNdivisions(505);
hFrame->Draw("col");
if(Nspecies>=3) {
if(hDen2D[2]) {
exHot->Draw();
hDen2D[2]->Draw("colz same");
}
}
exPlasma->Draw();
hDen2D[0]->Draw("colz same");
if(hDen2D[1]) {
exElec->Draw();
hDen2D[1]->Draw("colz same");
}
if(opt.Contains("1dline")) {
lineYzero->Draw();
lineYdown->Draw();
lineYup->Draw();
}
示例6: PlotRakeInjection
//.........这里部分代码省略.........
// // cout << Form("%f %f %f %f",hmarl,vmard,hmarr,vmaru) << endl;
pad[k]->SetLeftMargin(hmarl);
pad[k]->SetRightMargin(hmarr);
pad[k]->SetBottomMargin(vmard);
pad[k]->SetTopMargin(vmaru);
pad[k]->SetFrameLineWidth(3);
if(opt.Contains("logz")) {
pad[k]->SetLogz(1);
} else {
pad[k]->SetLogz(0);
}
pad[k]->Draw();
pad[k]->cd();
sprintf(name,"hFrame_%i",k);
hFrame[k] = (TH2F*) gROOT->FindObject(name);
if(hFrame[k]) delete hFrame[k];
hFrame[k] = (TH2F*) hDen2D[k][0]->Clone(name);
hFrame[k]->Reset();
hFrame[k]->GetXaxis()->CenterTitle();
hFrame[k]->GetYaxis()->CenterTitle();
hFrame[k]->GetZaxis()->CenterTitle();
hFrame[k]->SetLabelFont(42,"xyz");
hFrame[k]->SetTitleFont(42,"xyz");
hFrame[k]->SetNdivisions(505,"xyz");
hFrame[k]->SetTickLength(0.04,"xyz");
hFrame[k]->SetTickLength(0.04*vfactor,"y");
hFrame[k]->GetYaxis()->SetLabelSize(0.03/vfactor);
hFrame[k]->GetYaxis()->SetLabelOffset(0.02);
hFrame[k]->GetYaxis()->SetTitleSize(0.03/vfactor);
hFrame[k]->GetYaxis()->SetTitleOffset(999.0*vfactor);
if(k==0) {
hFrame[k]->GetXaxis()->SetLabelSize(0.10);
hFrame[k]->GetXaxis()->SetLabelOffset(0.02);
hFrame[k]->GetXaxis()->SetTitleSize(0.14);
hFrame[k]->GetXaxis()->SetTitleOffset(1.0);
} else {
hFrame[k]->GetXaxis()->SetLabelSize(0.0);
hFrame[k]->GetXaxis()->SetTitleSize(0.0);
}
hFrame[k]->Draw("axis");
exPlasma->Draw();
// Sum of histograms!
hDen2D[k][0]->Add(hDen2D[k][1]);
// hDen2D[k][0]->GetZaxis()->SetRangeUser(Min[1],Max[1]);
hDen2D[k][0]->Draw("colz same");
pad[k]->Update();
TPaletteAxis *palette = (TPaletteAxis*)hDen2D[k][0]->GetListOfFunctions()->FindObject("palette");
Float_t y1 = pad[k]->GetBottomMargin();
示例7: macro_2Dhisto
void macro_2Dhisto(TString channel, TString njmt, TString syst, TString region, TString BDT1_name, TString BDT2_name, TString lep){
if((lep=="electron"||lep=="electronantiiso")&& channel=="QCDMuPt20toInf") return;
if((lep=="muonantiiso"||lep=="electronantiiso") && channel=="TT_sd") return;
if((channel.Contains("hdamp")||channel.Contains("psq2"))&&((lep=="muonantiiso"||lep=="electronantiiso")||(syst!=""))) return;
TFile * f=TFile::Open("trees_lumi/"+lep+"/trees_"+channel+"_"+lep+".root");
TString treename, histoname;
TH2F * h2 = new TH2F("h2", "h2",10,-1,1,10,-1,1);
// Float_t BDT1, BDT2, etajprime, mtw, w, w_nominal, var_syst;
gStyle->SetOptStat(0);
TString outfilename, taglio, selection;
selection = "BDT_"+BDT1_name+":BDT_"+BDT2_name;
if(syst.EqualTo("jesUp")||syst.EqualTo("jesDown")||syst.EqualTo("jerUp")||syst.EqualTo("jerDown")) treename = "events_"+njmt+"_"+syst;
else treename = "events_"+njmt;
TTree * t =(TTree*)f->Get(treename);
if(region=="cr") taglio = "(mtw>50 && etajprime<2.4";
else taglio = "(mtw>50 && etajprime>2.4";
if(lep=="electronantiiso") taglio += " &&mlb>30";
if(syst.EqualTo("")){
histoname = "h2D_"+njmt+"_"+channel+"_"+region;
t->Project("h2",selection,taglio+")*w*w_nominal");
}
else{
if(syst.EqualTo("jesUp")||syst.EqualTo("jesDown")||syst.EqualTo("jerUp")||syst.EqualTo("jerDown")){
histoname = "h2D_"+njmt+"_"+channel+"_"+region+"_"+syst;
t->Project("h2",selection,taglio+")*w*w_nominal");
}
else{
histoname = "h2D_"+njmt+"_"+channel+"_"+region+"_"+syst;
t->Project("h2",selection,taglio+")*w*"+syst);
}
}
h2->SetName(histoname);
TCanvas * c = new TCanvas( "c1"," ");
Float_t newMargin1 = 0.13;
Float_t newMargin2 = 0.15;
c->SetGrid();
c->SetTicks();
c->SetLeftMargin ( newMargin2 );
c->SetBottomMargin( newMargin2 );
c->SetRightMargin ( newMargin1 );
c->SetTopMargin ( newMargin1 );
gStyle->SetPalette( 1, 0 );
gStyle->SetPaintTextFormat( "3g" );
h2->SetMarkerSize( 1.5 );
h2->SetMarkerColor( 0 );
Float_t labelSize = 0.040;
h2->GetXaxis()->SetLabelSize( labelSize );
h2->GetYaxis()->SetLabelSize( labelSize );
h2->GetXaxis()->SetTitle( "BDT_"+BDT1_name );
h2->GetYaxis()->SetTitle( "BDT_"+BDT2_name );
// h2->LabelsOption( "d" );
h2->SetLabelOffset( 0.011 );// label offset on x axis
h2->Draw("colz"); // color pads
c->Update();
// modify properties of paletteAxis
TPaletteAxis * paletteAxis = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject( "palette" );
paletteAxis->SetLabelSize( 0.03 );
paletteAxis->SetX1NDC( paletteAxis->GetX1NDC() + 0.02 );
h2->Draw("textsame"); // add text
// TMVAGlob::plot_logo( );
c->Update();
outfilename = "Plot/histo2D_"+lep+".root";
TFile * fout = TFile::Open(outfilename, "UPDATE");
h2->Write();
c->SaveAs("Plot2D/"+histoname+"_"+lep+".pdf");
}
示例8: correlations
// input: - Input file (result from TMVA),
// - use of colors or grey scale
// - use of TMVA plotting TStyle
void correlations( TString fin = "TMVA.root",TString outputdir="plots", Bool_t isRegression = kFALSE,
Bool_t greyScale = kFALSE, Bool_t useTMVAStyle = kTRUE )
{
// set style and remove existing canvas'
TMVAGlob::Initialize( useTMVAStyle );
// checks if file with name "fin" is already open, and if not opens one
TFile* file = TMVAGlob::OpenFile( fin );
// signal and background or regression problem
Int_t ncls = (isRegression ? 1 : 2 );
TString hName[2] = { "CorrelationMatrixS", "CorrelationMatrixB" };
if (isRegression) hName[0]= "CorrelationMatrix";
const Int_t width = 600;
for (Int_t ic=0; ic<ncls; ic++) {
TH2* h2 = file->Get( hName[ic] );
if(!h2) {
cout << "Did not find histogram " << hName[ic] << " in " << fin << endl;
continue;
}
TCanvas* c = new TCanvas( hName[ic],
Form("Correlations between MVA input variables (%s)",
(isRegression ? "" : (ic==0 ? "signal" : "background"))),
ic*(width+5)+200, 0, width, width );
Float_t newMargin1 = 0.13;
Float_t newMargin2 = 0.15;
if (TMVAGlob::UsePaperStyle) newMargin2 = 0.13;
c->SetGrid();
c->SetTicks();
c->SetLeftMargin ( newMargin2 );
c->SetBottomMargin( newMargin2 );
c->SetRightMargin ( newMargin1 );
c->SetTopMargin ( newMargin1 );
gStyle->SetPalette( 1, 0 );
gStyle->SetPaintTextFormat( "3g" );
h2->SetMarkerSize( 1.5 );
h2->SetMarkerColor( 0 );
Float_t labelSize = 0.040;
h2->GetXaxis()->SetLabelSize( labelSize );
h2->GetYaxis()->SetLabelSize( labelSize );
h2->LabelsOption( "d" );
h2->SetLabelOffset( 0.011 );// label offset on x axis
h2->Draw("colz"); // color pads
c->Update();
// modify properties of paletteAxis
TPaletteAxis* paletteAxis = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject( "palette" );
paletteAxis->SetLabelSize( 0.03 );
paletteAxis->SetX1NDC( paletteAxis->GetX1NDC() + 0.02 );
h2->Draw("textsame"); // add text
// add comment
TText* t = new TText( 0.53, 0.88, "Linear correlation coefficients in %" );
t->SetNDC();
t->SetTextSize( 0.026 );
t->AppendPad();
// TMVAGlob::plot_logo( );
c->Update();
TString fname = outputdir + TString("/");
fname += hName[ic];
TMVAGlob::imgconv( c, fname );
}
}
示例9: PlotEvolutionsWIII
//.........这里部分代码省略.........
Int_t lysize = fontsize-2;
Int_t tzsize = tfontsize-4;
Int_t lzsize = fontsize-2;
Float_t txoffset = (250/ypadsize) * 2.4 / (950/ysize);
Float_t lxoffset = 0.015;
Float_t tyoffset = 1.2 / (950/ysize);
Float_t lyoffset = 0.01;
Float_t tzoffset = 1.4 / (950/ysize);
Float_t lzoffset = 0.01;
Float_t tylength = 0.015;
Float_t txlength = 0.04;
for(Int_t i=NPad-1;i>=0;i--) {
char name[16];
sprintf(name,"pad_%i",i);
pad[i] = (TPad*) gROOT->FindObject(name);
pad[i]->SetFrameLineWidth(2);
pad[i]->SetTickx(1);
pad[i]->SetTicky(1);
if(opt.Contains("trans"))
pad[i]->SetFillStyle(4000);
pad[i]->SetFrameFillStyle(4000);
sprintf(name,"hFrame_%i",i);
hFrame[i] = (TH2F*) gROOT->FindObject(name);
if(hFrame[i]) delete hFrame[i];
hFrame[i] = (TH2F*) hEvsTime[0]->Clone(name);
hFrame[i]->Reset();
Float_t xFactor = pad[NPad-1]->GetAbsWNDC()/pad[i]->GetAbsWNDC();
Float_t yFactor = pad[NPad-1]->GetAbsHNDC()/pad[i]->GetAbsHNDC();
// Format for y axis
hFrame[i]->GetYaxis()->SetLabelFont(fonttype);
hFrame[i]->GetYaxis()->SetLabelSize(lysize);
hFrame[i]->GetYaxis()->SetLabelOffset(lyoffset);
hFrame[i]->GetYaxis()->SetTitleFont(fonttype);
hFrame[i]->GetYaxis()->SetTitleSize(tysize);
hFrame[i]->GetYaxis()->SetTitleOffset(tyoffset);
hFrame[i]->GetYaxis()->SetTickLength(xFactor*tylength/yFactor);
// Format for x axis
hFrame[i]->GetXaxis()->SetLabelFont(fonttype);
hFrame[i]->GetXaxis()->SetLabelSize(lxsize);
hFrame[i]->GetXaxis()->SetLabelOffset(lxoffset);
hFrame[i]->GetXaxis()->SetTitleFont(fonttype);
hFrame[i]->GetXaxis()->SetTitleSize(txsize);
hFrame[i]->GetXaxis()->SetTitleOffset(txoffset);
hFrame[i]->GetXaxis()->SetTickLength(yFactor*txlength/xFactor);
if(i>0) { // skip x axis labels except for the lowest one
hFrame[i]->GetXaxis()->SetLabelSize(0.0);
hFrame[i]->GetXaxis()->SetTitleSize(0.0);
}
if(opt.Contains("nomar")) {
hFrame[i]->GetYaxis()->SetTickLength(0.0);
hFrame[i]->GetXaxis()->SetTickLength(0.0);
}
// Labels for the frames
}
// Access to color Palettes
示例10: MakeBioluminescencePlots
void MakeBioluminescencePlots(){
gStyle->SetOptStat(0);
gStyle->SetCanvasColor(0);
gStyle->SetPadColor(0);
gStyle->SetPadBorderMode(0);
gStyle->SetCanvasBorderMode(0);
gStyle->SetFrameBorderMode(0);
gStyle->SetLabelSize(0.03,"x");
gStyle->SetLabelSize(0.03,"y");
gStyle->SetLabelFont(42,"x");
gStyle->SetLabelFont(42,"y");
gStyle->SetOptStat(1111);
////////////// DECLARES HISTOGRAMS /////////////////////////////////////////////////////////////
TH2D * histXY = new TH2D("histXY","",200,-15,15,200,-15,15);
///////////////////// DECLARES CHAINS ////////////////////////////////////////////////////////////
TChain *chain1 = new TChain("OpticalData","");
///////////////////////////// ADDS NTUPLES TO CHAINS ////////////////////////////////////////////
chain1->Add("./Bioluminescence_skin.root/OpticalData");
//////////////////////////////////// MAKES SELECTIONS IN EACH CHAIN ////////////////////////////////////////////////////////////
chain1->Draw("CrystalLastHitPos_Y:CrystalLastHitPos_X>>histXY","CrystalLastHitPos_Z == 30.0 && CrystalLastHitEnergy > 0.0","goff");
TCanvas *XY = new TCanvas("XY", " ",0,22,800,802);
XY->Range(-125,-125,125,125);
XY->SetGridx();
XY->SetGridy();
XY->SetTickx(1);
XY->SetTicky(1);
XY->SetFrameBorderMode(0);
XY->SetFrameBorderMode(0);
XY->SetFillColor(kWhite);
TPaletteAxis *palette = new TPaletteAxis(13.23807,-14.97093,14.93405,15.01938,histXY);
palette->SetLabelColor(1);
palette->SetLabelFont(62);
palette->SetLabelOffset(0.005);
palette->SetLabelSize(0.02);
palette->SetTitleOffset(1);
palette->SetTitleSize(0.04);
palette->SetFillColor(0);
palette->SetFillStyle(1001);
histXY->GetListOfFunctions()->Add(palette,"br");
histXY->GetXaxis()->SetTitle("x-position(mm)");
histXY->GetXaxis()->SetLabelFont(42);
histXY->GetXaxis()->SetTitleFont(42);
histXY->GetYaxis()->SetTitle("y-position(mm)");
histXY->GetYaxis()->SetLabelFont(42);
histXY->GetYaxis()->SetTitleOffset(1.43);
histXY->GetYaxis()->SetTitleFont(42);
histXY->Draw("colz");
histXY->GetXaxis()->SetTitleSize(0.03);
histXY->GetYaxis()->SetTitleSize(0.03);
histXY->GetXaxis()->SetLabelSize(0.03);
histXY->GetYaxis()->SetLabelSize(0.03);
XY->Modified();
XY->cd();
XY->SetSelected(XY);
}
示例11: PlotPotential2D
//.........这里部分代码省略.........
// Text objects
TPaveText **textLabel = new TPaveText*[2];
C->cd(0);
char pname[16];
sprintf(pname,"pad_%i",1);
pad[0] = (TPad*) gROOT->FindObject(pname);
pad[0]->Draw();
pad[0]->cd(); // <---------------------------------------------- Top Plot ---------
if(opt.Contains("logz")) {
pad[0]->SetLogz(1);
} else {
pad[0]->SetLogz(0);
}
pad[0]->SetFrameLineWidth(3);
pad[0]->SetTickx(1);
// Re-range:
for(Int_t i=0; i<Nspecies; i++) {
if(!hDen2D[i]) continue;
hDen2D[i]->GetYaxis()->SetRangeUser(yMin -(factor-1)*yRange, yMax);
}
TH2F *hFrame = (TH2F*) gROOT->FindObject("hFrame1");
if(hFrame) delete hFrame;
hFrame = (TH2F*) hDen2D[0]->Clone("hFrame1");
hFrame->Reset();
hFrame->SetLabelFont(42,"xyz");
hFrame->SetTitleFont(42,"xyz");
hFrame->GetYaxis()->SetNdivisions(505);
hFrame->GetYaxis()->SetLabelSize(0.085);
hFrame->GetYaxis()->SetTitleSize(0.09);
hFrame->GetYaxis()->SetTitleOffset(0.7);
hFrame->GetYaxis()->SetTickLength(0.02);
hFrame->GetXaxis()->SetLabelOffset(999.);
hFrame->GetXaxis()->SetTitleOffset(999.);
hFrame->GetXaxis()->SetTickLength(0.04);
// Frame asymmetry:
hFrame->Draw("col");
// hDen2D[0]->GetZaxis()->SetNdivisions(505);
// Injected electrons if any
if(Nspecies>=3) {
if(hDen2D[2]) {
exHot->Draw();
hDen2D[2]->Draw("colz same");
}
}
// Plasma
hDen2D[0]->GetZaxis()->SetTitleFont(42);
exPlasma->Draw();
hDen2D[0]->Draw("colz same");
// Beam driver.
if(hDen2D[1]) {
// hDen2D[1]->GetZaxis()->SetNdivisions(505);
exElec->Draw();
hDen2D[1]->Draw("colz same");
}
示例12: printEff
void printEff(TTree* HltTree,const char *cut,const char *title, char *projectTitle)
{
cout <<" * "<<title<<":"<<endl;
cout <<" * Efficiencies:"<<endl;
double nEvt = HltTree->GetEntries(cut);
cout <<" | "<<setw(20)<<"HLT Path";
cout <<" | "<<setw(25)<<"Efficiency";
cout <<" | "<<endl;
triggers->clear();
triggerCuts->clear();
vector <double*> effs;
// calculate the efficiency //
effs.push_back(calcEff(HltTree,"L1Tech_BSC_OR",nEvt,Form("(%s)&&L1Tech_BSC_minBias_OR.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_thr1",nEvt,Form("(%s)&&L1Tech_BSC_minBias_threshold1.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_thr2",nEvt,Form("(%s)&&L1Tech_BSC_minBias_threshold2.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_inner_thr1",nEvt,Form("(%s)&&L1Tech_BSC_minBias_inner_threshold1.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_BSC_inner_thr2",nEvt,Form("(%s)&&L1Tech_BSC_minBias_inner_threshold2.v0==1",cut)));
effs.push_back(calcEff(HltTree,"L1Tech_HF_coinc_PM",nEvt,Form("(%s)&&L1Tech_HCAL_HF_coincidence_PM.v0==1",cut)));
effs.push_back(calcEff(HltTree,"HLT_MBPixel_1Track",nEvt,Form("(%s)&&HLT_MinBiasPixel_SingleTrack==1",cut)));
//effs.push_back(calcEff(HltTree,"L1Tech_BSC_splash_beam1.v0",nEvt,Form("(%s)&&L1Tech_BSC_splash_beam1.v0==1",cut)));
//effs.push_back(calcEff(HltTree,"L1Tech_BSC_splash_beam2.v0",nEvt,Form("(%s)&&L1Tech_BSC_splash_beam2.v0==1",cut)));
//effs.push_back(calcEff(HltTree,"All",nEvt,Form("(%s)&&(L1Tech_BSC_minBias_threshold1.v0||L1Tech_BSC_minBias_threshold2.v0||L1Tech_BSC_minBias_OR.v0||L1Tech_BSC_minBias_inner_threshold1.v0||L1Tech_BSC_minBias_inner_threshold2.v0||L1Tech_BSC_splash_beam1.v0||L1Tech_BSC_splash_beam2.v0)",cut)));
results->push_back(effs);
cout <<" * Correlation Matrix:"<<endl;
int tsize = (int)triggers->size();
TH2D *h = new TH2D(Form("h%s",title),"",tsize,0,tsize,tsize,0,tsize);
TH2D *hct = new TH2D(Form("h%s_ct",title),"",tsize,0,tsize,tsize,0,tsize);
for (int i=tsize-1;i>=0;i--){
int nEvtAfterCut = HltTree->GetEntries((*triggerCuts)[i].c_str());
h->GetXaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
h->GetYaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
hct->GetXaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
hct->GetYaxis()->SetBinLabel(i+1,(*triggers)[i].c_str());
for (int j=0;j<tsize;j++){
string cut ="("+(*triggerCuts)[i]+")&&("+(*triggerCuts)[j]+")";
double* eff = calcEff(HltTree,"",nEvtAfterCut,Form("%s",cut.c_str()),0);
if (nEvtAfterCut==0) eff[0]=0;
h->SetBinContent(i+1,j+1,int(eff[0]*100000)/1000.);
hct->SetBinContent(i+1,j+1,HltTree->GetEntries(cut.c_str()));
}
}
h->GetXaxis()->LabelsOption("v");
hct->GetXaxis()->LabelsOption("v");
TCanvas *c1 = new TCanvas(Form("c%s",title), Form("c_%s",title),800,600);
c1->Range(-3.609756,-1.910995,12.7561,10.60209);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(0);
c1->SetTickx();
c1->SetTicky();
c1->SetLeftMargin(0.25);
c1->SetRightMargin(0.1684054);
c1->SetTopMargin(0.02);
c1->SetBottomMargin(0.3);
c1->SetFrameLineColor(0);
c1->SetFrameBorderMode(0);
c1->SetFrameLineColor(0);
c1->SetFrameBorderMode(0);
h->Draw("col text");
TPaletteAxis *palette = new TPaletteAxis(tsize*1.02,0,tsize*1.1,tsize,h);
palette->SetLabelColor(1);
palette->SetLabelFont(42);
palette->SetLabelOffset(0.005);
palette->SetLabelSize(0.045);
palette->SetTitleOffset(1);
palette->SetTitleSize(0.04);
palette->SetFillColor(100);
palette->SetFillStyle(1001);
h->GetListOfFunctions()->Add(palette,"br");
h->Draw("col text z");
string fname(Form("plot_%s_%s.gif",projectTitle,title));
c1->SaveAs(fname.c_str());
c1->SaveAs(Form("plot_%s_%s.C",projectTitle,title));
cout <<"<img src=\"%ATTACHURLPATH%/"<<fname<<"\" alt=\""<<fname<<"\" width='671' height='478' />"<<endl;
}
示例13: BinCovarianceHggRazor
//.........这里部分代码省略.........
corr->SetBinContent(416,-1.17764);
corr->SetBinContent(417,-1.085029);
corr->SetBinContent(418,30.42);
corr->SetMinimum(-4000);
corr->SetMaximum(4000);
corr->SetEntries(361);
corr->SetStats(0);
corr->SetContour(20);
corr->SetContourLevel(0,-4000);
corr->SetContourLevel(1,-3600);
corr->SetContourLevel(2,-3200);
corr->SetContourLevel(3,-2800);
corr->SetContourLevel(4,-2400);
corr->SetContourLevel(5,-2000);
corr->SetContourLevel(6,-1600);
corr->SetContourLevel(7,-1200);
corr->SetContourLevel(8,-800);
corr->SetContourLevel(9,-400);
corr->SetContourLevel(10,0);
corr->SetContourLevel(11,400);
corr->SetContourLevel(12,800);
corr->SetContourLevel(13,1200);
corr->SetContourLevel(14,1600);
corr->SetContourLevel(15,2000);
corr->SetContourLevel(16,2400);
corr->SetContourLevel(17,2800);
corr->SetContourLevel(18,3200);
corr->SetContourLevel(19,3600);
TPaletteAxis *palette = new TPaletteAxis(19.11905,-0.7931685,20.2619,19.82922,corr);
palette->SetLabelColor(1);
palette->SetLabelFont(42);
palette->SetLabelOffset(0.005);
palette->SetLabelSize(0.035);
palette->SetTitleOffset(1);
palette->SetTitleSize(0.035);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#f9f90e");
palette->SetFillColor(ci);
palette->SetFillStyle(1001);
corr->GetListOfFunctions()->Add(palette,"br");
ci = TColor::GetColor("#000099");
corr->SetLineColor(ci);
corr->GetXaxis()->SetBinLabel(1,"Bin 0");
corr->GetXaxis()->SetBinLabel(2,"Bin 1");
corr->GetXaxis()->SetBinLabel(3,"Bin 2");
corr->GetXaxis()->SetBinLabel(4,"Bin 3");
corr->GetXaxis()->SetBinLabel(5,"Bin 4");
corr->GetXaxis()->SetBinLabel(6,"Bin 5");
corr->GetXaxis()->SetBinLabel(7,"Bin 6");
corr->GetXaxis()->SetBinLabel(8,"Bin 7");
corr->GetXaxis()->SetBinLabel(9,"Bin 8");
corr->GetXaxis()->SetBinLabel(10,"Bin 9 HighRes");
corr->GetXaxis()->SetBinLabel(11,"Bin 10 HighRes");
corr->GetXaxis()->SetBinLabel(12,"Bin 11 HighRes");
corr->GetXaxis()->SetBinLabel(13,"Bin 12 HighRes");
corr->GetXaxis()->SetBinLabel(14,"Bin 13 HighRes");
corr->GetXaxis()->SetBinLabel(15,"Bin 9 LowRes");
corr->GetXaxis()->SetBinLabel(16,"Bin 10 LowRes");
corr->GetXaxis()->SetBinLabel(17,"Bin 11 LowRes");
corr->GetXaxis()->SetBinLabel(18,"Bin 12 LowRes");
corr->GetXaxis()->SetBinLabel(19,"Bin 13 LowRes");
corr->GetXaxis()->SetBit(TAxis::kLabelsVert);
示例14: PlotField2D
//.........这里部分代码省略.........
gPad->SetLeftMargin(lMargin);
gPad->SetRightMargin(rMargin);
gPad->SetBottomMargin(bMargin);
gPad->SetTopMargin(tMargin);
if(opt.Contains("logz")) {
gPad->SetLogz(1);
} else {
gPad->SetLogz(0);
}
gPad->SetFrameLineWidth(2);
// Define the frames for plotting
Int_t fonttype = 43;
Int_t fontsize = 28;
Int_t tfontsize = 30;
Float_t txoffset = 1.3;
Float_t lxoffset = 0.02;
Float_t tyoffset = 1.0;
Float_t lyoffset = 0.01;
Float_t tylength = 0.02;
Float_t txlength = 0.04;
TH2F *hFrame = (TH2F*) gROOT->FindObject("hFrame");
if(hFrame) delete hFrame;
hFrame = (TH2F*) hE2D[index]->Clone("hFrame");
hFrame->Reset();
// Format for y axis
hFrame->GetYaxis()->SetTitleFont(fonttype);
hFrame->GetYaxis()->SetTitleSize(tfontsize);
hFrame->GetYaxis()->SetTitleOffset(tyoffset);
hFrame->GetYaxis()->SetLabelFont(fonttype);
hFrame->GetYaxis()->SetLabelSize(fontsize);
hFrame->GetYaxis()->SetLabelOffset(lyoffset);
hFrame->GetYaxis()->SetTickLength(tylength);
// Format for x axis
hFrame->GetXaxis()->SetTitleFont(fonttype);
hFrame->GetXaxis()->SetTitleSize(tfontsize+2);
hFrame->GetXaxis()->SetTitleOffset(txoffset);
hFrame->GetXaxis()->SetLabelFont(fonttype);
hFrame->GetXaxis()->SetLabelSize(fontsize+2);
hFrame->GetXaxis()->SetLabelOffset(lxoffset);
hFrame->GetXaxis()->SetTickLength(txlength);
hFrame->Draw("col");
// hE2D[index]->GetZaxis()->SetNdivisions(505);
hE2D[index]->GetZaxis()->SetTitleFont(fonttype);
hE2D[index]->Draw("colz same");
// Re-touchs
gPad->Update();
Float_t y1 = gPad->GetBottomMargin();
Float_t y2 = 1 - gPad->GetTopMargin();
Float_t x1 = gPad->GetLeftMargin();
Float_t x2 = 1 - gPad->GetRightMargin();
Float_t gap = 0.005;
TPaletteAxis *palette = (TPaletteAxis*)hE2D[index]->GetListOfFunctions()->FindObject("palette");
if(palette) {
palette->SetY2NDC(y2 - gap);