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 "AliITSDetTypeRec.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 Float_t cluglo[3]={0.,0.,0.};
52 AliITSDetTypeRec* detTypeRec = new AliITSDetTypeRec();
54 Int_t totmod=AliITSgeomTGeo::GetNModules();
55 Int_t modmin=AliITSgeomTGeo::GetModuleIndex(1,1,1);
56 Int_t modmax=AliITSgeomTGeo::GetNModules()-1;
58 Float_t xlim[6]={4.5,7.5,16.,26.,40.,45.};
59 Float_t zlim[6]={15.,15.,22.,30.,45.,55.};
61 TH1F* hlayer=new TH1F("hlayer","",6,-0.5,5.5);
62 TH1F** hmod=new TH1F*[6];
63 TH1F** hxl=new TH1F*[6];
64 TH1F** hzl=new TH1F*[6];
65 TH1F** hxg=new TH1F*[6];
66 TH1F** hyg=new TH1F*[6];
67 TH1F** hzg=new TH1F*[6];
68 TH1F** hr=new TH1F*[6];
69 TH1F** hphi=new TH1F*[6];
70 TH2F** hzphi=new TH2F*[6];
71 TH1F** hq=new TH1F*[6];
72 TH1F** hdrtime=new TH1F*[6];
75 for(Int_t iLay=0;iLay<6;iLay++){
76 sprintf(name,"hmod%d",iLay+1);
77 hmod[iLay]=new TH1F(name,"",totmod,modmin-0.5,modmax+0.5);
78 hmod[iLay]->GetXaxis()->SetTitle("Module");
79 hmod[iLay]->GetXaxis()->CenterTitle();
80 sprintf(name,"hxloc%d",iLay+1);
81 hxl[iLay]=new TH1F(name,"",100,-4.,4.);
82 hxl[iLay]->GetXaxis()->SetTitle("Xloc (cm)");
83 hxl[iLay]->GetXaxis()->CenterTitle();
84 sprintf(name,"hzloc%d",iLay+1);
85 hzl[iLay]=new TH1F(name,"",100,-4.,4.);
86 hzl[iLay]->GetXaxis()->SetTitle("Zloc (cm)");
87 hzl[iLay]->GetXaxis()->CenterTitle();
88 sprintf(name,"hxgl%d",iLay+1);
89 hxg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
90 hxg[iLay]->GetXaxis()->SetTitle("Xglob (cm)");
91 hxg[iLay]->GetXaxis()->CenterTitle();
92 sprintf(name,"hygl%d",iLay+1);
93 hyg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
94 hyg[iLay]->GetXaxis()->SetTitle("Yglob (cm)");
95 hyg[iLay]->GetXaxis()->CenterTitle();
96 sprintf(name,"hzgl%d",iLay+1);
97 hzg[iLay]=new TH1F(name,"",100,-zlim[iLay],zlim[iLay]);
98 hzg[iLay]->GetXaxis()->SetTitle("Zglob (cm)");
99 hzg[iLay]->GetXaxis()->CenterTitle();
100 sprintf(name,"hr%d",iLay+1);
101 hr[iLay]=new TH1F(name,"",100,0.,50.);
102 hr[iLay]->GetXaxis()->SetTitle("r (cm)");
103 hr[iLay]->GetXaxis()->CenterTitle();
104 sprintf(name,"hphi%d",iLay+1);
105 hphi[iLay]=new TH1F(name,"",100,-TMath::Pi(),TMath::Pi());
106 hphi[iLay]->GetXaxis()->SetTitle("#varphi (rad)");
107 hphi[iLay]->GetXaxis()->CenterTitle();
108 sprintf(name,"hq%d",iLay+1);
109 hq[iLay]=new TH1F(name,"",100,0.,300.);
110 hq[iLay]->GetXaxis()->SetTitle("Charge (keV)");
111 hq[iLay]->GetXaxis()->CenterTitle();
112 sprintf(name,"hdtim%d",iLay+1);
113 hdrtime[iLay]=new TH1F(name,"",100,0.,7000.);
114 hdrtime[iLay]->GetXaxis()->SetTitle("Drift Time (ns)");
115 hdrtime[iLay]->GetXaxis()->CenterTitle();
116 sprintf(name,"hzphi%d",iLay+1);
117 hzphi[iLay]=new TH2F(name,Form("Layer %d",iLay+1),50,-TMath::Pi(),TMath::Pi(),50,-zlim[iLay],zlim[iLay]);
118 hzphi[iLay]->GetXaxis()->SetTitle("#varphi (rad)");
119 hzphi[iLay]->GetYaxis()->SetTitle("Zglob (cm)");
120 hzphi[iLay]->SetStats(0);
123 TGraph *gptsXY=new TGraph(0);
124 TGraph *gptsRZ=new TGraph(0);
126 Int_t totev=rl->GetNumberOfEvents();
127 printf("Total Number of events = %d\n",totev);
129 for(Int_t iev=0;iev<totev;iev++){
131 TTree *TR = ITSloader->TreeR();
132 TClonesArray *ITSrec = detTypeRec->RecPoints();
135 branch = ITSloader->TreeR()->GetBranch("ITSRecPoints");
136 if(branch)branch->SetAddress(&ITSrec);
138 if(iev%100==0) printf("Event #%d\n",iev);
142 for (Int_t mod=modmin; mod<=modmax; mod++){
143 detTypeRec->ResetRecPoints();
144 branch->GetEvent(mod);
145 Int_t nrecp = ITSrec->GetEntries();
147 for(Int_t irec=0;irec<nrecp;irec++) {
148 AliITSRecPoint *recp = (AliITSRecPoint*)ITSrec->At(irec);
149 Int_t lay=recp->GetLayer();
151 recp->GetGlobalXYZ(cluglo);
152 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
153 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
155 gptsXY->SetPoint(ipt,cluglo[0],cluglo[1]);
156 if(cluglo[1]>0) gptsRZ->SetPoint(ipt,cluglo[2],rad);
157 else gptsRZ->SetPoint(ipt,cluglo[2],-rad);
160 hmod[lay]->Fill(mod);
161 hzl[lay]->Fill(recp->GetDetLocalZ());
162 hxl[lay]->Fill(recp->GetDetLocalX());
163 hzg[lay]->Fill(cluglo[2]);
164 hyg[lay]->Fill(cluglo[1]);
165 hxg[lay]->Fill(cluglo[0]);
167 hphi[lay]->Fill(phi);
168 hq[lay]->Fill(recp->GetQ());
169 hdrtime[lay]->Fill(recp->GetDriftTime());
170 hzphi[lay]->Fill(phi,cluglo[2]);
176 TCanvas **c=new TCanvas*[6];
178 for(Int_t iLay=0;iLay<6;iLay++){
179 sprintf(name,"can%d",iLay+1);
180 sprintf(ctit,"Layer %d",iLay+1);
181 c[iLay]=new TCanvas(name,ctit,1200,900);
182 c[iLay]->Divide(3,3,0.001,0.001);
203 TCanvas* cdrtim=new TCanvas("cdrtim","SDD drift time",1000,600);
210 gStyle->SetPalette(1);
211 TLatex* tstat=new TLatex();
213 TCanvas* cspd=new TCanvas("cspd","SPD",1000,600);
216 hzphi[0]->Draw("colz");
217 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[0]->GetEntries())));
219 hzphi[1]->Draw("colz");
220 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[1]->GetEntries())));
222 TCanvas* csdd=new TCanvas("csdd","SDD",1000,600);
225 hzphi[2]->Draw("colz");
226 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[2]->GetEntries())));
228 hzphi[3]->Draw("colz");
229 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[3]->GetEntries())));
231 TCanvas* cssd=new TCanvas("cssd","SSD",1000,600);
234 hzphi[4]->Draw("colz");
235 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[4]->GetEntries())));
237 hzphi[5]->Draw("colz");
238 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[5]->GetEntries())));
241 sprintf(ctit,"Event %d XY",nevfordisp);
242 cev0=new TCanvas("cev0",ctit,600,600);
243 if(gptsXY->GetN()>0){
244 gptsXY->SetMarkerStyle(7);
247 gptsXY->GetXaxis()->SetTitle("Xglob");
248 gptsXY->GetYaxis()->SetTitle("Yglob");
252 sprintf(ctit,"Event %d Zr",nevfordisp);
253 cev1=new TCanvas("cev1",ctit,600,600);
254 if(gptsRZ->GetN()>0){
255 gptsRZ->SetMarkerStyle(7);
258 gptsRZ->GetXaxis()->SetTitle("Zglob");
259 gptsRZ->GetYaxis()->SetTitle("Radius");