1 void RICHchamberView (Int_t evNumber=0, Int_t ChamberView = 3)
4 /////////////////////////////////////////////////////////////////////////
6 gClassTable->GetID("AliRun");
9 // Dynamically link some shared libs
11 if (gClassTable->GetID("AliRun") < 0) {
12 gROOT->LoadMacro("loadlibs.C");
21 // Connect the Root Galice file containing Geometry, Kine and Hits
23 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
24 if (!file) file = new TFile("galice.root","UPDATE");
26 // Get AliRun object from file or create it if not on file
29 gAlice = (AliRun*)file->Get("gAlice");
30 if (gAlice) printf("AliRun object found on file %d \n",gAlice);
31 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
35 gAlice = (AliRun*)file->Get("gAlice");
36 if (gAlice) printf("AliRun object found on file\n");
37 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
40 TH2F *ChView = new TH2F("ChView","RICH DISPLAY",160,0,160,144,0,144);
42 gStyle->SetPalette(1);
44 TCanvas *view = new TCanvas("Display","ALICE RICH Display",0,0,1200,750);
48 ChView->SetMaximum(100);
50 Int_t Nevents = gAlice->GetEventsPerRun();
52 printf(" Events in Run: %d\n",Nevents);
54 Int_t ich = ChamberView - 1;
56 AliRICH *RICH = (AliRICH*)gAlice->GetDetector("RICH");
58 AliRICHSegmentationV0* segmentation;
59 AliRICHChamber* chamber;
61 chamber = &(RICH->Chamber(ich));
62 segmentation=(AliRICHSegmentationV0*) chamber->GetSegmentationModel(ich);
64 Int_t NpadX = segmentation->Npx(); // number of pads on X
65 Int_t NpadY = segmentation->Npy(); // number of pads on Y
67 printf(" NpadX: %d NpadY: %d \n",NpadX,NpadY);
69 // Start loop over events
71 for (int nev=evNumber; nev<= Nevents; nev++) {
73 Int_t nparticles = gAlice->GetEvent(nev);
75 if (nparticles == -1) break;
77 printf("Particles:%d\n",nparticles);
79 gAlice->ResetDigits();
81 gAlice->TreeD()->GetEvent(0);
83 printf("gAlice D: %x\n",gAlice);
85 TClonesArray *Digits = RICH->DigitsAddress(ich); // Raw clusters branch
87 Int_t ndigits = Digits->GetEntriesFast();
89 printf("Digits:%d %d\n",Digits,ndigits);
91 for (Int_t hit=0;hit<ndigits;hit++) {
93 AliRICHDigit *dHit = (AliRICHDigit*) Digits->UncheckedAt(hit);
95 // printf(" dHit %d\n",dHit);
97 Int_t qtot = dHit->Signal(); // charge
98 Int_t ipx = dHit->PadX() + NpadX/2; // pad number on X
99 Int_t ipy = dHit->PadY() + NpadY/2; // pad number on Y
101 ChView -> Fill((Float_t)ipx,(Float_t)ipy,(Float_t)qtot);
103 // printf(" X: %d Y: %d Q: %d\n",ipx,ipy,qtot);
109 gAlice->TreeR()->GetEvent(0);
110 Int_t nent=(Int_t)gAlice->TreeR()->GetEntries();
111 printf("ich: %d nent: %d\n",ich,nent);
112 gAlice->TreeR()->GetEvent(nent-1);
114 TClonesArray *RecRings = RICH->RecHitsAddress1D(ich);
116 printf(" Ring Pointer: %x\n",RecRings);
118 Int_t nRecRings = RecRings->GetEntriesFast();
120 printf(" nRings: %d\n",nRecRings);
123 for (Int_t ring=0;ring<nRecRings;ring++) {
125 AliRICHRecHit1D *recHit1D = (AliRICHRecHit1D*) RecRings->UncheckedAt(ring);
127 printf(" Pointer to PatRec: %d \n",recHit1D);
129 Float_t r_omega = recHit1D->fOmega; // Cerenkov angle
130 Float_t *cer_pho = recHit1D->fCerPerPhoton; // Cerenkov angle per photon
131 Int_t *padsx = recHit1D->fPadsUsedX; // Pads Used fo reconstruction (x)
132 Int_t *padsy = recHit1D->fPadsUsedY; // Pads Used fo reconstruction (y)
133 Int_t goodPhotons = recHit1D->fGoodPhotons; // Number of pads used for reconstruct
135 printf(" Theta Cerenkov %d : %f NgoodPhotons: %d\n",ring,r_omega,goodPhotons);
139 ChView->Draw("colz");
144 gSystem->Sleep(1000);
152 printf("\nEnd of macro\n");
153 printf("**********************************\n");