10 Int_t particle_type=0;
14 void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0, Int_t merging=0)
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.
21 /////////////////////////////////////////////////////////////////////////
23 // Dynamically link some shared libs
26 if (gClassTable->GetID("AliRun") < 0) {
27 gROOT->LoadMacro("loadlibs.C");
34 // Connect the Root Galice file containing Geometry, Kine and Hits
36 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
37 if (file) file->Close();
38 file = new TFile("galice.root","UPDATE");
40 // Get AliRun object from file or create it if not on file
44 if (gClassTable->GetID("AliRun") < 0) {
45 gROOT->LoadMacro("loadlibs.C");
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");
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");
61 AliRICH *RICH = (AliRICH*) gAlice->GetDetector("RICH");
64 printf("Merging is ON\n");
66 printf("Merging is OFF\n");
68 // Creation of merger object
69 AliRICHMerger* merger = new AliRICHMerger();
72 merger->SetMode(merging);
73 merger->SetSignalEventNumber(0);
74 merger->SetBackgroundEventNumber(0);
75 merger->SetBackgroundFileName("bg.root");
78 RICH->SetMerger(merger);
84 for (int nev=0; nev<= evNumber2; nev++) {
85 Int_t nparticles = gAlice->GetEvent(nev);
86 cout <<endl<< "Processing event:" <<nev<<endl;
87 cout << "Particles :" <<nparticles<<endl;
88 if (nev < evNumber1) continue;
89 if (nparticles <= 0) return;
92 //gAlice->MakeTree("D");
93 //RICH->MakeBranch("D");
94 //RICH->Digitise(nev, particle_type);
95 //gAlice->SDigits2Digits("RICH");
96 //gAlice->Tree2Tree("D");
97 RICH->MakeBranch("D");
98 RICH->SDigits2Digits(nev, particle_type);
104 printf("\nEnd of Macro *************************************\n");