]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RICH/AliRICHDisplFast.cxx
Zero suppression added. Sigmas of noise generated randomly.
[u/mrichter/AliRoot.git] / RICH / AliRICHDisplFast.cxx
CommitLineData
6b17b320 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16#include "AliRICH.h"
17#include "AliRICHDisplFast.h"
18#include "AliRICHParam.h"
19#include <AliLoader.h>
6b17b320 20#include <TCanvas.h>
21#include <TParticle.h>
22#include <TStyle.h>
6b17b320 23#include <TH2.h>
24#include <TMath.h>
6b17b320 25
aed240d4 26ClassImp(AliRICHDisplFast)
6b17b320 27
aed240d4 28//__________________________________________________________________________________________________
29void AliRICHDisplFast::Exec()
6b17b320 30{
aed240d4 31 TH2F *pHitsH2 = new TH2F("pHitsH2" , "Event Display",165,-AliRICHParam::PcSizeY()/2,AliRICHParam::PcSizeY()/2,
32 144,-AliRICHParam::PcSizeX()/2,AliRICHParam::PcSizeX()/2);
33 pHitsH2->SetStats(kFALSE);
34 TH2F *pDigitsH2 = new TH2F("pDigitsH2" ,"Event Display",165,-AliRICHParam::PcSizeY()/2,AliRICHParam::PcSizeY()/2,
35 144,-AliRICHParam::PcSizeX()/2,AliRICHParam::PcSizeX()/2);
36 TH2F *pClustersH2 = new TH2F("pClustersH2","Event Display",165,-AliRICHParam::PcSizeY()/2,AliRICHParam::PcSizeY()/2,
37 144,-AliRICHParam::PcSizeX()/2,AliRICHParam::PcSizeX()/2);
38
39 TCanvas *Display = new TCanvas("Display","RICH Display",0,0,600,600);
6b17b320 40
c94cc386 41 gStyle->SetPalette(1);
42
6b17b320 43 AliRICH *pRich = (AliRICH*)gAlice->GetDetector("RICH");
c94cc386 44 pRich->GetLoader()->LoadRecPoints();
6b17b320 45 pRich->GetLoader()->LoadDigits();
6b17b320 46 pRich->GetLoader()->LoadHits();
aed240d4 47 for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){//events Loop
48 pRich->GetLoader()->GetRunLoader()->GetEvent(iEventN);
49 pRich->GetLoader()->TreeD()->GetEntry(0);
50 pRich->GetLoader()->TreeR()->GetEntry(0);
6b17b320 51
c94cc386 52
aed240d4 53 Int_t nPrimaries = (Int_t)pRich->GetLoader()->TreeH()->GetEntries();
54 TObjArray * Hits = new TObjArray[nPrimaries];
6b17b320 55
aed240d4 56 for(Int_t i=0;i<nPrimaries;i++) {
57 pRich->GetLoader()->TreeH()->GetEntry(i);
58 Int_t nHits = pRich->Hits()->GetEntries();
59 for(Int_t k=0;k<nHits;k++) Hits[i].Add(pRich->Hits()->At(k));
60
6b17b320 61 }
6b17b320 62
aed240d4 63 for(Int_t iChamber=1;iChamber<=7;iChamber++){//modules loop
6b17b320 64
aed240d4 65 Int_t nDigits = pRich->Digits(iChamber)->GetEntries();
c94cc386 66 Int_t nClusters = pRich->Clusters(iChamber)->GetEntries();
6b17b320 67
aed240d4 68 pHitsH2->Reset(); pDigitsH2->Reset(); pClustersH2->Reset();
6b17b320 69
c712cb2f 70 Double_t xpad,ypad;
6b17b320 71
aed240d4 72 for(Int_t i=0;i<nPrimaries;i++){//prims loop
6b17b320 73 pRich->GetLoader()->TreeH()->GetEntry(i);
74 Int_t nHits = pRich->Hits()->GetEntries();
aed240d4 75 for(Int_t j=0;j<nHits;j++){//hits loop
6b17b320 76 AliRICHhit *pHit = (AliRICHhit*)Hits[i].At(j);
aed240d4 77 if(pHit->C()==iChamber){
6b17b320 78 TVector3 xyzhit(pHit->X(),pHit->Y(),pHit->Z());
c712cb2f 79 TVector3 hitlocal = pRich->C(iChamber)->Glob2Loc(xyzhit);
aed240d4 80 pHitsH2->Fill(hitlocal.X(),hitlocal.Y(),200);
81 }//if
82 }//hits loop
83 }//prims loop
c94cc386 84
aed240d4 85 for(Int_t j=0;j<nDigits;j++){//digits loop
86 AliRICHdigit *pDigit = (AliRICHdigit*)pRich->Digits(iChamber)->At(j);
87 AliRICHParam::Pad2Loc(pDigit->X(),pDigit->Y(),xpad,ypad);
88 pDigitsH2->Fill(xpad,ypad,100);
89 }//digits loop
c94cc386 90
aed240d4 91 for(Int_t j=0;j<nClusters;j++){//clusters loop
92 AliRICHcluster *pCluster = (AliRICHcluster*)pRich->Clusters(iChamber)->At(j);
93 pClustersH2->Fill(pCluster->X(),pCluster->Y(),50);
94 }//clusters loop
95
96 pHitsH2->SetTitle(Form("event %i module %2i",iEventN,iChamber));
97 pHitsH2->SetMarkerColor(kRed); pHitsH2->SetMarkerStyle(29); pHitsH2->SetMarkerSize(0.4);
98 pHitsH2->Draw();
6b17b320 99 Display->Update();
100 Display->Modified();
6b17b320 101 getchar();
aed240d4 102
103 pDigitsH2->SetMarkerColor(kGreen); pDigitsH2->SetMarkerStyle(29); pDigitsH2->SetMarkerSize(0.4);
104 pDigitsH2->Draw("same");
6b17b320 105 Display->Update();
aed240d4 106 Display->Modified();
6b17b320 107 getchar();
aed240d4 108
109 pClustersH2->SetMarkerColor(kBlue); pClustersH2->SetMarkerStyle(29); pClustersH2->SetMarkerSize(0.4);
110 pClustersH2->Draw("same");
c94cc386 111 Display->Update();
112 Display->Modified();
113 getchar();
aed240d4 114 }//modules loop
115 delete [] Hits;
116 }////events Loop
117 pRich->GetLoader()->UnloadRecPoints();
118 pRich->GetLoader()->UnloadDigits();
119 pRich->GetLoader()->UnloadHits();
120}//Exec()
121//__________________________________________________________________________________________________