本文整理汇总了C++中TPaveText::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ TPaveText::Clone方法的具体用法?C++ TPaveText::Clone怎么用?C++ TPaveText::Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPaveText
的用法示例。
在下文中一共展示了TPaveText::Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateBkgTemplates
void CreateBkgTemplates(float XMIN, float XMAX, TString OUTPATH, bool MERGE)
{
gROOT->ProcessLineSync(".x ../common/styleCMSTDR.C");
gROOT->ForceStyle();
RooMsgService::instance().setSilentMode(kTRUE);
for(int i=0;i<2;i++) {
RooMsgService::instance().setStreamStatus(i,kFALSE);
}
const int NSEL(2);
if (!MERGE) {const int NCAT[NSEL] = {4,3};}
else {const int NCAT[NSEL] = {4,2};}
if (!MERGE) {const double MVA_BND[NSEL][NCAT[0]+1] = {{-0.6,0.0,0.7,0.84,1},{-0.1,0.4,0.8,1}};}
else {const double MVA_BND[NSEL][NCAT[0]+1] = {{-0.6,0.0,0.7,0.84,1},{-0.1,0.4,1}};}
float LUMI[2] = {19784,18281};
TString SELECTION[2] = {"NOM","VBF"};
TString SELNAME[2] = {"NOM","PRK"};
TString MASS_VAR[2] = {"mbbReg[1]","mbbReg[2]"};
TString TRIG_WT[2] = {"trigWtNOM[1]","trigWtVBF"};
TString PATH("flat/");
TFile *inf[9];
TTree *tr;
TH1F *hMbb[9],*hMbbYield[9],*hPass;
TH1F *hZ,*hW,*hTT,*hST,*hTop;
TH1F *hZYield,*hWYield,*hTTYield,*hSTYield,*hTopYield;
char name[1000];
float LUMI;
float XSEC[9] = {56.4,11.1,3.79,30.7,11.1,1.76,245.8,650,1.2*1205};
RooDataHist *roohist_Z[5],*roohist_T[5];
RooRealVar *kJES[10],*kJER[10];
RooWorkspace *w = new RooWorkspace("w","workspace");
TString tMERGE = MERGE ? "_CATmerge56" : "";
//RooRealVar x("mbbReg","mbbReg",XMIN,XMAX);
int counter(0);
for(int isel=0;isel<NSEL;isel++) {
inf[0] = TFile::Open(PATH+"Fit_T_t-channel_sel"+SELECTION[isel]+".root");
inf[1] = TFile::Open(PATH+"Fit_T_tW-channel_sel"+SELECTION[isel]+".root");
inf[2] = TFile::Open(PATH+"Fit_T_s-channel_sel"+SELECTION[isel]+".root");
inf[3] = TFile::Open(PATH+"Fit_Tbar_t-channel_sel"+SELECTION[isel]+".root");
inf[4] = TFile::Open(PATH+"Fit_Tbar_tW-channel_sel"+SELECTION[isel]+".root");
inf[5] = TFile::Open(PATH+"Fit_Tbar_s-channel_sel"+SELECTION[isel]+".root");
inf[6] = TFile::Open(PATH+"Fit_TTJets_sel"+SELECTION[isel]+".root");
inf[7] = TFile::Open(PATH+"Fit_ZJets_sel"+SELECTION[isel]+".root");
inf[8] = TFile::Open(PATH+"Fit_WJets_sel"+SELECTION[isel]+".root");
TCanvas *canZ = new TCanvas("canZ_"+SELECTION[isel],"canZ_"+SELECTION[isel],900,600);
TCanvas *canT = new TCanvas("canT_"+SELECTION[isel],"canT_"+SELECTION[isel],900,600);
canZ->Divide(2,2);
canT->Divide(2,2);
TCanvas *can = new TCanvas();
sprintf(name,"CMS_vbfbb_scale_mbb_sel%s",SELECTION[isel].Data());
kJES[isel] = new RooRealVar(name,name,1.0);
sprintf(name,"CMS_vbfbb_res_mbb_sel%s",SELECTION[isel].Data());
kJER[isel] = new RooRealVar(name,name,1.0);
kJES[isel]->setConstant(kTRUE);
kJER[isel]->setConstant(kTRUE);
for(int icat=0;icat<NCAT[isel];icat++) {
if (MERGE && SELECTION[isel]=="VBF" && icat==1) counter = 56;
/*
sprintf(name,"CMS_vbfbb_scale_mbb_CAT%d",counter);
kJES[counter] = new RooRealVar(name,name,1.0);
sprintf(name,"CMS_vbbb_res_mbb_CAT%d",counter);
kJER[counter] = new RooRealVar(name,name,1.0);
kJES[counter]->setConstant(kTRUE);
kJER[counter]->setConstant(kTRUE);
*/
for(int i=0;i<9;i++) {
hPass = (TH1F*)inf[i]->Get("TriggerPass");
sprintf(name,"Hbb/events",icat);
tr = (TTree*)inf[i]->Get(name);
sprintf(name,"puWt[0]*%s*(mva%s>%1.2f && mva%s<=%1.2f)",TRIG_WT[isel].Data(),SELECTION[isel].Data(),MVA_BND[isel][icat],SELECTION[isel].Data(),MVA_BND[isel][icat+1]);
TCut cut(name);
int NBINS(20);
//if (icat > 1 && icat<=2) NBINS = 20;
if (icat > 2) NBINS = 12;
sprintf(name,"hMbb%d_sel%s_CAT%d",i,SELECTION[isel].Data(),icat);
hMbb[i] = new TH1F(name,name,NBINS,XMIN,XMAX);
hMbb[i]->Sumw2();
can->cd();
tr->Draw(MASS_VAR[isel]+">>"+hMbb[i]->GetName(),cut);
sprintf(name,"hMbbYield%d_sel%s_CAT%d",i,SELECTION[isel].Data(),icat);
hMbbYield[i] = new TH1F(name,name,NBINS,XMIN,XMAX);
hMbbYield[i]->Sumw2();
tr->Draw(MASS_VAR[isel]+">>"+hMbbYield[i]->GetName(),cut);
hMbbYield[i]->Scale(LUMI[isel]*XSEC[i]/hPass->GetBinContent(1));
}
hZ = (TH1F*)hMbb[7]->Clone("Z");
hW = (TH1F*)hMbb[8]->Clone("W");
hTT = (TH1F*)hMbb[6]->Clone("TT");
hST = (TH1F*)hMbb[0]->Clone("ST");
hST->Add(hMbb[1]);
hST->Add(hMbb[2]);
hST->Add(hMbb[3]);
hST->Add(hMbb[4]);
hST->Add(hMbb[5]);
hTop = (TH1F*)hTT->Clone("Top");
hTop->Add(hST);
//.........这里部分代码省略.........