1 #if !defined(__CINT__) || defined(__MAKECINT__)
7 #include<TClassTable.h>
8 #include<TClonesArray.h>
14 #include <TInterpreter.h>
15 #include <TGeoManager.h>
23 #include "AliCDBManager.h"
24 #include "AliGeomManager.h"
26 #include "AliITSgeomTGeo.h"
27 #include "AliITSDetTypeRec.h"
28 #include "AliITSRecPoint.h"
29 #include "AliITSRecPoint.h"
30 #include "AliITSdigit.h"
31 #include "AliITSdigitSSD.h"
32 #include "AliITShit.h"
33 #include "AliITSmodule.h"
34 #include "AliITSsegmentation.h"
35 #include "AliITSsegmentationSPD.h"
36 #include "AliITSsegmentationSDD.h"
37 #include "AliITSsegmentationSSD.h"
38 #include "AliRunLoader.h"
39 #include "AliITSLoader.h"
40 #include "AliHeader.h"
45 // macro to display the coordindates (local+global) and the energy deposit
52 AliCDBManager* man = AliCDBManager::Instance();
53 if (!man->IsDefaultStorageSet()) {
54 printf("Setting a local default storage and run number 0\n");
55 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
59 printf("Using deafult storage \n");
63 AliGeomManager::LoadGeometry("geometry.root");
65 AliGeomManager::ApplyAlignObjsFromCDB("ITS");
67 Int_t totmod=AliITSgeomTGeo::GetNModules();
68 Int_t modmin=AliITSgeomTGeo::GetModuleIndex(1,1,1);
69 Int_t modmax=AliITSgeomTGeo::GetNModules()-1;
71 Float_t xlim[6]={4.5,7.5,16.,26.,40.,45.};
72 Float_t zlim[6]={15.,15.,22.,30.,45.,55.};
74 TH1F* hlayer=new TH1F("hlayer","",6,-0.5,5.5);
75 TH1F** hmod=new TH1F*[6];
76 TH1F** hxl=new TH1F*[6];
77 TH1F** hzl=new TH1F*[6];
78 TH1F** hxg=new TH1F*[6];
79 TH1F** hyg=new TH1F*[6];
80 TH1F** hzg=new TH1F*[6];
81 TH1F** hr=new TH1F*[6];
82 TH1F** hphi=new TH1F*[6];
83 TH2F** hzphi=new TH2F*[6];
84 TH1F** hq=new TH1F*[6];
87 for(Int_t iLay=0;iLay<6;iLay++){
88 sprintf(name,"hmod%d",iLay+1);
89 hmod[iLay]=new TH1F(name,"",totmod,modmin-0.5,modmax+0.5);
90 hmod[iLay]->GetXaxis()->SetTitle("Module");
91 hmod[iLay]->GetXaxis()->CenterTitle();
92 sprintf(name,"hxloc%d",iLay+1);
93 hxl[iLay]=new TH1F(name,"",100,-4.,4.);
94 hxl[iLay]->GetXaxis()->SetTitle("Xloc (cm)");
95 hxl[iLay]->GetXaxis()->CenterTitle();
96 sprintf(name,"hzloc%d",iLay+1);
97 hzl[iLay]=new TH1F(name,"",100,-4.,4.);
98 hzl[iLay]->GetXaxis()->SetTitle("Zloc (cm)");
99 hzl[iLay]->GetXaxis()->CenterTitle();
100 sprintf(name,"hxgl%d",iLay+1);
101 hxg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
102 hxg[iLay]->GetXaxis()->SetTitle("Xglob (cm)");
103 hxg[iLay]->GetXaxis()->CenterTitle();
104 sprintf(name,"hygl%d",iLay+1);
105 hyg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
106 hyg[iLay]->GetXaxis()->SetTitle("Yglob (cm)");
107 hyg[iLay]->GetXaxis()->CenterTitle();
108 sprintf(name,"hzgl%d",iLay+1);
109 hzg[iLay]=new TH1F(name,"",100,-zlim[iLay],zlim[iLay]);
110 hzg[iLay]->GetXaxis()->SetTitle("Zglob (cm)");
111 hzg[iLay]->GetXaxis()->CenterTitle();
112 sprintf(name,"hr%d",iLay+1);
113 hr[iLay]=new TH1F(name,"",100,0.,50.);
114 hr[iLay]->GetXaxis()->SetTitle("r (cm)");
115 hr[iLay]->GetXaxis()->CenterTitle();
116 sprintf(name,"hphi%d",iLay+1);
117 hphi[iLay]=new TH1F(name,"",100,-TMath::Pi(),TMath::Pi());
118 hphi[iLay]->GetXaxis()->SetTitle("#varphi (rad)");
119 hphi[iLay]->GetXaxis()->CenterTitle();
120 sprintf(name,"hq%d",iLay+1);
121 hq[iLay]=new TH1F(name,"",100,0.,300.);
122 hq[iLay]->GetXaxis()->SetTitle("Charge (keV)");
123 hq[iLay]->GetXaxis()->CenterTitle();
124 sprintf(name,"hzphi%d",iLay+1);
125 hzphi[iLay]=new TH2F(name,Form("Layer %d",iLay+1),50,-TMath::Pi(),TMath::Pi(),50,-zlim[iLay],zlim[iLay]);
126 hzphi[iLay]->GetXaxis()->SetTitle("#varphi (rad)");
127 hzphi[iLay]->GetYaxis()->SetTitle("Zglob (cm)");
128 hzphi[iLay]->SetStats(0);
132 AliRunLoader* rl = AliRunLoader::Open("galice.root");
134 cerr<<"Can not open session RL=NULL"<< endl;
137 Int_t retval = rl->LoadgAlice();
139 cerr<<"LoadgAlice returned error"<<endl;
142 gAlice=rl->GetAliRun();
144 retval = rl->LoadHeader();
146 cerr<<"LoadHeader returned error"<<endl;
150 retval = rl->LoadKinematics();
152 cerr<<"LoadKinematics returned error"<<endl;
156 AliITSLoader* ITSloader = (AliITSLoader*) rl->GetLoader("ITSLoader");
158 cerr<<"ITS loader not found"<<endl;
162 ITSloader->LoadHits("read");
163 AliITS *ITS = (AliITS*)gAlice->GetModule("ITS");
164 ITS->SetTreeAddress();
165 Int_t totev=rl->GetNumberOfEvents();
167 for(Int_t iev=0; iev<totev; iev++){
171 TTree *TH = ITSloader->TreeH();
172 printf("Event %d Tracks %d\n",iev,(Int_t)TH->GetEntries());
176 ITS->InitModules(-1,nmodules);
177 ITS->FillModules(0,0,nmodules," "," ");
180 for (Int_t mod=modmin; mod<=modmax; mod++){
182 AliITSgeomTGeo::GetModuleId(mod,lay,lad,det);
186 AliITSmodule *modu = ITS->GetModule(mod);
187 TObjArray *arrHits = modu->GetHits();
188 Int_t nhits = arrHits->GetEntriesFast();
189 for (Int_t iHit=0;iHit<nhits;iHit++) {
190 AliITShit *hit = (AliITShit*) arrHits->At(iHit);
191 Int_t iMod=hit->GetModule();
193 Double_t xl,yl,zl,xl0,yl0,zl0;
194 Double_t xg,yg,zg,tof,xg0,yg0,zg0,tof0;
195 Float_t hitloc[3],hitglo[3];
196 hit->GetPositionL(xl,yl,zl,tof);
197 hit->GetPositionL0(xl0,yl0,zl0,tof0);
198 hit->GetPositionG(xg,yg,zg,tof);
199 hit->GetPositionG0(xg0,yg0,zg0,tof0);
200 Double_t hitlen=TMath::Abs(yl-yl0);
201 if(hitlen<0.005) continue; // remove hits "shorter" than 50 um
202 if(lay > 1 && hitlen<0.025) continue; // remove hits "shorter" than 250 um in SDD,SSD
203 hitloc[0]=0.5*(xl+xl0);
204 hitloc[1]=0.5*(yl+yl0);
205 hitloc[2]=0.5*(zl+zl0);
206 hitglo[0]=0.5*(xg+xg0);
207 hitglo[1]=0.5*(yg+yg0);
208 hitglo[2]=0.5*(zg+zg0);
209 Float_t edep=hit->GetIonization()*1000000;
210 Float_t rad=TMath::Sqrt(hitglo[0]*hitglo[0]+hitglo[1]*hitglo[1]);
211 Float_t phi=TMath::ATan2(hitglo[1],hitglo[0]);
212 hmod[lay]->Fill(iMod);
213 hzl[lay]->Fill(hitloc[2]);
214 hxl[lay]->Fill(hitloc[0]);
215 hzg[lay]->Fill(hitglo[2]);
216 hyg[lay]->Fill(hitglo[1]);
217 hxg[lay]->Fill(hitglo[0]);
219 hphi[lay]->Fill(phi);
221 hzphi[lay]->Fill(phi,hitglo[2]);
226 gStyle->SetOptStat(10);
227 gStyle->SetPadBottomMargin(0.14);
230 TCanvas **c=new TCanvas*[6];
232 for(Int_t iLay=0;iLay<6;iLay++){
233 sprintf(name,"can%d",iLay+1);
234 sprintf(ctit,"Layer %d",iLay+1);
235 c[iLay]=new TCanvas(name,ctit,1200,900);
236 c[iLay]->Divide(3,3,0.001,0.001);
257 gStyle->SetPalette(1);
258 TLatex* tstat=new TLatex();
260 TCanvas* cspd=new TCanvas("cspd","SPD",1000,600);
263 hzphi[0]->Draw("colz");
264 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[0]->GetEntries())));
266 hzphi[1]->Draw("colz");
267 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[1]->GetEntries())));
269 TCanvas* csdd=new TCanvas("csdd","SDD",1000,600);
272 hzphi[2]->Draw("colz");
273 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[2]->GetEntries())));
275 hzphi[3]->Draw("colz");
276 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[3]->GetEntries())));
278 TCanvas* cssd=new TCanvas("cssd","SSD",1000,600);
281 hzphi[4]->Draw("colz");
282 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[4]->GetEntries())));
284 hzphi[5]->Draw("colz");
285 tstat->DrawLatex(0.6,0.92,Form("# Clusters = %d",int(hzphi[5]->GetEntries())));