]>
Commit | Line | Data |
---|---|---|
a897a37a | 1 | #include "iostream.h" |
a9e2aefa | 2 | //Add the Trigger output in the tree TR of the ROOT file galice.root |
a897a37a | 3 | |
a9e2aefa | 4 | void MUONtrigger (Int_t evNumber1=0, Int_t evNumber2=0) |
a897a37a | 5 | { |
a9e2aefa | 6 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
a897a37a | 7 | // Dynamically link some shared libs |
a897a37a | 8 | if (gClassTable->GetID("AliRun") < 0) { |
9 | gROOT->LoadMacro("loadlibs.C"); | |
10 | loadlibs(); | |
11 | } | |
12 | ||
a897a37a | 13 | // Connect the Root Galice file containing Geometry, Kine and Hits |
a897a37a | 14 | TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); |
15 | if (file) file->Close(); | |
16 | file = new TFile("galice.root","UPDATE"); | |
a897a37a | 17 | |
18 | // Get AliRun object from file or create it if not on file | |
a897a37a | 19 | if (!gAlice) { |
20 | gAlice = (AliRun*)file->Get("gAlice"); | |
21 | if (gAlice) printf("AliRun object found on file\n"); | |
22 | if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); | |
23 | } | |
24 | printf ("I'm after gAlice \n"); | |
25 | ||
26 | AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON"); | |
a9e2aefa | 27 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
28 | ||
29 | for (int nev=evNumber1; nev<= evNumber2; nev++) { // event loop | |
30 | Int_t nparticles = gAlice->GetEvent(nev); | |
31 | cout << "nev " <<nev<<endl; | |
32 | cout << "nparticles " <<nparticles<<endl; | |
33 | if (nparticles <= 0) return; | |
34 | ||
35 | if (MUON) MUON->Trigger(nev); | |
36 | ||
a897a37a | 37 | } // event loop |
38 | file->Close(); | |
39 | } | |
40 | ||
41 | ||
42 | ||
43 | ||
a9e2aefa | 44 | |
45 | ||
46 | ||
47 | ||
48 | ||
49 | ||
50 | ||
51 | ||
52 | ||
53 |