]>
Commit | Line | Data |
---|---|---|
2b680d9b | 1 | /************************************************************************** |
effd7456 | 2 | * Copyright(c) 2007-2008, ALICE Experiment at CERN, All rights reserved. * |
2b680d9b | 3 | * * |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
effd7456 | 16 | |
b7943f00 | 17 | //************************************************************************ |
effd7456 | 18 | // |
b7943f00 | 19 | // Inner Traking System geometry v11 |
20 | // | |
21 | // Based on ROOT geometrical modeler | |
b7943f00 | 22 | // |
23 | // B. Nilsen, L. Gaudichet | |
24 | //************************************************************************ | |
25 | ||
26 | ||
541f7ba6 | 27 | #include <TClonesArray.h> |
2b680d9b | 28 | #include <TLorentzVector.h> |
b7943f00 | 29 | |
30 | #include "AliITS.h" | |
531d6cdc | 31 | #include "AliITSDetTypeSim.h" |
7a82301d | 32 | #include <TVirtualMC.h> |
33 | ||
b7943f00 | 34 | #include "AliITSgeom.h" |
35 | #include "AliITSgeomSDD.h" | |
36 | #include "AliITSgeomSPD.h" | |
37 | #include "AliITSgeomSSD.h" | |
38 | #include "AliITShit.h" | |
531d6cdc | 39 | |
40 | #include "AliITSCalibrationSDD.h" | |
531d6cdc | 41 | |
2b680d9b | 42 | #include "AliITSsegmentationSDD.h" |
b7943f00 | 43 | #include "AliITSsegmentationSPD.h" |
44 | #include "AliITSsegmentationSSD.h" | |
b7943f00 | 45 | #include "AliMagF.h" |
46 | #include "AliRun.h" | |
47 | #include "AliTrackReference.h" | |
48 | #include "AliMC.h" | |
49 | ||
50 | #include <TGeoManager.h> | |
51 | #include <TGeoVolume.h> | |
52 | #include <TGeoPcon.h> | |
108bd0fe | 53 | #include "AliITSv11.h" |
54c9a3d9 | 54 | #include "AliITSv11GeometrySPD.h" |
db486a6e | 55 | #include "AliITSv11GeometrySDD.h" |
54c9a3d9 | 56 | #include "AliITSv11GeometrySSD.h" |
57 | #include "AliITSv11GeometrySupport.h" | |
171f3f35 | 58 | |
2b680d9b | 59 | |
541f7ba6 | 60 | |
b7943f00 | 61 | ClassImp(AliITSv11) |
62 | ||
fa4639a3 | 63 | |
64 | ||
33ddec7d | 65 | //______________________________________________________________________ |
012f0f4c | 66 | AliITSv11::AliITSv11() : |
67 | AliITS(), | |
68 | fGeomDetOut(kFALSE), | |
69 | fGeomDetIn(kFALSE), | |
70 | fByThick(kTRUE), | |
71 | fMajorVersion(IsVersion()), | |
72 | fMinorVersion(0), | |
73 | fEuclidGeomDet(), | |
74 | fRead(), | |
75 | fWrite(), | |
54c9a3d9 | 76 | fSPDgeom(), |
012f0f4c | 77 | fSDDgeom(0), |
54c9a3d9 | 78 | fSSDgeom(), |
79 | fSupgeom(), | |
012f0f4c | 80 | fIgm(kv11) |
33ddec7d | 81 | { |
b7943f00 | 82 | // Standard default constructor for the ITS version 11. |
f7315efc | 83 | |
531d6cdc | 84 | fIdN = 0; |
85 | fIdName = 0; | |
86 | fIdSens = 0; | |
531d6cdc | 87 | Int_t i; |
88 | for(i=0;i<60;i++) fRead[i] = '\0'; | |
89 | for(i=0;i<60;i++) fWrite[i] = '\0'; | |
90 | for(i=0;i<60;i++) fEuclidGeomDet[i] = '\0'; | |
91 | strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60); | |
2b680d9b | 92 | } |
b7943f00 | 93 | |
fa4639a3 | 94 | |
95 | //______________________________________________________________________ | |
012f0f4c | 96 | AliITSv11::AliITSv11(const char *name, const char *title): |
97 | AliITS("ITS", title), | |
98 | fGeomDetOut(kFALSE), | |
99 | fGeomDetIn(kFALSE), | |
100 | fByThick(kTRUE), | |
101 | fMajorVersion(IsVersion()), | |
102 | fMinorVersion(0), | |
103 | fEuclidGeomDet(), | |
104 | fRead(), | |
105 | fWrite(), | |
54c9a3d9 | 106 | fSPDgeom(), |
012f0f4c | 107 | fSDDgeom(0), |
54c9a3d9 | 108 | fSSDgeom(), |
109 | fSupgeom(), | |
012f0f4c | 110 | fIgm(kv11) |
33ddec7d | 111 | { |
fa4639a3 | 112 | // Standard constructor for the ITS version 11. |
113 | ||
531d6cdc | 114 | fSDDgeom = new AliITSv11GeometrySDD(0); |
fa4639a3 | 115 | |
116 | Int_t i; | |
531d6cdc | 117 | fIdN = 6; |
118 | fIdName = new TString[fIdN]; | |
119 | fIdName[0] = name; // removes warning message | |
120 | fIdName[0] = "ITS1"; | |
121 | fIdName[1] = "ITS2"; | |
108bd0fe | 122 | fIdName[2] = fSDDgeom->GetSenstiveVolumeName3(); |
123 | fIdName[3] = fSDDgeom->GetSenstiveVolumeName4(); | |
531d6cdc | 124 | fIdName[4] = "ITS5"; |
125 | fIdName[5] = "ITS6"; | |
fa4639a3 | 126 | fIdSens = new Int_t[fIdN]; |
531d6cdc | 127 | for(i=0;i<fIdN;i++) fIdSens[i] = 0; |
33ddec7d | 128 | // not needed, fByThick set to kTRUE in in the member initialization lis |
531d6cdc | 129 | |
33ddec7d | 130 | |
531d6cdc | 131 | fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.euc"; |
132 | strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det",60); | |
133 | strncpy(fRead,fEuclidGeomDet,60); | |
134 | strncpy(fWrite,fEuclidGeomDet,60); | |
135 | strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60); | |
fa4639a3 | 136 | } |
2b680d9b | 137 | //______________________________________________________________________ |
db486a6e | 138 | AliITSv11::AliITSv11(Int_t debugITS,Int_t debugSPD,Int_t debugSDD, |
b7943f00 | 139 | Int_t debugSSD,Int_t debugSUP) : |
012f0f4c | 140 | AliITS("ITS","ITS geometry v11"), |
141 | fGeomDetOut(kFALSE), | |
142 | fGeomDetIn(kFALSE), | |
143 | fByThick(kTRUE), | |
144 | fMajorVersion(IsVersion()), | |
145 | fMinorVersion(0), | |
146 | fEuclidGeomDet(), | |
147 | fRead(), | |
148 | fWrite(), | |
54c9a3d9 | 149 | fSPDgeom(), |
012f0f4c | 150 | fSDDgeom(0), |
54c9a3d9 | 151 | fSSDgeom(), |
152 | fSupgeom(), | |
012f0f4c | 153 | fIgm(kv11) |
154 | { | |
b7943f00 | 155 | // Standard default constructor for the ITS version 11. |
b7943f00 | 156 | |
b7943f00 | 157 | |
531d6cdc | 158 | // fSPDgeom = new AliITSv11GeometrySPD(debugSPD); |
159 | fSDDgeom = new AliITSv11GeometrySDD(debugSDD); | |
160 | fSDDgeom->SetDebug(debugSDD); | |
161 | // fSupgeom = new AliITSv11GeometrySupport(debugSUP); | |
162 | ||
163 | Int_t i; | |
164 | fIdN = 6; | |
165 | fIdName = new TString[fIdN]; | |
54c9a3d9 | 166 | fIdName[0] = fSPDgeom->GetSenstiveVolumeName1(); |
167 | fIdName[1] = fSPDgeom->GetSenstiveVolumeName2(); | |
108bd0fe | 168 | fIdName[2] = fSDDgeom->GetSenstiveVolumeName3(); |
169 | fIdName[3] = fSDDgeom->GetSenstiveVolumeName4(); | |
54c9a3d9 | 170 | fIdName[4] = fSSDgeom->GetSenstiveVolumeName5(); |
171 | fIdName[5] = fSSDgeom->GetSenstiveVolumeName6(); | |
531d6cdc | 172 | fIdSens = new Int_t[fIdN]; |
173 | for(i=0;i<fIdN;i++) fIdSens[i] = 0; | |
174 | fEuclidOut = kFALSE; // Don't write Euclide file | |
531d6cdc | 175 | |
b7943f00 | 176 | fEuclidGeometry="$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.euc"; |
177 | strncpy(fEuclidGeomDet,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det",60); | |
178 | strncpy(fRead,fEuclidGeomDet,60); | |
179 | strncpy(fWrite,fEuclidGeomDet,60); | |
180 | strncpy(fRead,"$ALICE_ROOT/ITS/ITSgeometry_vPPRasymmFMD.det",60); | |
181 | ||
fa4639a3 | 182 | debugITS = (debugSPD && debugSSD && debugSUP && debugSDD); //remove temp. warnings |
162acd47 | 183 | } |
dfefbaec | 184 | //______________________________________________________________________ |
b7943f00 | 185 | AliITSv11::~AliITSv11() { |
186 | delete fSDDgeom; | |
187 | } | |
b7943f00 | 188 | //______________________________________________________________________ |
189 | void AliITSv11::BuildGeometry(){ | |
190 | ||
2b680d9b | 191 | } |
192 | //______________________________________________________________________ | |
aa9bc63b | 193 | void AliITSv11::CreateGeometry(){ |
012f0f4c | 194 | // |
195 | // Create ROOT geometry | |
196 | // | |
197 | // These constant character strings are set by cvs during commit | |
198 | // do not change them unless you know what you are doing! | |
199 | const Char_t *cvsDate="$Date$"; | |
200 | const Char_t *cvsRevision="$Revision$"; | |
201 | ||
202 | TGeoManager *geoManager = gGeoManager; | |
203 | TGeoVolume *vALIC = geoManager->GetTopVolume(); | |
204 | ||
205 | TGeoPcon *sITS = new TGeoPcon("ITS Top Volume",0.0,360.0,2); | |
206 | ||
207 | // DefineSection(section number, Z, Rmin, Rmax). | |
208 | const Double_t kcm = 1.0; | |
209 | sITS->DefineSection(0,-300.0*kcm,0.01*kcm,50.0*kcm); | |
210 | sITS->DefineSection(1,+300.0*kcm,0.01*kcm,50.0*kcm); | |
211 | ||
212 | TGeoMedium *air = gGeoManager->GetMedium("ITS_AIR$"); | |
213 | TGeoVolume *vITS = new TGeoVolume("ITSV",sITS,air); | |
214 | vITS->SetVisibility(kFALSE); | |
215 | const Int_t length=100; | |
216 | Char_t vstrng[length]; | |
217 | if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(), | |
218 | fMinorVersion,cvsDate,cvsRevision)) | |
219 | vITS->SetTitle(vstrng); | |
220 | //printf("Title set to %s\n",vstrng); | |
221 | vALIC->AddNode(vITS,1,0); | |
b7943f00 | 222 | |
223 | // fSPDgeom->CenteralSPD(vITS); | |
fa4639a3 | 224 | |
b7943f00 | 225 | fSDDgeom->Layer3(vITS); |
226 | fSDDgeom->Layer4(vITS); | |
fa4639a3 | 227 | |
b7943f00 | 228 | // fSupgeom->SPDCone(vITS); |
229 | // fSupgeom->SPDThermalSheald(vITS); | |
230 | // fSupgeom->SDDCone(vITS); | |
231 | // fSupgeom->SSDCone(vITS); | |
232 | // fSupgeom->ServicesCableSupport(vITS); | |
233 | ||
541f7ba6 | 234 | } |
235 | //______________________________________________________________________ | |
236 | void AliITSv11::CreateMaterials(){ | |
54c9a3d9 | 237 | // Create Standard ITS Materials |
238 | // Inputs: | |
239 | // none. | |
240 | // Outputs: | |
241 | // none. | |
242 | // Return: | |
243 | // none. | |
531d6cdc | 244 | |
531d6cdc | 245 | |
54c9a3d9 | 246 | // |
247 | fSPDgeom->AliITSv11Geometry::CreateDefaultMaterials(); | |
248 | // Detector specific material definistions | |
249 | fSPDgeom->CreateMaterials(); | |
250 | fSDDgeom->CreateMaterials(); | |
251 | fSSDgeom->CreateMaterials(); | |
252 | fSupgeom->CreateMaterials(); | |
dfefbaec | 253 | } |
012f0f4c | 254 | /* |
dfefbaec | 255 | //______________________________________________________________________ |
256 | void AliITSv11::InitAliITSgeom(){ | |
b7943f00 | 257 | // |
258 | // Fill fITSgeom with the 3 sub-detector geometries | |
259 | // | |
260 | ||
108bd0fe | 261 | if (gGeoManager) gGeoManager->Export("geometry.root"); |
262 | ||
531d6cdc | 263 | const Int_t knlayers = 6; |
264 | const Int_t kndeep = 3; | |
108bd0fe | 265 | const AliITSDetector kidet[knlayers]={kSPD,kSPD,kSDD,kSDD,kSSD,kSSD}; |
266 | const TString knames[knlayers] = { | |
267 | "AliITSv11:spd missing", // lay=1 | |
268 | "AliITSv11:spd missing", // lay=2 | |
531d6cdc | 269 | "/ALIC_1/ITSV_1/ITSsddLayer3_1/ITSsddLadd_%d/ITSsddSensor_%d/ITSsddWafer_%d", // lay=3 |
270 | "/ALIC_1/ITSV_1/ITSsddLayer4_1/ITSsddLadd_%d/ITSsddSensor_%d/ITSsddWafer_%d", // lay=4 | |
108bd0fe | 271 | "AliITSv11:ssd missing", // lay=5 |
272 | "AliITSv11:ssd missing" // lay=6 | |
273 | }; | |
274 | ||
275 | const Int_t kitsGeomTreeCopys[knlayers][kndeep]= {{10, 2, 4},// lay=1 | |
276 | {10, 4, 4}, // lay=2 | |
277 | {14, 6, 1}, // lay=3 | |
278 | {22, 8, 1}, // lay=4 | |
279 | {34,22, 1}, // lay=5 | |
280 | {38,25, 1}};// lay=6 | |
531d6cdc | 281 | Int_t nlad[knlayers],ndet[knlayers]; |
282 | Int_t mod,lay,lad=0,det=0,i,j,k,cp0,cp1,cp2; | |
283 | TString path,shapeName; | |
284 | TGeoHMatrix materix; | |
285 | Double_t trans[3]={3*0.0},rot[10]={9*0.0,1.0}; | |
286 | TArrayD shapePar; | |
287 | TArrayF shapeParF; | |
108bd0fe | 288 | Bool_t shapeDefined[3]={kFALSE,kFALSE,kFALSE}; |
531d6cdc | 289 | |
290 | AliDebug(1,"Reading Geometry transformation directly from Modler."); | |
291 | mod = 0; | |
292 | for(i=0;i<knlayers;i++){ | |
293 | k = 1; | |
108bd0fe | 294 | for(j=0;j<kndeep;j++) if(kitsGeomTreeCopys[i][j]!=0) |
295 | k *= TMath::Abs(kitsGeomTreeCopys[i][j]); | |
531d6cdc | 296 | mod += k; |
297 | } // end for i | |
298 | ||
531d6cdc | 299 | SetITSgeom(0); |
300 | nlad[0]=20;nlad[1]=40;nlad[2]=14;nlad[3]=22;nlad[4]=34;nlad[5]=38; | |
301 | ndet[0]= 4;ndet[1]= 4;ndet[2]= 6;ndet[3]= 8;ndet[4]=22;ndet[5]=25; | |
302 | AliITSgeom* geom = new AliITSgeom(0,6,nlad,ndet,mod); | |
303 | SetITSgeom(geom); | |
304 | mod = 0; | |
305 | for(lay=1;lay<=knlayers;lay++){ | |
108bd0fe | 306 | |
307 | for(cp0=0; cp0<kitsGeomTreeCopys[lay-1][0]; cp0++){ | |
308 | for(cp1=0; cp1<kitsGeomTreeCopys[lay-1][1]; cp1++){ | |
309 | for(cp2=1; cp2<=kitsGeomTreeCopys[lay-1][2]; cp2++){ | |
310 | ||
311 | path.Form(knames[lay-1].Data(), | |
531d6cdc | 312 | cp0,cp1,cp2); |
313 | switch (lay){ | |
314 | case 1:{ | |
315 | det = cp2; | |
316 | lad = cp1+2*(cp0-1); | |
317 | }break; | |
318 | case 2:{ | |
319 | det = cp2; | |
320 | lad = cp1+4*(cp0-1); | |
321 | } break; | |
322 | case 3: case 4: case 5: case 6:{ | |
323 | det = cp1; | |
324 | lad = cp0; | |
325 | } break; | |
326 | } // end switch | |
327 | //AliInfo(Form("path=%s lay=%d lad=%d det=%d", | |
328 | // path.Data(),lay,lad,det)); | |
329 | gMC->GetTransformation(path.Data(),materix); | |
330 | gMC->GetShape(path.Data(),shapeName,shapePar); | |
331 | shapeParF.Set(shapePar.GetSize()); | |
332 | for(i=0;i<shapePar.GetSize();i++) shapeParF[i]=shapePar[i]; | |
108bd0fe | 333 | geom->CreateMatrix(mod,lay,lad,det,kidet[lay-1],trans,rot); |
531d6cdc | 334 | geom->SetTrans(mod,materix.GetTranslation()); |
335 | geom->SetRotMatrix(mod,materix.GetRotationMatrix()); | |
108bd0fe | 336 | geom->GetGeomMatrix(mod)->SetPath(path.Data()); |
531d6cdc | 337 | switch (lay){ |
108bd0fe | 338 | case 1: case 2: |
339 | if(!shapeDefined[kSPD]){ | |
531d6cdc | 340 | geom->ReSetShape(kSPD,new AliITSgeomSPD425Short( |
341 | shapeParF.GetSize(),shapeParF.GetArray())); | |
108bd0fe | 342 | shapeDefined[kSPD] = kTRUE; |
531d6cdc | 343 | }break; |
108bd0fe | 344 | case 3: case 4: |
345 | if(!shapeDefined[kSDD]){ | |
531d6cdc | 346 | geom->ReSetShape(kSDD,new AliITSgeomSDD256( |
347 | shapeParF.GetSize(),shapeParF.GetArray())); | |
108bd0fe | 348 | shapeDefined[kSDD] = kTRUE; |
531d6cdc | 349 | }break; |
108bd0fe | 350 | case 5: case 6: |
351 | if(!shapeDefined[kSSD]){ | |
531d6cdc | 352 | geom->ReSetShape(kSSD,new AliITSgeomSSD75and275( |
353 | shapeParF.GetSize(),shapeParF.GetArray())); | |
108bd0fe | 354 | shapeDefined[kSSD] = kTRUE; |
531d6cdc | 355 | }break; |
356 | default:{ | |
357 | }break; | |
358 | } // end switch | |
359 | mod++; | |
360 | } /// end for cp2 | |
361 | } // end for cp1 | |
362 | } // end for cp0 | |
363 | } // end for lay | |
531d6cdc | 364 | |
365 | // fSDDgeom->ExportSensorGeometry(GetITSgeom(), +3, 0); //SDD | |
dfefbaec | 366 | } |
012f0f4c | 367 | */ |
dfefbaec | 368 | //______________________________________________________________________ |
369 | void AliITSv11::Init(){ | |
b7943f00 | 370 | // |
371 | // Initialise the ITS after it has been created. | |
372 | // | |
373 | ||
531d6cdc | 374 | //AliInfo(Form("Minor version %d",fMinorVersion)); |
375 | // | |
012f0f4c | 376 | UpdateInternalGeometry(); |
377 | AliITS::Init(); | |
378 | if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); | |
379 | ||
380 | // | |
381 | /* | |
b7943f00 | 382 | if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); |
383 | if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); | |
531d6cdc | 384 | if(GetITSgeom()!=0) SetITSgeom(0x0); |
385 | AliITSgeom* geom = new AliITSgeom(); | |
386 | SetITSgeom(geom); | |
387 | if(fGeomDetIn) GetITSgeom()->ReadNewFile(fRead); | |
b7943f00 | 388 | else this->InitAliITSgeom(); |
531d6cdc | 389 | if(fGeomDetOut) GetITSgeom()->WriteNewFile(fWrite); |
b7943f00 | 390 | AliITS::Init(); |
012f0f4c | 391 | */ // |
dfefbaec | 392 | } |
b7943f00 | 393 | |
108bd0fe | 394 | // //______________________________________________________________________ |
395 | // void AliITSv11::SetDefaults(){ | |
396 | // // | |
397 | // // Set response ans segmentation models for SPD, SDD and SSD | |
398 | // // | |
399 | // const Float_t kconv = 1.0e+04; // convert cm to microns | |
400 | // AliInfo("Called"); | |
401 | ||
402 | // if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); | |
403 | // fDetTypeSim->SetITSgeom(GetITSgeom()); | |
404 | ||
405 | // AliITSgeomSPD *s0; | |
406 | // AliITSgeomSDD *s1; | |
407 | // AliITSgeomSSD *s2; | |
408 | // Int_t i; | |
409 | // Float_t bx[256],bz[280]; | |
410 | ||
411 | // fDetTypeSim->ResetCalibrationArray(); | |
412 | // fDetTypeSim->ResetSegmentation(); | |
413 | // fDetTypeSim->SetDefaults(); | |
414 | ||
415 | // //SPD | |
416 | // s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. Do it this way for now. | |
417 | // AliITSsegmentationSPD* seg0 = (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0); | |
418 | // seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD | |
419 | // s0->GetDz()*2.*kconv, // for now. | |
420 | // s0->GetDy()*2.*kconv); // x,z,y full width in microns. | |
421 | // seg0->SetNPads(256,160);// Number of Bins in x and z | |
422 | // for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns. | |
423 | // for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below | |
424 | // for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector. | |
425 | // bz[ 31] = bz[ 32] = 625.0; // first chip boundry | |
426 | // bz[ 63] = bz[ 64] = 625.0; // first chip boundry | |
427 | // bz[ 95] = bz[ 96] = 625.0; // first chip boundry | |
428 | // bz[127] = bz[128] = 625.0; // first chip boundry | |
429 | // bz[160] = 425.0; // Set so that there is no zero pixel size for fNz. | |
430 | // seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now. | |
431 | // SetSegmentationModel(kSPD,seg0); | |
432 | // // set digit and raw cluster classes to be used | |
433 | // const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()))->DataType(); | |
434 | // if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit"); | |
435 | // else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD"); | |
436 | ||
437 | ||
438 | ||
439 | // // SDD | |
440 | // s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now. | |
441 | // AliITSsegmentationSDD* seg1 = (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1); | |
442 | // seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD | |
443 | // s1->GetDz()*2.*kconv, // for now. | |
444 | // s1->GetDy()*2.*kconv); // x,z,y full width in microns. | |
445 | // seg1->SetNPads(256,256);// Use AliITSgeomSDD for now | |
446 | // SetSegmentationModel(kSDD,seg1); | |
447 | // const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType(); | |
448 | // AliITSCalibrationSDD* rsp = (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()); | |
449 | // const char *kopt=rsp->GetZeroSuppOption(); | |
450 | // if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){ | |
451 | // fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit"); | |
452 | // } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD"); | |
453 | ||
454 | ||
455 | // // SSD | |
456 | // s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now. | |
457 | // AliITSsegmentationSSD* seg2 = (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2); | |
458 | // seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD | |
459 | // s2->GetDz()*2.*kconv, // for now. | |
460 | // s2->GetDy()*2.*kconv); // x,z,y full width in microns. | |
461 | // seg2->SetPadSize(95.,0.); // strip x pitch in microns | |
462 | // seg2->SetNPads(768,0); // number of strips on each side. | |
463 | // seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side. | |
464 | // seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side. | |
465 | // seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side. | |
466 | // SetSegmentationModel(kSSD,seg2); | |
467 | // const char *kData2=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType(); | |
468 | // if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit"); | |
469 | // else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD"); | |
470 | // if(fgkNTYPES>3){ | |
471 | // Warning("SetDefaults", | |
472 | // "Only the four basic detector types are initialised!"); | |
473 | // }// end if | |
474 | ||
475 | ||
476 | // return; | |
477 | // } | |
478 | ||
479 | ||
dfefbaec | 480 | //______________________________________________________________________ |
481 | void AliITSv11::SetDefaults(){ | |
b7943f00 | 482 | // |
108bd0fe | 483 | // Set response and segmentation models for SPD, SDD and SSD |
b7943f00 | 484 | // |
531d6cdc | 485 | const Float_t kconv = 1.0e+04; // convert cm to microns |
486 | AliInfo("Called"); | |
b7943f00 | 487 | |
108bd0fe | 488 | // if(!fDetTypeSim) fDetTypeSim = new AliITSDetTypeSim(); |
489 | // fDetTypeSim->SetITSgeom(GetITSgeom()); | |
490 | if(!fDetTypeSim) { | |
491 | Warning("SetDefaults","Error fDetTypeSim not defined"); | |
492 | return; | |
493 | } | |
531d6cdc | 494 | |
495 | AliITSgeomSPD *s0; | |
496 | AliITSgeomSDD *s1; | |
497 | AliITSgeomSSD *s2; | |
498 | Int_t i; | |
499 | Float_t bx[256],bz[280]; | |
500 | ||
501 | fDetTypeSim->ResetCalibrationArray(); | |
502 | fDetTypeSim->ResetSegmentation(); | |
503 | fDetTypeSim->SetDefaults(); | |
504 | ||
505 | //SPD | |
506 | s0 = (AliITSgeomSPD*) GetITSgeom()->GetShape(kSPD);// Get shape info. Do it this way for now. | |
507 | AliITSsegmentationSPD* seg0 = (AliITSsegmentationSPD*)fDetTypeSim->GetSegmentationModel(0); | |
b7943f00 | 508 | seg0->SetDetSize(s0->GetDx()*2.*kconv, // base this on AliITSgeomSPD |
509 | s0->GetDz()*2.*kconv, // for now. | |
510 | s0->GetDy()*2.*kconv); // x,z,y full width in microns. | |
511 | seg0->SetNPads(256,160);// Number of Bins in x and z | |
512 | for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns. | |
513 | for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below | |
514 | for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector. | |
515 | bz[ 31] = bz[ 32] = 625.0; // first chip boundry | |
516 | bz[ 63] = bz[ 64] = 625.0; // first chip boundry | |
517 | bz[ 95] = bz[ 96] = 625.0; // first chip boundry | |
518 | bz[127] = bz[128] = 625.0; // first chip boundry | |
519 | bz[160] = 425.0; // Set so that there is no zero pixel size for fNz. | |
520 | seg0->SetBinSize(bx,bz); // Based on AliITSgeomSPD for now. | |
521 | SetSegmentationModel(kSPD,seg0); | |
522 | // set digit and raw cluster classes to be used | |
531d6cdc | 523 | const char *kData0=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSPD()))->DataType(); |
524 | if (strstr(kData0,"real")) fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigit"); | |
525 | else fDetTypeSim->SetDigitClassName(kSPD,"AliITSdigitSPD"); | |
526 | ||
527 | ||
528 | ||
529 | // SDD | |
530 | s1 = (AliITSgeomSDD*) GetITSgeom()->GetShape(kSDD);// Get shape info. Do it this way for now. | |
531 | AliITSsegmentationSDD* seg1 = (AliITSsegmentationSDD*)fDetTypeSim->GetSegmentationModel(1); | |
532 | seg1->SetDetSize(s1->GetDx()*kconv, // base this on AliITSgeomSDD | |
533 | s1->GetDz()*2.*kconv, // for now. | |
534 | s1->GetDy()*2.*kconv); // x,z,y full width in microns. | |
535 | seg1->SetNPads(256,256);// Use AliITSgeomSDD for now | |
536 | SetSegmentationModel(kSDD,seg1); | |
537 | const char *kData1=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()))->DataType(); | |
538 | AliITSCalibrationSDD* rsp = (AliITSCalibrationSDD*)fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSDD()); | |
539 | const char *kopt=rsp->GetZeroSuppOption(); | |
b7943f00 | 540 | if((!strstr(kopt,"2D")) && (!strstr(kopt,"1D")) || strstr(kData1,"real") ){ |
531d6cdc | 541 | fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigit"); |
542 | } else fDetTypeSim->SetDigitClassName(kSDD,"AliITSdigitSDD"); | |
543 | ||
544 | ||
545 | // SSD | |
546 | s2 = (AliITSgeomSSD*) GetITSgeom()->GetShape(kSSD);// Get shape info. Do it this way for now. | |
547 | AliITSsegmentationSSD* seg2 = (AliITSsegmentationSSD*)fDetTypeSim->GetSegmentationModel(2); | |
b7943f00 | 548 | seg2->SetDetSize(s2->GetDx()*2.*kconv, // base this on AliITSgeomSSD |
549 | s2->GetDz()*2.*kconv, // for now. | |
550 | s2->GetDy()*2.*kconv); // x,z,y full width in microns. | |
551 | seg2->SetPadSize(95.,0.); // strip x pitch in microns | |
552 | seg2->SetNPads(768,0); // number of strips on each side. | |
553 | seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side. | |
554 | seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side. | |
555 | seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side. | |
556 | SetSegmentationModel(kSSD,seg2); | |
531d6cdc | 557 | const char *kData2=(fDetTypeSim->GetCalibrationModel(GetITSgeom()->GetStartSSD()))->DataType(); |
558 | if(strstr(kData2,"real") ) fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigit"); | |
559 | else fDetTypeSim->SetDigitClassName(kSSD,"AliITSdigitSSD"); | |
560 | if(fgkNTYPES>3){ | |
561 | Warning("SetDefaults", | |
562 | "Only the four basic detector types are initialised!"); | |
563 | }// end if | |
564 | ||
565 | ||
566 | return; | |
567 | } | |
b7943f00 | 568 | |
569 | ||
108bd0fe | 570 | |
571 | ||
572 | ||
dfefbaec | 573 | //______________________________________________________________________ |
b7943f00 | 574 | void AliITSv11::DrawModule() const{ |
575 | ||
dfefbaec | 576 | } |
b7943f00 | 577 | |
108bd0fe | 578 | // //______________________________________________________________________ |
579 | // void AliITSv11::StepManager(){ | |
580 | // // | |
581 | // // Called for every step in the ITS, then calles the AliITShit class | |
582 | // // creator with the information to be recoreded about that hit. | |
583 | // // | |
584 | // Int_t copy, id; | |
585 | // TLorentzVector position, momentum; | |
586 | // static TLorentzVector position0; | |
587 | // static Int_t stat0=0; | |
588 | ||
589 | // if(!(this->IsActive())){ | |
590 | // return; | |
591 | // } // end if !Active volume. | |
592 | ||
593 | // if(!(gMC->TrackCharge())) return; | |
594 | ||
595 | // id=gMC->CurrentVolID(copy); | |
596 | ||
597 | // Bool_t sensvol = kFALSE; | |
598 | // for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE; | |
599 | // if(sensvol && (gMC->IsTrackExiting())){ | |
600 | // copy = fTrackReferences->GetEntriesFast(); | |
601 | // TClonesArray &lTR = *fTrackReferences; | |
602 | // // Fill TrackReference structure with this new TrackReference. | |
603 | // new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber()); | |
604 | // } // if Outer ITS mother Volume | |
605 | ||
606 | ||
607 | // Int_t copy1,copy2; | |
608 | // Int_t vol[5]; | |
609 | // TClonesArray &lhits = *fHits; | |
610 | // // | |
611 | // // Track status | |
612 | // vol[3] = 0; | |
613 | // vol[4] = 0; | |
614 | // if(gMC->IsTrackInside()) vol[3] += 1; | |
615 | // if(gMC->IsTrackEntering()) vol[3] += 2; | |
616 | // if(gMC->IsTrackExiting()) vol[3] += 4; | |
617 | // if(gMC->IsTrackOut()) vol[3] += 8; | |
618 | // if(gMC->IsTrackDisappeared()) vol[3] += 16; | |
619 | // if(gMC->IsTrackStop()) vol[3] += 32; | |
620 | // if(gMC->IsTrackAlive()) vol[3] += 64; | |
621 | // // | |
622 | // // Fill hit structure. | |
623 | // if(!(gMC->TrackCharge())) return; | |
624 | // // | |
625 | // // Only entering charged tracks | |
626 | // if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) { | |
627 | // vol[0] = 1; | |
628 | // id = gMC->CurrentVolOffID(2,copy); | |
629 | // //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A) | |
630 | // vol[1] = copy; | |
631 | // gMC->CurrentVolOffID(3,copy1); | |
632 | // //ladder copy in the module = 1<->2 (I10A < I12A) | |
633 | // gMC->CurrentVolOffID(4,copy2); | |
634 | // //module copy in the layer = 1<->10 (I12A < IT12) | |
635 | // vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2 | |
636 | // } else if(id == fIdSens[1]){ | |
637 | // vol[0] = 2; | |
638 | // id = gMC->CurrentVolOffID(2,copy); | |
639 | // //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A) | |
640 | // vol[1] = copy; | |
641 | // gMC->CurrentVolOffID(3,copy1); | |
642 | // //ladder copy in the module = 1<->4 (I20A < I12A) | |
643 | // gMC->CurrentVolOffID(4,copy2); | |
644 | // //module copy in the layer = 1<->10 (I12A < IT12) | |
645 | // vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4 | |
646 | // } else if(id == fIdSens[2]){ | |
647 | // vol[0] = 3; | |
648 | // id = gMC->CurrentVolOffID(1,copy); | |
649 | // //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004) | |
650 | // vol[1] = copy; | |
651 | // id = gMC->CurrentVolOffID(2,copy); | |
652 | // //ladder copy in the layer = 1<->14 (I004 < IT34) | |
653 | // vol[2] = copy; | |
654 | // } else if(id == fIdSens[3]){ | |
655 | // vol[0] = 4; | |
656 | // id = gMC->CurrentVolOffID(1,copy); | |
657 | // //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005) | |
658 | // vol[1] = copy; | |
659 | // id = gMC->CurrentVolOffID(2,copy); | |
660 | // //ladder copy in the layer = 1<->22 (I005 < IT34)) | |
661 | // vol[2] = copy; | |
662 | // }else if(id == fIdSens[4]){ | |
663 | // vol[0] = 5; | |
664 | // id = gMC->CurrentVolOffID(1,copy); | |
665 | // //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565) | |
666 | // vol[1] = copy; | |
667 | // id = gMC->CurrentVolOffID(2,copy); | |
668 | // //ladder copy in the layer = 1<->34 (I565 < IT56) | |
669 | // vol[2] = copy; | |
670 | // }else if(id == fIdSens[5]){ | |
671 | // vol[0] = 6; | |
672 | // id = gMC->CurrentVolOffID(1,copy); | |
673 | // //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569) | |
674 | // vol[1] = copy; | |
675 | // id = gMC->CurrentVolOffID(2,copy); | |
676 | // //ladder copy in the layer = 1<->38 (I569 < IT56) | |
677 | // vol[2] = copy; | |
678 | // } else { | |
679 | // return; // not an ITS volume? | |
680 | // } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i]) | |
681 | // // | |
682 | // gMC->TrackPosition(position); | |
683 | // gMC->TrackMomentum(momentum); | |
684 | // vol[4] = stat0; | |
685 | // if(gMC->IsTrackEntering()){ | |
686 | // position0 = position; | |
687 | // stat0 = vol[3]; | |
688 | // return; | |
689 | // } // end if IsEntering | |
690 | // // Fill hit structure with this new hit. | |
691 | ||
692 | // new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, | |
693 | // gMC->Edep(),gMC->TrackTime(),position, | |
694 | // position0,momentum); | |
695 | ||
696 | // position0 = position; | |
697 | // stat0 = vol[3]; | |
698 | ||
699 | // return; | |
700 | // } | |
701 | ||
702 | ||
dfefbaec | 703 | //______________________________________________________________________ |
704 | void AliITSv11::StepManager(){ | |
b7943f00 | 705 | // |
706 | // Called for every step in the ITS, then calles the AliITShit class | |
707 | // creator with the information to be recoreded about that hit. | |
708 | // | |
531d6cdc | 709 | Int_t copy, id; |
710 | TLorentzVector position, momentum; | |
711 | static TLorentzVector position0; | |
712 | static Int_t stat0=0; | |
713 | ||
714 | if(!(this->IsActive())){ | |
715 | return; | |
716 | } // end if !Active volume. | |
717 | ||
718 | if(!(gMC->TrackCharge())) return; | |
719 | ||
720 | id=gMC->CurrentVolID(copy); | |
721 | ||
722 | Bool_t sensvol = kFALSE; | |
723 | for(Int_t kk=0;kk<6;kk++)if(id == fIdSens[kk])sensvol=kTRUE; | |
724 | if(sensvol && (gMC->IsTrackExiting())){ | |
e6add757 | 725 | AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS); |
531d6cdc | 726 | } // if Outer ITS mother Volume |
727 | ||
728 | ||
729 | Int_t copy1,copy2; | |
730 | Int_t vol[5]; | |
731 | TClonesArray &lhits = *fHits; | |
732 | // | |
733 | // Track status | |
734 | vol[3] = 0; | |
735 | vol[4] = 0; | |
736 | if(gMC->IsTrackInside()) vol[3] += 1; | |
737 | if(gMC->IsTrackEntering()) vol[3] += 2; | |
738 | if(gMC->IsTrackExiting()) vol[3] += 4; | |
739 | if(gMC->IsTrackOut()) vol[3] += 8; | |
740 | if(gMC->IsTrackDisappeared()) vol[3] += 16; | |
741 | if(gMC->IsTrackStop()) vol[3] += 32; | |
742 | if(gMC->IsTrackAlive()) vol[3] += 64; | |
743 | // | |
744 | // Fill hit structure. | |
745 | if(!(gMC->TrackCharge())) return; | |
108bd0fe | 746 | |
531d6cdc | 747 | // Only entering charged tracks |
748 | if((id = gMC->CurrentVolID(copy)) == fIdSens[0]) { | |
749 | vol[0] = 1; | |
750 | id = gMC->CurrentVolOffID(2,copy); | |
751 | //detector copy in the ladder = 1<->4 (ITS1 < I101 < I103 < I10A) | |
752 | vol[1] = copy; | |
753 | gMC->CurrentVolOffID(3,copy1); | |
754 | //ladder copy in the module = 1<->2 (I10A < I12A) | |
755 | gMC->CurrentVolOffID(4,copy2); | |
756 | //module copy in the layer = 1<->10 (I12A < IT12) | |
757 | vol[2] = copy1+(copy2-1)*2;//# of ladders in one module = 2 | |
108bd0fe | 758 | |
531d6cdc | 759 | } else if(id == fIdSens[1]){ |
760 | vol[0] = 2; | |
761 | id = gMC->CurrentVolOffID(2,copy); | |
762 | //detector copy in the ladder = 1<->4 (ITS2 < I1D1 < I1D3 < I20A) | |
763 | vol[1] = copy; | |
764 | gMC->CurrentVolOffID(3,copy1); | |
765 | //ladder copy in the module = 1<->4 (I20A < I12A) | |
766 | gMC->CurrentVolOffID(4,copy2); | |
767 | //module copy in the layer = 1<->10 (I12A < IT12) | |
768 | vol[2] = copy1+(copy2-1)*4;//# of ladders in one module = 4 | |
108bd0fe | 769 | |
531d6cdc | 770 | } else if(id == fIdSens[2]){ |
771 | vol[0] = 3; | |
772 | id = gMC->CurrentVolOffID(1,copy); | |
773 | //detector copy in the ladder = 1<->6 (ITS3 < I302 < I004) | |
774 | vol[1] = copy; | |
775 | id = gMC->CurrentVolOffID(2,copy); | |
776 | //ladder copy in the layer = 1<->14 (I004 < IT34) | |
777 | vol[2] = copy; | |
108bd0fe | 778 | |
531d6cdc | 779 | } else if(id == fIdSens[3]){ |
780 | vol[0] = 4; | |
781 | id = gMC->CurrentVolOffID(1,copy); | |
782 | //detector copy in the ladder = 1<->8 (ITS4 < I402 < I005) | |
783 | vol[1] = copy; | |
784 | id = gMC->CurrentVolOffID(2,copy); | |
785 | //ladder copy in the layer = 1<->22 (I005 < IT34)) | |
786 | vol[2] = copy; | |
108bd0fe | 787 | |
531d6cdc | 788 | }else if(id == fIdSens[4]){ |
789 | vol[0] = 5; | |
790 | id = gMC->CurrentVolOffID(1,copy); | |
791 | //detector copy in the ladder = 1<->22 (ITS5 < I562 < I565) | |
792 | vol[1] = copy; | |
793 | id = gMC->CurrentVolOffID(2,copy); | |
794 | //ladder copy in the layer = 1<->34 (I565 < IT56) | |
795 | vol[2] = copy; | |
108bd0fe | 796 | |
531d6cdc | 797 | }else if(id == fIdSens[5]){ |
798 | vol[0] = 6; | |
799 | id = gMC->CurrentVolOffID(1,copy); | |
800 | //detector copy in the ladder = 1<->25 (ITS6 < I566 < I569) | |
801 | vol[1] = copy; | |
802 | id = gMC->CurrentVolOffID(2,copy); | |
803 | //ladder copy in the layer = 1<->38 (I569 < IT56) | |
804 | vol[2] = copy; | |
805 | } else { | |
806 | return; // not an ITS volume? | |
807 | } // end if/else if (gMC->CurentVolID(copy) == fIdSens[i]) | |
808 | // | |
809 | gMC->TrackPosition(position); | |
810 | gMC->TrackMomentum(momentum); | |
811 | vol[4] = stat0; | |
812 | if(gMC->IsTrackEntering()){ | |
813 | position0 = position; | |
814 | stat0 = vol[3]; | |
815 | return; | |
816 | } // end if IsEntering | |
817 | // Fill hit structure with this new hit. | |
b7943f00 | 818 | |
531d6cdc | 819 | new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, |
820 | gMC->Edep(),gMC->TrackTime(),position, | |
821 | position0,momentum); | |
b7943f00 | 822 | |
b7943f00 | 823 | position0 = position; |
824 | stat0 = vol[3]; | |
531d6cdc | 825 | |
b7943f00 | 826 | return; |
531d6cdc | 827 | } |
108bd0fe | 828 |