示例#1
0
void
Canvas::autoclip_dashed_line(int width, const POINT a, const POINT b,
                             const Color color, const RECT rc)
{
  if (need_clipping())
    clipped_dashed_line(width, a, b, color, rc);
  else
    dashed_line(width, a, b, color);
}
void DataCard::create_datacard(std::vector<double> mc_weights, DataChain* data_chain, DataChain* signal_chain, std::vector<DataChain*> bg_chains,
                               Variable* var, bool with_cut, std::vector<Variable*>* variables, std::string mva_cut_str,
																															std::string training_output_name)
{
std::cout<<"started create datacard";

	 //std::vector<double> mc_weights = HistoPlot::mc_weights(data_chain, bg_chains, var, with_cut, variables,mva_cut_str);

	 std::fstream fs;
	 const char* data_card_name = get_data_card_name(training_output_name);

	 fs.open (data_card_name, std::fstream::in | std::fstream::out | std::fstream::app);
  int size = 1 + bg_chains.size();

  fs << imax_string();
  fs << jmax_string(size - 1);
  fs << kmax_string(size);
  fs << no_shape_line();
  fs << dashed_line();
  fs << bin_header_string();
  fs << bin_observation_string(get_total_nevents(bg_chains, var, with_cut, variables, mc_weights,mva_cut_str));
  std::cout<<"made observation string: "<<bin_observation_string(get_total_nevents(bg_chains, var, with_cut, variables, mc_weights,mva_cut_str));

  fs << dashed_line();
  fs << bin_grid_line(size);
std::cout<<"made grid line";
  fs << process_labels(bg_chains, signal_chain);
std::cout<<"made  process_labels";
  fs << process_2_string(process_line_2(size));
std::cout<<"made process_2_string ";
  fs << rate_string(get_rates(data_chain, bg_chains, signal_chain, var, with_cut, variables, mc_weights,mva_cut_str));
std::cout<<"made rate_string: "<<rate_string(get_rates(data_chain, bg_chains, signal_chain, var, with_cut, variables, mc_weights,mva_cut_str))<<"\n";

  fs << dashed_line();
  fs << get_systematic_string(data_chain, bg_chains, signal_chain, var, with_cut, variables, mc_weights,mva_cut_str);
std::cout<<"made syst_string ";

	 fs.close();
std::cout<<"data card created with name: "<<data_card_name<<"\n";
for (int i=0; i< 10;i++){
}

}