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 **************************************************************************/
17 //_________________________________________________________________________
18 // Implementation version v0 of EMCAL Manager class
19 // An object of this class does not produce hits nor digits
20 // It is the one to use if you do not want to produce outputs in TREEH or TREED
21 // This class places a Geometry of the EMCAL in the ALICE Detector as defined in AliEMCALGeometry.cxx
22 //*-- Author: Yves Schutz (SUBATECH)
23 //*-- and : Sahal Yacoob (LBL / UCT)
24 // : Alexei Pavlinov (WSU) SHASHLYK
26 // --- ROOT system ---
29 #include <TGeometry.h>
30 #include <TGeoPhysicalNode.h>
31 #include <TGeoManager.h>
32 #include <TGeoMatrix.h>
33 #include <TVirtualMC.h>
41 #include "AliEMCALShishKebabTrd1Module.h"
43 // --- Standard library ---
47 // --- AliRoot header files ---
49 #include "AliEMCALv0.h"
50 #include "AliEMCALGeometry.h"
53 #include "AliGeomManager.h"
54 #include "AliEMCALSpaceFrame.h"
58 // EMCAL material: look to the AliEMCAL.cxx
70 //______________________________________________________________________
71 AliEMCALv0::AliEMCALv0()
73 fShishKebabModules(),fEnvelop1(0),fIdRotm(0),fIdTmedArr(0),
74 fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),fCalFrame(0)
77 for(Int_t i = 0; i < 5 ; i++) fParEMOD[i]=0.0;
80 //______________________________________________________________________
81 AliEMCALv0::AliEMCALv0(const char *name, const char *title)
82 : AliEMCAL(name,title),
83 fShishKebabModules(),fEnvelop1(0),fIdRotm(0),fIdTmedArr(0),
84 fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),fCalFrame(0)
86 // ctor : title is used to identify the layout
88 // Nov 22, 2006 - case of 1X1
90 for(Int_t i = 0; i < 5 ; i++) fParEMOD[i]=0.0;
91 TString ntmp(GetTitle());
94 AliEMCALGeometry *g = GetGeometry() ;
95 TString gn(g->GetName()); gn.ToUpper();
96 fShishKebabModules = g->GetShishKebabTrd1Modules();
98 fSampleWidth = double(g->GetECPbRadThick()+g->GetECScintThick());
99 if(gn.Contains("V1")) fSampleWidth += 2.*g->GetTrd1BondPaperThick();
100 printf("<I> AliEMCALv0::AliEMCALv : fGeometry %p : gMC %p : fSampleWidth %5.4f\n",
101 fGeometry, gMC, fSampleWidth);
104 //______________________________________________________________________
105 void AliEMCALv0::CreateGeometry()
107 // Create the EMCAL geometry for Geant
108 // Geometry of a tower
110 AliEMCALGeometry * geom = GetGeometry() ;
111 TString gn(geom->GetName());
114 if(!(geom->IsInitialized())){
115 Error("CreateGeometry","EMCAL Geometry class has not been set up.");
118 // Get pointer to the array containing media indices
119 fIdTmedArr = fIdtmed->GetArray() - 1599 ;
122 // gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3) - see AliModule
123 AliMatrix(fIdRotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
125 // Create the EMCAL Mother Volume (a polygone) within which to place the Detector and named XEN1
127 Float_t envelopA[10];
128 if(gn.Contains("WSUC") ) { // TRD1 for WSUC facility
133 gMC->Gsvolu("XEN1", "BOX", fIdTmedArr[kIdSC], envelopA, 3) ;
135 for(int i=0; i<3; i++) fEnvelop1[i] = envelopA[i]; // 23-may-05
136 // Position the EMCAL Mother Volume (XEN1) in WSUC.
137 // Look to AliEMCALWsuCosmicRaySetUp.
138 gMC->Gspos("XEN1", 1, "WSUC", 0.0, 0.0, + 265., fIdRotm, "ONLY") ;
140 envelopA[0] = geom->GetArm1PhiMin(); // minimum phi angle
141 envelopA[1] = geom->GetArm1PhiMax() - geom->GetArm1PhiMin(); // angular range in phi
142 envelopA[2] = geom->GetNPhiSuperModule(); // number of sections in phi
143 envelopA[3] = 2; // 2 z coordinates
144 envelopA[4] = -geom->GetEnvelop(2)/2.; // zmin - includes padding
145 envelopA[5] = geom->GetEnvelop(0) ; // rmin at z1 - includes padding
146 envelopA[6] = geom->GetEnvelop(1) ; // rmax at z1 - includes padding
147 envelopA[7] = geom->GetEnvelop(2)/2.; // zmax includes padding
149 envelopA[8] = envelopA[5] ; // radii are the same.
150 envelopA[9] = envelopA[6] ; // radii are the same.
152 gMC->Gsvolu("XEN1", "PGON", fIdTmedArr[kIdAIR], envelopA, 10) ; // Polygone filled with air
153 fEnvelop1.Set(10, envelopA);
155 printf("CreateGeometry: XEN1 = %f, %f\n", envelopA[5], envelopA[6]);
156 printf("CreateGeometry: XU0 = %f, %f\n", envelopA[5], envelopA[6]);
158 // Position the EMCAL Mother Volume (XEN1) in Alice (ALIC)
159 gMC->Gspos(geom->GetNameOfEMCALEnvelope(), 1, "ALIC", 0.0, 0.0, 0.0, fIdRotm, "ONLY") ;
163 AliDebug(2,Form("Shish-Kebab geometry : %s", GetTitle()));
164 CreateShishKebabGeometry();
166 if(gn.Contains("WSUC")==0) { // Nov 24,2010 for TB
168 AliDebug(2,"Creating EMCAL Space Frame");
169 fCalFrame = new AliEMCALSpaceFrame();
170 fCalFrame->CreateGeometry();
174 //______________________________________________________________________
175 void AliEMCALv0::Init(void)
177 // Just prints an information message
179 if(AliLog::GetGlobalDebugLevel()>0) {
180 TString message("\n") ;
181 message += "*****************************************\n" ;
183 // Here the EMCAL initialisation code (if any!)
185 AliEMCALGeometry * geom = GetGeometry() ;
188 message += "AliEMCAL " ;
189 message += Version() ;
190 message += "EMCAL geometry initialized for " ;
191 message += geom->GetName() ;
194 message += "AliEMCAL " ;
195 message += Version() ;
196 message += "EMCAL geometry initialization failed !" ;
198 message += "\n*****************************************" ;
199 printf("%s",message.Data() ) ;
204 //______________________________________________________________________
205 void AliEMCALv0::CreateShishKebabGeometry()
209 AliEMCALGeometry * g = GetGeometry();
210 TString gn(g->GetName()); gn.ToUpper();
211 Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad(), tanTrd1 = TMath::Tan(trd1Angle/2.);
212 // see AliModule::fFIdTmedArr
213 // fIdTmedArr = fIdtmed->GetArray() - 1599 ; // see AliEMCAL::::CreateMaterials()
214 // int kIdAIR=1599, kIdPB = 1600, kIdSC = 1601, kIdSTEEL = 1603;
216 Double_t par[10], xpos=0., ypos=0., zpos=0.;
218 CreateSmod(g->GetNameOfEMCALEnvelope());
220 CreateEmod("SMOD","EMOD"); // 18-may-05
222 if(g->GetKey110DEG()) CreateEmod("SM10","EMOD"); // Nov 1,2006
224 // Sensitive SC (2x2 tiles)
225 double parSCM0[5]={0,0,0,0}, *dummy = 0, parTRAP[11];
227 if(!gn.Contains("V1")) {
228 double wallThickness = g->GetPhiModuleSize()/g->GetNPHIdiv() - g->GetPhiTileSize();
229 for(int i=0; i<3; i++) parSCM0[i] = fParEMOD[i] - wallThickness;
230 parSCM0[3] = fParEMOD[3];
231 gMC->Gsvolu("SCM0", "TRD1", fIdTmedArr[kIdAIR], parSCM0, 4);
232 gMC->Gspos("SCM0", 1, "EMOD", 0., 0., 0., 0, "ONLY") ;
234 double wTh = g->GetLateralSteelStrip();
235 parSCM0[0] = fParEMOD[0] - wTh + tanTrd1*g->GetTrd1AlFrontThick();
236 parSCM0[1] = fParEMOD[1] - wTh;
237 parSCM0[2] = fParEMOD[2] - wTh;
238 parSCM0[3] = fParEMOD[3] - g->GetTrd1AlFrontThick()/2.;
239 gMC->Gsvolu("SCM0", "TRD1", fIdTmedArr[kIdAIR], parSCM0, 4);
240 double zshift = g->GetTrd1AlFrontThick()/2.;
241 gMC->Gspos("SCM0", 1, "EMOD", 0., 0., zshift, 0, "ONLY");
243 CreateAlFrontPlate("EMOD","ALFP");
246 if(g->GetNPHIdiv()==2 && g->GetNETAdiv()==2) {
247 // Division to tile size - 1-oct-04
248 AliDebug(2,Form(" Divide SCM0 on y-axis %i\n", g->GetNETAdiv()));
249 gMC->Gsdvn("SCMY","SCM0", g->GetNETAdiv(), 2); // y-axis
251 parTRAP[0] = parSCM0[3]; // dz
252 parTRAP[1] = TMath::ATan2((parSCM0[1]-parSCM0[0])/2.,2.*parSCM0[3])*180./TMath::Pi(); // theta
253 parTRAP[2] = 0.; // phi
255 parTRAP[3] = parSCM0[2]/2.; // H1
256 parTRAP[4] = parSCM0[0]/2.; // BL1
257 parTRAP[5] = parTRAP[4]; // TL1
258 parTRAP[6] = 0.0; // ALP1
260 parTRAP[7] = parSCM0[2]/2.; // H2
261 parTRAP[8] = parSCM0[1]/2.; // BL2
262 parTRAP[9] = parTRAP[8]; // TL2
263 parTRAP[10]= 0.0; // ALP2
264 AliDebug(2,Form(" ** TRAP ** \n"));
265 for(int i=0; i<11; i++) AliDebug(3, Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
267 gMC->Gsvolu("SCMX", "TRAP", fIdTmedArr[kIdSC], parTRAP, 11);
268 xpos = +(parSCM0[1]+parSCM0[0])/4.;
269 gMC->Gspos("SCMX", 1, "SCMY", xpos, 0.0, 0.0, 0, "ONLY") ;
271 // Using rotation because SCMX should be the same due to Pb tiles
273 AliMatrix(fIdRotm, 90.0,180., 90.0, 270.0, 0.0,0.0) ;
274 gMC->Gspos("SCMX", 2, "SCMY", xpos, 0.0, 0.0, fIdRotm, "ONLY");
275 // put LED to the SCM0
276 AliEMCALShishKebabTrd1Module *mod = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(0);
277 Double_t tanBetta = mod->GetTanBetta();
281 double xCenterSCMX = (parTRAP[4] + parTRAP[8])/2.;
282 if(!gn.Contains("V1")) {
283 par[1] = parSCM0[2]/2; // y
284 par[2] = g->GetECPbRadThick()/2.; // z
285 gMC->Gsvolu("PBTI", "BOX", fIdTmedArr[kIdPB], dummy, 0);
286 zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
287 AliDebug(2,Form(" Pb tiles \n"));
288 for(int iz=0; iz<g->GetNECLayers(); iz++){
289 par[0] = (parSCM0[0] + tanBetta*fSampleWidth*iz)/2.;
290 xpos = par[0] - xCenterSCMX;
291 gMC->Gsposp("PBTI", ++nr, "SCMX", xpos, ypos, zpos, 0, "ONLY", par, 3) ;
292 AliDebug(3,Form(" %i xpos %f zpos %f par[0] %f \n", iz+1, xpos, zpos, par[0]));
293 zpos += fSampleWidth;
295 AliDebug(2,Form(" Number of Pb tiles in SCMX %i \n", nr));
298 // First sheet of paper
299 par[1] = parSCM0[2]/2.; // y
300 par[2] = g->GetTrd1BondPaperThick()/2.; // z
301 par[0] = parSCM0[0]/2.; // x
302 gMC->Gsvolu("PAP1", "BOX", fIdTmedArr[kIdPAPER], par, 3);
303 xpos = par[0] - xCenterSCMX;
304 zpos = -parSCM0[3] + g->GetTrd1BondPaperThick()/2.;
305 gMC->Gspos("PAP1", 1, "SCMX", xpos, ypos, zpos, 0, "ONLY");
306 for(int iz=0; iz<g->GetNECLayers()-1; iz++){
308 Double_t dz = g->GetECScintThick() + g->GetTrd1BondPaperThick() + fSampleWidth*iz;
309 // PB + 2 paper sheets
310 par[2] = g->GetECPbRadThick()/2. + g->GetTrd1BondPaperThick(); // z
311 par[0] = (parSCM0[0] + tanBetta*dz)/2.;
312 TString pa(Form("PA%2.2i",nr));
313 gMC->Gsvolu(pa.Data(), "BOX", fIdTmedArr[kIdPAPER], par, 3);
314 xpos = par[0] - xCenterSCMX;
315 zpos = -parSCM0[3] + dz + par[2];
316 gMC->Gspos(pa.Data(), 1, "SCMX", xpos, ypos, zpos, 0, "ONLY") ;
318 TString pb(Form("PB%2.2i",nr));
319 par[2] = g->GetECPbRadThick()/2.; // z
320 gMC->Gsvolu(pb.Data(), "BOX", fIdTmedArr[kIdPB], par, 3);
321 gMC->Gspos(pb.Data(), 1, pa.Data(), 0.0, 0.0, 0.0, 0, "ONLY") ;
325 } else if(g->GetNPHIdiv()==3 && g->GetNETAdiv()==3) {
326 printf(" before AliEMCALv0::Trd1Tower3X3() : parSCM0");
327 for(int i=0; i<4; i++) printf(" %7.4f ", parSCM0[i]);
329 Trd1Tower3X3(parSCM0);
330 } else if(g->GetNPHIdiv()==1 && g->GetNETAdiv()==1) {
331 // no division in SCM0
332 Trd1Tower1X1(parSCM0);
333 } else if(g->GetNPHIdiv()==4 && g->GetNETAdiv()==4) {
339 //______________________________________________________________________
340 void AliEMCALv0::CreateSmod(const char* mother)
342 // 18-may-05; mother="XEN1";
343 // child="SMOD" from first to 10th, "SM10" (11th and 12th) (TRD1 case)
344 AliEMCALGeometry * g = GetGeometry();
345 TString gn(g->GetName()); gn.ToUpper();
347 Double_t par[3], xpos=0., ypos=0., zpos=0., rpos=0., dphi=0., phi=0.0, phiRad=0.;
349 // ===== define Super Module from air - 14x30 module ==== ;
350 AliDebug(2,Form("\n ## Super Module | fSampleWidth %5.3f ## %s \n", fSampleWidth, gn.Data()));
351 par[0] = g->GetShellThickness()/2.;
352 par[1] = g->GetPhiModuleSize()*g->GetNPhi()/2.;
353 par[2] = g->GetEtaModuleSize()*15.;
355 int nphism = g->GetNumberOfSuperModules()/2; // 20-may-05
357 dphi = (g->GetArm1PhiMax() - g->GetArm1PhiMin())/nphism;
358 // if(g->GetKey110DEG()) dphi = (g->GetArm1PhiMax() - g->GetArm1PhiMin())/(nphism-1);
359 rpos = (g->GetEnvelop(0) + g->GetEnvelop(1))/2.;
360 AliDebug(2,Form(" rpos %8.2f : dphi %6.1f degree \n", rpos, dphi));
363 if(gn.Contains("WSUC")) {
364 par[0] = g->GetPhiModuleSize()*g->GetNPhi()/2.;
365 par[1] = g->GetShellThickness()/2.;
366 par[2] = g->GetEtaModuleSize()*g->GetNZ()/2. + 5;
368 gMC->Gsvolu("SMOD", "BOX", fIdTmedArr[kIdAIR], par, 3);
370 AliDebug(2,Form("SMOD in WSUC : tmed %i | dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n",
371 fIdTmedArr[kIdAIR], par[0],par[1],par[2]));
375 nphism = g->GetNumberOfSuperModules();
377 par[2] = 350./2.; // 11-oct-04 - for 26 division
378 AliDebug(2,Form(" par[0] %7.2f (old) \n", par[0]));
379 Float_t parSM[] = {g->GetSuperModulesPar(0),g->GetSuperModulesPar(1),g->GetSuperModulesPar(2)};
380 for(int i=0; i<3; i++) par[i] = parSM[i];
382 gMC->Gsvolu("SMOD", "BOX", fIdTmedArr[kIdAIR], par, 3);
383 AliDebug(2,Form("tmed %i | dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n",
384 fIdTmedArr[kIdAIR], par[0],par[1],par[2]));
387 if(g->GetKey110DEG()) { // 12-oct-05
390 gMC->Gsvolu("SM10", "BOX", fIdTmedArr[kIdAIR], par, 3);
391 AliDebug(2,Form(" Super module with name \"SM10\" was created too par[1] = %f\n", par[1]));
395 if(g->GetSteelFrontThickness() > 0.0) { // 28-mar-05
396 par[0] = g->GetSteelFrontThickness()/2.;
397 gMC->Gsvolu("STPL", "BOX", fIdTmedArr[kIdSTEEL], par, 3);
398 printf("tmed %i | dx %7.2f dy %7.2f dz %7.2f (STPL) \n", fIdTmedArr[kIdSTEEL], par[0],par[1],par[2]);
399 xpos = -(g->GetShellThickness() - g->GetSteelFrontThickness())/2.;
400 gMC->Gspos("STPL", 1, "SMOD", xpos, 0.0, 0.0, 0, "ONLY") ;
403 int nr=0, nrsmod=0, i0=0;
405 // Turn whole super module
406 for(int i=i0; i<nphism; i++) {
407 if(gn.Contains("WSUC")) {
408 xpos = ypos = zpos = 0.0;
410 gMC->Gspos("SMOD", 1, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
411 printf(" fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f \n",
412 fIdRotm, phi, phiRad, xpos, ypos, zpos);
415 TString smName("SMOD"); // 12-oct-05
416 if(i==5 && g->GetKey110DEG()) {
421 phi = g->GetArm1PhiMin() + dphi*(2*i+1)/2.; // phi= 70, 90, 110, 130, 150, 170
422 phiRad = phi*TMath::Pi()/180.;
424 AliMatrix(fIdRotm, 90.0, phi, 90.0, 90.0+phi, 0.0, 0.0);
426 xpos = rpos * TMath::Cos(phiRad);
427 ypos = rpos * TMath::Sin(phiRad);
428 zpos = fSmodPar2; // 21-sep-04
429 if(i==5 && g->GetKey110DEG()) {
430 xpos += (par1C/2. * TMath::Sin(phiRad));
431 ypos -= (par1C/2. * TMath::Cos(phiRad));
434 // 1th module in z-direction;
435 gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
436 AliDebug(3, Form(" %s : %2i fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : i %i \n",
437 smName.Data(), nr, fIdRotm, phi, phiRad, xpos, ypos, zpos, i));
438 // 2th module in z-direction;
439 // turn arround X axis; 0<phi<360
440 double phiy = 90. + phi + 180.;
441 if(phiy>=360.) phiy -= 360.;
443 AliMatrix(fIdRotm, 90.0, phi, 90.0, phiy, 180.0, 0.0);
444 gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, -zpos, fIdRotm, "ONLY");
445 AliDebug(3, Form(" %s : %2i fIdRotm %3i phiy %6.1f xpos %7.2f ypos %7.2f zpos %7.2f \n",
446 smName.Data(), nr, fIdRotm, phiy, xpos, ypos, -zpos));
449 AliDebug(2,Form(" Number of Super Modules %i \n", nr+nrsmod));
452 //______________________________________________________________________
453 void AliEMCALv0::CreateEmod(const char* mother, const char* child)
455 // 17-may-05; mother="SMOD"; child="EMOD"
457 AliEMCALGeometry * g = GetGeometry();
458 TString gn(g->GetName()); gn.ToUpper();
460 Double_t xpos=0., ypos=0., zpos=0.;
461 //Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad();tanTrd1 = TMath::Tan(trd1Angle/2.);
463 if(strcmp(mother,"SMOD")==0) {
464 fParEMOD[0] = g->GetEtaModuleSize()/2.; // dx1
465 fParEMOD[1] = g->Get2Trd1Dx2()/2.; // dx2
466 fParEMOD[2] = g->GetPhiModuleSize()/2.;; // dy
467 fParEMOD[3] = g->GetLongModuleSize()/2.; // dz
468 gMC->Gsvolu(child, "TRD1", fIdTmedArr[kIdSTEEL], fParEMOD, 4);
473 // X->Z(0, 0); Y->Y(90, 90); Z->X(90, 0)
474 AliEMCALShishKebabTrd1Module *mod=0; // current module
476 for(int iz=0; iz<g->GetNZ(); iz++) {
477 Double_t angle=90., phiOK=0;
478 mod = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(iz);
479 angle = mod->GetThetaInDegree();
480 if(!gn.Contains("WSUC")) { // ALICE
481 AliMatrix(fIdRotm, 90.-angle,180., 90.0,90.0, angle, 0.);
482 phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
483 // printf(" %2i | angle | %6.3f - %6.3f = %6.3f(eta %5.3f)\n",
484 //iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule());
485 xpos = mod->GetPosXfromR() + g->GetSteelFrontThickness() - fSmodPar0;
486 zpos = mod->GetPosZ() - fSmodPar2;
488 int iyMax = g->GetNPhi();
489 if(strcmp(mother,"SMOD") && g->GetKey110DEG()) {
492 for(int iy=0; iy<iyMax; iy++) { // flat in phi
493 ypos = g->GetPhiModuleSize()*(2*iy+1 - iyMax)/2.;
494 gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
495 //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f fIdRotm %i\n", nr, xpos, ypos, zpos, fIdRotm);
496 AliDebug(3,Form("%3.3i(%2.2i,%2.2i) ", nr,iy+1,iz+1));
500 if(iz==0) AliMatrix(fIdRotm, 0.,0., 90.,0., 90.,90.); // (x')z; y'(x); z'(y)
501 else AliMatrix(fIdRotm, 90-angle,270., 90.0,0.0, angle,90.);
502 phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
503 printf(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n",
504 iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule());
505 zpos = mod->GetPosZ() - fSmodPar2;
506 ypos = mod->GetPosXfromR() - fSmodPar1;
507 printf(" zpos %7.2f ypos %7.2f fIdRotm %i\n xpos ", zpos, xpos, fIdRotm);
508 for(int ix=0; ix<g->GetNPhi(); ix++) { // flat in phi
509 xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.;
510 gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
511 printf(" %7.2f ", xpos);
516 AliDebug(2,Form(" Number of modules in Super Module(%s) %i \n", mother, nr));
519 void AliEMCALv0::CreateAlFrontPlate(const char* mother, const char* child)
521 // Oct 26,2010 : Al front plate : ALFP
522 AliEMCALGeometry * g = GetGeometry();
523 TString gn(g->GetName()); gn.ToUpper();
524 Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad(), tanTrd1 = TMath::Tan(trd1Angle/2.);
525 Double_t parALFP[5], zposALFP=0.;
527 parALFP[0] = g->GetEtaModuleSize()/2. - g->GetLateralSteelStrip(); // dx1
528 parALFP[1] = parALFP[0] + tanTrd1*g->GetTrd1AlFrontThick(); // dx2
529 parALFP[2] = g->GetPhiModuleSize()/2. - g->GetLateralSteelStrip(); // dy
530 parALFP[3] = g->GetTrd1AlFrontThick()/2.; // dz
531 gMC->Gsvolu(child, "TRD1", fIdTmedArr[kIdAL], parALFP, 4);
532 zposALFP = -fParEMOD[3] + g->GetTrd1AlFrontThick()/2.;
533 gMC->Gspos (child, 1, mother, 0.0, 0.0, zposALFP, 0, "ONLY");
536 //______________________________________________________________________
537 void AliEMCALv0::Trd1Tower3X3(const double *parSCM0)
539 // Started Dec 8,2004 by PAI
541 printf(" AliEMCALv0::Trd1Tower3X3() : parSCM0");
542 for(int i=0; i<4; i++) printf(" %7.4f ", parSCM0[i]);
544 // Nov 10, 2006 - different name of SCMX
545 double parTRAP[11], *dummy=0;
546 AliEMCALGeometry * g = GetGeometry();
547 TString gn(g->GetName()), scmx;
549 // Division to tile size
550 AliDebug(2,Form("Trd1Tower3X3() : Divide SCM0 on y-axis %i", g->GetNETAdiv()));
551 gMC->Gsdvn("SCMY","SCM0", g->GetNETAdiv(), 2); // y-axis
552 double dx1=parSCM0[0], dx2=parSCM0[1], dy=parSCM0[2], dz=parSCM0[3];
553 double ndiv=3., xpos=0.0;
554 // should be defined once
555 gMC->Gsvolu("PBTI", "BOX", fIdTmedArr[kIdPB], dummy, 0);
556 for(int ix=1; ix<=3; ix++) { // 3X3
557 scmx = "SCX"; // Nov 10,2006
560 double xCentBot = 2.*dx1/3.;
561 double xCentTop = 2.*(dx2/4. + dx1/12.);
562 parTRAP[1] = TMath::ATan2((xCentTop-xCentBot),2.*dz)*TMath::RadToDeg(); // theta
563 parTRAP[2] = 0.; // phi
565 parTRAP[3] = dy/ndiv; // H1
566 parTRAP[4] = dx1/ndiv; // BL1
567 parTRAP[5] = parTRAP[4]; // TL1
568 parTRAP[6] = 0.0; // ALP1
570 parTRAP[7] = dy/ndiv; // H2
571 parTRAP[8] = dx2/2 - dx1/6.;// BL2
572 parTRAP[9] = parTRAP[8]; // TL2
573 parTRAP[10]= 0.0; // ALP2
574 xpos = (xCentBot+xCentTop)/2.;
577 parTRAP[1] = -parTRAP[1];
579 } else if(ix==2) { // central part is box but we treat as trapesoid due to numbering
581 parTRAP[8] = dx1/ndiv; // BL2
582 parTRAP[9] = parTRAP[8]; // TL2
585 AliDebug(2,Form(" ** TRAP ** xpos %9.3f\n", xpos));
586 for(int i=0; i<11; i++) AliDebug(2,Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
589 gMC->Gsvolu(scmx.Data(), "TRAP", fIdTmedArr[kIdSC], parTRAP, 11);
590 gMC->Gspos(scmx.Data(), 1, "SCMY", xpos, 0.0, 0.0, 0, "ONLY") ;
592 PbInTrap(parTRAP, scmx);
594 AliDebug(2,"Trd1Tower3X3 - Ver. 1.0 : was tested.");
598 //______________________________________________________________________
599 void AliEMCALv0::PbInTrap(const double parTRAP[11], TString n)
601 // see for example CreateShishKebabGeometry(); just for case TRD1
603 AliDebug(2,Form(" Pb tiles : nrstart %i\n", nr));
604 AliEMCALGeometry * g = GetGeometry();
607 double xpos = 0.0, ypos = 0.0;
608 double zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
610 double coef = (parTRAP[8] - parTRAP[4]) / (2.*parTRAP[0]);
611 double xCenterSCMX = (parTRAP[4] + parTRAP[8])/2.; // ??
612 // double tan = TMath::Tan(parTRAP[1]*TMath::DegToRad());
614 par[1] = parTRAP[3]; // y
615 par[2] = g->GetECPbRadThick()/2.; // z
616 for(int iz=0; iz<g->GetNECLayers(); iz++){
617 par[0] = parTRAP[4] + coef*fSampleWidth*iz;
618 xpos = par[0] - xCenterSCMX;
619 if(parTRAP[1] < 0.) xpos = -xpos;
620 gMC->Gsposp("PBTI", ++nr, n.Data(), xpos, ypos, zpos, 0, "ONLY", par, 3) ;
621 AliDebug(2,Form(" %i xpos %9.3f zpos %9.3f par[0] %9.3f |", iz+1, xpos, zpos, par[0]));
622 zpos += fSampleWidth;
623 if(iz%2>0) printf("\n");
625 AliDebug(2,Form(" Number of Pb tiles in SCMX %i coef %9.7f \n", nr, coef));
626 AliDebug(2,Form(" par[1] %9.3f par[2] %9.3f ypos %9.3f \n", par[1], par[2], ypos));
627 AliDebug(2,Form(" PbInTrap Ver. 1.0 : was tested."));
631 //______________________________________________________________________
632 void AliEMCALv0::Trd1Tower4X4() const
637 //______________________________________________________________________
638 void AliEMCALv0::Trd1Tower1X1(double *parSCM0)
640 // Started Nov 22,2006 by PAI
641 AliDebug(1," AliEMCALv0::Trd1Tower1X1() : parSCM0");
642 for(int i=0; i<4; i++) printf(" %7.4f ", parSCM0[i]);
645 // No division - keeping the same volume logic
646 // and as consequence the same abs is scheme
647 AliDebug(2,"Trd1Tower1X1() : Create SCMX(SCMY) as SCM0");
649 gMC->Gsvolu("SCMY", "TRD1", fIdTmedArr[kIdAIR], parSCM0, 4);
650 gMC->Gspos("SCMY", 1, "SCM0", 0.0, 0.0, 0.0, 0, "ONLY");
651 gMC->Gsvolu("SCMX", "TRD1", fIdTmedArr[kIdSC], parSCM0, 4);
652 gMC->Gspos("SCMX", 1, "SCMY", 0.0, 0.0, 0.0, 0, "ONLY");
654 // should be defined once
656 gMC->Gsvolu("PBTI", "BOX", fIdTmedArr[kIdPB], dummy, 0);
658 PbInTrd1(parSCM0, "SCMX");
660 AliDebug(1,"Trd1Tower1X1() : Ver. 0.1 : was tested.");
663 //______________________________________________________________________
664 void AliEMCALv0::PbInTrd1(const double *parTrd1, TString n)
666 // see PbInTrap(const double parTrd1[11], TString n)
667 static int nr=0, ndeb=2;
668 AliDebug(ndeb,Form(" Pb tiles : nrstart %i\n", nr));
669 AliEMCALGeometry * g = GetGeometry();
672 double xpos = 0.0, ypos = 0.0;
673 double zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
674 double coef = (parTrd1[1] - parTrd1[0]) / (2.*parTrd1[3]);
676 par[1] = parTrd1[2]; // y
677 par[2] = g->GetECPbRadThick()/2.; // z
679 for(int iz=0; iz<g->GetNECLayers(); iz++){
680 par[0] = parTrd1[0] + coef*fSampleWidth*iz;
681 gMC->Gsposp("PBTI", ++nr, n.Data(), xpos, ypos, zpos, 0, "ONLY", par, 3) ;
682 AliDebug(2,Form(" %i xpos %9.3f zpos %9.3f par[0] %9.3f |", iz+1, xpos, zpos, par[0]));
683 zpos += fSampleWidth;
684 if(iz%2>0) printf("\n");
686 AliDebug(ndeb,Form(" Number of Pb tiles in SCMX %i coef %9.7f ", nr, coef));
687 AliDebug(ndeb,Form(" PbInTrd1 Ver. 0.1 : was tested."));
691 //______________________________________________________________________
692 void AliEMCALv0::Scm0InTrd2(const AliEMCALGeometry * g, const Double_t emodPar[5], Double_t parSCM0[5])
694 // Passive material inside the detector
695 double wallThickness = g->GetPhiModuleSize()/2. - g->GetPhiTileSize(); //Need check
696 AliDebug(2,Form(" wall thickness %7.5f \n", wallThickness));
697 for(int i=0; i<4; i++) { // on pictures sometimes I can not see 0 -> be carefull!!
698 parSCM0[i] = emodPar[i] - wallThickness;
699 AliDebug(2,Form(" %i parSCMO %7.3f emodPar %7.3f : dif %7.3f \n",
700 i, parSCM0[i],emodPar[i], parSCM0[i]-emodPar[i]));
702 parSCM0[4] = emodPar[4];
703 gMC->Gsvolu("SCM0", "TRD2", fIdTmedArr[kIdSC], parSCM0, 5); // kIdAIR -> kIdSC
704 gMC->Gspos("SCM0", 1, "EMOD", 0., 0., 0., 0, "ONLY") ;
706 if(g->GetNPHIdiv()==2 && g->GetNETAdiv()==2) {
707 Division2X2InScm0(g, parSCM0);
709 Info("Scm0InTrd2"," no division SCM0 in this geometry |%s|\n", g->GetName());
714 //______________________________________________________________________
715 void AliEMCALv0::Division2X2InScm0(const AliEMCALGeometry * g, const Double_t parSCM0[5])
718 Double_t parTRAP[11], xpos=0.,ypos=0., dx1=0.0,dx2=0.,dy1=0.0,dy2=0.,dz=0.
722 Info("Division2X2InScm0","Divide SCM0 on y-axis %i\n", g->GetNETAdiv());
723 TString n("SCMX"), overLapFlagSCMY("ONLY"), overLapFlagSCMX("ONLY");
724 n = "SCM0"; // for testing - 14-mar-05
726 PbInTrapForTrd2(parSCM0, n);
727 // overLapFlagSCMY=overLapFlagSCMX="MANY"; // do not work
731 dy1 = parSCM0[2] , dy2 = parSCM0[3], dz = parSCM0[4];
733 parTRAP[0] = parSCM0[4]; // dz
734 parTRAP[1] = TMath::ATan2((dy2-dy1)/2.,2.*dz)*TMath::RadToDeg();
735 parTRAP[2] = 90.; // phi
737 parTRAP[3] = parSCM0[2]/2.; // H1
738 parTRAP[4] = parSCM0[0]; // BL1
739 parTRAP[5] = parTRAP[4]; // TL1
740 parTRAP[6] = 0.0; // ALP1
742 parTRAP[7] = parSCM0[3]/2.; // H2
743 parTRAP[8] = parSCM0[1]; // BL2
744 parTRAP[9] = parTRAP[8]; // TL2
745 parTRAP[10]= 0.0; // ALP2
746 AliDebug(2,Form(" ** SCMY ** \n"));
747 for(int i=0; i<11; i++) AliDebug(2,Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
750 gMC->Gsvolu("SCMY", "TRAP", fIdTmedArr[kIdSC], parTRAP, 11); // kIdAIR -> kIdSC
751 ypos = +(parTRAP[3]+parTRAP[7])/2.; //
752 AliDebug(2,Form(" Y shift SCMY inside SCM0 : %7.3f : opt %s\n", ypos, overLapFlagSCMY.Data()));
753 gMC->Gspos("SCMY", 1, "SCM0", 0.0, ypos, 0.0, fIdRotm, overLapFlagSCMY.Data()) ;
754 // Rotation SCMY around z-axis on 180 degree; x'=-x; y'=-y and z=z
755 AliMatrix(fIdRotm, 90.0,180., 90.0, 270.0, 0.0,0.0) ;
756 // We may have problem with numeration due to rotation - 4-feb-05
757 gMC->Gspos("SCMY", 2, "SCM0", 0.0, -ypos, 0.0, fIdRotm, overLapFlagSCMY.Data());
759 Info("Division2X2InScm0","Divide SCMY on x-axis %i\n", g->GetNPHIdiv());
762 dr1=TMath::Sqrt(dx1*dx1+dy1*dy1);
763 dr2=TMath::Sqrt(dx2*dx2+dy2*dy2);
765 parTRAP[0] = parSCM0[4]; // dz
766 parTRAP[1] = TMath::ATan2((dr2-dr1)/2.,2.*dz)*TMath::RadToDeg(); //
767 parTRAP[2] = 45.; // phi
769 parTRAP[3] = parSCM0[2]/2.; // H1
770 parTRAP[4] = parSCM0[0]/2.; // BL1
771 parTRAP[5] = parTRAP[4]; // TL1
772 parTRAP[6] = 0.0; // ALP1
774 parTRAP[7] = parSCM0[3]/2.; // H2
775 parTRAP[8] = parSCM0[1]/2; // BL2
776 parTRAP[9] = parTRAP[8]; // TL2
777 parTRAP[10]= 0.0; // ALP2
778 AliDebug(2,Form(" ** SCMX ** \n"));
779 for(int i=0; i<11; i++) AliDebug(2,Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
782 gMC->Gsvolu("SCMX", "TRAP", fIdTmedArr[kIdSC], parTRAP, 11);
783 xpos = (parTRAP[4]+parTRAP[8])/2.;
784 AliDebug(2,Form(" X shift SCMX inside SCMX : %7.3f : opt %s\n", xpos, overLapFlagSCMX.Data()));
785 gMC->Gspos("SCMX", 1, "SCMY", xpos, 0.0, 0.0, fIdRotm, overLapFlagSCMX.Data()) ;
786 // AliMatrix(fIdRotm, 90.0,270., 90.0, 0.0, 0.0,0.0); // x'=-y; y'=x; z'=z
787 AliMatrix(fIdRotm, 90.0,90., 90.0, -180.0, 0.0,0.0); // x'=y; y'=-x; z'=z
788 gMC->Gspos("SCMX", 2, "SCMY", -xpos, 0.0, 0.0, fIdRotm, overLapFlagSCMX.Data()) ;
790 if(n=="SCMX" && overLapFlagSCMY == "ONLY") {
791 PbInTrapForTrd2(parTRAP, n);
796 //______________________________________________________________________
797 void AliEMCALv0::PbInTrapForTrd2(const double *parTRAP, TString name)
801 TString pbShape("BOX"), pbtiChonly("ONLY");
804 // pbtiChonly = "MANY";
806 gMC->Gsvolu("PBTI", pbShape.Data(), fIdTmedArr[kIdPB], dummy, 0);
809 Info("PbInTrapForTrd2"," Pb tiles inside %s: shape %s :pbtiChonly %s\n nrstart %i\n",
810 name.Data(), pbShape.Data(), pbtiChonly.Data(), nr);
811 AliEMCALGeometry * g = GetGeometry();
813 double par[5], parPB[5], parSC[5];
814 double xpos = 0.0, ypos = 0.0;
815 double zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
816 if(name == "SCMX") { // common trapezoid - 11 parameters
817 double coef = (parTRAP[8] - parTRAP[4]) / (2.*parTRAP[0]);
818 double xCenterSCMX = (parTRAP[4] + parTRAP[8])/2.; // the same for y
819 AliDebug(2,Form(" xCenterSCMX %8.5f : coef %8.7f \n", xCenterSCMX, coef));
821 par[2] = g->GetECPbRadThick()/2.; // z
822 for(int iz=0; iz<g->GetNECLayers(); iz++){
823 par[0] = parTRAP[4] + coef*fSampleWidth*iz;
825 xpos = ypos = par[0] - xCenterSCMX;
826 //if(parTRAP[1] < 0.) xpos = -xpos;
827 gMC->Gsposp("PBTI", ++nr, name.Data(), xpos, ypos, zpos, 0, "ONLY", par, 3) ;
828 AliDebug(2,Form(" %2.2i xpos %8.5f zpos %6.3f par[0,1] %6.3f |", iz+1, xpos, zpos, par[0]));
829 if(iz%2>0) AliDebug(2,Form("\n"));
830 zpos += fSampleWidth;
832 AliDebug(2,Form(" Number of Pb tiles in SCMX %i coef %9.7f \n", nr, coef));
833 AliDebug(2,Form(" par[1] %9.5f par[2] %9.5f ypos %9.5f \n", par[1], par[2], ypos));
834 } else if(name == "SCM0") { // 1-mar-05 ; TRD2 - 5 parameters
835 AliDebug(2,Form(" SCM0 par = "));
836 for(int i=0; i<5; i++) AliDebug(2,Form(" %9.5f ", parTRAP[i]));
837 AliDebug(2,Form("\n zpos %f \n",zpos));
839 double tanx = (parTRAP[1] - parTRAP[0]) / (2.*parTRAP[4]); // tanx = tany now
840 double tany = (parTRAP[3] - parTRAP[2]) / (2.*parTRAP[4]), ztmp=0.;
841 parPB[4] = g->GetECPbRadThick()/2.;
842 parSC[2] = g->GetECScintThick()/2.;
843 for(int iz=0; iz<g->GetNECLayers(); iz++){
844 ztmp = fSampleWidth*double(iz);
845 parPB[0] = parTRAP[0] + tanx*ztmp;
846 parPB[1] = parPB[0] + tanx*g->GetECPbRadThick();
847 parPB[2] = parTRAP[2] + tany*ztmp;
848 parPB[3] = parPB[2] + tany*g->GetECPbRadThick();
849 gMC->Gsposp("PBTI", ++nr, name.Data(), xpos, ypos, zpos, 0, pbtiChonly.Data(), parPB, 5) ;
850 AliDebug(2,Form("\n PBTI %2i | zpos %6.3f | par = ", nr, zpos));
852 for(int i=0; i<5; i++) printf(" %9.5f ", parPB[i]);
853 // individual SC tile
856 gMC->Gsposp("SCTI", nr, name.Data(), xpos, ypos, zpos+g->GetECScintThick(),
857 0, pbtiChonly.Data(), parSC, 3) ;
858 printf("\n SCTI zpos %6.3f | par = ", zpos+g->GetECScintThick());
859 for(int i=0; i<3; i++) printf(" %9.5f ", parPB[i]);
861 zpos += fSampleWidth;
863 AliDebug(2,Form("\n"));
865 Info("PbInTrapForTrd2", "Ver. 0.03 : was tested.");
869 //______________________________________________________________________
870 void AliEMCALv0::PbmoInTrd2(const AliEMCALGeometry * g, const Double_t emodPar[5], Double_t parPBMO[5])
873 Info("PbmoInTrd2"," started : geometry %s ", g->GetName());
874 double wallThickness = g->GetPhiModuleSize()/2. - g->GetPhiTileSize();
875 AliDebug(2,Form(" wall thickness %7.5f \n", wallThickness));
876 for(int i=0; i<4; i++) {
877 parPBMO[i] = emodPar[i] - wallThickness;
878 AliDebug(2,Form(" %i parPBMO %7.3f emodPar %7.3f : dif %7.3f \n",
879 i, parPBMO[i],emodPar[i], parPBMO[i]-emodPar[i]));
881 parPBMO[4] = emodPar[4];
882 gMC->Gsvolu("PBMO", "TRD2", fIdTmedArr[kIdPB], parPBMO, 5);
883 gMC->Gspos("PBMO", 1, "EMOD", 0., 0., 0., 0, "ONLY") ;
885 if(g->GetNPHIdiv()==2 && g->GetNETAdiv()==2) {
886 Division2X2InPbmo(g, parPBMO);
887 AliDebug(2,Form(" PBMO, division 2X2 | geometry |%s|\n", g->GetName()));
889 AliDebug(2,Form(" no division PBMO in this geometry |%s|\n", g->GetName()));
894 //______________________________________________________________________
895 void AliEMCALv0::Division2X2InPbmo(const AliEMCALGeometry * g, const Double_t parPBMO[5])
898 Info("Division2X2InPbmo"," started : geometry %s ", g->GetName());
900 // gMC->Gsvolu("SCTI", "BOX", fIdTmedArr[kIdSC], dummy, 0);
903 double xpos = 0.0, ypos = 0.0, zpos = 0.0, ztmp=0;;
904 double tanx = (parPBMO[1] - parPBMO[0]) / (2.*parPBMO[4]); // tanx = tany now
905 double tany = (parPBMO[3] - parPBMO[2]) / (2.*parPBMO[4]);
906 const Int_t buffersize = 10;
907 char name[buffersize], named[buffersize], named2[buffersize];
909 AliDebug(2,Form(" PBMO par = "));
910 for(int i=0; i<5; i++) AliDebug(2,Form(" %9.5f ", parPBMO[i]));
911 AliDebug(2,Form("\n"));
913 parSC[2] = g->GetECScintThick()/2.;
914 zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick() + g->GetECScintThick()/2.;
915 AliDebug(2,Form(" parSC[2] %9.5f \n", parSC[2]));
916 for(int iz=0; iz<g->GetNECLayers(); iz++){
917 ztmp = g->GetECPbRadThick() + fSampleWidth*double(iz); // Z for previous PB
918 parSC[0] = parPBMO[0] + tanx*ztmp;
919 parSC[1] = parPBMO[2] + tany*ztmp;
921 snprintf(name,buffersize,"SC%2.2i", iz+1);
922 gMC->Gsvolu(name, "BOX", fIdTmedArr[kIdSC], parSC, 3);
923 gMC->Gspos(name, 1, "PBMO", xpos, ypos, zpos, 0, "ONLY") ;
924 AliDebug(2,Form("%s | zpos %6.3f | parSC[0,1]=(%7.5f,%7.5f) -> ",
925 name, zpos, parSC[0], parSC[1]));
927 snprintf(named,buffersize,"SY%2.2i", iz+1);
928 printf(" %s -> ", named);
929 gMC->Gsdvn(named,name, 2, 2);
931 snprintf(named2,buffersize,"SX%2.2i", iz+1);
932 printf(" %s \n", named2);
933 gMC->Gsdvn(named2,named, 2, 1);
935 zpos += fSampleWidth;
939 //______________________________________________________________________
940 AliEMCALShishKebabTrd1Module* AliEMCALv0::GetShishKebabModule(Int_t neta)
943 AliEMCALShishKebabTrd1Module* trd1=0;
944 if(fShishKebabModules && neta>=0 && neta<fShishKebabModules->GetSize()) {
945 trd1 = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(neta);
950 //_____________________________________________________________________________
951 void AliEMCALv0::AddAlignableVolumes() const
953 //Add volumes which are alignable (?)
954 TString ntmp(GetTitle()); // name of EMCAL geometry
956 if(ntmp.Contains("WSUC")) {
957 AddAlignableVolumesInWSUC(); // WSUC case
959 AddAlignableVolumesInALICE(); // ALICE case
963 //______________________________________________________________________
964 void AliEMCALv0::AddAlignableVolumesInALICE() const
967 // Create entries for alignable volumes associating the symbolic volume
968 // name with the corresponding volume path. Needs to be synchronized with
969 // eventual changes in the geometry.
972 Float_t pars[] = {GetGeometry()->GetSuperModulesPar(0),GetGeometry()->GetSuperModulesPar(1),GetGeometry()->GetSuperModulesPar(2)};
973 double rpos = (GetGeometry()->GetEnvelop(0) + GetGeometry()->GetEnvelop(1))/2.;
974 double phi, phiRad, xpos, ypos, zpos;
976 AliGeomManager::ELayerID idEMCAL = AliGeomManager::kEMCAL;
977 Int_t modUID, modnum = 0;
978 TString volpath, symname;
980 Int_t nSMod = GetGeometry()->GetNumberOfSuperModules();
981 for (Int_t smodnum=0; smodnum < nSMod; smodnum++) {
982 modUID = AliGeomManager::LayerToVolUID(idEMCAL,modnum++);
983 volpath = "ALIC_1/XEN1_1/SMOD_";
984 volpath += (smodnum+1);
985 symname = "EMCAL/FullSupermodule";
986 symname += (smodnum+1);
988 if(GetGeometry()->GetKey110DEG() && smodnum>=10) {
989 volpath = "ALIC_1/XEN1_1/SM10_";
990 volpath += (smodnum-10+1);
991 symname = "EMCAL/HalfSupermodule";
992 symname += (smodnum-10+1);
995 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
996 AliFatal("AliEMCALv0::Unable to set alignable entry!!");
998 // Creates the Tracking to Local transformation matrix for EMCAL
1000 TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID) ;
1002 phiRad = GetGeometry()->GetPhiCenterOfSM(smodnum); //comes in radians, not degrees
1003 phi = phiRad*180./TMath::Pi(); //need degrees for rot. matrix
1004 xpos = rpos * TMath::Cos(phiRad);
1005 ypos = rpos * TMath::Sin(phiRad);
1007 if(GetGeometry()->GetKey110DEG() && smodnum >= 10) {
1008 xpos += (pars[1]/2. * TMath::Sin(phiRad));
1009 ypos -= (pars[1]/2. * TMath::Cos(phiRad));
1012 TGeoHMatrix *matTtoL;
1013 TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
1015 if(smodnum%2 == 0) {
1017 TGeoTranslation geoTran0(xpos,ypos, zpos);
1018 TGeoRotation geoRot0("geoRot0", 90.0, phi, 90.0, 90.0+phi, 0.0, 0.0);
1019 TGeoCombiTrans mat0(geoTran0, geoRot0);
1020 matTtoL = new TGeoHMatrix(mat0);
1022 matTtoL->MultiplyLeft(&(globMatrix->Inverse()));
1023 alignableEntry->SetMatrix(matTtoL);
1027 double phiy = 90. + phi + 180.;
1028 if(phiy>=360.) phiy -= 360.;
1029 TGeoTranslation geoTran1(xpos,ypos,-zpos);
1030 TGeoRotation geoRot1("geoRot1", 90.0, phi, 90.0, phiy, 180.0, 0.0);
1031 TGeoCombiTrans mat1(geoTran1, geoRot1);
1032 matTtoL = new TGeoHMatrix(mat1);
1034 matTtoL->MultiplyLeft(&(globMatrix->Inverse()));
1035 alignableEntry->SetMatrix(matTtoL);
1043 //______________________________________________________________________
1044 void AliEMCALv0::AddAlignableVolumesInWSUC() const
1047 // Create entries for alignable volumes associating the symbolic volume
1048 // name with the corresponding volume path. Needs to be synchronized with
1049 // eventual changes in the geometry.
1052 TString vpstr1 = "WSUC_1/XEN1_1/SMOD_";
1053 TString snstr1 = "EMCAL/CosmicTestSupermodule";
1054 TString volpath, symname;
1057 for (Int_t smodnum=0; smodnum < 1; smodnum++) {
1059 symname += (smodnum+1);
1061 volpath += (smodnum+1);
1062 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1063 AliFatal("Unable to set alignable entry!!");