]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/MUONtrigger.C
Constructor needed by AliMUONv3 added. (G. Martinez)
[u/mrichter/AliRoot.git] / MUON / MUONtrigger.C
1 #include "iostream.h"
2 //Add the Trigger output in the tree TR of the ROOT file galice.root
3
4 void MUONtrigger (Int_t evNumber1=0, Int_t evNumber2=0)
5 {
6 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 // Dynamically link some shared libs
8    if (gClassTable->GetID("AliRun") < 0) {
9       gROOT->LoadMacro("loadlibs.C");
10       loadlibs();
11    }
12
13 // Connect the Root Galice file containing Geometry, Kine and Hits
14    TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
15    if (file) file->Close(); 
16    file = new TFile("galice.root","UPDATE");
17
18 // Get AliRun object from file or create it if not on file
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");
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      
37    } // event loop 
38    file->Close();
39 }
40
41
42
43
44
45
46
47
48
49
50
51
52
53