10 Int_t particle_type=0;
14 void RICHMerger (Int_t evNumber1=0,Int_t evNumber2=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");
36 // Connect the Root Galice file containing Geometry, Kine and Hits
38 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
39 if (file) file->Close();
40 file = new TFile("galice.root","UPDATE");
42 // Get AliRun object from file or create it if not on file
46 if (gClassTable->GetID("AliRun") < 0) {
47 gROOT->LoadMacro("loadlibs.C");
53 gAlice = (AliRun*)file->Get("gAlice");
54 if (gAlice) printf("AliRun object found on file\n");
55 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
58 gAlice = (AliRun*)file->Get("gAlice");
59 if (gAlice) printf("AliRun object found on file\n");
60 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
63 AliRICH *RICH = (AliRICH*) gAlice->GetDetector("RICH");
65 AliRICHChamber* iChamber;
67 printf("Generating tresholds...\n");
69 for(Int_t i=0;i<7;i++)
71 iChamber = &(RICH->Chamber(i));
72 iChamber->GenerateTresholds();
76 AliRICHMerger* merger = new AliRICHMerger();
79 merger->SetSignalEventNumber(0);
80 merger->SetBackgroundEventNumber(0);
81 merger->SetBackgroundFileName("bg.root");
84 RICH->SetMerger(merger);
89 for (int nev=0; nev<= evNumber2; nev++) {
90 Int_t nparticles = gAlice->GetEvent(nev);
91 cout <<endl<< "Processing event:" <<nev<<endl;
92 cout << "Particles :" <<nparticles<<endl;
93 if (nev < evNumber1) continue;
94 if (nparticles <= 0) return;
97 //gAlice->MakeTree("D");
98 //RICH->MakeBranch("D");
99 merger->Digitise(nev, particle_type);
101 //if (RICH) gAlice->SDigits2Digits("RICH");
103 //sprintf(hname,"TreeD%d",nev);
104 //gAlice->TreeD()->Write(hname);
105 //gAlice->TreeD()->Reset();
110 printf("\nEnd of Macro *************************************\n");