本文整理汇总了C++中TPaletteAxis::SetLabelColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaletteAxis::SetLabelColor方法的具体用法?C++ TPaletteAxis::SetLabelColor怎么用?C++ TPaletteAxis::SetLabelColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaletteAxis
的用法示例。
在下文中一共展示了TPaletteAxis::SetLabelColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: BinCovarianceHggRazor
//.........这里部分代码省略.........
corr->SetBinContent(413,2.505161);
corr->SetBinContent(414,8.661255);
corr->SetBinContent(415,0.5727072);
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");