]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONTestTrigger.C
Change of argument list of methods GetPadCxy, GetPadIxy, SetHit and FirstPad
[u/mrichter/AliRoot.git] / MUON / MUONTestTrigger.C
CommitLineData
a9e2aefa 1#include "iostream.h"
2// example of macro which retrieves the Trigger Output from galice.root
3
4void MUONTestTrigger (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","READ");
17
18// Get AliRun object from file or create it if not on file
19 printf ("I'm after Map \n");
20 if (!gAlice) {
21 gAlice = (AliRun*)file->Get("gAlice");
22 if (gAlice) printf("AliRun object found on file\n");
23 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
24 }
25 printf ("I'm after gAlice \n");
26//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27
28 for (int nev=evNumber1; nev<= evNumber2; nev++) {
29 Int_t nparticles = gAlice->GetEvent(nev);
30 cout << "nev npart =" << nev << " , " << nparticles << "\n";
31 if (nev < evNumber1) continue;
32 if (nparticles <= 0) return;
33
34 Int_t nbytes = 0;
35 AliMUONGlobalTrigger *gloTrg;
36 AliMUONLocalTrigger *locTrg;
37
38// Get pointers to Alice detectors and Triggers containers
39 AliMUON *MUON = (AliMUON*)gAlice->GetModule("MUON");
40 TClonesArray *globalTrigger = MUON->GlobalTrigger();
41 TClonesArray *localTrigger = MUON->LocalTrigger();
42
43 TTree *TR = gAlice->TreeR();
44 TBranch *gbranch = TR->GetBranch("MUONGlobalTrigger");
45 TBranch *lbranch = TR->GetBranch("MUONLocalTrigger");
46 gbranch->SetAddress(&globalTrigger);
47 lbranch->SetAddress(&localTrigger);
48
49 Int_t nent = TR->GetEntries();
50 cout << ">>> " << nent << " entries found in TreeR of event "
51 << nev << "\n";
52 Int_t nb = 0;
53
54 for (Int_t n=1; n<nent; n++) {
55 MUON->ResetTrigger();
56 nbytes += TR->GetEvent(n);
57
58 Int_t nglobals = globalTrigger->GetEntries(); // should be = 1
59 Int_t nlocals = localTrigger->GetEntries(); // who knows ?
60
61 for (Int_t i=0; i<nglobals; i++) { // inspect Global Trigger
62 cout << " >>> Output for Global Trigger " << "\n";
63
64 gloTrg = (AliMUONGlobalTrigger*)globalTrigger->UncheckedAt(i);
65
66 cout << "fSinglePlusLpt = " << gloTrg->fSinglePlusLpt << "\n";
67 cout << "fSinglePlusHpt = " << gloTrg->fSinglePlusHpt << "\n";
68 cout << "fSinglePlusApt = " << gloTrg->fSinglePlusApt << "\n";
69
70 cout << "fSingleMinusLpt = " << gloTrg->fSingleMinusLpt << "\n";
71 cout << "fSingleMinusHpt = " << gloTrg->fSingleMinusHpt << "\n";
72 cout << "fSingleMinusApt = " << gloTrg->fSingleMinusApt << "\n";
73
74 cout << "fSingleUndefLpt = " << gloTrg->fSingleUndefLpt << "\n";
75 cout << "fSingleUndefHpt = " << gloTrg->fSingleUndefHpt << "\n";
76 cout << "fSingleUndefApt = " << gloTrg->fSingleUndefApt << "\n";
77
78 cout << "fPairLikeLpt = " << gloTrg->fPairLikeLpt << "\n";
79 cout << "fPairLikeHpt = " << gloTrg->fPairLikeHpt << "\n";
80 cout << "fPairLikeApt = " << gloTrg->fPairLikeApt << "\n";
81
82 cout << "fPairUnlikeLpt = " << gloTrg->fPairUnlikeLpt << "\n";
83 cout << "fPairUnlikeHpt = " << gloTrg->fPairUnlikeHpt << "\n";
84 cout << "fPairUnlikeApt = " << gloTrg->fPairUnlikeApt << "\n";
85 } // end of loop on Global Trigger
86
87 for (Int_t i=0; i<nlocals; i++) { // inspect Local Trigger
88 cout << " >>> Output for Local Trigger # " << i << "\n";
89
90 locTrg = (AliMUONLocalTrigger*)localTrigger->UncheckedAt(i);
91
92 cout << "fLoCircuit = " << locTrg->fLoCircuit << "\n";
93 cout << "fLoStripX = " << locTrg->fLoStripX << "\n";
94 cout << "fLoDev = " << locTrg->fLoDev << "\n";
95 cout << "fLoStripY = " << locTrg->fLoStripY << "\n";
96 cout << "fLoLpt = " << locTrg->fLoLpt << "\n";
97 cout << "fLoHpt = " << locTrg->fLoHpt << "\n";
98 cout << "fLoApt = " << locTrg->fLoApt << "\n";
99
100 } // end of loop on Local Trigger
101 } // end of loop on entries of TreeR
102 } // loop on event
103
104// store histos in ouput file
105 hfile->Write();
106}
107
108
109
110