3 //__________________________________________________________________________
8 #include <Reve/TTreeTools.h>
10 #include "ITSDigitsInfo.h"
11 //#include <AliITSresponseSDD.h>
12 #include <AliITSCalibrationSDD.h>
13 #include <AliITSdigit.h>
14 #include <AliITSdigitSPD.h>
17 using namespace Alieve;
20 ClassImp(ITSDigitsInfo)
22 /**************************************************************************/
24 ITSDigitsInfo::ITSDigitsInfo() :
27 fSPDmap(), fSDDmap(), fSSDmap(),
30 fSegSPD(0), fSegSDD(0), fSegSSD(0)
33 /**************************************************************************/
35 ITSDigitsInfo:: ~ITSDigitsInfo()
37 map<Int_t, TClonesArray*>::iterator j;
38 for(j = fSPDmap.begin(); j != fSPDmap.end(); ++j)
40 for(j = fSDDmap.begin(); j != fSDDmap.end(); ++j)
42 for(j = fSSDmap.begin(); j != fSSDmap.end(); ++j)
45 delete fSegSPD; delete fSegSDD; delete fSegSSD;
50 /**************************************************************************/
52 void ITSDigitsInfo::SetTree(TTree* tree)
54 static const Exc_t eH("ITSDigitsInfo::SetTree ");
57 fGeom = new AliITSgeom();
58 fGeom->ReadNewFile("$REVESYS/alice-data/ITSgeometry.det");
60 throw(eH + "can not load ITS geometry \n");
67 // create tables for scaling
68 // lowest scale factor refers to unscaled ITS module
74 // spd lows resolution is in the level of 8x2 readout chips
75 Int_t nx = 8; // fSegSPD->Npx()/8; // 32
76 Int_t nz = 6; // fSegSPD->Npz()/2; // 128
78 fSPDScaleX[1] = Int_t(nx);
79 fSPDScaleZ[1] = Int_t(nz);
80 fSPDScaleX[2] = Int_t(nx*2);
81 fSPDScaleZ[2] = Int_t(nz*2);
82 fSPDScaleX[3] = Int_t(nx*3);
83 fSPDScaleZ[3] = Int_t(nz*3);
84 fSPDScaleX[4] = Int_t(nx*4);
85 fSPDScaleZ[4] = Int_t(nz*4);
103 // lowest scale factor refers unscaled ITS module
111 /**************************************************************************/
113 void ITSDigitsInfo::SetITSSegmentation()
116 fSegSPD = new AliITSsegmentationSPD(fGeom);
120 Float_t fZ1pitchSPD=0.0425; Float_t fZ2pitchSPD=0.0625;
123 fSPDZCoord[0]=fZ1pitchSPD -fHlSPD;
124 for (m=1; m<fNzSPD; m++) {
125 Double_t dz=fZ1pitchSPD;
126 if (m==31 || m==32 || m==63 || m==64 || m==95 || m==96 ||
127 m==127 || m==128) dz=fZ2pitchSPD;
128 fSPDZCoord[m]=fSPDZCoord[m-1]+dz;
131 for (m=0; m<fNzSPD; m++) {
132 Double_t dz=1.*fZ1pitchSPD;
133 if (m==31 || m==32 || m==63 || m==64 || m==95 || m==96 ||
134 m==127 || m==128) dz=1.*fZ2pitchSPD;
138 // end of SPD geometry
141 // response replaced by Calibration (March 2006).
142 AliITSresponseSDD* resp1 = new AliITSresponseSDD();
143 AliITSCalibrationSDD* cal1 = new AliITSCalibrationSDD;
144 cal1->SetResponse(resp1);
145 fSegSDD = new AliITSsegmentationSDD(fGeom, cal1);
148 fSegSSD = new AliITSsegmentationSSD(fGeom);
151 void ITSDigitsInfo::GetSPDLocalZ(Int_t j, Float_t& z)
156 /**************************************************************************/
158 TClonesArray* ITSDigitsInfo::GetDigits(Int_t mod, Int_t subdet)
162 TClonesArray* digitsSPD = 0;
163 map<Int_t, TClonesArray*>::iterator i = fSPDmap.find(mod);
164 if(i == fSPDmap.end()) {
165 fTree->SetBranchAddress("ITSDigitsSPD",&digitsSPD);
166 fTree->GetEntry(mod);
167 fSPDmap[mod] = digitsSPD;
175 TClonesArray* digitsSDD = 0;
176 map<Int_t, TClonesArray*>::iterator i = fSDDmap.find(mod);
177 if(i == fSDDmap.end()) {
178 fTree->SetBranchAddress("ITSDigitsSDD",&digitsSDD);
179 fTree->GetEntry(mod);
180 fSDDmap[mod] = digitsSDD;
188 TClonesArray* digitsSSD = 0;
189 map<Int_t, TClonesArray*>::iterator i = fSSDmap.find(mod);
190 if(i == fSSDmap.end()) {
191 fTree->SetBranchAddress("ITSDigitsSSD",&digitsSSD);
192 fTree->GetEntry(mod);
193 fSSDmap[mod] = digitsSSD;
207 /**************************************************************************/
209 void ITSDigitsInfo::Print(Option_t* ) const
211 printf("*********************************************************\n");
212 printf("SPD module dimension (%f,%f) \n",fSegSPD->Dx()*0.0001, fSegSPD->Dz()*0.0001);
213 printf("SPD first,last module:: %d,%d \n", fGeom->GetStartSPD(),fGeom->GetLastSPD() );
214 printf("SPD num cells per module (x::%d,z::%d)\n",fSegSPD->Npx(), fSegSPD->Npz());
216 printf("SPD dimesion of (%d,%d) in pixel(%f,%f) \n", ix,iz, fSegSPD->Dpx(ix), fSegSPD->Dpz(iz));
218 printf("SPD dimesion of pixel (%d,%d) are (%f,%f) \n", ix,iz, fSegSPD->Dpx(ix)*0.001, fSegSPD->Dpz(iz)*0.001);
220 printf("*********************************************************\n");
221 printf("SDD module dimension (%f,%f) \n",fSegSDD->Dx()*0.0001, fSegSDD->Dz()*0.0001);
222 printf("SDD first,last module:: %d,%d \n", fGeom->GetStartSDD(),fGeom->GetLastSDD() );
223 printf("SDD num cells per module (x::%d,z::%d)\n",fSegSDD->Npx(), fSegSDD->Npz());
224 printf("SDD dimesion of pixel are (%f,%f) \n", fSegSDD->Dpx(1)*0.001,fSegSDD->Dpz(1)*0.001);
225 printf("*********************************************************\n");
226 printf("SSD module dimension (%f,%f) \n",fSegSSD->Dx()*0.0001, fSegSSD->Dz()*0.0001);
227 printf("SSD first,last module:: %d,%d \n", fGeom->GetStartSSD(),fGeom->GetLastSSD() );
228 printf("SSD strips in module %d \n",fSegSSD->Npx());
229 printf("SSD strip sizes are (%f,%f) \n", fSegSSD->Dpx(1),fSegSSD->Dpz(1));
230 fSegSSD->SetLayer(5); Float_t ap,an; fSegSSD->Angles(ap,an);
231 printf("SSD layer 5 stereoP %f stereoN %f angle \n",ap,an);
232 fSegSSD->SetLayer(6); fSegSSD->Angles(ap,an);
233 printf("SSD layer 6 stereoP %f stereoN %f angle \n",ap,an);
238 printf("num cells %d,%d scaled %d,%d \n",fSegSPD->Npz(),fSegSPD->Npx(),Nz,Nx);
239 printf("%d digits in ITSModule %d\n",ne, module);
240 Float_t zn = i*(3.48*2)/Nz - 3.48 ;
241 Float_t xo = -fSegSPD->Dx()*0.00005 + fSegSPD->Dpx(0)*od->GetCoord2()*0.0001;
242 Float_t xn = -fSegSPD->Dx()*0.00005 + j*0.0001*fSegSPD->Dx()/Nx;
243 Float_t dpx = 0.0001*fSegSPD->Dx()/Nx;
244 Float_t dpz = 3.48*2/Nz;
245 printf("Z::original (%3f) scaled (%3f, %3f) \n", zo, zn-dpz/2, zn+dpz/2);
246 printf("X::original (%3f) scaled (%3f, %3f) \n", xo, xn-dpx/2, xn+dpx/2);
247 printf("%d,%d maped to %d,%d \n", od->GetCoord1(), od->GetCoord2(), i,j );