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 for(map<Int_t, TClonesArray*>::iterator j=fSPDmap.begin(); j!=fSPDmap.end(); ++j) {
40 for(map<Int_t, TClonesArray*>::iterator j=fSDDmap.begin(); j!=fSDDmap.end(); ++j) {
43 for(map<Int_t, TClonesArray*>::iterator j=fSSDmap.begin(); j!=fSSDmap.end(); ++j) {
46 delete fSegSPD; delete fSegSDD; delete fSegSSD;
51 /**************************************************************************/
53 void ITSDigitsInfo::SetTree(TTree* tree)
55 static const Exc_t eH("ITSDigitsInfo::SetTree ");
58 fGeom = new AliITSgeom();
59 fGeom->ReadNewFile("$REVESYS/alice-data/ITSgeometry.det");
61 throw(eH + "can not load ITS geometry \n");
68 // create tables for scaling
69 // lowest scale factor refers unscaled ITS module
75 // spd lows rsolution is in the level of 8x2 redaut chips
76 Int_t nx = 8; // fSegSPD->Npx()/8; // 32
77 Int_t nz = 6; // fSegSPD->Npz()/2; // 128
79 fSPDScaleX[1] = Int_t(nx);
80 fSPDScaleZ[1] = Int_t(nz);
81 fSPDScaleX[2] = Int_t(nx*2);
82 fSPDScaleZ[2] = Int_t(nz*2);
83 fSPDScaleX[3] = Int_t(nx*3);
84 fSPDScaleZ[3] = Int_t(nz*3);
85 fSPDScaleX[4] = Int_t(nx*4);
86 fSPDScaleZ[4] = Int_t(nz*4);
104 // lowest scale factor refers unscaled ITS module
112 /**************************************************************************/
114 void ITSDigitsInfo::SetITSSegmentation()
117 fSegSPD = new AliITSsegmentationSPD(fGeom);
121 Float_t fZ1pitchSPD=0.0425; Float_t fZ2pitchSPD=0.0625;
124 fSPDZCoord[0]=fZ1pitchSPD -fHlSPD;
125 for (m=1; m<fNzSPD; m++) {
126 Double_t dz=fZ1pitchSPD;
127 if (m==31 || m==32 || m==63 || m==64 || m==95 || m==96 ||
128 m==127 || m==128) dz=fZ2pitchSPD;
129 fSPDZCoord[m]=fSPDZCoord[m-1]+dz;
132 for (m=0; m<fNzSPD; m++) {
133 Double_t dz=1.*fZ1pitchSPD;
134 if (m==31 || m==32 || m==63 || m==64 || m==95 || m==96 ||
135 m==127 || m==128) dz=1.*fZ2pitchSPD;
139 // end of SPD geometry
142 // response replaced by Calibration (March 2006).
143 AliITSresponseSDD* resp1 = new AliITSresponseSDD();
144 AliITSCalibrationSDD* cal1 = new AliITSCalibrationSDD;
145 cal1->SetResponse(resp1);
146 fSegSDD = new AliITSsegmentationSDD(fGeom, cal1);
149 fSegSSD = new AliITSsegmentationSSD(fGeom);
152 void ITSDigitsInfo::GetSPDLocalZ(Int_t j, Float_t& z)
157 /**************************************************************************/
159 TClonesArray* ITSDigitsInfo::GetDigits(Int_t mod, Int_t subdet)
163 TClonesArray* digitsSPD = 0;
164 map<Int_t, TClonesArray*>::iterator i = fSPDmap.find(mod);
165 if(i == fSPDmap.end()) {
166 fTree->SetBranchAddress("ITSDigitsSPD",&digitsSPD);
167 fTree->GetEntry(mod);
168 fSPDmap[mod] = digitsSPD;
177 TClonesArray* digitsSDD = 0;
178 map<Int_t, TClonesArray*>::iterator i = fSDDmap.find(mod);
179 if(i == fSDDmap.end()) {
180 fTree->SetBranchAddress("ITSDigitsSDD",&digitsSDD);
181 fTree->GetEntry(mod);
182 fSDDmap[mod] = digitsSDD;
191 TClonesArray* digitsSSD = 0;
192 map<Int_t, TClonesArray*>::iterator i = fSSDmap.find(mod);
193 if(i == fSSDmap.end()) {
194 fTree->SetBranchAddress("ITSDigitsSSD",&digitsSSD);
195 fTree->GetEntry(mod);
196 fSSDmap[mod] = digitsSSD;
211 /**************************************************************************/
213 void ITSDigitsInfo::Print(Option_t* ) const
215 printf("*********************************************************\n");
216 printf("SPD module dimension (%f,%f) \n",fSegSPD->Dx()*0.0001, fSegSPD->Dz()*0.0001);
217 printf("SPD first,last module:: %d,%d \n", fGeom->GetStartSPD(),fGeom->GetLastSPD() );
218 printf("SPD num cells per module (x::%d,z::%d)\n",fSegSPD->Npx(), fSegSPD->Npz());
220 printf("SPD dimesion of (%d,%d) in pixel(%f,%f) \n", ix,iz, fSegSPD->Dpx(ix), fSegSPD->Dpz(iz));
222 printf("SPD dimesion of pixel (%d,%d) are (%f,%f) \n", ix,iz, fSegSPD->Dpx(ix)*0.001, fSegSPD->Dpz(iz)*0.001);
224 printf("*********************************************************\n");
225 printf("SDD module dimension (%f,%f) \n",fSegSDD->Dx()*0.0001, fSegSDD->Dz()*0.0001);
226 printf("SDD first,last module:: %d,%d \n", fGeom->GetStartSDD(),fGeom->GetLastSDD() );
227 printf("SDD num cells per module (x::%d,z::%d)\n",fSegSDD->Npx(), fSegSDD->Npz());
228 printf("SDD dimesion of pixel are (%f,%f) \n", fSegSDD->Dpx(1)*0.001,fSegSDD->Dpz(1)*0.001);
229 printf("*********************************************************\n");
230 printf("SSD module dimension (%f,%f) \n",fSegSSD->Dx()*0.0001, fSegSSD->Dz()*0.0001);
231 printf("SSD first,last module:: %d,%d \n", fGeom->GetStartSSD(),fGeom->GetLastSSD() );
232 printf("SSD strips in module %d \n",fSegSSD->Npx());
233 printf("SSD strip sizes are (%f,%f) \n", fSegSSD->Dpx(1),fSegSSD->Dpz(1));
234 fSegSSD->SetLayer(5); Float_t ap,an; fSegSSD->Angles(ap,an);
235 printf("SSD layer 5 stereoP %f stereoN %f angle \n",ap,an);
236 fSegSSD->SetLayer(6); fSegSSD->Angles(ap,an);
237 printf("SSD layer 6 stereoP %f stereoN %f angle \n",ap,an);
242 printf("num cells %d,%d scaled %d,%d \n",fSegSPD->Npz(),fSegSPD->Npx(),Nz,Nx);
243 printf("%d digits in ITSModule %d\n",ne, module);
244 Float_t zn = i*(3.48*2)/Nz - 3.48 ;
245 Float_t xo = -fSegSPD->Dx()*0.00005 + fSegSPD->Dpx(0)*od->GetCoord2()*0.0001;
246 Float_t xn = -fSegSPD->Dx()*0.00005 + j*0.0001*fSegSPD->Dx()/Nx;
247 Float_t dpx = 0.0001*fSegSPD->Dx()/Nx;
248 Float_t dpz = 3.48*2/Nz;
249 printf("Z::original (%3f) scaled (%3f, %3f) \n", zo, zn-dpz/2, zn+dpz/2);
250 printf("X::original (%3f) scaled (%3f, %3f) \n", xo, xn-dpx/2, xn+dpx/2);
251 printf("%d,%d maped to %d,%d \n", od->GetCoord1(), od->GetCoord2(), i,j );