]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONdigit.C
DrawP dummy function body introduced
[u/mrichter/AliRoot.git] / MUON / MUONdigit.C
CommitLineData
a897a37a 1#include "iostream.h"
2
3void MUONdigit (Int_t evNumber1=0,Int_t evNumber2=0,Int_t nsignal =25)
fe4da5cc 4{
5/////////////////////////////////////////////////////////////////////////
a897a37a 6// This macro is a small example of a ROOT macro
7// illustrating how to read the output of GALICE
8// and do some analysis.
9//
fe4da5cc 10/////////////////////////////////////////////////////////////////////////
11
12// Dynamically link some shared libs
13
14 if (gClassTable->GetID("AliRun") < 0) {
a897a37a 15 gROOT->LoadMacro("loadlibs.C");
16 loadlibs();
fe4da5cc 17 }
18
a897a37a 19
fe4da5cc 20// Connect the Root Galice file containing Geometry, Kine and Hits
21
22 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
23 if (file) file->Close();
24 file = new TFile("galice.root","UPDATE");
25 file->ls();
fe4da5cc 26
a897a37a 27 printf ("I'm after Map \n");
fe4da5cc 28
29// Get AliRun object from file or create it if not on file
30
31 if (!gAlice) {
32 gAlice = (AliRun*)file->Get("gAlice");
a897a37a 33 if (gAlice) printf("AliRun object found on file\n");
fe4da5cc 34 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
35 }
a897a37a 36 printf ("I'm after gAlice \n");
37
38 AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON");
fe4da5cc 39//
a897a37a 40// Event Loop
fe4da5cc 41//
a897a37a 42 Int_t nbgr_ev=0;
43
fe4da5cc 44 for (int nev=0; nev<= evNumber2; nev++) {
45 Int_t nparticles = gAlice->GetEvent(nev);
46 cout << "nev " <<nev<<endl;
47 cout << "nparticles " <<nparticles<<endl;
48 if (nev < evNumber1) continue;
49 if (nparticles <= 0) return;
50
a897a37a 51 Int_t nbgr_ev=Int_t(nev/nsignal);
52// printf("nbgr_ev %d\n",nbgr_ev);
53 //if (MUON) MUON->Digitise(nev,nbgr_ev,"Add"," ","galice_bgr.root");
54 if (MUON) MUON->Digitise(nev,nbgr_ev,"rien"," ","galice_bgr.root");
55// char hname[30];
56// sprintf(hname,"TreeD%d",nev);
57// file->ls();
58 } // event loop
59 file->Close();
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