]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONdigit.C
Put vacuum in beam-pipe not air.
[u/mrichter/AliRoot.git] / MUON / MUONdigit.C
CommitLineData
2a10b148 1void MUONdigit (Int_t evNumber1=0, Int_t evNumber2=0, Int_t ibg=0, Int_t bgr=10)
fe4da5cc 2{
fe4da5cc 3// Dynamically link some shared libs
4
5 if (gClassTable->GetID("AliRun") < 0) {
a897a37a 6 gROOT->LoadMacro("loadlibs.C");
7 loadlibs();
fe4da5cc 8 }
9
10// Connect the Root Galice file containing Geometry, Kine and Hits
11
12 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
13 if (file) file->Close();
14 file = new TFile("galice.root","UPDATE");
fe4da5cc 15
16// Get AliRun object from file or create it if not on file
17
18 if (!gAlice) {
19 gAlice = (AliRun*)file->Get("gAlice");
a897a37a 20 if (gAlice) printf("AliRun object found on file\n");
fe4da5cc 21 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
22 }
66f93042 23 AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON");
24 if (pMUON) {
25// creation
26 AliMUONMerger* merger = new AliMUONMerger();
27// configuration
2a10b148 28 if (ibg) {
29 merger->SetMode(ibg);
30 merger->SetBackgroundFileName("bg.root");
31 }
32 // pass
66f93042 33 pMUON->SetMerger(merger);
34 }
35// Action !
3f2e2671 36//
37// Loop over events
38//
39 for (int nev=evNumber1; nev<= evNumber2; nev++) {
40 Int_t nparticles = gAlice->GetEvent(nev);
41 cout << "nev " << nev <<endl;
42 cout << "nparticles " << nparticles <<endl;
43 if (nev < evNumber1) continue;
44 if (nparticles <= 0) return;
2a10b148 45 Int_t nbgr_ev = Int_t(nev*bgr/(evNumber2+1));
46
47 if (ibg) {
48 merger->SetBackgroundEventNumber(nbgr_ev);
49 }
50
3f2e2671 51 gAlice->SDigits2Digits();
52
53 char hname[30];
54 sprintf(hname,"TreeD%d",nev);
55 gAlice->TreeD()->Write(hname);
56 // reset tree
57 gAlice->TreeD()->Reset();
58
59 } // event loop
a897a37a 60}
fe4da5cc 61
fe4da5cc 62
fe4da5cc 63
fe4da5cc 64
fe4da5cc 65
fe4da5cc 66
fe4da5cc 67
fe4da5cc 68
fe4da5cc 69
fe4da5cc 70
fe4da5cc 71
72
fe4da5cc 73
fe4da5cc 74