/* must be protected with a mutex */
int framework_main(enum benchmark_size_t size) {
  int score;
  memset(bench_info_list, 0, sizeof(bench_info_list));
  memset(bench_run_data, 0, sizeof(bench_run_data));

#ifdef ARRAYFILE
  arrayfile_stdout = arrayfile_fopen("arrayfile", "w");
  assert(arrayfile_stdout);
#endif

  if (size == kBenchmarkSmall) {
    SetupSmallBenchmarks();
  } else {
    SetupLargeBenchmarks();
  }

  fasta_10k_ref_output_len = strlen(fasta_10k_ref_output);

  printf("%d benchmarks registered\n", benchmark_count);
  RunAll();
  PrintScores();
  score = (int) GeometricMean();
#ifdef ARRAYFILE
  arrayfile_fclose(arrayfile_stdout);
  arrayfile_stdout = NULL;
#endif
  ClearBenchmarks();

   print_total_stats();
	
  printf("Aggregate score: %d\n", score);

  return score;
}
Esempio n. 2
0
//================================================
void makeHisto(TString fileName)
{
  Double_t pt_cuts_1[6] = {1.0,1.2,1.5,2.0,4.0,4.5};
  Double_t pt_cuts_2[2] = {1.0,1.2};

  TH2F *hUS[6][2];
  TH2F *hLS[6][2];
  TH2F *hLSpos[6][2];
  TH2F *hLSneg[6][2];

  const char *hName[3] = {"hJpsiInfo","hBkgLSPos","hBkgLSNeg"};
  THnSparseF *hnInvMass[3];

  for(Int_t j=0; j<3; j++)
    {
      hnInvMass[j] = (THnSparseF*)f->Get(Form("%s_%s",hName[j],trigName[kTrigType]));
    }

  for(Int_t i=0; i<6; i++)
    {
      for(Int_t k=0; k<2; k++)
	{
	  for(Int_t j=0; j<3; j++)
	    {
	      hnInvMass[j]->GetAxis(2)->SetRangeUser(pt_cuts_1[i]+0.01,100);
	      hnInvMass[j]->GetAxis(3)->SetRangeUser(pt_cuts_2[k]+0.01,100);
	      TH2F *h2 = (TH2F*)hnInvMass[j]->Projection(1,0);
	      h2->SetName(Form("%d_%d_%d",i,j,k));
	      if(j==0) hUS[i][k] = (TH2F*)h2->Clone(Form("US_pt_vs_InvMass_pt1_%1.1f_pt2_%1.1f_%s",pt_cuts_1[i],pt_cuts_2[k],trigName[kTrigType]));
	      if(j==1) hLSpos[i][k] = (TH2F*)h2->Clone(Form("LSpos_pt_vs_InvMass_pt1_%1.1f_pt2_%1.1f_%s",pt_cuts_1[i],pt_cuts_2[k],trigName[kTrigType]));
	      if(j==2) hLSneg[i][k] = (TH2F*)h2->Clone(Form("LSneg_pt_vs_InvMass_pt1_%1.1f_pt2_%1.1f_%s",pt_cuts_1[i],pt_cuts_2[k],trigName[kTrigType]));
	    }

	  hLS[i][k] = (TH2F*)hLSpos[i][k]->Clone(Form("LS_pt_vs_InvMass_pt1_%1.1f_pt2_%1.1f_%s",pt_cuts_1[i],pt_cuts_2[k],trigName[kTrigType]));
	  hLS[i][k]->Add(hLSneg[i][k]);
	}
    }

  TH2F *hUSRebin[6][2];
  TH2F *hLSGeom[6][2];
  TH2F *hLSposRebin[6][2];
  TH2F *hLSnegRebin[6][2];

  for(Int_t i=0; i<6; i++)
    {
      for(Int_t k=0; k<2; k++)
	{
	  hUSRebin[i][k] = new TH2F(Form("%s_Rebin",hUS[i][k]->GetName()), hUS[i][k]->GetTitle(), nSpecMBins, specM, nSpecPtBins, specPt);
	  CopyTH2(hUS[i][k], hUSRebin[i][k]);

	  hLSposRebin[i][k] = new TH2F(Form("%s_Rebin",hLSpos[i][k]->GetName()), hLSpos[i][k]->GetTitle(), nSpecMBins, specM, nSpecPtBins, specPt);
	  CopyTH2(hLSpos[i][k], hLSposRebin[i][k]);

	  hLSnegRebin[i][k] = new TH2F(Form("%s_Rebin",hLSneg[i][k]->GetName()), hLSneg[i][k]->GetTitle(), nSpecMBins, specM, nSpecPtBins, specPt);
	  CopyTH2(hLSneg[i][k], hLSnegRebin[i][k]);

	  hLSGeom[i][k] = new TH2F(Form("LS_Geom_pt_vs_InvMass_pt1_%1.1f_pt2_%1.1f_%s",pt_cuts_1[i],pt_cuts_2[k],trigName[kTrigType]), hLS[i][k]->GetTitle(), nSpecMBins, specM, nSpecPtBins, specPt);
	  GeometricMean(hLSposRebin[i][k], hLSnegRebin[i][k], hLSGeom[i][k]);
	}
    }
	  

  TFile *fout = TFile::Open(Form("Rootfiles/%s",fileName.Data()),"recreate");
  for(Int_t i=0; i<6; i++)
    {
      for(Int_t k=0; k<2; k++)
	{
	  hUS[i][k]->Write();
	  hLS[i][k]->Write();
	  hLSpos[i][k]->Write();
	  hLSneg[i][k]->Write();

	  hUSRebin[i][k]->Write();
	  hLSGeom[i][k]->Write();
	  hLSposRebin[i][k]->Write();
	  hLSnegRebin[i][k]->Write();
	}
    }
}