当前位置: 首页>>代码示例>>C++>>正文


C++ TCut::SetName方法代码示例

本文整理汇总了C++中TCut::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ TCut::SetName方法的具体用法?C++ TCut::SetName怎么用?C++ TCut::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCut的用法示例。


在下文中一共展示了TCut::SetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: printYield

int printYield(){
  // Open input file(s)
  string basedirectory = "/lstore/cms/cbeiraod/Stop4Body/LepFix/";

  // Create chains
  TChain* wjetsChain = new TChain("bdttree"); //creates a chain to process a Tree called "bdttree"
  wjetsChain->Add((basedirectory + "Wjets_100to200_bdt.root").c_str());
  wjetsChain->Add((basedirectory + "Wjets_200to400_bdt.root").c_str());
  wjetsChain->Add((basedirectory + "Wjets_400to600_bdt.root").c_str());
  wjetsChain->Add((basedirectory + "Wjets_600toInf_bdt.root").c_str());

  TChain* ttbarChain = new TChain("bdttree"); //creates a chain to process a Tree called "bdttree"
  ttbarChain->Add((basedirectory + "TTJets_LO_bdt.root").c_str());

  TChain* stopChain = new TChain("bdttree"); //creates a chain to process a Tree called "bdttree"
  stopChain->Add((basedirectory + "T2DegStop_300_270_bdt.root").c_str());

  TChain* dataChain = new TChain("bdttree"); //creates a chain to process a Tree called "bdttree"
  dataChain->Add((basedirectory + "PseudoData_bdt.root").c_str());

  vector<process> vprocess;

  process pwjets(wjetsChain,"wjets");
  process pttbar(ttbarChain,"ttbar");
  process psignal(stopChain,"signal");

  vprocess.push_back(pwjets);
  vprocess.push_back(pttbar);
  vprocess.push_back(psignal);

  //Create TCuts
  TCut null = "1";
  TCut muon = "(abs(LepID)==13)&&(LepIso03<0.2)";
  TCut electron = "(abs(LepID)==11)&&(LepIso03<0.2)";
  TCut emu = muon||electron;
  TCut ISRjet = "Jet1Pt > 110";
  TCut met = "Met > 300";
  TCut njets = "Njet > 2";
  TCut lepPt = "LepPt < 17";
//  TCut mt = "mt < 135";
  TCut preSel = met && emu && ISRjet;

  TCut selection = preSel;

  TCut Met540 = "Met>540";
  TCut mt100 = "mt > 100";
  TCut jet1Pt550 = "Jet1Pt > 550";
  TCut CosDeltaPhi025 = "CosDeltaPhi < 0.25";
  TCut ht20700 = "HT20 > 700";

  //Set names of TCuts
  emu.SetName("emu");
  ISRjet.SetName("$p_T$(Jet1)$ > 110$");
  electron.SetName("electron");
  preSel.SetName("PreSelection");
  selection.SetName("Selection FOM");

  // Create VCut
  vector<TCut> vcut;
  //vcut.push_back(emu);
  //vcut.push_back(ISRjet*emu);
  //vcut.push_back(met*ISRjet*emu);
  vcut.push_back(preSel);
  vcut.push_back(Met540*preSel);
  vcut.push_back(mt100*Met540*preSel);
  vcut.push_back(jet1Pt550*mt100*Met540*preSel);
//  vcut.push_back(CosDeltaPhi025*Met540*preSel);
//  vcut.push_back(ht20700*CosDeltaPhi025*Met540*preSel);

  vcut[1].SetName("Met $>$ 540");
//  vcut[2].SetName("$Cos(\\Delta \\phi)$ $<$ 0.25");
  vcut[2].SetName("$m_T >$ 100");
//  vcut[3].SetName("$H_T$ (20) $>$ 700");
  vcut[3].SetName("$p_T$ (Jet) $>$ 550");

  // Create matrix
  double** matrix = new double*[vprocess.size()+3];
  for(int i=0; i<int(vprocess.size()+3); i++)
    matrix[i] = new double[vcut.size()+1];

  double** matrixError = new double*[vprocess.size()+3];
  for(int i=0; i<int(vprocess.size()+3); i++)
    matrixError[i] = new double[vcut.size()+1];

  // Total
  for(int i=0;i<int(vprocess.size());i++)
    {
      matrix[i][0] = countTotal(vprocess[i]);
      matrixError[i][0] = countError(vprocess[i].GetChain(), null);
    }

  // Processes
  for(int i=0; i<int(vprocess.size()); i++)
    {
      for(int j=0;j<int(vcut.size());j++)
      {
        matrix[i][j+1] = countEvt(vprocess[i],vcut[j]);
        matrixError[i][j+1] = countError(vprocess[i].GetChain(),vcut[j]);
      }
    }
//.........这里部分代码省略.........
开发者ID:beatrizlopes,项目名称:SkeletonAnalysis,代码行数:101,代码来源:printYield.C


注:本文中的TCut::SetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。