]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RICH/RICHdigit.C
Updated Linkdef and libTOF.pkg
[u/mrichter/AliRoot.git] / RICH / RICHdigit.C
CommitLineData
237c933d 1// 0 = all
e659e1d4 2// 1 = not pion
3// 2 = not kaon
4// 3 = not proton
5// 4 = not muon
6// 5 = not electron
7// 6 = not neutron
237c933d 8
9
8a82cc0b 10Int_t particle_type=0;
237c933d 11
ddae0931 12#include "iostream.h"
13
6e585aa2 14void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0, Int_t merging=0)
ddae0931 15{
16/////////////////////////////////////////////////////////////////////////
17// This macro is a small example of a ROOT macro
18// illustrating how to read the output of GALICE
19// and do some analysis.
20//
21/////////////////////////////////////////////////////////////////////////
22
23// Dynamically link some shared libs
24
e480e62b 25
26 if (gClassTable->GetID("AliRun") < 0) {
ddae0931 27 gROOT->LoadMacro("loadlibs.C");
28 loadlibs();
ff34e3ab 29 }else {
30 delete gAlice;
31 gAlice = 0;
32 }
33
ddae0931 34// Connect the Root Galice file containing Geometry, Kine and Hits
35
36 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
37 if (file) file->Close();
38 file = new TFile("galice.root","UPDATE");
e480e62b 39// file->ls();
40// Get AliRun object from file or create it if not on file
ddae0931 41
e480e62b 42
43
44 if (gClassTable->GetID("AliRun") < 0) {
45 gROOT->LoadMacro("loadlibs.C");
46 loadlibs();
47 }
ddae0931 48
ddae0931 49
50 if (!gAlice) {
51 gAlice = (AliRun*)file->Get("gAlice");
52 if (gAlice) printf("AliRun object found on file\n");
53 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
e480e62b 54 } else {
55 delete gAlice;
56 gAlice = (AliRun*)file->Get("gAlice");
57 if (gAlice) printf("AliRun object found on file\n");
58 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
59 }
60
ddae0931 61 AliRICH *RICH = (AliRICH*) gAlice->GetDetector("RICH");
c95f0940 62
003303fb 63 if (merging)
64 printf("Merging is ON\n");
65 else
66 printf("Merging is OFF\n");
c95f0940 67
003303fb 68// Creation of merger object
69 AliRICHMerger* merger = new AliRICHMerger();
c95f0940 70
003303fb 71// Configuration
72 merger->SetMode(merging);
73 merger->SetSignalEventNumber(0);
74 merger->SetBackgroundEventNumber(0);
75 merger->SetBackgroundFileName("bg.root");
76
77// Pass
78 RICH->SetMerger(merger);
79
80
ddae0931 81//
82// Event Loop
83//
84 for (int nev=0; nev<= evNumber2; nev++) {
85 Int_t nparticles = gAlice->GetEvent(nev);
e480e62b 86 cout <<endl<< "Processing event:" <<nev<<endl;
87 cout << "Particles :" <<nparticles<<endl;
ddae0931 88 if (nev < evNumber1) continue;
89 if (nparticles <= 0) return;
ff34e3ab 90 if (RICH)
91 {
1709ef81 92 //gAlice->MakeTree("D");
93 //RICH->MakeBranch("D");
003303fb 94 //RICH->Digitise(nev, particle_type);
95 //gAlice->SDigits2Digits("RICH");
96 //gAlice->Tree2Tree("D");
97 RICH->MakeBranch("D");
98 RICH->SDigits2Digits(nev, particle_type);
ff34e3ab 99 }
ddae0931 100 } // event loop
101 file->Close();
e480e62b 102
103 //delete gAlice;
104 printf("\nEnd of Macro *************************************\n");
ddae0931 105}
106
107
108