]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RICH/RICHdigit.C
Added some include files. Needed due to new forward declorations in other
[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
003303fb 14void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0, Int_t merging)
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
34 galice=0;
ddae0931 35
36// Connect the Root Galice file containing Geometry, Kine and Hits
37
38 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
39 if (file) file->Close();
40 file = new TFile("galice.root","UPDATE");
e480e62b 41// file->ls();
42// Get AliRun object from file or create it if not on file
ddae0931 43
e480e62b 44
45
46 if (gClassTable->GetID("AliRun") < 0) {
47 gROOT->LoadMacro("loadlibs.C");
48 loadlibs();
49 }
ddae0931 50
ddae0931 51
52 if (!gAlice) {
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");
e480e62b 56 } else {
57 delete gAlice;
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");
61 }
62
ddae0931 63 AliRICH *RICH = (AliRICH*) gAlice->GetDetector("RICH");
c95f0940 64
003303fb 65 if (merging)
66 printf("Merging is ON\n");
67 else
68 printf("Merging is OFF\n");
c95f0940 69
003303fb 70// Creation of merger object
71 AliRICHMerger* merger = new AliRICHMerger();
c95f0940 72
003303fb 73// Configuration
74 merger->SetMode(merging);
75 merger->SetSignalEventNumber(0);
76 merger->SetBackgroundEventNumber(0);
77 merger->SetBackgroundFileName("bg.root");
78
79// Pass
80 RICH->SetMerger(merger);
81
82
ddae0931 83//
84// Event Loop
85//
86 for (int nev=0; nev<= evNumber2; nev++) {
87 Int_t nparticles = gAlice->GetEvent(nev);
e480e62b 88 cout <<endl<< "Processing event:" <<nev<<endl;
89 cout << "Particles :" <<nparticles<<endl;
ddae0931 90 if (nev < evNumber1) continue;
91 if (nparticles <= 0) return;
ff34e3ab 92 if (RICH)
93 {
1709ef81 94 //gAlice->MakeTree("D");
95 //RICH->MakeBranch("D");
003303fb 96 //RICH->Digitise(nev, particle_type);
97 //gAlice->SDigits2Digits("RICH");
98 //gAlice->Tree2Tree("D");
99 RICH->MakeBranch("D");
100 RICH->SDigits2Digits(nev, particle_type);
ff34e3ab 101 }
ddae0931 102 } // event loop
103 file->Close();
e480e62b 104
105 //delete gAlice;
106 printf("\nEnd of Macro *************************************\n");
ddae0931 107}
108
109
110