]> git.uio.no Git - u/mrichter/AliRoot.git/blob - test/QA/sim.C
saving syswatch.log s
[u/mrichter/AliRoot.git] / test / QA / sim.C
1 void sim(Int_t nev=1) {
2   AliSimulation simu;
3   simu.SetMakeSDigits("TRD TOF PHOS HMPID  EMCAL MUON FMD PMD T0 ZDC VZERO");
4   simu.SetMakeDigits ("TRD TOF PHOS HMPID  EMCAL MUON FMD PMD T0 ZDC VZERO");
5   simu.SetMakeDigitsFromHits("ITS TPC");
6   simu.SetWriteRawData("ALL","raw.root",kTRUE);
7   simu.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
8   simu.SetSpecificStorage("GRP/GRP/Data",
9                           Form("local://%s",gSystem->pwd()));
10
11   simu.SetRunQA("ALL:ALL") ; 
12   simu.SetQARefDefaultStorage("local://$ALICE_ROOT/OCDB") ;
13
14   for (Int_t det = 0 ; det < AliQA::kNDET ; det++) {
15     simu.SetQACycles(det, 2) ;
16   }
17   
18   TStopwatch timer;
19   timer.Start();
20   simu.Run(nev);
21   WriteXsection();
22   timer.Stop();
23   timer.Print();
24 }
25
26 WriteXsection()
27 {
28   TPythia6 *pythia = TPythia6::Instance();
29   pythia->Pystat(1);
30   Double_t xsection = pythia->GetPARI(1);
31   Int_t    ntrials  = pythia->GetMSTI(5);
32
33   TTree   *tree   = new TTree("Xsection","Pythia cross section");
34   TBranch *branch = tree->Branch("xsection", &xsection, "X/D");
35   TBranch *branch = tree->Branch("ntrials" , &ntrials , "X/i");
36   tree->Fill();
37
38   TFile *file = new TFile("pyxsec.root","recreate");
39   tree->Write();
40   file->Close();
41
42   cout << "Pythia cross section: " << xsection 
43        << ", number of trials: " << ntrials << endl;
44 }
45