コード例 #1
0
ファイル: SuffixTree.cpp プロジェクト: Tsuiwiki/infobright
void SuffixTree<Symb,NSymb>::SetSuffix()
{
	// recursive procedure SetSuffix(n) processed nodes in post-order;
	// this one processes in pre-order (it is easier to implement iteratively)
	// TODO: ratio - more sophisticated choose of long suffix link

	std::vector<PNode> stack;
	stack.reserve(STACK_INIT);
	stack.push_back(ROOT);

	PNode n, ch;
	while(!stack.empty()) {
		n = stack.back();
		stack.pop_back();
		Node& node = GetNode(n);
		BHASSERT_WITH_NO_PERFORMANCE_IMPACT(n != NIL);

		// put children on stack
		for(ch = node.child; ch != NIL; ch = NxtChild(ch))
			stack.push_back(ch);

		if(n == ROOT) continue;
		PNode& suf = node.suf;
		if(data[node.pos + node.len - 1] == '\0')
			// if the node's edge label ends with '\0', link the suffix directly to the root
			suf = ROOT;
		else
			// find suffix which is not cut off and has signifficantly different distribution than 'n'
			// TODO: time - optimize searching for the best suffix link
			while((suf != NIL) && (GetCut(suf) || Similar(n, suf)))
				suf = GetNode(suf).suf;
		//if(suf == NIL) suf = ROOT;
	}
}
コード例 #2
0
TCanvas *PlotDataMC2D(TChain *data, TChain *mc, 
		      TString branchname, TString binning, 
		      TString category, TString selection, 
		      TString dataLabel, TString mcLabel, 
		      TString xLabel, TString yLabel, 
		      int type=2, TString opt="colz",
		      bool usePU=true, bool smear=false, bool scale=false){
  
  TCut sel ="";
  if(category.Sizeof()>1) sel= GetCut(category, 0);
  sel+=selection;
  return PlotDataMC2D(data, mc, branchname, binning, sel, dataLabel, mcLabel, xLabel, yLabel, type, opt,usePU, smear, scale);
} 
コード例 #3
0
ファイル: propaganda_plot2.C プロジェクト: J-C-Wright/ECALELF
  //  pv.AddText("#sqrt{s} = 8TeV, L = 19.6 fb^{-1}");

  pv.AddText("");
  pv.SetTextAlign(11);

  pv.SetFillStyle(1);
  pv.SetFillColor(0);
  pv.SetBorderSize(0);

  TPaveText pv_EB(pv);
  pv_EB.AddText("ECAL barrel");

  TPaveText pv_EE(pv);
  pv_EE.AddText("ECAL endcap");
  
  TCut EB_cut = GetCut("EB-eleID_7");
  TCut EE_cut = GetCut("EE-eleID_7");


  data_chain->Draw("invMass_SC_regrCorr_ele>>invMass_SC_regrCorr_ele_EB(170,45,130)", EB_cut);
  TH1F *invMass_SC_regrCorr_ele_EB = (TH1F *) gROOT->FindObject("invMass_SC_regrCorr_ele_EB");
  data_chain->Draw("invMass_SC_regrCorr_ele>>invMass_SC_regrCorr_ele_EE(170,45,130)", EE_cut);
  TH1F *invMass_SC_regrCorr_ele_EE = (TH1F *) gROOT->FindObject("invMass_SC_regrCorr_ele_EE");
    
  data_chain->Draw("invMass_e5x5>>invMass_e5x5_EB(120,60,120)", EB_cut);
  TH1F *invMass_e5x5_EB = (TH1F *) gROOT->FindObject("invMass_e5x5_EB");
  
  data_chain->Draw("invMass_e5x5>>invMass_e5x5_EE(120,60,120)", EE_cut);
  TH1F *invMass_e5x5_EE = (TH1F *) gROOT->FindObject("invMass_e5x5_EE");
  
  data_chain->Draw("invMass_rawSC>>invMass_rawSC_EB(160,50,130)", EB_cut);