本文整理汇总了C++中TVirtualPad::SetFillStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ TVirtualPad::SetFillStyle方法的具体用法?C++ TVirtualPad::SetFillStyle怎么用?C++ TVirtualPad::SetFillStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVirtualPad
的用法示例。
在下文中一共展示了TVirtualPad::SetFillStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeIntegerAxis
/**
*
*
* @param o
* @param useWeights
* @param correct
*
* @ingroup pwglf_forward_scripts_tests
*/
void
TestPoisson(Double_t o=.3, bool useWeights=false, bool correct=true)
{
const char* load = "$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/scripts/LoadLibs.C";
if (!gROOT->GetClass("AliAODForwardMult")) {
gROOT->Macro(load);
gROOT->GetInterpreter()->UnloadFile(gSystem->ExpandPathName(load));
}
// --- Parameters of this script -----------------------------------
Int_t nBin = 5; // Our detector matrix size
Int_t nMax = TMath::Max(Int_t(nBin * nBin * o + .5)+nBin/2,nBin);
Int_t nEv = 10000; // Number of events
Double_t mp = o; // The 'hit' probability
TH2D* base = new TH2D("base", "Basic histogram",
nBin,-.5, nBin-.5, nBin, -.5, nBin-.5);
base->SetXTitle("#eta");
base->SetYTitle("#varphi");
base->SetDirectory(0);
base->SetOption("colz");
Int_t tN1=nMax; Double_t tMin1; Double_t tMax1;
Int_t tN2=nMax*10; Double_t tMin2; Double_t tMax2=nMax;
MakeIntegerAxis(tN1, tMin1, tMax1);
MakeIntegerAxis(tN2, tMin2, tMax2);
TH2D* corr = new TH2D("comp", "Comparison",
tN1, tMin1, tMax1, tN2, tMin2, tMax2);
corr->SetXTitle("Input");
corr->SetYTitle("Poisson");
corr->SetDirectory(0);
corr->SetOption("colz");
corr->SetStats(0);
TLine* lcorr = new TLine(0, 0, tMax2, tMax2);
Int_t mm = TMath::Max(Int_t(nBin * o + .5),nBin/2);
tN2=mm*10; tMax2 = mm;
MakeIntegerAxis(tN2, tMin2, tMax2);
Info("", "Making mean w/nbins=%d,range=[%f,%f]", tN2, tMin2, tMax2);
TH2D* mean = new TH2D("mean", "Mean comparison",
tN2, tMin2, tMax2, tN2, tMin2, tMax2);
mean->SetXTitle("Input");
mean->SetYTitle("Poisson");
mean->SetDirectory(0);
mean->SetOption("colz");
mean->SetStats(0);
TLine* lmean = new TLine(tMin2, tMin2, tMax2, tMax2);
TH1D* dist = new TH1D("dist", "Distribution of hits", tN1, tMin1, tMax1);
dist->SetXTitle("s");
dist->SetYTitle("P(s)");
dist->SetFillColor(kRed+1);
dist->SetFillStyle(3001);
dist->SetDirectory(0);
TH1D* diff = new TH1D("diff", "P-T", 100, -25, 25);
diff->SetXTitle("Difference");
diff->SetFillColor(kRed+1);
diff->SetFillStyle(3001);
diff->SetYTitle("Prob");
AliPoissonCalculator* c = new AliPoissonCalculator("ignored");
c->Init(nBin ,nBin);
for (Int_t i = 0; i < nEv; i++) {
c->Reset(base);
base->Reset();
for (Int_t iEta = 0; iEta < nBin; iEta++) {
for (Int_t iPhi = 0; iPhi < nBin; iPhi++) {
// Throw a die
Int_t m = gRandom->Poisson(mp);
dist->Fill(m);
// Fill into our base histogram
base->Fill(iEta, iPhi, m);
// Fill into poisson calculator
c->Fill(iEta, iPhi, m > 0, (useWeights ? m : 1));
}
}
// Calculate the result
TH2D* res = c->Result(correct);
// Now loop and compare
Double_t mBase = 0;
Double_t mPois = 0;
for (Int_t iEta = 0; iEta < nBin; iEta++) {
for (Int_t iPhi = 0; iPhi < nBin; iPhi++) {
Double_t p = res->GetBinContent(iEta, iPhi);
//.........这里部分代码省略.........