1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 #include "AliRICHDisplFast.h"
18 #include "AliRICHParam.h"
19 #include <AliLoader.h>
20 #include <Riostream.h>
22 #include <TParticle.h>
30 #define NPointsOfRing 201
32 // Geometry of the RICH at Star...
34 static const Int_t nPadX = AliRICHParam::NpadsY();
35 static const Int_t nPadY = AliRICHParam::NpadsX();
36 static const Float_t PadSizeX = AliRICHParam::PadSizeY();
37 static const Float_t PadSizeY = AliRICHParam::PadSizeX();
38 static const Float_t spacer = AliRICHParam::DeadZone();
39 static const Float_t degree = 180/3.1415926535;
41 static const Float_t pi = TMath::Pi();
43 static const Float_t RadiatorWidth = AliRICHParam::FreonThickness();
44 static const Float_t QuartzWidth = AliRICHParam::QuartzThickness();
45 static const Float_t GapWidth = AliRICHParam::RadiatorToPads();
47 static const Float_t Xmin = -AliRICHParam::PcSizeY()/2.;
48 static const Float_t Xmax = AliRICHParam::PcSizeY()/2.;
49 static const Float_t Ymin = -AliRICHParam::PcSizeX()/2.;
50 static const Float_t Ymax = AliRICHParam::PcSizeX()/2.;
53 AliRICHDisplFast::AliRICHDisplFast()
57 void AliRICHDisplFast::Display()
62 TH2F *h2_disp = new TH2F("h2_disp" ,"STAR-RICH Event Display",165,Xmin,Xmax,144,Ymin,Ymax);
63 TH2F *gHitsH2 = new TH2F("gHitsH2" ,"STAR-RICH Event Display",165,Xmin,Xmax,144,Ymin,Ymax);
64 TH2F *h2_dispad = new TH2F("h2_dispad","STAR-RICH Event Display",161,0.,161.,145,0.,145.);
65 TH2F *gClustersH2 = new TH2F("gClusH2" ,"STAR-RICH Event Display",165,Xmin,Xmax,144,Ymin,Ymax);
67 TCanvas *Display = new TCanvas("Display","Star Display",0,0,800,800);
71 gStyle->SetPalette(1);
73 AliRICH *pRich = (AliRICH*)gAlice->GetDetector("RICH");
74 pRich->GetLoader()->LoadRecPoints();
75 pRich->GetLoader()->LoadDigits();
76 pRich->GetLoader()->LoadHits();
77 pRich->GetLoader()->TreeD()->GetEntry(0);
78 pRich->GetLoader()->TreeR()->GetEntry(0);
80 cout << " start to display..." << endl;
82 Int_t nPrimaries = (Int_t)pRich->GetLoader()->TreeH()->GetEntries();
83 TObjArray Hits[nPrimaries];
85 for(Int_t i=0;i<nPrimaries;i++) {
86 pRich->GetLoader()->TreeH()->GetEntry(i);
87 Int_t nHits = pRich->Hits()->GetEntries();
88 for(Int_t k=0;k<nHits;k++) {
89 Hits[i].Add(pRich->Hits()->At(k));
93 for(Int_t iChamber=1;iChamber<=7;iChamber++) {
95 Int_t nDigits = pRich->Digits(iChamber)->GetEntries();
96 Int_t nClusters = pRich->Clusters(iChamber)->GetEntries();
98 Display->ToggleEventStatus();
101 text = new TText(0,0,"");
102 text->SetTextFont(61);
103 text->SetTextSize(0.03);
104 text->SetTextAlign(22);
106 // Display->Resize();
110 gClustersH2->Reset();
111 // h2_dispad->Reset();
115 for(Int_t i=0;i<nPrimaries;i++) {
116 pRich->GetLoader()->TreeH()->GetEntry(i);
117 Int_t nHits = pRich->Hits()->GetEntries();
119 for(Int_t j=0;j<nHits;j++) {
121 AliRICHhit *pHit = (AliRICHhit*)Hits[i].At(j);
122 cout << " chamber " << iChamber << " hit n. " << j << " ch " << pHit->Chamber() << endl;
123 if(pHit->C()==iChamber) {
124 TVector3 xyzhit(pHit->X(),pHit->Y(),pHit->Z());
125 TVector3 hitlocal = pRich->C(iChamber)->Glob2Loc(xyzhit);
126 gHitsH2->Fill(hitlocal.X(),hitlocal.Y());
132 for(Int_t j=0;j<nDigits;j++)
134 AliRICHdigit *pDigit = (AliRICHdigit*)pRich->Digits(iChamber)->At(j);
135 AliRICHParam::Pad2Loc(pDigit->X(),pDigit->Y(),xpad,ypad);
136 Float_t charge = (Float_t)pDigit->Q();
137 h2_disp->Fill(xpad,ypad,charge);
138 h2_dispad->Fill(pDigit->X(),pDigit->Y(),pDigit->Q());
142 for(Int_t j=0;j<nClusters;j++)
144 AliRICHcluster *pCluster = (AliRICHcluster*)pRich->Clusters(iChamber)->At(j);
145 // gClustersH2->Fill(pCluster->X(),pCluster->Y(),pCluster->Q());
146 gClustersH2->Fill(pCluster->X(),pCluster->Y(),100);
152 cout << " -----------------" << endl;
158 h2_disp->SetMaximum(200);
159 h2_disp->SetStats(0);
160 h2_disp->Draw("colz");
161 h2_disp->SetTitle(Form("Chamber %2i",iChamber));
164 h2_dispad->SetTitle(Form("Chamber %2i",iChamber));
165 h2_dispad->SetMaximum(200);
166 h2_dispad->SetStats(0);
167 h2_dispad->Draw("colz");
173 gHitsH2->SetTitle(Form("Chamber %2i",iChamber));
174 gHitsH2->SetMarkerColor(kBlue);
175 gHitsH2->SetMarkerStyle(29);
176 gHitsH2->SetMarkerSize(0.4);
177 gHitsH2->Draw("same");
182 gClustersH2->SetTitle(Form("Chamber %2i",iChamber));
183 gClustersH2->SetMarkerColor(kBlue);
184 gClustersH2->SetMarkerStyle(29);
185 gClustersH2->SetMarkerSize(0.4);
186 gClustersH2->Draw("same");