]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/RICHdigit.C
Re-definition of IntPH() to accomodate for wire sag effect.
[u/mrichter/AliRoot.git] / RICH / RICHdigit.C
1 // 0 = all
2 // 1 = not pion
3 // 2 = not kaon
4 // 3 = not proton
5 // 4 = not muon
6 // 5 = not electron
7 // 6 = not neutron
8
9
10 Int_t particle_type=0;
11
12 #include "iostream.h"
13
14 void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0) 
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
25    
26   if (gClassTable->GetID("AliRun") < 0) {
27       gROOT->LoadMacro("loadlibs.C");
28       loadlibs();
29   }else {
30     delete gAlice;
31     gAlice = 0;
32   }
33   
34   galice=0;
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");
41 //   file->ls();
42 // Get AliRun object from file or create it if not on file
43
44    
45
46    if (gClassTable->GetID("AliRun") < 0) {
47         gROOT->LoadMacro("loadlibs.C");
48         loadlibs();
49     }
50
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");
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       
63    AliRICH *RICH  = (AliRICH*) gAlice->GetDetector("RICH");
64
65    AliRICHChamber*       iChamber;
66    
67    printf("Generating tresholds...\n");
68
69    for(Int_t i=0;i<7;i++)
70      {
71        iChamber = &(RICH->Chamber(i));
72        iChamber->GenerateTresholds();
73      }
74    
75 //
76 // Event Loop
77 //
78    for (int nev=0; nev<= evNumber2; nev++) {
79        Int_t nparticles = gAlice->GetEvent(nev);
80        cout <<endl<< "Processing event:" <<nev<<endl;
81        cout << "Particles       :" <<nparticles<<endl;
82        if (nev < evNumber1) continue;
83        if (nparticles <= 0) return;
84        if (RICH) 
85          {
86            gAlice->MakeTree("D");
87            RICH->MakeBranch("D");
88            RICH->Digitise(nev, particle_type);
89          }
90        //if (RICH) gAlice->SDigits2Digits("RICH");
91        //char hname[30];
92        //sprintf(hname,"TreeD%d",nev);
93        //gAlice->TreeD()->Write(hname);
94        //gAlice->TreeD()->Reset();
95    } // event loop 
96    file->Close();
97
98    //delete gAlice;
99    printf("\nEnd of Macro  *************************************\n");
100 }
101
102
103
104
105
106
107
108
109
110
111
112
113
114