StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunHijing.C
1 #include "TSystem.h"
2 #include "TString.h"
3 
4 void RunHijing(const char *jobid="test")
5 {
6  Int_t nev=99999999;
7 
8  TString input("/star/u/russcher/gamma/analysis/data/hijing/hijing.root");
9 
10  TString outdir("/star/u/russcher/gamma/analysis/output/dAu/hijing/");
11  TString psout("pi0_hijing.ps");
12  TString rootout("pi0_hijing.root");
13  psout.Prepend(jobid);
14  rootout.Prepend(jobid);
15  TString command("mkdir ");
16  command.Append(outdir.Data());
17  command.Append(jobid);
18  gSystem->Exec(command.Data());
19  cout<<endl<<"storing results in: "<<command.Data()<<endl<<endl;
20  outdir.Append(jobid);
21  outdir.Append("/");
22 
23  psout.Prepend(outdir.Data());
24  rootout.Prepend(outdir.Data());
25 
26  gSystem->Load("MyEvent/MyEvent.so");
27  gSystem->Load("gamma/analysis/lib/AnaCuts.so");
28  gSystem->Load("gamma/analysis/lib/Pi0Analysis.so");
29 
30  Pi0Analysis *pi0=new Pi0Analysis(psout.Data(),"dAu");
31  pi0->setMC(kFALSE);
32  pi0->setHijing(kTRUE);
33  pi0->init(rootout.Data());
34  pi0->make(nev,input.Data());
35 
36  TH1F *h_mb=new TH1F(*pi0->getYield(0,"mb"));
37  for(int i=1;i<=h_mb->GetNbinsX();i++){
38  h_mb->SetBinContent(i,h_mb->GetBinContent(i)*h_mb->GetXaxis()->GetBinWidth(i));
39  h_mb->SetBinError(i,h_mb->GetBinError(i)*h_mb->GetXaxis()->GetBinWidth(i));
40  }
41  TH1F *h_input=new TH1F(*(TH1F*)pi0->h_mcneutronsMB);
42 
43  TCanvas *c=new TCanvas("c","c",400,600);
44  c->Divide(1,2);
45  c->cd(1);
46  gPad->SetLogy();
47  h_input->Draw();
48  h_mb->Draw("same");
49  h_mb->SetLineStyle(2);
50  c->cd(2);
51  TH1F *eff=new TH1F(*h_mb);
52  eff->Divide(h_input);
53  eff->Draw();
54  c->cd(0);
55  c->SaveAs("hijing.ps");
56 
57  pi0->finish();
58 }