1 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include <TClassTable.h>
6 #include <TGeoManager.h>
11 #include <TInterpreter.h>
12 #include "AliGeomManager.h"
13 #include "AliHeader.h"
15 #include "AliITSRecPointContainer.h"
16 #include "AliITSgeomTGeo.h"
17 #include "AliITSRecPoint.h"
21 Int_t ShowITSRecPoints(Int_t nevfordisp=0){
22 ///////////////////////////////////////////////////////////////////////
23 // Macro to check clusters in the 6 ITS layers //
25 // 6 canvases with 9 plots each (1 canvas for each layer) //
26 // 3 canvases with cluster XY coordinates for the first 3 events //
27 ///////////////////////////////////////////////////////////////////////
29 if (gClassTable->GetID("AliRun") < 0) {
30 gInterpreter->ExecuteMacro("loadlibs.C");
35 AliGeomManager::LoadGeometry("geometry.root");
38 AliRunLoader* rl = AliRunLoader::Open("galice.root");
40 cerr<<"Can not open session RL=NULL"<< endl;
44 AliITSLoader* ITSloader = (AliITSLoader*) rl->GetLoader("ITSLoader");
46 cerr<<"ITS loader not found"<<endl;
49 ITSloader->LoadRecPoints("read");
51 AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
53 Float_t cluglo[3]={0.,0.,0.};
55 Int_t totmod=AliITSgeomTGeo::GetNModules();
56 Int_t modmin=AliITSgeomTGeo::GetModuleIndex(1,1,1);
57 Int_t modmax=AliITSgeomTGeo::GetNModules()-1;
59 Float_t xlim[6]={4.5,7.5,16.,26.,40.,45.};
60 Float_t zlim[6]={15.,15.,22.,30.,45.,55.};
62 TH1F* hlayer=new TH1F("hlayer","",6,-0.5,5.5);
63 TH1F** hmod=new TH1F*[6];
64 TH1F** hxl=new TH1F*[6];
65 TH1F** hzl=new TH1F*[6];
66 TH1F** hxg=new TH1F*[6];
67 TH1F** hyg=new TH1F*[6];
68 TH1F** hzg=new TH1F*[6];
69 TH1F** hr=new TH1F*[6];
70 TH1F** hphi=new TH1F*[6];
71 TH2F** hzphi=new TH2F*[6];
72 TH1F** hq=new TH1F*[6];
73 TH1F** hdrtime=new TH1F*[6];
76 for(Int_t iLay=0;iLay<6;iLay++){
77 sprintf(name,"hmod%d",iLay+1);
78 hmod[iLay]=new TH1F(name,"",totmod,modmin-0.5,modmax+0.5);
79 hmod[iLay]->GetXaxis()->SetTitle("Module");
80 hmod[iLay]->GetXaxis()->CenterTitle();
81 sprintf(name,"hxloc%d",iLay+1);
82 hxl[iLay]=new TH1F(name,"",100,-4.,4.);
83 hxl[iLay]->GetXaxis()->SetTitle("Xloc (cm)");
84 hxl[iLay]->GetXaxis()->CenterTitle();
85 sprintf(name,"hzloc%d",iLay+1);
86 hzl[iLay]=new TH1F(name,"",100,-4.,4.);
87 hzl[iLay]->GetXaxis()->SetTitle("Zloc (cm)");
88 hzl[iLay]->GetXaxis()->CenterTitle();
89 sprintf(name,"hxgl%d",iLay+1);
90 hxg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
91 hxg[iLay]->GetXaxis()->SetTitle("Xglob (cm)");
92 hxg[iLay]->GetXaxis()->CenterTitle();
93 sprintf(name,"hygl%d",iLay+1);
94 hyg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
95 hyg[iLay]->GetXaxis()->SetTitle("Yglob (cm)");
96 hyg[iLay]->GetXaxis()->CenterTitle();
97 sprintf(name,"hzgl%d",iLay+1);
98 hzg[iLay]=new TH1F(name,"",100,-zlim[iLay],zlim[iLay]);
99 hzg[iLay]->GetXaxis()->SetTitle("Zglob (cm)");
100 hzg[iLay]->GetXaxis()->CenterTitle();
101 sprintf(name,"hr%d",iLay+1);
102 hr[iLay]=new TH1F(name,"",100,0.,50.);
103 hr[iLay]->GetXaxis()->SetTitle("r (cm)");
104 hr[iLay]->GetXaxis()->CenterTitle();
105 sprintf(name,"hphi%d",iLay+1);
106 hphi[iLay]=new TH1F(name,"",100,-TMath::Pi(),TMath::Pi());
107 hphi[iLay]->GetXaxis()->SetTitle("#varphi (rad)");
108 hphi[iLay]->GetXaxis()->CenterTitle();
109 sprintf(name,"hq%d",iLay+1);
110 hq[iLay]=new TH1F(name,"",100,0.,300.);
111 hq[iLay]->GetXaxis()->SetTitle("Charge (keV)");
112 hq[iLay]->GetXaxis()->CenterTitle();
113 sprintf(name,"hdtim%d",iLay+1);
114 hdrtime[iLay]=new TH1F(name,"",100,0.,7000.);
115 hdrtime[iLay]->GetXaxis()->SetTitle("Drift Time (ns)");
116 hdrtime[iLay]->GetXaxis()->CenterTitle();
117 sprintf(name,"hzphi%d",iLay+1);
118 hzphi[iLay]=new TH2F(name,Form("Layer %d",iLay+1),50,-TMath::Pi(),TMath::Pi(),50,-zlim[iLay],zlim[iLay]);
119 hzphi[iLay]->GetXaxis()->SetTitle("#varphi (rad)");
120 hzphi[iLay]->GetYaxis()->SetTitle("Zglob (cm)");
121 hzphi[iLay]->SetStats(0);
124 TGraph *gptsXY=new TGraph(0);
125 TGraph *gptsRZ=new TGraph(0);
127 Int_t totev=rl->GetNumberOfEvents();
128 printf("Total Number of events = %d\n",totev);
130 for(Int_t iev=0;iev<totev;iev++){
132 TTree *TR = ITSloader->TreeR();
133 rpcont->FetchClusters(0,TR);
134 TClonesArray *ITSrec = NULL;
135 if(iev%100==0) printf("Event #%d\n",iev);
139 for (Int_t mod=modmin; mod<=modmax; mod++){
140 ITSrec = rpcont->UncheckedGetClusters(mod);
141 Int_t nrecp = ITSrec->GetEntries();
143 for(Int_t irec=0;irec<nrecp;irec++) {
144 AliITSRecPoint *recp = (AliITSRecPoint*)ITSrec->At(irec);
145 Int_t lay=recp->GetLayer();
147 recp->GetGlobalXYZ(cluglo);
148 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
149 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
151 gptsXY->SetPoint(ipt,cluglo[0],cluglo[1]);
152 if(cluglo[1]>0) gptsRZ->SetPoint(ipt,cluglo[2],rad);
153 else gptsRZ->SetPoint(ipt,cluglo[2],-rad);
156 hmod[lay]->Fill(mod);
157 hzl[lay]->Fill(recp->GetDetLocalZ());
158 hxl[lay]->Fill(recp->GetDetLocalX());
159 hzg[lay]->Fill(cluglo[2]);
160 hyg[lay]->Fill(cluglo[1]);
161 hxg[lay]->Fill(cluglo[0]);
163 hphi[lay]->Fill(phi);
164 hq[lay]->Fill(recp->GetQ());
165 hdrtime[lay]->Fill(recp->GetDriftTime());
166 hzphi[lay]->Fill(phi,cluglo[2]);
172 TCanvas **c=new TCanvas*[6];
174 for(Int_t iLay=0;iLay<6;iLay++){
175 sprintf(name,"can%d",iLay+1);
176 sprintf(ctit,"Layer %d",iLay+1);
177 c[iLay]=new TCanvas(name,ctit,1200,900);
178 c[iLay]->Divide(3,3,0.001,0.001);
199 TCanvas* cdrtim=new TCanvas("cdrtim","SDD drift time",1000,600);
206 gStyle->SetPalette(1);
207 TLatex* tstat=new TLatex();
209 TCanvas* cspd=new TCanvas("cspd","SPD",1000,600);
212 hzphi[0]->Draw("colz");
213 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[0]->GetEntries())));
215 hzphi[1]->Draw("colz");
216 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[1]->GetEntries())));
218 TCanvas* csdd=new TCanvas("csdd","SDD",1000,600);
221 hzphi[2]->Draw("colz");
222 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[2]->GetEntries())));
224 hzphi[3]->Draw("colz");
225 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[3]->GetEntries())));
227 TCanvas* cssd=new TCanvas("cssd","SSD",1000,600);
230 hzphi[4]->Draw("colz");
231 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[4]->GetEntries())));
233 hzphi[5]->Draw("colz");
234 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[5]->GetEntries())));
237 sprintf(ctit,"Event %d XY",nevfordisp);
238 cev0=new TCanvas("cev0",ctit,600,600);
239 if(gptsXY->GetN()>0){
240 gptsXY->SetMarkerStyle(7);
243 gptsXY->GetXaxis()->SetTitle("Xglob");
244 gptsXY->GetYaxis()->SetTitle("Yglob");
248 sprintf(ctit,"Event %d Zr",nevfordisp);
249 cev1=new TCanvas("cev1",ctit,600,600);
250 if(gptsRZ->GetN()>0){
251 gptsRZ->SetMarkerStyle(7);
254 gptsRZ->GetXaxis()->SetTitle("Zglob");
255 gptsRZ->GetYaxis()->SetTitle("Radius");