1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 #include "AliRICHv3.h"
24 #include <Riostream.h>
26 #include <TGeometry.h>
29 #include <TLorentzVector.h>
31 #include <TParticle.h>
34 #include "AliRICHGeometry.h"
35 #include "AliRICHSegmentationV1.h"
36 #include "AliRICHResponseV0.h"
37 #include "AliRICHHit.h"
41 //______________________________________________________________
42 // Implementation of the RICH version 3 with azimuthal rotation
45 AliRICHv3::AliRICHv3(const char *sName, const char *sTitle)
46 :AliRICH(sName,sTitle)
48 // The named ctor currently creates a single copy of
49 // AliRICHGeometry AliRICHSegmentationV1 AliRICHResponseV0
50 // and initialises the corresponding models of all 7 chambers with these stuctures.
51 // Note: all chambers share the single copy of models. MUST be changed later (???).
52 cout<<ClassName()<<"::named ctor(sName,sTitle)>\n"; // no way to control it as ctor is called before call to SetDebugXXXX()
54 fCkovNumber=fFreonProd=fDebugLevel=0;
56 AliRICHGeometry *pRICHGeometry =new AliRICHGeometry; // ??? to be moved to AlRICHChamber::named ctor
57 AliRICHSegmentationV1 *pRICHSegmentation=new AliRICHSegmentationV1; // ??? to be moved to AlRICHChamber::named ctor
58 AliRICHResponseV0 *pRICHResponse =new AliRICHResponseV0; // ??? to be moved to AlRICHChamber::named ctor
60 fChambers = new TObjArray(kNCH);
61 for (Int_t i=0; i<kNCH; i++){
62 fChambers->AddAt(new AliRICHChamber,i); // ??? to be changed to named ctor of AliRICHChamber
63 SetGeometryModel(i,pRICHGeometry);
64 SetSegmentationModel(i,pRICHSegmentation);
65 SetResponseModel(i,pRICHResponse);
66 ((AliRICHChamber*)fChambers->At(i))->Init(i); // ??? to be removed
68 }//AliRICHv3::ctor(const char *pcName, const char *pcTitle)
70 AliRICHv3::~AliRICHv3()
72 // Dtor deletes RICH models. In future (???) AliRICHChamber will be responsible for that.
73 if(IsDebugStart()) cout<<ClassName()<<"::dtor()>\n";
75 delete GetChamber(0)->GetGeometryModel();
76 delete GetChamber(0)->GetResponseModel();
77 delete GetChamber(0)->GetSegmentationModel();
81 void AliRICHv3::CreateGeometry()
83 // Provides geometry structure for simulation (currently GEANT volumes tree)
84 if(IsDebugStart()) cout<<ClassName()<<"::CreateGeometry()>\n";
86 AliRICH *pRICH = (AliRICH *) gAlice->GetDetector("RICH");
87 AliRICHSegmentationV0* segmentation;
88 AliRICHGeometry* geometry;
89 AliRICHChamber* iChamber;
91 iChamber = &(pRICH->Chamber(0));
92 segmentation=(AliRICHSegmentationV0*) iChamber->GetSegmentationModel(0);
93 geometry=iChamber->GetGeometryModel();
96 distance = geometry->GetFreonThickness()/2 + geometry->GetQuartzThickness() + geometry->GetGapThickness();
97 geometry->SetRadiatorToPads(distance);
99 //Opaque quartz thickness
100 Float_t oqua_thickness = .5;
104 Float_t csi_width = segmentation->Npx()*segmentation->Dpx() + segmentation->DeadZone();
105 Float_t csi_length = segmentation->Npy()*segmentation->Dpy() + 2*segmentation->DeadZone();
108 Int_t *idtmed = fIdtmed->GetArray()-999;
115 // --- Define the RICH detector
116 // External aluminium box
118 par[1] = 13; //Original Settings
120 gMC->Gsvolu("RICH", "BOX ", idtmed[1009], par, 3);
124 par[1] = 13; //Original Settings
126 gMC->Gsvolu("SRIC", "BOX ", idtmed[1000], par, 3);
128 // Air 2 (cutting the lower part of the box)
131 par[1] = 3; //Original Settings
133 gMC->Gsvolu("AIR2", "BOX ", idtmed[1000], par, 3);
135 // Air 3 (cutting the lower part of the box)
138 par[1] = 3; //Original Settings
140 gMC->Gsvolu("AIR3", "BOX ", idtmed[1000], par, 3);
144 par[1] = .188; //Original Settings
146 gMC->Gsvolu("HONE", "BOX ", idtmed[1001], par, 3);
150 par[1] = .025; //Original Settings
155 gMC->Gsvolu("ALUM", "BOX ", idtmed[1009], par, 3);
158 par[0] = geometry->GetQuartzWidth()/2;
159 par[1] = geometry->GetQuartzThickness()/2;
160 par[2] = geometry->GetQuartzLength()/2;
161 gMC->Gsvolu("QUAR", "BOX ", idtmed[1002], par, 3);
163 // Spacers (cylinders)
166 par[2] = geometry->GetFreonThickness()/2;
167 gMC->Gsvolu("SPAC", "TUBE", idtmed[1002], par, 3);
169 // Feet (freon slabs supports)
174 gMC->Gsvolu("FOOT", "BOX", idtmed[1009], par, 3);
177 par[0] = geometry->GetQuartzWidth()/2;
179 par[2] = geometry->GetQuartzLength()/2;
180 gMC->Gsvolu("OQUA", "BOX ", idtmed[1007], par, 3);
182 // Frame of opaque quartz
183 par[0] = geometry->GetOuterFreonWidth()/2;
184 par[1] = geometry->GetFreonThickness()/2;
185 par[2] = geometry->GetOuterFreonLength()/2;
186 gMC->Gsvolu("OQF1", "BOX ", idtmed[1007], par, 3);
188 par[0] = geometry->GetInnerFreonWidth()/2;
189 par[1] = geometry->GetFreonThickness()/2;
190 par[2] = geometry->GetInnerFreonLength()/2;
191 gMC->Gsvolu("OQF2", "BOX ", idtmed[1007], par, 3);
195 par[0] = geometry->GetOuterFreonWidth()/2 - oqua_thickness;
196 par[1] = geometry->GetFreonThickness()/2;
197 par[2] = geometry->GetOuterFreonLength()/2 - 2*oqua_thickness;
198 gMC->Gsvolu("FRE1", "BOX ", idtmed[1003], par, 3);
200 par[0] = geometry->GetInnerFreonWidth()/2 - oqua_thickness;
201 par[1] = geometry->GetFreonThickness()/2;
202 par[2] = geometry->GetInnerFreonLength()/2 - 2*oqua_thickness;
203 gMC->Gsvolu("FRE2", "BOX ", idtmed[1003], par, 3);
206 par[0] = csi_width/2;
207 par[1] = geometry->GetGapThickness()/2;
208 par[2] = csi_length/2;
209 gMC->Gsvolu("META", "BOX ", idtmed[1004], par, 3);
212 par[0] = csi_width/2;
213 par[1] = geometry->GetProximityGapThickness()/2;
214 par[2] = csi_length/2;
215 gMC->Gsvolu("GAP ", "BOX ", idtmed[1008], par, 3);
218 par[0] = csi_width/2;
220 par[2] = csi_length/2;
221 gMC->Gsvolu("CSI ", "BOX ", idtmed[1005], par, 3);
227 gMC->Gsvolu("GRID", "TUBE", idtmed[1006], par, 3);
232 par[0] = csi_width/2;
235 gMC->Gsvolu("WSMe", "BOX ", idtmed[1009], par, 3);
237 // Ceramic pick up (base)
239 par[0] = csi_width/2;
242 gMC->Gsvolu("WSG1", "BOX ", idtmed[1010], par, 3);
244 // Ceramic pick up (head)
246 par[0] = csi_width/2;
249 gMC->Gsvolu("WSG2", "BOX ", idtmed[1010], par, 3);
251 // Aluminium supports for methane and CsI
254 par[0] = csi_width/2;
255 par[1] = geometry->GetGapThickness()/2 + .25;
256 par[2] = (68.35 - csi_length/2)/2;
257 gMC->Gsvolu("SMSH", "BOX", idtmed[1009], par, 3);
261 par[0] = (66.3 - csi_width/2)/2;
262 par[1] = geometry->GetGapThickness()/2 + .25;
263 par[2] = csi_length/2 + 68.35 - csi_length/2;
264 gMC->Gsvolu("SMLG", "BOX", idtmed[1009], par, 3);
266 // Aluminium supports for freon
269 par[0] = geometry->GetQuartzWidth()/2;
271 par[2] = (68.35 - geometry->GetQuartzLength()/2)/2;
272 gMC->Gsvolu("SFSH", "BOX", idtmed[1009], par, 3);
276 par[0] = (66.3 - geometry->GetQuartzWidth()/2)/2;
278 par[2] = geometry->GetQuartzLength()/2 + 68.35 - geometry->GetQuartzLength()/2;
279 gMC->Gsvolu("SFLG", "BOX", idtmed[1009], par, 3);
283 par[0] = csi_width/2;
285 par[2] = csi_length/4 -.5025;
286 gMC->Gsvolu("PCB ", "BOX", idtmed[1011], par, 3);
289 // Backplane supports
296 gMC->Gsvolu("BACK", "BOX", idtmed[1009], par, 3);
303 gMC->Gsvolu("BKHL", "BOX", idtmed[1000], par, 3);
310 gMC->Gsvolu("BKHS", "BOX", idtmed[1000], par, 3);
312 // Place holes inside backplane support
314 gMC->Gspos("BKHS", 1, "BACK", .8 + 5.7,0., .6 + 4.4625, 0, "ONLY");
315 gMC->Gspos("BKHS", 2, "BACK", -.8 - 5.7,0., .6 + 4.4625, 0, "ONLY");
316 gMC->Gspos("BKHS", 3, "BACK", .8 + 5.7,0., -.6 - 4.4625, 0, "ONLY");
317 gMC->Gspos("BKHS", 4, "BACK", -.8 - 5.7,0., -.6 - 4.4625, 0, "ONLY");
318 gMC->Gspos("BKHS", 5, "BACK", .8 + 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
319 gMC->Gspos("BKHS", 6, "BACK", -.8 - 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
320 gMC->Gspos("BKHS", 7, "BACK", .8 + 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
321 gMC->Gspos("BKHS", 8, "BACK", -.8 - 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
322 gMC->Gspos("BKHL", 1, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., .6 + 4.4625, 0, "ONLY");
323 gMC->Gspos("BKHL", 2, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 4.4625, 0, "ONLY");
324 gMC->Gspos("BKHL", 3, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 4.4625, 0, "ONLY");
325 gMC->Gspos("BKHL", 4, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 4.4625, 0, "ONLY");
326 gMC->Gspos("BKHL", 5, "BACK", .8 + 11.4+ 1.6 + 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
327 gMC->Gspos("BKHL", 6, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
328 gMC->Gspos("BKHL", 7, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
329 gMC->Gspos("BKHL", 8, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
333 // --- Places the detectors defined with GSVOLU
334 // Place material inside RICH
335 gMC->Gspos("SRIC", 1, "RICH", 0.,0., 0., 0, "ONLY");
336 gMC->Gspos("AIR2", 1, "RICH", 66.3 + 1.2505, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
337 gMC->Gspos("AIR2", 2, "RICH", -66.3 - 1.2505, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
338 gMC->Gspos("AIR3", 1, "RICH", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, -68.35 - 1.25, 0, "ONLY");
339 gMC->Gspos("AIR3", 2, "RICH", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 68.35 + 1.25, 0, "ONLY");
342 gMC->Gspos("ALUM", 1, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .376 -.025, 0., 0, "ONLY");
343 gMC->Gspos("HONE", 1, "SRIC", 0., 1.276- geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .05 - .188, 0., 0, "ONLY");
344 gMC->Gspos("ALUM", 2, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .6 - .025, 0., 0, "ONLY");
345 gMC->Gspos("FOOT", 1, "SRIC", 64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, 36.9, 0, "ONLY");
346 gMC->Gspos("FOOT", 2, "SRIC", 21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3 , 36.9, 0, "ONLY");
347 gMC->Gspos("FOOT", 3, "SRIC", -21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, 36.9, 0, "ONLY");
348 gMC->Gspos("FOOT", 4, "SRIC", -64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, 36.9, 0, "ONLY");
349 gMC->Gspos("FOOT", 5, "SRIC", 64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
350 gMC->Gspos("FOOT", 6, "SRIC", 21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
351 gMC->Gspos("FOOT", 7, "SRIC", -21.65, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
352 gMC->Gspos("FOOT", 8, "SRIC", -64.95, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .4 - .3, -36.9, 0, "ONLY");
353 gMC->Gspos("OQUA", 1, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()- .2, 0., 0, "ONLY");
358 gMC->Gspos("SMLG", 1, "SRIC", csi_width/2 + (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
359 gMC->Gspos("SMLG", 2, "SRIC", - csi_width/2 - (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
360 gMC->Gspos("SMSH", 1, "SRIC", 0., 1.276 + .25, csi_length/2 + (68.35 - csi_length/2)/2, 0, "ONLY");
361 gMC->Gspos("SMSH", 2, "SRIC", 0., 1.276 + .25, - csi_length/2 - (68.35 - csi_length/2)/2, 0, "ONLY");
365 Float_t supp_y = 1.276 - geometry->GetGapThickness()/2- geometry->GetQuartzThickness() -geometry->GetFreonThickness() - .2 + .3; //y position of freon supports
367 gMC->Gspos("SFLG", 1, "SRIC", geometry->GetQuartzWidth()/2 + (66.3 - geometry->GetQuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
368 gMC->Gspos("SFLG", 2, "SRIC", - geometry->GetQuartzWidth()/2 - (66.3 - geometry->GetQuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
369 gMC->Gspos("SFSH", 1, "SRIC", 0., supp_y, geometry->GetQuartzLength()/2 + (68.35 - geometry->GetQuartzLength()/2)/2, 0, "ONLY");
370 gMC->Gspos("SFSH", 2, "SRIC", 0., supp_y, - geometry->GetQuartzLength()/2 - (68.35 - geometry->GetQuartzLength()/2)/2, 0, "ONLY");
372 AliMatrix(idrotm[1019], 0., 0., 90., 0., 90., 90.);
377 for (i = 0; i < nspacers/3; i++) {
378 zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
379 gMC->Gspos("SPAC", i, "FRE1", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
382 for (i = nspacers/3; i < (nspacers*2)/3; i++) {
383 zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
384 gMC->Gspos("SPAC", i, "FRE1", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
387 for (i = (nspacers*2)/3; i < nspacers; ++i) {
388 zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
389 gMC->Gspos("SPAC", i, "FRE1", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
392 for (i = 0; i < nspacers/3; i++) {
393 zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
394 gMC->Gspos("SPAC", i, "FRE2", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
397 for (i = nspacers/3; i < (nspacers*2)/3; i++) {
398 zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
399 gMC->Gspos("SPAC", i, "FRE2", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
402 for (i = (nspacers*2)/3; i < nspacers; ++i) {
403 zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
404 gMC->Gspos("SPAC", i, "FRE2", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
408 gMC->Gspos("FRE1", 1, "OQF1", 0., 0., 0., 0, "ONLY");
409 gMC->Gspos("FRE2", 1, "OQF2", 0., 0., 0., 0, "ONLY");
410 gMC->Gspos("OQF1", 1, "SRIC", geometry->GetOuterFreonWidth()/2 + geometry->GetInnerFreonWidth()/2 + 2, 1.276 - geometry->GetGapThickness()/2- geometry->GetQuartzThickness() -geometry->GetFreonThickness()/2, 0., 0, "ONLY"); //Original settings (31.3)
411 gMC->Gspos("OQF2", 2, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()/2, 0., 0, "ONLY"); //Original settings
412 gMC->Gspos("OQF1", 3, "SRIC", - (geometry->GetOuterFreonWidth()/2 + geometry->GetInnerFreonWidth()/2) - 2, 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness() - geometry->GetFreonThickness()/2, 0., 0, "ONLY"); //Original settings (-31.3)
413 gMC->Gspos("QUAR", 1, "SRIC", 0., 1.276 - geometry->GetGapThickness()/2 - geometry->GetQuartzThickness()/2, 0., 0, "ONLY");
414 gMC->Gspos("GAP ", 1, "META", 0., geometry->GetGapThickness()/2 - geometry->GetProximityGapThickness()/2 - 0.0001, 0., 0, "ONLY");
415 gMC->Gspos("META", 1, "SRIC", 0., 1.276, 0., 0, "ONLY");
416 gMC->Gspos("CSI ", 1, "SRIC", 0., 1.276 + geometry->GetGapThickness()/2 + .25, 0., 0, "ONLY");
417 printf("CSI pos: %f\n",1.276 + geometry->GetGapThickness()/2 + .25);
419 // Wire support placing
421 gMC->Gspos("WSG2", 1, "GAP ", 0., geometry->GetProximityGapThickness()/2 - .1, 0., 0, "ONLY");
422 gMC->Gspos("WSG1", 1, "CSI ", 0., 0., 0., 0, "ONLY");
423 gMC->Gspos("WSMe", 1, "SRIC ", 0., 1.276 + geometry->GetGapThickness()/2 + .5 + 1.05, 0., 0, "ONLY");
427 gMC->Gspos("BACK", 1, "SRIC ", -33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, 43.3, 0, "ONLY");
428 gMC->Gspos("BACK", 2, "SRIC ", 33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2 , 43.3, 0, "ONLY");
429 gMC->Gspos("BACK", 3, "SRIC ", -33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
430 gMC->Gspos("BACK", 4, "SRIC ", 33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
431 gMC->Gspos("BACK", 5, "SRIC ", 33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
432 gMC->Gspos("BACK", 6, "SRIC ", -33.15, 1.276 + geometry->GetGapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
436 gMC->Gspos("PCB ", 1, "SRIC ", 0., 1.276 + geometry->GetGapThickness()/2 + .5 + 1.05, csi_width/4 + .5025 + 2.5, 0, "ONLY");
437 gMC->Gspos("PCB ", 2, "SRIC ", 0., 1.276 + geometry->GetGapThickness()/2 + .5 + 1.05, -csi_width/4 - .5025 - 2.5, 0, "ONLY");
439 // Place chambers into mother volume ALIC
441 Double_t dOffset = geometry->GetOffset() - geometry->GetGapThickness()/2; // distance from center of mother volume ALIC to methane
443 Double_t dAlpha = geometry->GetAlphaAngle(); // angle between centers of chambers - y-z plane
444 Double_t dAlphaRad = dAlpha*kDegrad;
446 Double_t dBeta = geometry->GetBetaAngle(); // angle between center of chambers - y-x plane
447 Double_t dBetaRad = dBeta*kDegrad;
449 Double_t dRotAngle = geometry->GetRotationAngle(); // the whole RICH is to be rotated in x-y plane + means clockwise rotation
450 Double_t dRotAngleRad = dRotAngle*kDegrad;
453 TRotMatrix *pRotMatrix; // tmp pointer
455 TVector3 vector(0,dOffset,0); // Position of chamber 2 without rotation
457 // Chamber 0 standalone (no other chambers in this row)
458 pRotMatrix = new TRotMatrix("rot993","rot993", 0., 0., 0.,0.,0.,0.);
459 const Double_t* r = pRotMatrix->SetAngles(90., 0., 90.-dAlpha , 90., dAlpha, -90.);
460 Double_t* rr = RotateXY(r, -dRotAngleRad);
461 AliMatrix(idrotm[1000], rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
462 pRotMatrix->SetAngles(rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
464 vector.SetXYZ(0,dOffset,0); vector.RotateX(dAlphaRad);
465 vector.RotateZ(-dRotAngleRad);
467 gMC->Gspos("RICH",1,"ALIC",vector.X(),vector.Y(),vector.Z(),idrotm[1000], "ONLY");
468 Chamber(0).SetChamberTransform(vector.X(),vector.Y(),vector.Z(),pRotMatrix);
470 pRotMatrix = new TRotMatrix("rot994","rot994", 0., 0., 0.,0.,0.,0.);
471 r = pRotMatrix->SetAngles(90., -dBeta, 90., 90.-dBeta, 0., 0.);
472 rr = RotateXY(r, -dRotAngleRad);
473 AliMatrix(idrotm[1001], rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
474 pRotMatrix->SetAngles(rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
475 vector.SetXYZ(0,dOffset,0); vector.RotateZ(-dBetaRad);
476 vector.RotateZ(-dRotAngleRad);
478 gMC->Gspos("RICH",2,"ALIC",vector.X(),vector.Y(),vector.Z(),idrotm[1001], "ONLY");
479 Chamber(1).SetChamberTransform(vector.X(),vector.Y(),vector.Z(),pRotMatrix);
481 // Chamber 2 the top one with no Alpha-Beta rotation
482 pRotMatrix = new TRotMatrix("rot995","rot995", 0., 0., 0.,0.,0.,0.);
483 r = pRotMatrix->SetAngles(90., 0., 90., 90., 0., 0.);
484 rr = RotateXY(r, -dRotAngleRad);
485 AliMatrix(idrotm[1002], rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
486 pRotMatrix->SetAngles(rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
487 vector.SetXYZ(0,dOffset,0);
488 vector.RotateZ(-dRotAngleRad);
489 gMC->Gspos("RICH",3,"ALIC",vector.X(),vector.Y(),vector.Z(),idrotm[1002], "ONLY");
490 Chamber(2).SetChamberTransform(vector.X(),vector.Y(),vector.Z(),pRotMatrix);
492 pRotMatrix = new TRotMatrix("rot996","rot996", 0., 0., 0.,0.,0.,0.);
493 r = pRotMatrix->SetAngles(90., dBeta, 90., 90.+dBeta, 0., 0.);
494 rr = RotateXY(r, -dRotAngleRad);
495 AliMatrix(idrotm[1003], rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
496 pRotMatrix->SetAngles(rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
497 vector.SetXYZ(0,dOffset,0); vector.RotateZ(dBetaRad);
498 vector.RotateZ(-dRotAngleRad);
500 gMC->Gspos("RICH",4,"ALIC",vector.X(),vector.Y(),vector.Z(),idrotm[1003], "ONLY");
501 Chamber(3).SetChamberTransform(vector.X(),vector.Y(),vector.Z(),pRotMatrix);
504 pRotMatrix = new TRotMatrix("rot997","rot997", 0., 0., 0.,0.,0.,0.);
505 r = pRotMatrix->SetAngles(90., 360.-dBeta, 108.2, 90.-dBeta, 18.2, 90.-dBeta);
506 rr = RotateXY(r, -dRotAngleRad);
507 AliMatrix(idrotm[1004], rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
508 pRotMatrix->SetAngles(rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
509 vector.SetXYZ(0,dOffset,0); vector.RotateZ(-dBetaRad); vector.RotateX(-dAlphaRad);
510 vector.RotateZ(-dRotAngleRad);
512 gMC->Gspos("RICH",5,"ALIC",vector.X(),vector.Y(),vector.Z(),idrotm[1004], "ONLY");
513 Chamber(4).SetChamberTransform(vector.X(),vector.Y(),vector.Z(),pRotMatrix);
515 pRotMatrix = new TRotMatrix("rot998","rot998", 0., 0., 0.,0.,0.,0.);
516 r = pRotMatrix->SetAngles(90., 0., 90.+dAlpha, 90., dAlpha, 90.);
517 rr = RotateXY(r, -dRotAngleRad);
518 AliMatrix(idrotm[1005], rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
519 pRotMatrix->SetAngles(rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
520 vector.SetXYZ(0,dOffset,0); vector.RotateX(-dAlphaRad);
521 vector.RotateZ(-dRotAngleRad);
523 gMC->Gspos("RICH",6,"ALIC",vector.X(),vector.Y(),vector.Z(),idrotm[1005], "ONLY");
524 Chamber(5).SetChamberTransform(vector.X(),vector.Y(),vector.Z(),pRotMatrix);
526 pRotMatrix = new TRotMatrix("rot999","rot999", 0., 0., 0.,0.,0.,0.);
527 r = pRotMatrix->SetAngles(90., dBeta, 108.2, 90.+dBeta, 18.2, 90.+dBeta);
528 rr = RotateXY(r, -dRotAngleRad);
529 AliMatrix(idrotm[1006], rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
530 pRotMatrix->SetAngles(rr[0], rr[1], rr[2], rr[3], rr[4], rr[5]);
531 vector.SetXYZ(0,dOffset,0); vector.RotateZ(dBetaRad); vector.RotateX(-dAlphaRad);
532 vector.RotateZ(-dRotAngleRad);
534 gMC->Gspos("RICH",7,"ALIC",vector.X(),vector.Y(),vector.Z(),idrotm[1006], "ONLY");
535 Chamber(6).SetChamberTransform(vector.X(),vector.Y(),vector.Z(),pRotMatrix);
537 }//void AliRICHv3::CreateGeometry()
542 void AliRICHv3::Init()
544 // Makes nothing for a while
545 if(IsDebugStart()) cout<<ClassName()<<"::Init()>\n";
551 void AliRICHv3::BuildGeometry()
553 // Provides geometry structure for event display (ROOT TNode tree)
555 if(IsDebugStart()) cout<<ClassName()<<"::BuildGeometry()>\n";
557 TNode *node, *subnode, *top;
559 const int kColorRICH = kRed;
561 top=gAlice->GetGeometry()->GetNode("alice");
563 AliRICH *pRICH = (AliRICH *) gAlice->GetDetector("RICH");
564 AliRICHChamber* iChamber;
565 AliRICHGeometry* geometry;
567 iChamber = &(pRICH->Chamber(0));
568 AliRICHSegmentationV1* segmentation=(AliRICHSegmentationV1*) iChamber->GetSegmentationModel(0);
569 geometry=iChamber->GetGeometryModel();
571 new TBRIK("S_RICH","S_RICH","void",71.09999,11.5,73.15);
573 Float_t padplane_width = segmentation->GetPadPlaneWidth();
574 Float_t padplane_length = segmentation->GetPadPlaneLength();
577 new TBRIK("PHOTO","PHOTO","void", padplane_width/2,.1,padplane_length/2);
581 node = new TNode("RICH1","RICH1","S_RICH",Chamber(0).GetX(),Chamber(0).GetY(),Chamber(0).GetZ(),"rot993");
582 node->SetLineColor(kColorRICH);
584 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
585 subnode->SetLineColor(kGreen);
586 fNodes->Add(subnode);
587 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
588 subnode->SetLineColor(kGreen);
589 fNodes->Add(subnode);
590 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
591 subnode->SetLineColor(kGreen);
592 fNodes->Add(subnode);
593 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
594 subnode->SetLineColor(kGreen);
595 fNodes->Add(subnode);
596 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
597 subnode->SetLineColor(kGreen);
598 fNodes->Add(subnode);
599 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
600 subnode->SetLineColor(kGreen);
601 fNodes->Add(subnode);
606 node = new TNode("RICH2","RICH2","S_RICH",Chamber(1).GetX(),Chamber(1).GetY(),Chamber(1).GetZ(),"rot994");
607 node->SetLineColor(kColorRICH);
609 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
610 subnode->SetLineColor(kGreen);
611 fNodes->Add(subnode);
612 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
613 subnode->SetLineColor(kGreen);
614 fNodes->Add(subnode);
615 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
616 subnode->SetLineColor(kGreen);
617 fNodes->Add(subnode);
618 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
619 subnode->SetLineColor(kGreen);
620 fNodes->Add(subnode);
621 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
622 subnode->SetLineColor(kGreen);
623 fNodes->Add(subnode);
624 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
625 subnode->SetLineColor(kGreen);
626 fNodes->Add(subnode);
631 node = new TNode("RICH3","RICH3","S_RICH",Chamber(2).GetX(),Chamber(2).GetY(),Chamber(2).GetZ(),"rot995");
632 node->SetLineColor(kColorRICH);
634 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
635 subnode->SetLineColor(kGreen);
636 fNodes->Add(subnode);
637 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
638 subnode->SetLineColor(kGreen);
639 fNodes->Add(subnode);
640 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
641 subnode->SetLineColor(kGreen);
642 fNodes->Add(subnode);
643 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
644 subnode->SetLineColor(kGreen);
645 fNodes->Add(subnode);
646 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
647 subnode->SetLineColor(kGreen);
648 fNodes->Add(subnode);
649 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
650 subnode->SetLineColor(kGreen);
651 fNodes->Add(subnode);
656 node = new TNode("RICH4","RICH4","S_RICH",Chamber(3).GetX(),Chamber(3).GetY(),Chamber(3).GetZ(),"rot996");
657 node->SetLineColor(kColorRICH);
659 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
660 subnode->SetLineColor(kGreen);
661 fNodes->Add(subnode);
662 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
663 subnode->SetLineColor(kGreen);
664 fNodes->Add(subnode);
665 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
666 subnode->SetLineColor(kGreen);
667 fNodes->Add(subnode);
668 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
669 subnode->SetLineColor(kGreen);
670 fNodes->Add(subnode);
671 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
672 subnode->SetLineColor(kGreen);
673 fNodes->Add(subnode);
674 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
675 subnode->SetLineColor(kGreen);
676 fNodes->Add(subnode);
681 node = new TNode("RICH5","RICH5","S_RICH",Chamber(4).GetX(),Chamber(4).GetY(),Chamber(4).GetZ(),"rot997");
682 node->SetLineColor(kColorRICH);
684 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
685 subnode->SetLineColor(kGreen);
686 fNodes->Add(subnode);
687 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
688 subnode->SetLineColor(kGreen);
689 fNodes->Add(subnode);
690 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
691 subnode->SetLineColor(kGreen);
692 fNodes->Add(subnode);
693 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
694 subnode->SetLineColor(kGreen);
695 fNodes->Add(subnode);
696 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
697 subnode->SetLineColor(kGreen);
698 fNodes->Add(subnode);
699 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
700 subnode->SetLineColor(kGreen);
701 fNodes->Add(subnode);
706 node = new TNode("RICH6","RICH6","S_RICH",Chamber(5).GetX(),Chamber(5).GetY(),Chamber(5).GetZ(),"rot998");
707 node->SetLineColor(kColorRICH);
708 fNodes->Add(node);node->cd();
709 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
710 subnode->SetLineColor(kGreen);
711 fNodes->Add(subnode);
712 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
713 subnode->SetLineColor(kGreen);
714 fNodes->Add(subnode);
715 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
716 subnode->SetLineColor(kGreen);
717 fNodes->Add(subnode);
718 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
719 subnode->SetLineColor(kGreen);
720 fNodes->Add(subnode);
721 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
722 subnode->SetLineColor(kGreen);
723 fNodes->Add(subnode);
724 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
725 subnode->SetLineColor(kGreen);
726 fNodes->Add(subnode);
730 node = new TNode("RICH7","RICH7","S_RICH",Chamber(6).GetX(),Chamber(6).GetY(),Chamber(6).GetZ(),"rot999");
731 node->SetLineColor(kColorRICH);
733 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
734 subnode->SetLineColor(kGreen);
735 fNodes->Add(subnode);
736 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,padplane_length/2 + segmentation->DeadZone()/2,"");
737 subnode->SetLineColor(kGreen);
738 fNodes->Add(subnode);
739 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,padplane_length/2 + segmentation->DeadZone()/2,"");
740 subnode->SetLineColor(kGreen);
741 fNodes->Add(subnode);
742 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",padplane_width + segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
743 subnode->SetLineColor(kGreen);
744 fNodes->Add(subnode);
745 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-padplane_length/2 - segmentation->DeadZone()/2,"");
746 subnode->SetLineColor(kGreen);
747 fNodes->Add(subnode);
748 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-padplane_width - segmentation->DeadZone(),5,-padplane_length/2 - segmentation->DeadZone()/2,"");
749 subnode->SetLineColor(kGreen);
750 fNodes->Add(subnode);
753 }//AliRICHv3::BuildGeometry()
756 Double_t* AliRICHv3::RotateXY(const Double_t* r, Double_t a)
758 // Rotatation in xy-plane
760 // The resulting rotation matrix is given back in the G3 notation.
761 Double_t* rr = new Double_t[6];
765 for (i = 0; i < 3; i++) {
767 m[j] = r[j] * TMath::Cos(a) - r[j+1] * TMath::Sin(a);
768 m[j+1] = r[j] * TMath::Sin(a) + r[j+1] * TMath::Cos(a);
772 for (i = 0; i < 3; i++) {
775 rr[k] = TMath::ACos(m[j+2]) * kRaddeg;
776 rr[k+1] = TMath::ATan2(m[j+1], m[j]) * kRaddeg;