1 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include <TClassTable.h>
6 #include <TGeoManager.h>
8 #include <TInterpreter.h>
9 #include "AliGeomManager.h"
10 #include "AliHeader.h"
12 #include "AliITSDetTypeRec.h"
13 #include "AliITSgeomTGeo.h"
14 #include "AliITSRecPoint.h"
18 Int_t ShowITSRecPoints(Int_t nevfordisp=0){
19 ///////////////////////////////////////////////////////////////////////
20 // Macro to check clusters in the 6 ITS layers //
22 // 6 canvases with 9 plots each (1 canvas for each layer) //
23 // 3 canvases with cluster XY coordinates for the first 3 events //
24 ///////////////////////////////////////////////////////////////////////
26 if (gClassTable->GetID("AliRun") < 0) {
27 gInterpreter->ExecuteMacro("loadlibs.C");
32 AliGeomManager::LoadGeometry("geometry.root");
35 AliRunLoader* rl = AliRunLoader::Open("galice.root");
37 cerr<<"Can not open session RL=NULL"<< endl;
41 AliITSLoader* ITSloader = (AliITSLoader*) rl->GetLoader("ITSLoader");
43 cerr<<"ITS loader not found"<<endl;
46 ITSloader->LoadRecPoints("read");
48 Float_t cluglo[3]={0.,0.,0.};
49 AliITSDetTypeRec* detTypeRec = new AliITSDetTypeRec();
51 Int_t totmod=AliITSgeomTGeo::GetNModules();
52 Int_t modmin=AliITSgeomTGeo::GetModuleIndex(1,1,1);
53 Int_t modmax=AliITSgeomTGeo::GetNModules()-1;
55 Float_t xlim[6]={4.5,7.5,16.,26.,40.,45.};
56 Float_t zlim[6]={15.,15.,22.,30.,45.,55.};
58 TH1F* hlayer=new TH1F("hlayer","",6,-0.5,5.5);
59 TH1F** hmod=new TH1F*[6];
60 TH1F** hxl=new TH1F*[6];
61 TH1F** hzl=new TH1F*[6];
62 TH1F** hxg=new TH1F*[6];
63 TH1F** hyg=new TH1F*[6];
64 TH1F** hzg=new TH1F*[6];
65 TH1F** hr=new TH1F*[6];
66 TH1F** hphi=new TH1F*[6];
67 TH1F** hq=new TH1F*[6];
70 for(Int_t iLay=0;iLay<6;iLay++){
71 sprintf(name,"hmod%d",iLay+1);
72 hmod[iLay]=new TH1F(name,"",totmod,modmin-0.5,modmax+0.5);
73 hmod[iLay]->GetXaxis()->SetTitle("Module");
74 hmod[iLay]->GetXaxis()->CenterTitle();
75 sprintf(name,"hxloc%d",iLay+1);
76 hxl[iLay]=new TH1F(name,"",100,-4.,4.);
77 hxl[iLay]->GetXaxis()->SetTitle("Xloc (cm)");
78 hxl[iLay]->GetXaxis()->CenterTitle();
79 sprintf(name,"hzloc%d",iLay+1);
80 hzl[iLay]=new TH1F(name,"",100,-4.,4.);
81 hzl[iLay]->GetXaxis()->SetTitle("Zloc (cm)");
82 hzl[iLay]->GetXaxis()->CenterTitle();
83 sprintf(name,"hxgl%d",iLay+1);
84 hxg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
85 hxg[iLay]->GetXaxis()->SetTitle("Xglob (cm)");
86 hxg[iLay]->GetXaxis()->CenterTitle();
87 sprintf(name,"hygl%d",iLay+1);
88 hyg[iLay]=new TH1F(name,"",100,-xlim[iLay],xlim[iLay]);
89 hyg[iLay]->GetXaxis()->SetTitle("Yglob (cm)");
90 hyg[iLay]->GetXaxis()->CenterTitle();
91 sprintf(name,"hzgl%d",iLay+1);
92 hzg[iLay]=new TH1F(name,"",100,-zlim[iLay],zlim[iLay]);
93 hzg[iLay]->GetXaxis()->SetTitle("Zglob (cm)");
94 hzg[iLay]->GetXaxis()->CenterTitle();
95 sprintf(name,"hr%d",iLay+1);
96 hr[iLay]=new TH1F(name,"",100,0.,50.);
97 hr[iLay]->GetXaxis()->SetTitle("r (cm)");
98 hr[iLay]->GetXaxis()->CenterTitle();
99 sprintf(name,"hphi%d",iLay+1);
100 hphi[iLay]=new TH1F(name,"",100,-TMath::Pi(),TMath::Pi());
101 hphi[iLay]->GetXaxis()->SetTitle("#varphi (rad)");
102 hphi[iLay]->GetXaxis()->CenterTitle();
103 sprintf(name,"hq%d",iLay+1);
104 hq[iLay]=new TH1F(name,"",100,0.,300.);
105 hq[iLay]->GetXaxis()->SetTitle("Charge (keV)");
106 hq[iLay]->GetXaxis()->CenterTitle();
109 TGraph *gptsXY=new TGraph(0);
110 TGraph *gptsRZ=new TGraph(0);
112 Int_t totev=rl->GetNumberOfEvents();
113 printf("Total Number of events = %d\n",totev);
115 for(Int_t iev=0;iev<totev;iev++){
117 TTree *TR = ITSloader->TreeR();
118 TClonesArray *ITSrec = detTypeRec->RecPoints();
121 branch = ITSloader->TreeR()->GetBranch("ITSRecPoints");
122 if(branch)branch->SetAddress(&ITSrec);
124 Int_t nparticles = rl->GetHeader()->GetNtrack();
125 cout<<"Event #"<<iev<<" #Particles="<<nparticles<<endl;
129 for (Int_t mod=modmin; mod<=modmax; mod++){
130 detTypeRec->ResetRecPoints();
131 branch->GetEvent(mod);
132 Int_t nrecp = ITSrec->GetEntries();
134 for(Int_t irec=0;irec<nrecp;irec++) {
135 AliITSRecPoint *recp = (AliITSRecPoint*)ITSrec->At(irec);
136 Int_t lay=recp->GetLayer();
138 recp->GetGlobalXYZ(cluglo);
139 Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]);
140 Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
142 gptsXY->SetPoint(ipt,cluglo[0],cluglo[1]);
143 if(cluglo[1]>0) gptsRZ->SetPoint(ipt,cluglo[2],rad);
144 else gptsRZ->SetPoint(ipt,cluglo[2],-rad);
147 hmod[lay]->Fill(mod);
148 hzl[lay]->Fill(recp->GetDetLocalZ());
149 hxl[lay]->Fill(recp->GetDetLocalX());
150 hzg[lay]->Fill(cluglo[2]);
151 hyg[lay]->Fill(cluglo[1]);
152 hxg[lay]->Fill(cluglo[0]);
154 hphi[lay]->Fill(phi);
155 hq[lay]->Fill(recp->GetQ());
161 TCanvas **c=new TCanvas*[6];
163 for(Int_t iLay=0;iLay<6;iLay++){
164 sprintf(name,"can%d",iLay+1);
165 sprintf(ctit,"Layer %d",iLay+1);
166 c[iLay]=new TCanvas(name,ctit,1200,900);
167 c[iLay]->Divide(3,3,0.001,0.001);
189 sprintf(ctit,"Event %d XY",nevfordisp);
190 cev0=new TCanvas("cev0",ctit,600,600);
191 if(gptsXY->GetN()>0){
192 gptsXY->SetMarkerStyle(7);
195 gptsXY->GetXaxis()->SetTitle("Xglob");
196 gptsXY->GetYaxis()->SetTitle("Yglob");
200 sprintf(ctit,"Event %d Zr",nevfordisp);
201 cev1=new TCanvas("cev1",ctit,600,600);
202 if(gptsRZ->GetN()>0){
203 gptsRZ->SetMarkerStyle(7);
206 gptsRZ->GetXaxis()->SetTitle("Zglob");
207 gptsRZ->GetYaxis()->SetTitle("Radius");