// This class places a Geometry of the EMCAL in the ALICE Detector as defined in AliEMCALGeometry.cxx
//*-- Author: Yves Schutz (SUBATECH)
//*-- and : Sahal Yacoob (LBL / UCT)
-// : Aleksei Pavlinov (WSU) SHASHLYK
-
-// This Version of AliEMCALv0 reduces the number of volumes placed in XEN1 (the envelope) to less than five hundred
-// The Envelope is Placed in Alice, And the Aluminium layer. Mini envelopes (XU) are then placed in XEN1.
-// Each mini envelope contains 1 scintillator, and 1 lead layer, except the last one which contains just one scintillator layer.
-// At the moment I cannot place the 36 and above layers in the mini envelopes so all layers are still placed in XEN1
-
+// : Alexei Pavlinov (WSU) SHASHLYK
// --- ROOT system ---
-
-#include "TNode.h"
-#include "TBRIK.h"
-#include "TTRD1.h"
-#include "TTRD2.h"
-#include "TTRAP.h"
-#include "TPGON.h"
-#include "TTUBS.h"
-#include "TGeometry.h"
-#include "TVirtualMC.h"
-#include "TArrayI.h"
-#include "TROOT.h"
-#include "TArrayF.h"
-#include "TList.h"
-#include "TVector2.h"
-
-#include "AliEMCALShishKebabModule.h"
-#include "AliEMCALShishKebabTrd1Module.h"
-//#include <TGeant3.h> // can not include - I don't know why
+#include <cassert>
+
+#include <TGeometry.h>
+#include <TGeoPhysicalNode.h>
+#include <TGeoManager.h>
+#include <TGeoMatrix.h>
+#include <TVirtualMC.h>
+#include <TArrayI.h>
+#include <TROOT.h>
+#include <TList.h>
+#include <TVector2.h>
+#include <cassert>
// --- Standard library ---
//#include <stdio.h>
// --- AliRoot header files ---
+#include "AliRun.h"
+#include "AliLog.h"
+#include "AliGeomManager.h"
+//--- EMCAL system---
+#include "AliEMCALShishKebabTrd1Module.h"
#include "AliEMCALv0.h"
#include "AliEMCALGeometry.h"
-#include "AliRun.h"
-#include "AliLog.h"
+#include "AliEMCALSpaceFrame.h"
+
+
ClassImp(AliEMCALv0)
-TArrayF ENVELOP1; // now global for BuildGeometry() - 30-aug-2004
-int idAIR=1599, idPB = 1600, idSC = 1601, idSTEEL = 1603; // global
-Int_t *idtmed=0, idrotm=0;
-double sampleWidth=0.;
-double parEMOD[5], smodPar0=0., smodPar1=0., smodPar2=0.;
+// EMCAL material: look to the AliEMCAL.cxx
+enum
+ {
+ kIdAIR = 1599,
+ kIdPB = 1600,
+ kIdSC = 1601,
+ kIdAL = 1602,
+ kIdSTEEL = 1603,
+ kIdPAPER = 1604
+ };
//______________________________________________________________________
-AliEMCALv0::AliEMCALv0(const char *name, const char *title):
- AliEMCAL(name,title)
+AliEMCALv0::AliEMCALv0()
+ : AliEMCAL(),
+ fShishKebabModules(),fEnvelop1(0),fIdRotm(0),fIdTmedArr(0),
+ fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),fCalFrame(0)
{
- // ctor : title is used to identify the layout
- GetGeometry() ;
- fShishKebabModules = 0;
+ //default ctor
+ for(Int_t i = 0; i < 5 ; i++) fParEMOD[i]=0.0;
}
//______________________________________________________________________
-void AliEMCALv0::BuildGeometry()
+AliEMCALv0::AliEMCALv0(const char *name, const char *title)
+ : AliEMCAL(name,title),
+ fShishKebabModules(),fEnvelop1(0),fIdRotm(0),fIdTmedArr(0),
+ fSampleWidth(0),fSmodPar0(0),fSmodPar1(0),fSmodPar2(0),fCalFrame(0)
{
- // Display Geometry for display.C
-
- const Int_t kColorArm1 = kBlue ;
+ // ctor : title is used to identify the layout
+ // Apr 25, 2006
+ // Nov 22, 2006 - case of 1X1
+
+ for(Int_t i = 0; i < 5 ; i++) fParEMOD[i]=0.0;
+ TString ntmp(GetTitle());
+ ntmp.ToUpper();
- AliEMCALGeometry * geom = GetGeometry() ;
- TString gn(geom->GetName());
- gn.ToUpper();
-
- // Define the shape of the Calorimeter
- TNode * top = gAlice->GetGeometry()->GetNode("alice") ; // See AliceGeom/Nodes
- TNode * envelopNode = 0;
- char *envn = "Envelop1";
- if(!gn.Contains("SHISH") || gn.Contains("TRD2")){
- new TTUBS(envn, "Tubs that contains arm 1", "void",
- geom->GetEnvelop(0) -10, // rmin
- geom->GetEnvelop(1) +40 ,// rmax
- geom->GetEnvelop(2)/2.0, // half length in Z
- geom->GetArm1PhiMin(), // minimum phi angle
- geom->GetArm1PhiMax() // maximum phi angle
- );
- top->cd();
- envelopNode = new TNode(envn, "Arm1 Envelop", "Envelop1", 0., 0., 0., "") ;
- } else {
- if(gn.Contains("WSUC")) {
- envelopNode = BuildGeometryOfWSUC();
- } else { // Shish-kebab now for compact, twist and TRD1 cases (ALIC)
- envn="Envelop2";
- TPGON *pgon = new TPGON(envn, "PGON that contains arm 1", "void",
- geom->GetArm1PhiMin(),geom->GetArm1PhiMax()-geom->GetArm1PhiMin(),geom->GetNPhiSuperModule(), 2);
- // define section
- pgon->DefineSection(0, ENVELOP1[4], ENVELOP1[5], ENVELOP1[6]);
- pgon->DefineSection(1, ENVELOP1[7], ENVELOP1[5], ENVELOP1[6]);
- top->cd();
- envelopNode = new TNode(envn, "Arm1 Envelop2", envn, 0., 0., 0., "") ;
- }
- }
-
- envelopNode->SetLineColor(kColorArm1) ;
- fNodes->Add(envelopNode);
-}
+ AliEMCALGeometry *g = GetGeometry() ;
+ TString gn(g->GetName()); gn.ToUpper();
+ fShishKebabModules = g->GetShishKebabTrd1Modules();
+ fGeometry = g;
+ fSampleWidth = double(g->GetECPbRadThick()+g->GetECScintThick());
+ if(gn.Contains("V1")) fSampleWidth += 2.*g->GetTrd1BondPaperThick();
+ AliDebug(2,Form("fGeometry %p : gMC %p : fSampleWidth %5.4f\n",
+ fGeometry, gMC, fSampleWidth));
+ //Set geometry name again, in case it was changed during the initialization of the geometry.
+ SetTitle(fGeometry->GetEMCGeometry()->GetName());
-TNode *AliEMCALv0::BuildGeometryOfWSUC()
-{ // June 8, 2005; see directory geant3/TGeant3/G3toRoot.cxx
- // enum EColor { kWhite, kBlack, kRed, kGreen, kBlue, kYellow, kMagenta, kCyan } - see $ROOTSYS/include/Gtypes.h
- AliEMCALGeometry * g = GetGeometry();
- TNode * top = gAlice->GetGeometry()->GetNode("alice") ; // See AliceGeom/Nodes
- top->cd();
-
- TNode *envelopNode = 0;
- char *name = "";
- /*
- name = "WSUC";
- new TBRIK(name, "WSUC(XEN1 in Geant)","void",ENVELOP1[0],ENVELOP1[1],ENVELOP1[2]);
- envelopNode = new TNode(name, "envelope for WSUC", name, 0., 0., 0., "");
- envelopNode->SetVisibility(0);
- */
-
- TNode *emod=0, *scmx=0;
- name = "SMOD"; // super module
- new TBRIK(name, "SMOD(SMOD in Geant)","void", smodPar0,smodPar1,smodPar2);
- if(envelopNode) envelopNode->cd();
- TNode *smod = new TNode(name, "SMOD", name, 0., 0., 0., "");
- smod->SetLineColor(kBlue) ;
- if(envelopNode==0) envelopNode = smod;
-
- name = "EMOD"; // see CreateEMOD
- TTRD1 *EMOD = new TTRD1(name, "EMOD(EMOD in Geant)","void", float(parEMOD[0]),
- float(parEMOD[1]),float(parEMOD[2]),float(parEMOD[3]));
-
- // SCMX = EMOD/4 for simplicity of drawing
- name = "SCMX";
- Float_t dz=0.,theta=0.,phi=0.,h1=0.,bl1=0.,tl1=0.,alpha1=0.,h2=0.,bl2=0.,tl2=0.,alpha2=0.;
- h1 = EMOD->GetDy()/2.;
- bl1 = EMOD->GetDx()/2.;
- tl1 = bl1;
- alpha1 = 0.;
- h2 = EMOD->GetDy()/2.;
- bl2 = EMOD->GetDx2()/2.;
- tl2 = bl2;
- alpha2 = 0.;
-
- dz = EMOD->GetDz();
- double dr = TMath::Sqrt((h2-h1)*(h2-h1)+(bl2-bl1)*(bl2-bl1));
- theta = TMath::ATan2(dr,2.*dz) * TMath::RadToDeg();
- phi = 180.;
-
- TTRAP *SCMX = new TTRAP(name, "SCMX(SCMX as in Geant)","void",
- dz,theta,phi, h1,bl1,tl1,alpha1, h2,bl2,tl2,alpha2);
- // SCMX->Dump();
- Float_t xShiftSCMX = (EMOD->GetDx() + EMOD->GetDx2())/4.;
- Float_t yShiftSCMX = EMOD->GetDy()/2.;
- printf(" xShiftSCMX %7.4f yShiftSCMX %7.4f \n",xShiftSCMX,yShiftSCMX);
-
- name = "EMOD"; // see CreateEMOD
- smod->cd();
-
- AliEMCALShishKebabTrd1Module *mod=0;
- Double_t angle=90., xpos=0.,ypos=0.,zpos=0., xposSCMX=0.,yposSCMX=0.,zposSCMX=0.;
- char rtmn[100], rtmt[100];
- TRotMatrix *rtm=0, *rtmSCMX=0;
- int numEmod=0;
- for(int iz=0; iz<g->GetNZ(); iz++) {
- mod = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(iz);
- zpos = mod->GetPosZ() - smodPar2;
- ypos = mod->GetPosXfromR() - smodPar1;
-
- angle = mod->GetThetaInDegree();
- sprintf(rtmn,"rmEmod%5.1f",angle);
- sprintf(rtmt,"rotation matrix for EMOD, iz=%i, angle = %6.3f",iz, angle);
- if(iz==0) rtm = new TRotMatrix(rtmn, rtmt,0.,0., 90.,0., 90.,90.); // z'(x); y'(y); x'(z)
- else rtm = new TRotMatrix(rtmn, rtmt,90.-angle,270., 90.0,0.0, angle,90.);
-
- TGeometry *tg = gAlice->GetGeometry();
- for(int ix=0; ix<g->GetNPhi(); ix++) { // flat in phi
- xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.;
- sprintf(rtmt,"EMOD, iz %i, ix %i, angle %6.3f",iz,ix, angle);
- TString namNode=name;
- namNode += numEmod++;
- smod->cd();
- emod = new TNode(namNode.Data(), rtmt, (TShape*)EMOD, xpos,ypos,zpos,rtm);
- // emod->SetLineColor(kGreen) ;
- emod->SetVisibility(0); // SCMX will bi visible
- if(SCMX) { // 4(2x2) sensetive volume inside EMOD
- emod->cd();
- zposSCMX = 0.;
- for(int jy=0; jy<2; jy++){ // division on y
- yposSCMX = yShiftSCMX *(2*jy - 1);
- for(int jx=0; jx<2; jx++){ // division on x
- Double_t theta1=90.,phi1=0., theta2=90.,phi2=90., theta3=0.,phi3=0 ;
- xposSCMX = xShiftSCMX *(2*jx - 1);
- namNode = "SCMX";
- namNode += jy;
- namNode += jx;
- sprintf(rtmn,"rm%s",namNode.Data());
- sprintf(rtmt,"rotation matrix for %s inside EMOD",namNode.Data());
- rtmSCMX = tg->GetRotMatrix(rtmn);
- if(jx == 1) {
- phi1 = 180.; // x' = -x
- phi2 = 270.; // y' = -y
- }
- if(rtmSCMX == 0) rtmSCMX = new TRotMatrix(rtmn,rtmt, theta1,phi1, theta2,phi2, theta3,phi3);
- sprintf(rtmt,"%s inside %s", namNode.Data(), emod->GetName());
- scmx = new TNode(namNode.Data(), rtmt, (TShape*)SCMX, xposSCMX,yposSCMX,zposSCMX,rtmSCMX);
- scmx->SetLineColor(kMagenta);
- }
- }
- }
- }
- }
- // emod->Draw(); // for testing
-
- return envelopNode;
}
//______________________________________________________________________
{
// Create the EMCAL geometry for Geant
// Geometry of a tower
- //|-----------------------------------------------------| XEN1
- //| | | |
- //| | Al thickness = GetAlFrontThickness() | |
- //| | | |
- //| | | |
- //| | | |
- //| ------------------------------------------------- |
- //| | Air Gap = GetGap2Active() | |
- //| | | |
- //| ------------------------------------------------- |
- //| | XU1 : XPST (ECAL e = GetECScintThick() ) | |
- //| ------------------------------------------------- |
- //| | XU1 : XPBX (ECAL e = GetECPbRadThick() ) | |
- //| ------------------------------------------------- |
- //| | XU1 : XPST (ECAL e = GetECScintThick() | |
- //| ------------------------------------------------- |
- //| | XU1 : XPBX (ECAL e = GetECPbRadThick() ) | |
- //| ------------------------------------------------- |
- //| etc ..... GetNECLayers() - 1 times |
- //| ------------------------------------------------- |
- //| | XUNLayer : XPST (ECAL e = GetECScintThick() | |
- //| ------------------------------------------------- |
-
- Float_t etamin,etamax;
- Float_t *dum=0;
-
- AliEMCALGeometry * geom = GetGeometry() ;
- TString gn(geom->GetName());
- gn.ToUpper();
-
- if(!(geom->IsInitialized())){
- Error("CreateGeometry","EMCAL Geometry class has not been set up.");
- } // end if
-
- // Get pointer to the array containing media indices
- idtmed = fIdtmed->GetArray() - 1599 ;
-
- idrotm = 1;
- // gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3) - see AliModule
- AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
-
- // Create the EMCAL Mother Volume (a polygone) within which to place the Detector and named XEN1
-
- Float_t envelopA[10];
- if(gn.Contains("TRD2")) { // TUBS
- envelopA[0] = geom->GetEnvelop(0) - 10.; // rmin
- envelopA[1] = geom->GetEnvelop(1) + 12.; // rmax
- // envelopA[2] = geom->ZFromEtaR(geom->GetEnvelop(1), geom->GetArm1EtaMin());
- envelopA[2] = 390.; // 6-feb-05
- envelopA[3] = geom->GetArm1PhiMin();
- envelopA[4] = geom->GetArm1PhiMax();
- gMC->Gsvolu("XEN1", "TUBS", idtmed[1599], envelopA, 5) ; // Tubs filled with air
- ENVELOP1.Set(5, envelopA);
- // Position the EMCAL Mother Volume (XEN1) in Alice (ALIC)
- gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
- } else if(gn.Contains("TRD1") && gn.Contains("WSUC") ) { // TRD1 for WSUC facility
- // 17-may-05 - just BOX
- envelopA[0] = 26;
- envelopA[1] = 15;
- envelopA[2] = 30;
- gMC->Gsvolu("XEN1", "BOX", idtmed[idSC], envelopA, 3) ;
- ENVELOP1.Set(3);
- for(int i=0; i<3; i++) ENVELOP1[i] = envelopA[i]; // 23-may-05
- // Position the EMCAL Mother Volume (XEN1) in WSUC
- gMC->Gspos("XEN1", 1, "WSUC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
- } else {
- envelopA[0] = geom->GetArm1PhiMin(); // minimum phi angle
- envelopA[1] = geom->GetArm1PhiMax() - geom->GetArm1PhiMin(); // angular range in phi
- envelopA[2] = geom->GetNPhi(); // number of sections in phi
- envelopA[3] = 2; // 2 z coordinates
- envelopA[4] = geom->ZFromEtaR(geom->GetEnvelop(1),
- geom->GetArm1EtaMin()); // z coordinate 1
- //add some padding for mother volume
- envelopA[5] = geom->GetEnvelop(0) ; // rmin at z1
- envelopA[6] = geom->GetEnvelop(1) ; // rmax at z1
- envelopA[7] = geom->ZFromEtaR(geom->GetEnvelop(1),
- geom->GetArm1EtaMax()); // z coordinate 2
- envelopA[8] = envelopA[5] ; // radii are the same.
- envelopA[9] = envelopA[6] ; // radii are the same.
-
- if(gn.Contains("SHISH")) envelopA[2] = geom->GetNPhiSuperModule();
-
- gMC->Gsvolu("XEN1", "PGON ", idtmed[1599], envelopA, 10) ; // Polygone filled with air
- ENVELOP1.Set(10, envelopA);
- if (gDebug==2) {
- printf("CreateGeometry: XEN1 = %f, %f\n", envelopA[5], envelopA[6]);
- printf("CreateGeometry: XU0 = %f, %f\n", envelopA[5], envelopA[6]);
- }
- // Position the EMCAL Mother Volume (XEN1) in Alice (ALIC)
- gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
- }
-
- if(gn.Contains("SHISH")){
- // Compact and twist
- CreateShishKebabGeometry();
- return;
- }
-
- if (AliLog::GetGlobalDebugLevel()>=2) {
- printf("CreateGeometry: XEN1 = %f, %f\n", envelopA[5], envelopA[6]);
- printf("CreateGeometry: XU0 = %f, %f\n", envelopA[5], envelopA[6]);
- }
+
+ AliEMCALGeometry * geom = GetGeometry() ;
+ TString gn(geom->GetName());
+ gn.ToUpper();
+
+ if(!(geom->IsInitialized())){
+ Error("CreateGeometry","EMCAL Geometry class has not been set up.");
+ } // end if
- // Create mini-envelopes which will contain the Tower scintillator-radiator
-
- TString label ;
-
- envelopA[5] = envelopA[5] + geom->GetGap2Active() // we are at the first scintllator
- + geom->GetAlFrontThickness(); // rmin at z1
- envelopA[6] = envelopA[5] ;
-
-
- Int_t i ;
-
- Int_t nLayers = geom->GetNECLayers();
-
- for (i = 0; i < (nLayers-1); i++ ){
- label = "XU" ;
- label += i ;
- Float_t tseg ;
- tseg = geom->GetECScintThick()+geom->GetECPbRadThick(); // thickness of scintillator+Pb in E Cal
- envelopA[5] = envelopA[6] ; // rmin at z1
- envelopA[4] = geom->ZFromEtaR(envelopA[5] + tseg,
- geom->GetArm1EtaMin()); // z coordinate 1
- envelopA[7] = geom->ZFromEtaR(envelopA[5] + tseg,
- geom->GetArm1EtaMax()); // z coordinate 2
- envelopA[6] = envelopA[5] + tseg ; // rmax at z1
- envelopA[8] = envelopA[5] ; // radii are the same.
- envelopA[9] = envelopA[6] ; // radii are the same.
-
- gMC->Gsvolu(label.Data(), "PGON", idtmed[1599], envelopA, 10);// Polygone filled with air
-
- // Position XUi in XEN1
-
- gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
-
- if (AliLog::GetGlobalDebugLevel() >= 2)
- printf("CreateGeometry: XU%d = %f, %f\n", i, envelopA[5], envelopA[6]);
-
- } // end i
-
+ // Get pointer to the array containing media indices
+ fIdTmedArr = fIdtmed->GetArray() - 1599 ;
- // Create one mini-envelope which will contain the last scintillator XU(nlayers-1) because there is one more scintillator than Pb layer XU(nlayers-1)
-
- label = "XU" ;
- label += i ;
- envelopA[5] = envelopA[6] ; // rmin at z1
- envelopA[4] = geom->ZFromEtaR(envelopA[5] + geom->GetECScintThick(),
- geom->GetArm1EtaMin()); // z coordinate 1
- envelopA[7] = geom->ZFromEtaR(envelopA[5] + geom->GetECScintThick(),
- geom->GetArm1EtaMax()); // z coordinate 2
- envelopA[6] = envelopA[5] + geom->GetECScintThick() ; // rmax at z1
- envelopA[8] = envelopA[5] ; // radii are the same.
- envelopA[9] = envelopA[6] ; // radii are the same.
-
- gMC->Gsvolu(label.Data(), "PGON", idtmed[1599], envelopA, 10); // Polygone filled with air
-
- // Position the last minienvelope in XEN1
+ fIdRotm = 1;
+ // gMC->Matrix(nmat, theta1, phi1, theta2, phi2, theta3, phi3) - see AliModule
+ AliMatrix(fIdRotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
- gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
-
- if(AliLog::GetGlobalDebugLevel() >= 2)
- printf("CreateGeometry: XEN%d = %f, %f\n", i, envelopA[5], envelopA[6]);
+ // Create the EMCAL Mother Volume (a polygone) within which to place the Detector and named XEN1
- // Create the shapes of active material (LEAD/Aluminium/Scintillator)
- // to be placed
- Float_t envelopB[10]; // First Layer of Aluminium
- Float_t envelopC[10]; // Scintillator Layers
- Float_t envelopD[10]; // Lead Layers
-
- envelopC[0] = envelopD[0] = envelopB[0] = envelopA[0] ; // starting position in Phi
- envelopC[1] = envelopD[1] = envelopB[1] = envelopA[1] ; // angular range in phi
- envelopC[2] = envelopD[2] = envelopB[2] = envelopA[2] ; // number of sections in Phi
- envelopC[3] = envelopD[3] = envelopB[3] = envelopA[3] ; // 2 z coordinates
-
- Float_t dist = geom->GetEnvelop(0) + geom->GetAlFrontThickness() + geom->GetGap2Active() ;
- envelopB[4] = geom->ZFromEtaR(dist,
- geom->GetArm1EtaMin()); // z co-ordinate 1
- envelopB[5] = geom->GetEnvelop(0) ; // rmin at z1
- envelopB[6] = envelopB[5] + geom->GetAlFrontThickness();// rmax at z1
- envelopB[7] = geom->ZFromEtaR(dist,
- geom->GetArm1EtaMax()); // z co-ordinate 2
- envelopB[8] = envelopB[5] ; // radii are the same.
- envelopB[9] = envelopB[6] ; // radii are the same.
-
- // Define active volumes completely
-
- gMC->Gsvolu("XALU", "PGON", idtmed[1602], envelopB, 10); // PGON filled with Al
+ Float_t envelopA[10];
+ if(gn.Contains("WSUC") ) { // TRD1 for WSUC facility
+ // Nov 25,2010
+ envelopA[0] = 30.;
+ envelopA[1] = 30;
+ envelopA[2] = 20;
+ gMC->Gsvolu("XEN1", "BOX", fIdTmedArr[kIdSC], envelopA, 3) ;
+ fEnvelop1.Set(3);
+ for(int i=0; i<3; i++) fEnvelop1[i] = envelopA[i]; // 23-may-05
+ // Position the EMCAL Mother Volume (XEN1) in WSUC.
+ // Look to AliEMCALWsuCosmicRaySetUp.
+ gMC->Gspos("XEN1", 1, "WSUC", 0.0, 0.0, + 265., fIdRotm, "ONLY") ;
+ } else {
+ envelopA[0] = geom->GetArm1PhiMin(); // minimum phi angle
+ envelopA[1] = geom->GetArm1PhiMax() - geom->GetArm1PhiMin(); // angular range in phi
+ envelopA[2] = geom->GetNPhiSuperModule(); // number of sections in phi
+ envelopA[3] = 2; // 2 z coordinates
+ envelopA[4] = -geom->GetEnvelop(2)/2.; // zmin - includes padding
+ envelopA[5] = geom->GetEnvelop(0) ; // rmin at z1 - includes padding
+ envelopA[6] = geom->GetEnvelop(1) ; // rmax at z1 - includes padding
+ envelopA[7] = geom->GetEnvelop(2)/2.; // zmax includes padding
- gMC->Gspos("XALU", 1, "XEN1", 0.0, 0.0, 0.0 , idrotm, "ONLY") ; // Position Aluminium Layer in XEN1
+ envelopA[8] = envelopA[5] ; // radii are the same.
+ envelopA[9] = envelopA[6] ; // radii are the same.
- gMC->Gsvolu("XPST", "PGON", idtmed[1601], dum, 0); // PGON filled with Scintillator (shape to be defined by GSPOSP)
-
- gMC->Gsvolu("XPBX", "PGON", idtmed[1600], dum, 0); // PGON filled with Lead (shape to be defined by GSPOSP)
-
- //gMC->Gsvolu("XCUX", "PGON", idtmed[1603], dum, 0); // PGON filled with Copper (shape to be defined by GSPOSP)
+ gMC->Gsvolu("XEN1", "PGON", fIdTmedArr[kIdAIR], envelopA, 10) ; // Polygone filled with air
+ fEnvelop1.Set(10, envelopA);
+ if (gDebug==2) {
+ printf("CreateGeometry: XEN1 = %f, %f\n", envelopA[5], envelopA[6]);
+ printf("CreateGeometry: XU0 = %f, %f\n", envelopA[5], envelopA[6]);
+ }
+ // Position the EMCAL Mother Volume (XEN1) in Alice (ALIC)
+ gMC->Gspos(geom->GetNameOfEMCALEnvelope(), 1, "ALIC", 0.0, 0.0, 0.0, fIdRotm, "ONLY") ;
+ }
- gMC->Gsdvn("XPHI", "XPST", geom->GetNPhi(), 2); // Divide eta section of scintillators into phi segments.
-
- // Position alternatively scintillator and Lead Layers in XUi.
+ // COMPACT, TRD1
+ AliDebug(2,Form("Shish-Kebab geometry : %s", GetTitle()));
+ CreateShishKebabGeometry();
- envelopD[6] = envelopB[6] + geom->GetGap2Active() ;// gap between Al layer and XU0
-
- for (int i = 0; i < nLayers; i++ ){
- label = "XU" ;
- label += i ; // we will place one layer in each mini envelope)
-
- Float_t scthick ; // scintillator thickness
- scthick = geom->GetECScintThick() ;
-
- envelopC[5] = envelopD[6] ; //rmin
- envelopC[6] = envelopC[5] + scthick ; //rmax
- envelopC[8] = envelopC[5] ; //rmin
- envelopC[9] = envelopC[6] ; //rmax
-
- if(AliLog::GetGlobalDebugLevel() >= 2 )
- printf("CreateGeometry: volume = %s, name = XPST thickness = %f deb = %f/%f fin = %f/%f", label.Data(), scthick, envelopC[5], envelopC[8], envelopC[6], envelopC[9]) ;
-
- for (int j =0; j < (geom->GetNEta()) ; j++){
- etamin = geom->GetArm1EtaMin()+
- (j*geom->GetDeltaEta());
- etamax = geom->GetArm1EtaMin()+
- ((j+1)*geom->GetDeltaEta());
- envelopC[4] = geom->ZFromEtaR(envelopC[5],etamin); //z begin
- envelopC[7] = geom->ZFromEtaR(envelopC[5],etamax);// z end
-
- gMC->Gsposp("XPST",1+j+i*(geom->GetNEta()), label.Data(),
- 0.0, 0.0, 0.0 , idrotm, "ONLY", envelopC, 10); // Position and define layer
- } // end for j
-
- Float_t radthick ; // radiator thickness
- TString radname ; // radiator name
- radthick = geom->GetECPbRadThick();
- radname = "XPBX" ;
-
- if ( i < nLayers -1 ) { // except for the last XU which contains only one scintillator layer
-
- envelopD[5] = envelopC[6] ; //rmin
- envelopD[8] = envelopD[5] ; //rmin
- envelopD[6] = envelopD[5] + radthick ; // rmax
- envelopD[9] = envelopD[6] ; //rmax
-
- if(AliLog::GetGlobalDebugLevel() >= 2 )
- printf("CreateGeometry: volume = %s, name = %s thickness = %f deb = %f/%f fin = %f/%f", label.Data(), radname.Data(), radthick, envelopD[5], envelopD[8], envelopD[6], envelopD[9]) ;
-
- for (int j =0; j < (geom->GetNEta()) ; j++){
- etamin = geom->GetArm1EtaMin()+
- (j*geom->GetDeltaEta());
- etamax = geom->GetArm1EtaMin()+
- ((j+1)*geom->GetDeltaEta());
- envelopD[4] = geom->ZFromEtaR(envelopD[5],etamin);//z begin
- envelopD[7] = geom->ZFromEtaR(envelopD[5],etamax);// z end
-
- // Position and Define Layer
-
- gMC->Gsposp(radname.Data(),1+j+i*(geom->GetNEta()), label.Data(),
- 0.0, 0.0, 0.0 , idrotm, "ONLY", envelopD, 10);
- } // end for j
- } // if not last layer
- } // for i
+ if(gn.Contains("WSUC")==0) { // Nov 24,2010 for TB
+ //Space Frame
+ AliDebug(2,"Creating EMCAL Space Frame");
+ fCalFrame = new AliEMCALSpaceFrame();
+ fCalFrame->CreateGeometry();
+ }
}
//______________________________________________________________________
void AliEMCALv0::Init(void)
{
// Just prints an information message
-
+ AliEMCAL::Init();
if(AliLog::GetGlobalDebugLevel()>0) {
TString message("\n") ;
message += "*****************************************\n" ;
message += "EMCAL geometry initialization failed !" ;
}
message += "\n*****************************************" ;
- printf(message.Data() ) ;
+ printf("%s",message.Data() ) ;
}
}
// 24-aug-04 by PAI
+//______________________________________________________________________
void AliEMCALv0::CreateShishKebabGeometry()
-{ // TWIST, TRD1 and TRD2
+{
+ // Oct 26,2010
+ // TRD1
AliEMCALGeometry * g = GetGeometry();
TString gn(g->GetName()); gn.ToUpper();
- // see AliModule::fIdtmed
- // idtmed = fIdtmed->GetArray() - 1599 ; // see AliEMCAL::::CreateMaterials()
- // int idAIR=1599, idPB = 1600, idSC = 1601, idSTEEL = 1603;
+ Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad(), tanTrd1 = TMath::Tan(trd1Angle/2.);
+ // see AliModule::fFIdTmedArr
+ // fIdTmedArr = fIdtmed->GetArray() - 1599 ; // see AliEMCAL::::CreateMaterials()
+ // int kIdAIR=1599, kIdPB = 1600, kIdSC = 1601, kIdSTEEL = 1603;
// idAL = 1602;
Double_t par[10], xpos=0., ypos=0., zpos=0.;
- CreateSmod("XEN1"); // 18-may-05
+ CreateSmod(g->GetNameOfEMCALEnvelope());
CreateEmod("SMOD","EMOD"); // 18-may-05
- if(gn.Contains("110DEG")) CreateEmod("SM10","EMOD"); // 12-oct-05
+ if(g->GetKey110DEG()) CreateEmod("SM10","EMOD"); // Nov 1,2006
// Sensitive SC (2x2 tiles)
- double parSCM0[5], *dummy = 0, parTRAP[11];
- Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad(), tanTmp = TMath::Tan(trd1Angle/2.);
- if(!gn.Contains("TRD")) { // standard module
- par[0] = (g->GetECPbRadThick()+g->GetECScintThick())*g->GetNECLayers()/2.;
- par[1] = par[2] = g->GetPhiTileSize(); // Symetric case
- gMC->Gsvolu("SCM0", "BOX", idtmed[idSC], par, 3); // 2x2 tiles
+ double parSCM0[5]={0,0,0,0}, *dummy = 0, parTRAP[11];
+
+ if(!gn.Contains("V1")) {
+ double wallThickness = g->GetPhiModuleSize()/g->GetNPHIdiv() - g->GetPhiTileSize();
+ for(int i=0; i<3; i++) parSCM0[i] = fParEMOD[i] - wallThickness;
+ parSCM0[3] = fParEMOD[3];
+ gMC->Gsvolu("SCM0", "TRD1", fIdTmedArr[kIdAIR], parSCM0, 4);
gMC->Gspos("SCM0", 1, "EMOD", 0., 0., 0., 0, "ONLY") ;
- // Division to tile size
- gMC->Gsdvn("SCM1","SCM0", g->GetNPHIdiv(), 2); // y-axis
- gMC->Gsdvn("SCM2","SCM1", g->GetNETAdiv(), 3); // z-axis
- // put LED to the SCM2
- par[0] = g->GetECPbRadThick()/2.;
- par[1] = par[2] = g->GetPhiTileSize()/2.; // Symetric case
- gMC->Gsvolu("PBTI", "BOX", idtmed[idPB], par, 3);
-
- printf(" Pb tiles \n");
- int nr=0;
- ypos = zpos = 0.0;
- xpos = -sampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
- for(int ix=0; ix<g->GetNECLayers(); ix++){
- gMC->Gspos("PBTI", ++nr, "SCM2", xpos, ypos, zpos, 0, "ONLY") ;
- // printf(" %i xpos %f \n", ix+1, xpos);
- xpos += sampleWidth;
- }
- printf(" Number of Pb tiles in SCM2 %i \n", nr);
- } else if(gn.Contains("TRD1")) { // TRD1 - 30-sep-04
- if(gn.Contains("MAY05")){
- Double_t dzTmp = g->GetFrontSteelStrip()+g->GetPassiveScintThick();
- parSCM0[0] = parEMOD[0] + tanTmp*dzTmp; // dx1
- parSCM0[1] = parEMOD[1]; // dx2
- parSCM0[2] = parEMOD[2]; // dy
- for(int i=0; i<3; i++) parSCM0[i] -= g->GetLateralSteelStrip();
- parSCM0[3] = parEMOD[3] - dzTmp/2.; // dz
-
- gMC->Gsvolu("SCM0", "TRD1", idtmed[idAIR], parSCM0, 4);
- gMC->Gspos("SCM0", 1, "EMOD", 0., 0., dzTmp/2., 0, "ONLY") ;
- } else { // before MAY 2005
- double wallThickness = g->GetPhiModuleSize()/2. - g->GetPhiTileSize(); // Need check
- for(int i=0; i<3; i++) parSCM0[i] = parEMOD[i] - wallThickness;
- parSCM0[3] = parEMOD[3];
- gMC->Gsvolu("SCM0", "TRD1", idtmed[idAIR], parSCM0, 4);
- gMC->Gspos("SCM0", 1, "EMOD", 0., 0., 0., 0, "ONLY") ;
- }
+ } else {
+ double wTh = g->GetLateralSteelStrip();
+ parSCM0[0] = fParEMOD[0] - wTh + tanTrd1*g->GetTrd1AlFrontThick();
+ parSCM0[1] = fParEMOD[1] - wTh;
+ parSCM0[2] = fParEMOD[2] - wTh;
+ parSCM0[3] = fParEMOD[3] - g->GetTrd1AlFrontThick()/2.;
+ gMC->Gsvolu("SCM0", "TRD1", fIdTmedArr[kIdAIR], parSCM0, 4);
+ double zshift = g->GetTrd1AlFrontThick()/2.;
+ gMC->Gspos("SCM0", 1, "EMOD", 0., 0., zshift, 0, "ONLY");
+ //
+ CreateAlFrontPlate("EMOD","ALFP");
+ }
- if(g->GetNPHIdiv()==2 && g->GetNETAdiv()==2) {
+ if(g->GetNPHIdiv()==2 && g->GetNETAdiv()==2) {
// Division to tile size - 1-oct-04
- printf("<I> Divide SCM0 on y-axis %i\n", g->GetNETAdiv());
- gMC->Gsdvn("SCMY","SCM0", g->GetNETAdiv(), 2); // y-axis
+ AliDebug(2,Form(" Divide SCM0 on y-axis %i\n", g->GetNETAdiv()));
+ gMC->Gsdvn("SCMY","SCM0", g->GetNETAdiv(), 2); // y-axis
// Trapesoid 2x2
- parTRAP[0] = parSCM0[3]; // dz
- parTRAP[1] = TMath::ATan2((parSCM0[1]-parSCM0[0])/2.,2.*parSCM0[3])*180./TMath::Pi(); // theta
- parTRAP[2] = 0.; // phi
- // bottom
- parTRAP[3] = parSCM0[2]/2.; // H1
- parTRAP[4] = parSCM0[0]/2.; // BL1
- parTRAP[5] = parTRAP[4]; // TL1
- parTRAP[6] = 0.0; // ALP1
- // top
- parTRAP[7] = parSCM0[2]/2.; // H2
- parTRAP[8] = parSCM0[1]/2.; // BL2
- parTRAP[9] = parTRAP[8]; // TL2
- parTRAP[10]= 0.0; // ALP2
- printf(" ** TRAP ** \n");
- for(int i=0; i<11; i++) printf(" par[%2.2i] %9.4f\n", i, parTRAP[i]);
-
- gMC->Gsvolu("SCMX", "TRAP", idtmed[idSC], parTRAP, 11);
- xpos = +(parSCM0[1]+parSCM0[0])/4.;
- gMC->Gspos("SCMX", 1, "SCMY", xpos, 0.0, 0.0, 0, "ONLY") ;
-
- // Using rotation because SCMX should be the same due to Pb tiles
- xpos = -xpos;
- AliMatrix(idrotm, 90.0,180., 90.0, 270.0, 0.0,0.0) ;
- gMC->Gspos("SCMX", 2, "SCMY", xpos, 0.0, 0.0, idrotm, "ONLY");
+ parTRAP[0] = parSCM0[3]; // dz
+ parTRAP[1] = TMath::ATan2((parSCM0[1]-parSCM0[0])/2.,2.*parSCM0[3])*180./TMath::Pi(); // theta
+ parTRAP[2] = 0.; // phi
+ // bottom
+ parTRAP[3] = parSCM0[2]/2.; // H1
+ parTRAP[4] = parSCM0[0]/2.; // BL1
+ parTRAP[5] = parTRAP[4]; // TL1
+ parTRAP[6] = 0.0; // ALP1
+ // top
+ parTRAP[7] = parSCM0[2]/2.; // H2
+ parTRAP[8] = parSCM0[1]/2.; // BL2
+ parTRAP[9] = parTRAP[8]; // TL2
+ parTRAP[10]= 0.0; // ALP2
+ AliDebug(2,Form(" ** TRAP ** \n"));
+ for(int i=0; i<11; i++) AliDebug(3, Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
+
+ gMC->Gsvolu("SCMX", "TRAP", fIdTmedArr[kIdSC], parTRAP, 11);
+ xpos = +(parSCM0[1]+parSCM0[0])/4.;
+ gMC->Gspos("SCMX", 1, "SCMY", xpos, 0.0, 0.0, 0, "ONLY") ;
+
+ // Using rotation because SCMX should be the same due to Pb tiles
+ xpos = -xpos;
+ AliMatrix(fIdRotm, 90.0,180., 90.0, 270.0, 0.0,0.0) ;
+ gMC->Gspos("SCMX", 2, "SCMY", xpos, 0.0, 0.0, fIdRotm, "ONLY");
// put LED to the SCM0
- AliEMCALShishKebabTrd1Module *mod = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(0);
- gMC->Gsvolu("PBTI", "BOX", idtmed[idPB], dummy, 0);
+ AliEMCALShishKebabTrd1Module *mod = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(0);
+ Double_t tanBetta = mod->GetTanBetta();
+ int nr=0;
+ ypos = 0.0;
+ double xCenterSCMX = (parTRAP[4] + parTRAP[8])/2.;
+ if(!gn.Contains("V1")) {
par[1] = parSCM0[2]/2; // y
par[2] = g->GetECPbRadThick()/2.; // z
-
- int nr=0;
- ypos = 0.0;
- zpos = -sampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
- double xCenterSCMX = (parTRAP[4] + parTRAP[8])/2.;
- if(!gn.Contains("NOPB")) { // for testing - 11-jul-05
- printf(" Pb tiles \n");
- for(int iz=0; iz<g->GetNECLayers(); iz++){
- par[0] = (parSCM0[0] + mod->GetTanBetta()*sampleWidth*iz)/2.;
- xpos = par[0] - xCenterSCMX;
- gMC->Gsposp("PBTI", ++nr, "SCMX", xpos, ypos, zpos, 0, "ONLY", par, 3) ;
- printf(" %i xpos %f zpos %f par[0] %f \n", iz+1, xpos, zpos, par[0]);
- zpos += sampleWidth;
- }
- printf(" Number of Pb tiles in SCMX %i \n", nr);
- }
- } else if(g->GetNPHIdiv()==3 && g->GetNETAdiv()==3) {
- Trd1Tower3X3(parSCM0);
- } else if(g->GetNPHIdiv()==4 && g->GetNETAdiv()==4) {
- Trd1Tower4X4();
+ gMC->Gsvolu("PBTI", "BOX", fIdTmedArr[kIdPB], dummy, 0);
+ zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
+ AliDebug(2,Form(" Pb tiles \n"));
+ for(int iz=0; iz<g->GetNECLayers(); iz++){
+ par[0] = (parSCM0[0] + tanBetta*fSampleWidth*iz)/2.;
+ xpos = par[0] - xCenterSCMX;
+ gMC->Gsposp("PBTI", ++nr, "SCMX", xpos, ypos, zpos, 0, "ONLY", par, 3) ;
+ AliDebug(3,Form(" %i xpos %f zpos %f par[0] %f \n", iz+1, xpos, zpos, par[0]));
+ zpos += fSampleWidth;
+ }
+ AliDebug(2,Form(" Number of Pb tiles in SCMX %i \n", nr));
+ } else {
+ // Oct 26, 2010
+ // First sheet of paper
+ par[1] = parSCM0[2]/2.; // y
+ par[2] = g->GetTrd1BondPaperThick()/2.; // z
+ par[0] = parSCM0[0]/2.; // x
+ gMC->Gsvolu("PAP1", "BOX", fIdTmedArr[kIdPAPER], par, 3);
+ xpos = par[0] - xCenterSCMX;
+ zpos = -parSCM0[3] + g->GetTrd1BondPaperThick()/2.;
+ gMC->Gspos("PAP1", 1, "SCMX", xpos, ypos, zpos, 0, "ONLY");
+ for(int iz=0; iz<g->GetNECLayers()-1; iz++){
+ nr = iz + 1;
+ Double_t dz = g->GetECScintThick() + g->GetTrd1BondPaperThick() + fSampleWidth*iz;
+ // PB + 2 paper sheets
+ par[2] = g->GetECPbRadThick()/2. + g->GetTrd1BondPaperThick(); // z
+ par[0] = (parSCM0[0] + tanBetta*dz)/2.;
+ TString pa(Form("PA%2.2i",nr));
+ gMC->Gsvolu(pa.Data(), "BOX", fIdTmedArr[kIdPAPER], par, 3);
+ xpos = par[0] - xCenterSCMX;
+ zpos = -parSCM0[3] + dz + par[2];
+ gMC->Gspos(pa.Data(), 1, "SCMX", xpos, ypos, zpos, 0, "ONLY") ;
+ // Pb
+ TString pb(Form("PB%2.2i",nr));
+ par[2] = g->GetECPbRadThick()/2.; // z
+ gMC->Gsvolu(pb.Data(), "BOX", fIdTmedArr[kIdPB], par, 3);
+ gMC->Gspos(pb.Data(), 1, pa.Data(), 0.0, 0.0, 0.0, 0, "ONLY") ;
+ }
}
- } else if(gn.Contains("TRD2")) { // TRD2 - 14-jan-05
- // Scm0InTrd2(g, parEMOD, parSCM0); // First dessin
- PbmoInTrd2(g, parEMOD, parSCM0); // Second dessin
+
+ } else if(g->GetNPHIdiv()==3 && g->GetNETAdiv()==3) {
+ printf(" before AliEMCALv0::Trd1Tower3X3() : parSCM0");
+ for(int i=0; i<4; i++) printf(" %7.4f ", parSCM0[i]);
+ printf("\n");
+ Trd1Tower3X3(parSCM0);
+ } else if(g->GetNPHIdiv()==1 && g->GetNETAdiv()==1) {
+ // no division in SCM0
+ Trd1Tower1X1(parSCM0);
+ } else if(g->GetNPHIdiv()==4 && g->GetNETAdiv()==4) {
+ Trd1Tower4X4();
}
+
}
+//______________________________________________________________________
void AliEMCALv0::CreateSmod(const char* mother)
-{ // 18-may-05; mother="XEN1";
+{
+ // 18-may-05; mother="XEN1";
// child="SMOD" from first to 10th, "SM10" (11th and 12th) (TRD1 case)
- // child="SMON" and "SMOP"("TRD2" case)
AliEMCALGeometry * g = GetGeometry();
TString gn(g->GetName()); gn.ToUpper();
- Double_t par[1], parTubs[5], xpos=0., ypos=0., zpos=0., rpos=0., dphi=0., phi=0.0, phiRad=0.;
+ Double_t par[3], xpos=0., ypos=0., zpos=0., rpos=0., dphi=0., phi=0.0, phiRad=0.;
Double_t par1C = 0.;
// ===== define Super Module from air - 14x30 module ==== ;
- sampleWidth = double(g->GetECPbRadThick()+g->GetECScintThick());
- printf("\n ## Super Module | sampleWidth %5.3f ## %s \n", sampleWidth, gn.Data());
+ AliDebug(2,Form("\n ## Super Module | fSampleWidth %5.3f ## %s \n", fSampleWidth, gn.Data()));
par[0] = g->GetShellThickness()/2.;
par[1] = g->GetPhiModuleSize()*g->GetNPhi()/2.;
par[2] = g->GetEtaModuleSize()*15.;
- idrotm=0;
+ fIdRotm=0;
int nphism = g->GetNumberOfSuperModules()/2; // 20-may-05
if(nphism>0) {
dphi = (g->GetArm1PhiMax() - g->GetArm1PhiMin())/nphism;
- // if(gn.Contains("110DEG")) dphi = (g->GetArm1PhiMax() - g->GetArm1PhiMin())/(nphism-1);
+ // if(g->GetKey110DEG()) dphi = (g->GetArm1PhiMax() - g->GetArm1PhiMin())/(nphism-1);
rpos = (g->GetEnvelop(0) + g->GetEnvelop(1))/2.;
- printf(" rpos %8.2f : dphi %6.1f degree \n", rpos, dphi);
+ AliDebug(2,Form(" rpos %8.2f : dphi %6.1f degree \n", rpos, dphi));
}
- if (gn.Contains("TRD2")) { // tubs - 27-jan-05
- parTubs[0] = g->GetTubsR(); // rmin
- parTubs[1] = parTubs[0] + g->GetShellThickness(); // rmax ??
- parTubs[2] = 380./2.; // DZ half length in z; 11-oct-04 - for 26 division
- parTubs[3] = -dphi/2.; // PHI1 starting angle of the segment;
- parTubs[4] = +dphi/2.; // PHI2 ending angle of the segment;
-
- gMC->Gsvolu("SMOP", "TUBS", idtmed[idAIR], parTubs, 5); // pozitive Z
- gMC->Gsvolu("SMON", "TUBS", idtmed[idAIR], parTubs, 5); // negative Z
-
- printf(" SMOP,N ** TUBS **\n");
- printf("tmed %i | Rmin %7.2f Rmax %7.2f dz %7.2f phi1,2 (%7.2f,%7.2f)\n",
- idtmed[idAIR], parTubs[0],parTubs[1],parTubs[2], parTubs[3],parTubs[4]);
- // have to add 1 cm plastic before EMOD - time solution
- } else if(gn.Contains("WSUC")) {
+ if(gn.Contains("WSUC")) {
par[0] = g->GetPhiModuleSize()*g->GetNPhi()/2.;
par[1] = g->GetShellThickness()/2.;
par[2] = g->GetEtaModuleSize()*g->GetNZ()/2. + 5;
- gMC->Gsvolu("SMOD", "BOX", idtmed[idAIR], par, 3);
+ gMC->Gsvolu("SMOD", "BOX", fIdTmedArr[kIdAIR], par, 3);
- printf("SMOD in WSUC : tmed %i | dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n",
- idtmed[idAIR], par[0],par[1],par[2]);
- smodPar0 = par[0];
- smodPar1 = par[1];
- smodPar2 = par[2];
+ AliDebug(2,Form("SMOD in WSUC : tmed %i | dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n",
+ fIdTmedArr[kIdAIR], par[0],par[1],par[2]));
+ fSmodPar0 = par[0];
+ fSmodPar1 = par[1];
+ fSmodPar2 = par[2];
nphism = g->GetNumberOfSuperModules();
} else {
- if (gn.Contains("TWIST")) {
- par[2] += 0.4; // for 27 division
- } else if(gn.Contains("TRD")) {
- par[2] = 350./2.; // 11-oct-04 - for 26 division
- }
- // par[2] = g->GetXYModuleSize()*g->GetNZ()/2.;
- gMC->Gsvolu("SMOD", "BOX", idtmed[idAIR], par, 3);
- printf("tmed %i | dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n",
- idtmed[idAIR], par[0],par[1],par[2]);
- smodPar0 = par[0];
- smodPar2 = par[2];
- if(gn.Contains("110DEG")) { // 12-oct-05
- par1C = par[1];
- par[1] /= 2.;
- gMC->Gsvolu("SM10", "BOX", idtmed[idAIR], par, 3);
- printf(" Super module with name \"SM10\" was created too par[1] = %f\n", par[1]);
- par[1] = par1C;
- }
+ par[2] = 350./2.; // 11-oct-04 - for 26 division
+ AliDebug(2,Form(" par[0] %7.2f (old) \n", par[0]));
+ Float_t parSM[] = {g->GetSuperModulesPar(0),g->GetSuperModulesPar(1),g->GetSuperModulesPar(2)};
+ for(int i=0; i<3; i++) par[i] = parSM[i];
+ }
+ gMC->Gsvolu("SMOD", "BOX", fIdTmedArr[kIdAIR], par, 3);
+ AliDebug(2,Form("tmed %i | dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n",
+ fIdTmedArr[kIdAIR], par[0],par[1],par[2]));
+ fSmodPar0 = par[0];
+ fSmodPar2 = par[2];
+ if(g->GetKey110DEG()) { // 12-oct-05
+ par1C = par[1];
+ par[1] /= 2.;
+ gMC->Gsvolu("SM10", "BOX", fIdTmedArr[kIdAIR], par, 3);
+ AliDebug(2,Form(" Super module with name \"SM10\" was created too par[1] = %f\n", par[1]));
+ par[1] = par1C;
+ }
// Steel plate
- if(g->GetSteelFrontThickness() > 0.0) { // 28-mar-05
- par[0] = g->GetSteelFrontThickness()/2.;
- gMC->Gsvolu("STPL", "BOX", idtmed[idSTEEL], par, 3);
- printf("tmed %i | dx %7.2f dy %7.2f dz %7.2f (STPL) \n", idtmed[idSTEEL], par[0],par[1],par[2]);
- xpos = -(g->GetShellThickness() - g->GetSteelFrontThickness())/2.;
- gMC->Gspos("STPL", 1, "SMOD", xpos, 0.0, 0.0, 0, "ONLY") ;
- }
+ if(g->GetSteelFrontThickness() > 0.0) { // 28-mar-05
+ par[0] = g->GetSteelFrontThickness()/2.;
+ gMC->Gsvolu("STPL", "BOX", fIdTmedArr[kIdSTEEL], par, 3);
+ printf("tmed %i | dx %7.2f dy %7.2f dz %7.2f (STPL) \n", fIdTmedArr[kIdSTEEL], par[0],par[1],par[2]);
+ xpos = -(g->GetShellThickness() - g->GetSteelFrontThickness())/2.;
+ gMC->Gspos("STPL", 1, "SMOD", xpos, 0.0, 0.0, 0, "ONLY") ;
}
int nr=0, nrsmod=0, i0=0;
- if(gn.Contains("TEST")) {nphism = 1;} // just only 2 super modules;
// Turn whole super module
- int TurnSupMod = 1; // should be ONE; for testing =0
for(int i=i0; i<nphism; i++) {
- if (gn.Contains("TRD2")) { // tubs - 27-jan-05
- if(i==i0) {
- printf("** TRD2 ** ");
- if(TurnSupMod==1) printf(" No 3 degree rotation !!! ");
- printf("\n");
- }
- Double_t phic=0., phicRad=0.; // phi angle of arc center
- phic = g->GetArm1PhiMin() + dphi*(2*i+1)/2.; //
- phicRad = phic*TMath::DegToRad();
- phi = phic - g->GetTubsTurnAngle();
- phiRad = phi*TMath::DegToRad();
- if(TurnSupMod==1) {
- TVector2 vc; // position of super module center
- vc.SetMagPhi(parTubs[0], phicRad);
- TVector2 vcTurn; // position of super module center with turn
- vcTurn.SetMagPhi(parTubs[0], phiRad);
- TVector2 vcShift = vc - vcTurn;
- phic = phi;
-
- xpos = vcShift.X();
- ypos = vcShift.Y();
- } else { // 1-mar-05 ; just for testing - no turn od SMOD; looks good
- xpos = ypos = 0.0;
- }
- zpos = parTubs[2];
- AliMatrix(idrotm, 90.0, phic, 90.0, 90.0+phic, 0.0, 0.0);
-
- gMC->Gspos("SMOP", ++nr, mother, xpos, ypos, zpos, idrotm, "ONLY") ;
- printf("SMOP %2i | %2i idrotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f \n",
- i, nr, idrotm, phic, phicRad, xpos, ypos, zpos);
- printf(" phiy(90+phic) %6.1f \n", 90. + phic);
-
- if(!gn.Contains("TEST1") && g->GetNumberOfSuperModules() > 1){
- // double phiy = 90. + phic + 180.;
- // if(phiy>=360.) phiy -= 360.;
- // printf(" phiy %6.1f \n", phiy);
- // AliMatrix(idrotm, 90.0, phic, 90.0, phiy, 180.0, 0.0);
- gMC->Gspos("SMON", nr, mother, xpos, ypos, -zpos, idrotm, "ONLY") ;
- printf("SMON %2i | %2i idrotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f \n",
- i, nr, idrotm, phic, phicRad, xpos, ypos, -zpos);
- }
- } else if(gn.Contains("WSUC")) {
+ if(gn.Contains("WSUC")) {
xpos = ypos = zpos = 0.0;
- idrotm = 0;
- gMC->Gspos("SMOD", 1, mother, xpos, ypos, zpos, idrotm, "ONLY") ;
- printf(" idrotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f \n",
- idrotm, phi, phiRad, xpos, ypos, zpos);
+ fIdRotm = 0;
+ gMC->Gspos("SMOD", 1, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
+ printf(" fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f \n",
+ fIdRotm, phi, phiRad, xpos, ypos, zpos);
nr++;
- } else {
+ } else { // TRD1
TString smName("SMOD"); // 12-oct-05
- if(i==5 && gn.Contains("110DEG")) {
+ if(i==5 && g->GetKey110DEG()) {
smName = "SM10";
nrsmod = nr;
nr = 0;
phi = g->GetArm1PhiMin() + dphi*(2*i+1)/2.; // phi= 70, 90, 110, 130, 150, 170
phiRad = phi*TMath::Pi()/180.;
- AliMatrix(idrotm, 90.0, phi, 90.0, 90.0+phi, 0.0, 0.0);
+ AliMatrix(fIdRotm, 90.0, phi, 90.0, 90.0+phi, 0.0, 0.0);
xpos = rpos * TMath::Cos(phiRad);
ypos = rpos * TMath::Sin(phiRad);
- zpos = smodPar2; // 21-sep-04
- if(i==5 && gn.Contains("110DEG")) {
+ zpos = fSmodPar2; // 21-sep-04
+ if(i==5 && g->GetKey110DEG()) {
xpos += (par1C/2. * TMath::Sin(phiRad));
ypos -= (par1C/2. * TMath::Cos(phiRad));
}
// 1th module in z-direction;
- gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, zpos, idrotm, "ONLY") ;
- printf(" %s : %2i idrotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : i %i \n",
- smName.Data(), nr, idrotm, phi, phiRad, xpos, ypos, zpos, i);
+ gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
+ AliDebug(3, Form(" %s : %2i fIdRotm %3i phi %6.1f(%5.3f) xpos %7.2f ypos %7.2f zpos %7.2f : i %i \n",
+ smName.Data(), nr, fIdRotm, phi, phiRad, xpos, ypos, zpos, i));
// 2th module in z-direction;
- if(gn.Contains("TWIST") || gn.Contains("TRD")) {
// turn arround X axis; 0<phi<360
- double phiy = 90. + phi + 180.;
- if(phiy>=360.) phiy -= 360.;
-
- AliMatrix(idrotm, 90.0, phi, 90.0, phiy, 180.0, 0.0);
- gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, -zpos, idrotm, "ONLY");
- printf(" %s : %2i idrotm %3i phiy %6.1f xpos %7.2f ypos %7.2f zpos %7.2f \n",
- smName.Data(), nr, idrotm, phiy, xpos, ypos, -zpos);
- } else {
- gMC->Gspos("SMOD", ++nr, mother, xpos, ypos, -zpos, idrotm, "ONLY");
- }
+ double phiy = 90. + phi + 180.;
+ if(phiy>=360.) phiy -= 360.;
+
+ AliMatrix(fIdRotm, 90.0, phi, 90.0, phiy, 180.0, 0.0);
+ gMC->Gspos(smName.Data(), ++nr, mother, xpos, ypos, -zpos, fIdRotm, "ONLY");
+ AliDebug(3, Form(" %s : %2i fIdRotm %3i phiy %6.1f xpos %7.2f ypos %7.2f zpos %7.2f \n",
+ smName.Data(), nr, fIdRotm, phiy, xpos, ypos, -zpos));
}
}
- printf(" Number of Super Modules %i \n", nr+nrsmod);
+ AliDebug(2,Form(" Number of Super Modules %i \n", nr+nrsmod));
}
+//______________________________________________________________________
void AliEMCALv0::CreateEmod(const char* mother, const char* child)
-{ // 17-may-05; mother="SMOD"; child="EMOD"
+{
+ // 17-may-05; mother="SMOD"; child="EMOD"
+ // Oct 26,2010
AliEMCALGeometry * g = GetGeometry();
TString gn(g->GetName()); gn.ToUpper();
// Module definition
- Double_t par[10], parTubs[5], xpos=0., ypos=0., zpos=0., rpos=0.;
- Double_t parSCPA[5], zposSCPA=0.; // passive SC - 13-MAY-05, TRD1 case
- Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad(), tanTrd1 = TMath::Tan(trd1Angle/2.);
- Double_t tanTrd2y = TMath::Tan(g->GetTrd2AngleY()*TMath::DegToRad()/2.);
- int nr=0;
- idrotm=0;
- if(!gn.Contains("TRD")) { // standard module
- par[0] = (sampleWidth*g->GetNECLayers())/2.;
- par[1] = par[2] = g->GetPhiModuleSize()/2.;
- gMC->Gsvolu(child, "BOX", idtmed[idSTEEL], par, 3);
-
- } else if (gn.Contains("TRD1")){ // TRD1 system coordinate iz differnet
- if(strcmp(mother,"SMOD")==0) {
- parEMOD[0] = g->GetEtaModuleSize()/2.; // dx1
- parEMOD[1] = g->Get2Trd1Dx2()/2.; // dx2
- parEMOD[2] = g->GetPhiModuleSize()/2.;; // dy
- parEMOD[3] = g->GetLongModuleSize()/2.; // dz
- gMC->Gsvolu(child, "TRD1", idtmed[idSTEEL], parEMOD, 4);
- if(gn.Contains("WSUC") || gn.Contains("MAY05")){
- parSCPA[0] = g->GetEtaModuleSize()/2. + tanTrd1*g->GetFrontSteelStrip(); // dx1
- parSCPA[1] = parSCPA[0] + tanTrd1*g->GetPassiveScintThick(); // dx2
- parSCPA[2] = g->GetPhiModuleSize()/2.; // dy
- parSCPA[3] = g->GetPassiveScintThick()/2.; // dz
- gMC->Gsvolu("SCPA", "TRD1", idtmed[idSC], parSCPA, 4);
- zposSCPA = -parEMOD[3] + g->GetFrontSteelStrip() + g->GetPassiveScintThick()/2.;
- gMC->Gspos ("SCPA", ++nr, child, 0.0, 0.0, zposSCPA, 0, "ONLY");
- }
- }
- } else if (gn.Contains("TRD2")){ // TRD2 as for TRD1 - 27-jan-05
- parEMOD[0] = g->GetEtaModuleSize()/2.; // dx1
- parEMOD[1] = g->Get2Trd1Dx2()/2.; // dx2
- parEMOD[2] = g->GetPhiModuleSize()/2.; // dy1
- parEMOD[3] = parEMOD[2] + tanTrd2y*g->GetLongModuleSize();// dy2
- parEMOD[4] = g->GetLongModuleSize()/2.; // dz
- gMC->Gsvolu(child, "TRD2", idtmed[idSTEEL], parEMOD, 5);
+ Double_t xpos=0., ypos=0., zpos=0.;
+ //Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad();tanTrd1 = TMath::Tan(trd1Angle/2.);
+
+ if(strcmp(mother,"SMOD")==0) {
+ fParEMOD[0] = g->GetEtaModuleSize()/2.; // dx1
+ fParEMOD[1] = g->Get2Trd1Dx2()/2.; // dx2
+ fParEMOD[2] = g->GetPhiModuleSize()/2.;; // dy
+ fParEMOD[3] = g->GetLongModuleSize()/2.; // dz
+ gMC->Gsvolu(child, "TRD1", fIdTmedArr[kIdSTEEL], fParEMOD, 4);
}
-
- nr = 0;
- if(gn.Contains("TWIST")) { // 13-sep-04
- fShishKebabModules = new TList;
- AliEMCALShishKebabModule *mod=0, *mTmp; // current module
- for(int iz=0; iz<g->GetNZ(); iz++) {
- //for(int iz=0; iz<4; iz++) {
- if(iz==0) {
- mod = new AliEMCALShishKebabModule();
- idrotm = 0;
- } else {
- mTmp = new AliEMCALShishKebabModule(*mod);
- mod = mTmp;
- Double_t angle = mod->GetThetaInDegree();
- AliMatrix(idrotm, angle,0., 90.0,90.0, 90.-angle, 180.);
- }
- fShishKebabModules->Add(mod);
-
- xpos = mod->GetPosXfromR() + g->GetSteelFrontThickness() - smodPar0;
- zpos = mod->GetPosZ() - smodPar2;
- for(int iy=0; iy<g->GetNPhi(); iy++) {
- ypos = g->GetPhiModuleSize()*(2*iy+1 - g->GetNPhi())/2.;
- gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, idrotm, "ONLY") ;
- //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f \n", nr, xpos, ypos, zpos);
- }
- }
- } else if(gn.Contains("TRD")) { // 30-sep-04; 27-jan-05 - as for TRD1 as for TRD2
- // X->Z(0, 0); Y->Y(90, 90); Z->X(90, 0)
- AliEMCALShishKebabTrd1Module *mod=0, *mTmp; // current module
- if(fShishKebabModules == 0) {
- fShishKebabModules = new TList;
- for(int iz=0; iz<g->GetNZ(); iz++) { // 27-may-05; g->GetNZ() -> 26
- if(iz==0) {
- mod = new AliEMCALShishKebabTrd1Module();
- } else {
- mTmp = new AliEMCALShishKebabTrd1Module(*mod);
- mod = mTmp;
- }
- fShishKebabModules->Add(mod);
+
+ int nr=0;
+ fIdRotm=0;
+ // X->Z(0, 0); Y->Y(90, 90); Z->X(90, 0)
+ AliEMCALShishKebabTrd1Module *mod=0; // current module
+
+ for(int iz=0; iz<g->GetNZ(); iz++) {
+ Double_t angle=90., phiOK=0;
+ mod = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(iz);
+ angle = mod->GetThetaInDegree();
+ if(!gn.Contains("WSUC")) { // ALICE
+ AliMatrix(fIdRotm, 90.-angle,180., 90.0,90.0, angle, 0.);
+ phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
+ // printf(" %2i | angle | %6.3f - %6.3f = %6.3f(eta %5.3f)\n",
+ //iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule());
+ xpos = mod->GetPosXfromR() + g->GetSteelFrontThickness() - fSmodPar0;
+ zpos = mod->GetPosZ() - fSmodPar2;
+
+ int iyMax = g->GetNPhi();
+ if(strcmp(mother,"SMOD") && g->GetKey110DEG()) {
+ iyMax /= 2;
}
- }
- for(int iz=0; iz<g->GetNZ(); iz++) {
- Double_t angle=90., phiOK=0;
- if(gn.Contains("TRD1")) {
- mod = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(iz);
- angle = mod->GetThetaInDegree();
- if(!gn.Contains("WSUC")) { // ALICE
- if(iz==0) AliMatrix(idrotm, 0.,0., 90.,90., 90.,0.); // z'(x); y'(y); x'(z)
- else AliMatrix(idrotm, 90.-angle,180., 90.0,90.0, angle, 0.);
- phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
- printf(" %2i | angle | %6.3f - %6.3f = %6.3f(eta %5.3f)\n",
- iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule());
- xpos = mod->GetPosXfromR() + g->GetSteelFrontThickness() - smodPar0;
- zpos = mod->GetPosZ() - smodPar2;
-
- int iyMax = g->GetNPhi();
- if(strcmp(mother,"SMOD") && gn.Contains("110DEG")) {
- iyMax /= 2;
- }
- for(int iy=0; iy<iyMax; iy++) { // flat in phi
- ypos = g->GetPhiModuleSize()*(2*iy+1 - iyMax)/2.;
- gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, idrotm, "ONLY") ;
- //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f idrotm %i\n", nr, xpos, ypos, zpos, idrotm);
- }
- } else {
- if(iz==0) AliMatrix(idrotm, 0.,0., 90.,0., 90.,90.); // (x')z; y'(x); z'(y)
- else AliMatrix(idrotm, 90-angle,270., 90.0,0.0, angle,90.);
- phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
- printf(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n",
- iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule());
- zpos = mod->GetPosZ() - smodPar2;
- ypos = mod->GetPosXfromR() - smodPar1;
- printf(" zpos %7.2f ypos %7.2f idrotm %i\n xpos ", zpos, xpos, idrotm);
- for(int ix=0; ix<g->GetNPhi(); ix++) { // flat in phi
- xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.;
- gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, idrotm, "ONLY") ;
- printf(" %7.2f ", xpos);
- }
- printf("\n");
- }
- } else if(gn.Contains("TRD2")){ // 1-feb-05 - TRD2; curve in phi
- double angEtaRow = 0.;
- double theta1=0.,phi1=0., theta2=0.,phi2=0., theta3=0.,phi3=0.;
- angle=90.;
- if(iz==0) {
- mod = new AliEMCALShishKebabTrd1Module();
- } else {
- mTmp = new AliEMCALShishKebabTrd1Module(*mod);
- mod = mTmp;
- angle = mod->GetThetaInDegree();
- }
-
- fShishKebabModules->Add(mod);
- phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
- printf(" %i | theta | %6.3f - %6.3f = %6.3f\n", iz+1, angle, phiOK, angle-phiOK);
-
- zpos = mod->GetPosZ() - parTubs[2];
- rpos = parTubs[0] + mod->GetPosXfromR();
-
- angle = mod->GetThetaInDegree();
- Double_t stepAngle = (parTubs[4] - parTubs[3])/g->GetNPhi(); // 11-mar-04
- for(int iy=0; iy<g->GetNPhi(); iy++) {
- angEtaRow = parTubs[3] + stepAngle*(0.5+double(iy));
- // angEtaRow = 0;
- theta1 = 90. + angle; phi1 = angEtaRow; // x' ~-z;
- theta2 = 90.; phi2 = 90. + angEtaRow;// y' ~ y;
- theta3 = angle; phi3 = angEtaRow; // z' ~ x;
- if(phi3 < 0.0) phi3 += 360.;
- AliMatrix(idrotm, theta1,phi1, theta2,phi2, theta3,phi3);
-
- xpos = rpos * TMath::Cos(angEtaRow*TMath::DegToRad());
- ypos = rpos * TMath::Sin(angEtaRow*TMath::DegToRad());
- gMC->Gspos(child, ++nr, "SMOP", xpos, ypos, zpos, idrotm, "ONLY") ;
- // SMON;
- phi1 = 180 + angEtaRow;
- theta3 = 180.-theta3; phi3 = angEtaRow;
- AliMatrix(idrotm, theta1,phi1, theta2,phi2, theta3,phi3);
- gMC->Gspos(child, nr, "SMON", xpos, ypos, -zpos, idrotm, "ONLY") ;
- if(0) {
- printf(" angEtaRow(phi) %7.2f | angle(eta) %7.2f \n", angEtaRow, angle);
- printf("iy=%2i xpos %7.2f ypos %7.2f zpos %7.2f idrotm %i\n", iy, xpos, ypos, zpos, idrotm);
- }
- } // for(int iy=0; iy<g->GetNPhi(); iy++)
+ for(int iy=0; iy<iyMax; iy++) { // flat in phi
+ ypos = g->GetPhiModuleSize()*(2*iy+1 - iyMax)/2.;
+ gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
+ //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f fIdRotm %i\n", nr, xpos, ypos, zpos, fIdRotm);
+ AliDebug(3,Form("%3.3i(%2.2i,%2.2i) ", nr,iy+1,iz+1));
}
- }
- } else {
- xpos = g->GetSteelFrontThickness()/2.;
- for(int iz=0; iz<g->GetNZ(); iz++) {
- zpos = -smodPar2 + g->GetEtaModuleSize()*(2*iz+1)/2.;
- for(int iy=0; iy<g->GetNPhi(); iy++) {
- ypos = g->GetPhiModuleSize()*(2*iy+1 - g->GetNPhi())/2.;
- gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, 0, "ONLY") ;
- //printf(" %2i xpos %7.2f ypos %7.2f zpos %7.2f \n", nr, xpos, ypos, zpos);
+ //PH printf("\n");
+ } else { //WSUC
+ if(iz==0) AliMatrix(fIdRotm, 0.,0., 90.,0., 90.,90.); // (x')z; y'(x); z'(y)
+ else AliMatrix(fIdRotm, 90-angle,270., 90.0,0.0, angle,90.);
+ phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi();
+ printf(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n",
+ iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule());
+ zpos = mod->GetPosZ() - fSmodPar2;
+ ypos = mod->GetPosXfromR() - fSmodPar1;
+ printf(" zpos %7.2f ypos %7.2f fIdRotm %i\n xpos ", zpos, xpos, fIdRotm);
+ for(int ix=0; ix<g->GetNPhi(); ix++) { // flat in phi
+ xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.;
+ gMC->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ;
+ printf(" %7.2f ", xpos);
}
+ printf("\n");
}
}
- printf(" Number of modules in Super Module %i \n", nr);
+ AliDebug(2,Form(" Number of modules in Super Module(%s) %i \n", mother, nr));
}
-// 8-dec-04 by PAI
-void AliEMCALv0::Trd1Tower3X3(const double parSCM0[4])
-{// PB should be for whole SCM0 - ?
+void AliEMCALv0::CreateAlFrontPlate(const char* mother, const char* child)
+{
+ // Oct 26,2010 : Al front plate : ALFP
+ AliEMCALGeometry * g = GetGeometry();
+ TString gn(g->GetName()); gn.ToUpper();
+ Double_t trd1Angle = g->GetTrd1Angle()*TMath::DegToRad(), tanTrd1 = TMath::Tan(trd1Angle/2.);
+ Double_t parALFP[5], zposALFP=0.;
+
+ parALFP[0] = g->GetEtaModuleSize()/2. - g->GetLateralSteelStrip(); // dx1
+ parALFP[1] = parALFP[0] + tanTrd1*g->GetTrd1AlFrontThick(); // dx2
+ parALFP[2] = g->GetPhiModuleSize()/2. - g->GetLateralSteelStrip(); // dy
+ parALFP[3] = g->GetTrd1AlFrontThick()/2.; // dz
+ gMC->Gsvolu(child, "TRD1", fIdTmedArr[kIdAL], parALFP, 4);
+ zposALFP = -fParEMOD[3] + g->GetTrd1AlFrontThick()/2.;
+ gMC->Gspos (child, 1, mother, 0.0, 0.0, zposALFP, 0, "ONLY");
+}
+
+//______________________________________________________________________
+void AliEMCALv0::Trd1Tower3X3(const double *parSCM0)
+{
+ // Started Dec 8,2004 by PAI
+ // Fixed Nov 13,2006
+ printf(" AliEMCALv0::Trd1Tower3X3() : parSCM0");
+ for(int i=0; i<4; i++) printf(" %7.4f ", parSCM0[i]);
+ printf("\n");
+ // Nov 10, 2006 - different name of SCMX
double parTRAP[11], *dummy=0;
AliEMCALGeometry * g = GetGeometry();
TString gn(g->GetName()), scmx;
gn.ToUpper();
// Division to tile size
- Info("Trd1Tower3X3()","<I> Divide SCM0 on y-axis %i", g->GetNETAdiv());
+ AliDebug(2,Form("Trd1Tower3X3() : Divide SCM0 on y-axis %i", g->GetNETAdiv()));
gMC->Gsdvn("SCMY","SCM0", g->GetNETAdiv(), 2); // y-axis
double dx1=parSCM0[0], dx2=parSCM0[1], dy=parSCM0[2], dz=parSCM0[3];
double ndiv=3., xpos=0.0;
// should be defined once
- gMC->Gsvolu("PBTI", "BOX", idtmed[idPB], dummy, 0);
- if(gn.Contains("TEST")==0) { // one name for all trapesoid
- scmx = "SCMX";
- gMC->Gsvolu(scmx.Data(), "TRAP", idtmed[idSC], dummy, 0);
- }
-
-
+ gMC->Gsvolu("PBTI", "BOX", fIdTmedArr[kIdPB], dummy, 0);
for(int ix=1; ix<=3; ix++) { // 3X3
+ scmx = "SCX"; // Nov 10,2006
// ix=1
parTRAP[0] = dz;
- parTRAP[1] = TMath::ATan2((dx2-dx1)/2.,2.*dz)*TMath::RadToDeg(); // theta
+ double xCentBot = 2.*dx1/3.;
+ double xCentTop = 2.*(dx2/4. + dx1/12.);
+ parTRAP[1] = TMath::ATan2((xCentTop-xCentBot),2.*dz)*TMath::RadToDeg(); // theta
parTRAP[2] = 0.; // phi
// bottom
parTRAP[3] = dy/ndiv; // H1
parTRAP[6] = 0.0; // ALP1
// top
parTRAP[7] = dy/ndiv; // H2
- parTRAP[8] = dx2/ndiv; // BL2
+ parTRAP[8] = dx2/2 - dx1/6.;// BL2
parTRAP[9] = parTRAP[8]; // TL2
parTRAP[10]= 0.0; // ALP2
- xpos = +(dx1+dx2)/3.; // 6 or 3
+ xpos = (xCentBot+xCentTop)/2.;
if (ix==3) {
parTRAP[1] = -parTRAP[1];
parTRAP[9] = parTRAP[8]; // TL2
xpos = 0.0;
}
- printf(" ** TRAP ** xpos %9.3f\n", xpos);
- for(int i=0; i<11; i++) printf(" par[%2.2i] %9.4f\n", i, parTRAP[i]);
- if(gn.Contains("TEST")){
- scmx = "SCX"; scmx += ix;
- gMC->Gsvolu(scmx.Data(), "TRAP", idtmed[idSC], parTRAP, 11);
- gMC->Gspos(scmx.Data(), 1, "SCMY", xpos, 0.0, 0.0, 0, "ONLY") ;
- } else {
- gMC->Gsposp(scmx.Data(), ix, "SCMY", xpos, 0.0, 0.0, 0, "ONLY", parTRAP, 11) ;
- }
+ AliDebug(2,Form(" ** TRAP ** xpos %9.3f\n", xpos));
+ for(int i=0; i<11; i++) AliDebug(2,Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
+
+ scmx += ix;
+ gMC->Gsvolu(scmx.Data(), "TRAP", fIdTmedArr[kIdSC], parTRAP, 11);
+ gMC->Gspos(scmx.Data(), 1, "SCMY", xpos, 0.0, 0.0, 0, "ONLY") ;
+
PbInTrap(parTRAP, scmx);
}
-
- Info("Trd1Tower3X3()", "Ver. 1.0 : was tested.");
+ AliDebug(2,"Trd1Tower3X3 - Ver. 1.0 : was tested.");
}
// 8-dec-04 by PAI
+//______________________________________________________________________
void AliEMCALv0::PbInTrap(const double parTRAP[11], TString n)
-{// see for example CreateShishKebabGeometry(); just for case TRD1
+{
+ // see for example CreateShishKebabGeometry(); just for case TRD1
static int nr=0;
- printf(" Pb tiles : nrstart %i\n", nr);
+ AliDebug(2,Form(" Pb tiles : nrstart %i\n", nr));
AliEMCALGeometry * g = GetGeometry();
double par[3];
- double sampleWidth = double(g->GetECPbRadThick()+g->GetECScintThick());
double xpos = 0.0, ypos = 0.0;
- double zpos = -sampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
+ double zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
double coef = (parTRAP[8] - parTRAP[4]) / (2.*parTRAP[0]);
double xCenterSCMX = (parTRAP[4] + parTRAP[8])/2.; // ??
par[1] = parTRAP[3]; // y
par[2] = g->GetECPbRadThick()/2.; // z
for(int iz=0; iz<g->GetNECLayers(); iz++){
- par[0] = parTRAP[4] + coef*sampleWidth*iz;
+ par[0] = parTRAP[4] + coef*fSampleWidth*iz;
xpos = par[0] - xCenterSCMX;
if(parTRAP[1] < 0.) xpos = -xpos;
gMC->Gsposp("PBTI", ++nr, n.Data(), xpos, ypos, zpos, 0, "ONLY", par, 3) ;
- printf(" %i xpos %9.3f zpos %9.3f par[0] %9.3f |", iz+1, xpos, zpos, par[0]);
- zpos += sampleWidth;
+ AliDebug(2,Form(" %i xpos %9.3f zpos %9.3f par[0] %9.3f |", iz+1, xpos, zpos, par[0]));
+ zpos += fSampleWidth;
if(iz%2>0) printf("\n");
}
- printf(" Number of Pb tiles in SCMX %i coef %9.7f \n", nr, coef);
- printf(" par[1] %9.3f par[2] %9.3f ypos %9.3f \n", par[1], par[2], ypos);
- Info("PbInTrap", "Ver. 1.0 : was tested.");
+ AliDebug(2,Form(" Number of Pb tiles in SCMX %i coef %9.7f \n", nr, coef));
+ AliDebug(2,Form(" par[1] %9.3f par[2] %9.3f ypos %9.3f \n", par[1], par[2], ypos));
+ AliDebug(2,Form(" PbInTrap Ver. 1.0 : was tested."));
}
// 8-dec-04 by PAI
-void AliEMCALv0::Trd1Tower4X4()
-{// see for example CreateShishKebabGeometry()
+//______________________________________________________________________
+void AliEMCALv0::Trd1Tower4X4() const
+{
+ // Not ready yet
+}
+
+//______________________________________________________________________
+void AliEMCALv0::Trd1Tower1X1(double *parSCM0)
+{
+ // Started Nov 22,2006 by PAI
+ AliDebug(1," AliEMCALv0::Trd1Tower1X1() : parSCM0");
+ for(int i=0; i<4; i++) printf(" %7.4f ", parSCM0[i]);
+ printf("\n");
+
+ // No division - keeping the same volume logic
+ // and as consequence the same abs is scheme
+ AliDebug(2,"Trd1Tower1X1() : Create SCMX(SCMY) as SCM0");
+
+ gMC->Gsvolu("SCMY", "TRD1", fIdTmedArr[kIdAIR], parSCM0, 4);
+ gMC->Gspos("SCMY", 1, "SCM0", 0.0, 0.0, 0.0, 0, "ONLY");
+ gMC->Gsvolu("SCMX", "TRD1", fIdTmedArr[kIdSC], parSCM0, 4);
+ gMC->Gspos("SCMX", 1, "SCMY", 0.0, 0.0, 0.0, 0, "ONLY");
+
+ // should be defined once
+ double *dummy=0;
+ gMC->Gsvolu("PBTI", "BOX", fIdTmedArr[kIdPB], dummy, 0);
+
+ PbInTrd1(parSCM0, "SCMX");
+
+ AliDebug(1,"Trd1Tower1X1() : Ver. 0.1 : was tested.");
+}
+
+//______________________________________________________________________
+void AliEMCALv0::PbInTrd1(const double *parTrd1, TString n)
+{
+ // see PbInTrap(const double parTrd1[11], TString n)
+ static int nr=0, ndeb=2;
+ AliDebug(ndeb,Form(" Pb tiles : nrstart %i\n", nr));
+ AliEMCALGeometry * g = GetGeometry();
+
+ double par[3];
+ double xpos = 0.0, ypos = 0.0;
+ double zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
+ double coef = (parTrd1[1] - parTrd1[0]) / (2.*parTrd1[3]);
+
+ par[1] = parTrd1[2]; // y
+ par[2] = g->GetECPbRadThick()/2.; // z
+
+ for(int iz=0; iz<g->GetNECLayers(); iz++){
+ par[0] = parTrd1[0] + coef*fSampleWidth*iz;
+ gMC->Gsposp("PBTI", ++nr, n.Data(), xpos, ypos, zpos, 0, "ONLY", par, 3) ;
+ AliDebug(2,Form(" %i xpos %9.3f zpos %9.3f par[0] %9.3f |", iz+1, xpos, zpos, par[0]));
+ zpos += fSampleWidth;
+ if(iz%2>0) printf("\n");
+ }
+ AliDebug(ndeb,Form(" Number of Pb tiles in SCMX %i coef %9.7f ", nr, coef));
+ AliDebug(ndeb,Form(" PbInTrd1 Ver. 0.1 : was tested."));
}
+
// 3-feb-05
-void AliEMCALv0::Scm0InTrd2(const AliEMCALGeometry * g, const Double_t parEMOD[5], Double_t parSCM0[5])
+//______________________________________________________________________
+void AliEMCALv0::Scm0InTrd2(const AliEMCALGeometry * g, const Double_t emodPar[5], Double_t parSCM0[5])
{
// Passive material inside the detector
double wallThickness = g->GetPhiModuleSize()/2. - g->GetPhiTileSize(); //Need check
- printf(" wall thickness %7.5f \n", wallThickness);
+ AliDebug(2,Form(" wall thickness %7.5f \n", wallThickness));
for(int i=0; i<4; i++) { // on pictures sometimes I can not see 0 -> be carefull!!
- parSCM0[i] = parEMOD[i] - wallThickness;
- printf(" %i parSCMO %7.3f parEMOD %7.3f : dif %7.3f \n", i, parSCM0[i],parEMOD[i], parSCM0[i]-parEMOD[i]);
+ parSCM0[i] = emodPar[i] - wallThickness;
+ AliDebug(2,Form(" %i parSCMO %7.3f emodPar %7.3f : dif %7.3f \n",
+ i, parSCM0[i],emodPar[i], parSCM0[i]-emodPar[i]));
}
- parSCM0[4] = parEMOD[4];
- gMC->Gsvolu("SCM0", "TRD2", idtmed[idSC], parSCM0, 5); // idAIR -> idSC
+ parSCM0[4] = emodPar[4];
+ gMC->Gsvolu("SCM0", "TRD2", fIdTmedArr[kIdSC], parSCM0, 5); // kIdAIR -> kIdSC
gMC->Gspos("SCM0", 1, "EMOD", 0., 0., 0., 0, "ONLY") ;
// Division
if(g->GetNPHIdiv()==2 && g->GetNETAdiv()==2) {
}
}
+//______________________________________________________________________
void AliEMCALv0::Division2X2InScm0(const AliEMCALGeometry * g, const Double_t parSCM0[5])
{
+ // Division 2X2
Double_t parTRAP[11], xpos=0.,ypos=0., dx1=0.0,dx2=0.,dy1=0.0,dy2=0.,dz=0.
,dr1=0.0,dr2=0.;
- idrotm=0;
+ fIdRotm=0;
Info("Division2X2InScm0","Divide SCM0 on y-axis %i\n", g->GetNETAdiv());
TString n("SCMX"), overLapFlagSCMY("ONLY"), overLapFlagSCMX("ONLY");
parTRAP[8] = parSCM0[1]; // BL2
parTRAP[9] = parTRAP[8]; // TL2
parTRAP[10]= 0.0; // ALP2
- printf(" ** SCMY ** \n");
- for(int i=0; i<11; i++) printf(" par[%2.2i] %9.4f\n", i, parTRAP[i]);
+ AliDebug(2,Form(" ** SCMY ** \n"));
+ for(int i=0; i<11; i++) AliDebug(2,Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
- idrotm=0;
- gMC->Gsvolu("SCMY", "TRAP", idtmed[idSC], parTRAP, 11); // idAIR -> idSC
+ fIdRotm=0;
+ gMC->Gsvolu("SCMY", "TRAP", fIdTmedArr[kIdSC], parTRAP, 11); // kIdAIR -> kIdSC
ypos = +(parTRAP[3]+parTRAP[7])/2.; //
- printf(" Y shift SCMY inside SCM0 : %7.3f : opt %s\n", ypos, overLapFlagSCMY.Data());
- gMC->Gspos("SCMY", 1, "SCM0", 0.0, ypos, 0.0, idrotm, overLapFlagSCMY.Data()) ;
+ AliDebug(2,Form(" Y shift SCMY inside SCM0 : %7.3f : opt %s\n", ypos, overLapFlagSCMY.Data()));
+ gMC->Gspos("SCMY", 1, "SCM0", 0.0, ypos, 0.0, fIdRotm, overLapFlagSCMY.Data()) ;
// Rotation SCMY around z-axis on 180 degree; x'=-x; y'=-y and z=z
- AliMatrix(idrotm, 90.0,180., 90.0, 270.0, 0.0,0.0) ;
+ AliMatrix(fIdRotm, 90.0,180., 90.0, 270.0, 0.0,0.0) ;
// We may have problem with numeration due to rotation - 4-feb-05
- gMC->Gspos("SCMY", 2, "SCM0", 0.0, -ypos, 0.0, idrotm, overLapFlagSCMY.Data());
+ gMC->Gspos("SCMY", 2, "SCM0", 0.0, -ypos, 0.0, fIdRotm, overLapFlagSCMY.Data());
Info("Division2X2InScm0","Divide SCMY on x-axis %i\n", g->GetNPHIdiv());
dx1 = parSCM0[0];
parTRAP[8] = parSCM0[1]/2; // BL2
parTRAP[9] = parTRAP[8]; // TL2
parTRAP[10]= 0.0; // ALP2
- printf(" ** SCMX ** \n");
- for(int i=0; i<11; i++) printf(" par[%2.2i] %9.4f\n", i, parTRAP[i]);
+ AliDebug(2,Form(" ** SCMX ** \n"));
+ for(int i=0; i<11; i++) AliDebug(2,Form(" par[%2.2i] %9.4f\n", i, parTRAP[i]));
- idrotm=0;
- gMC->Gsvolu("SCMX", "TRAP", idtmed[idSC], parTRAP, 11);
+ fIdRotm=0;
+ gMC->Gsvolu("SCMX", "TRAP", fIdTmedArr[kIdSC], parTRAP, 11);
xpos = (parTRAP[4]+parTRAP[8])/2.;
- printf(" X shift SCMX inside SCMX : %7.3f : opt %s\n", xpos, overLapFlagSCMX.Data());
- gMC->Gspos("SCMX", 1, "SCMY", xpos, 0.0, 0.0, idrotm, overLapFlagSCMX.Data()) ;
- // AliMatrix(idrotm, 90.0,270., 90.0, 0.0, 0.0,0.0); // x'=-y; y'=x; z'=z
- AliMatrix(idrotm, 90.0,90., 90.0, -180.0, 0.0,0.0); // x'=y; y'=-x; z'=z
- gMC->Gspos("SCMX", 2, "SCMY", -xpos, 0.0, 0.0, idrotm, overLapFlagSCMX.Data()) ;
+ AliDebug(2,Form(" X shift SCMX inside SCMX : %7.3f : opt %s\n", xpos, overLapFlagSCMX.Data()));
+ gMC->Gspos("SCMX", 1, "SCMY", xpos, 0.0, 0.0, fIdRotm, overLapFlagSCMX.Data()) ;
+ // AliMatrix(fIdRotm, 90.0,270., 90.0, 0.0, 0.0,0.0); // x'=-y; y'=x; z'=z
+ AliMatrix(fIdRotm, 90.0,90., 90.0, -180.0, 0.0,0.0); // x'=y; y'=-x; z'=z
+ gMC->Gspos("SCMX", 2, "SCMY", -xpos, 0.0, 0.0, fIdRotm, overLapFlagSCMX.Data()) ;
// PB:
if(n=="SCMX" && overLapFlagSCMY == "ONLY") {
PbInTrapForTrd2(parTRAP, n);
}
// 4-feb-05 by PAI
+//______________________________________________________________________
void AliEMCALv0::PbInTrapForTrd2(const double *parTRAP, TString name)
-{// TRD2 cases
+{
+ // TRD2 cases
Double_t *dummy=0;
TString pbShape("BOX"), pbtiChonly("ONLY");
if(name=="SCM0") {
pbShape = "TRD2";
// pbtiChonly = "MANY";
}
- gMC->Gsvolu("PBTI", pbShape.Data(), idtmed[idPB], dummy, 0);
+ gMC->Gsvolu("PBTI", pbShape.Data(), fIdTmedArr[kIdPB], dummy, 0);
int nr=0;
Info("PbInTrapForTrd2"," Pb tiles inside %s: shape %s :pbtiChonly %s\n nrstart %i\n",
AliEMCALGeometry * g = GetGeometry();
double par[5], parPB[5], parSC[5];
- double sampleWidth = double(g->GetECPbRadThick()+g->GetECScintThick());
double xpos = 0.0, ypos = 0.0;
- double zpos = -sampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
+ double zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.;
if(name == "SCMX") { // common trapezoid - 11 parameters
double coef = (parTRAP[8] - parTRAP[4]) / (2.*parTRAP[0]);
double xCenterSCMX = (parTRAP[4] + parTRAP[8])/2.; // the same for y
- printf(" xCenterSCMX %8.5f : coef %8.7f \n", xCenterSCMX, coef);
+ AliDebug(2,Form(" xCenterSCMX %8.5f : coef %8.7f \n", xCenterSCMX, coef));
par[2] = g->GetECPbRadThick()/2.; // z
for(int iz=0; iz<g->GetNECLayers(); iz++){
- par[0] = parTRAP[4] + coef*sampleWidth*iz;
+ par[0] = parTRAP[4] + coef*fSampleWidth*iz;
par[1] = par[0];
xpos = ypos = par[0] - xCenterSCMX;
//if(parTRAP[1] < 0.) xpos = -xpos;
gMC->Gsposp("PBTI", ++nr, name.Data(), xpos, ypos, zpos, 0, "ONLY", par, 3) ;
- printf(" %2.2i xpos %8.5f zpos %6.3f par[0,1] %6.3f |", iz+1, xpos, zpos, par[0]);
- if(iz%2>0) printf("\n");
- zpos += sampleWidth;
+ AliDebug(2,Form(" %2.2i xpos %8.5f zpos %6.3f par[0,1] %6.3f |", iz+1, xpos, zpos, par[0]));
+ if(iz%2>0) AliDebug(2,Form("\n"));
+ zpos += fSampleWidth;
}
- printf(" Number of Pb tiles in SCMX %i coef %9.7f \n", nr, coef);
- printf(" par[1] %9.5f par[2] %9.5f ypos %9.5f \n", par[1], par[2], ypos);
+ AliDebug(2,Form(" Number of Pb tiles in SCMX %i coef %9.7f \n", nr, coef));
+ AliDebug(2,Form(" par[1] %9.5f par[2] %9.5f ypos %9.5f \n", par[1], par[2], ypos));
} else if(name == "SCM0") { // 1-mar-05 ; TRD2 - 5 parameters
- printf(" SCM0 par = ");
- for(int i=0; i<5; i++) printf(" %9.5f ", parTRAP[i]);
- printf("\n zpos %f \n",zpos);
+ AliDebug(2,Form(" SCM0 par = "));
+ for(int i=0; i<5; i++) AliDebug(2,Form(" %9.5f ", parTRAP[i]));
+ AliDebug(2,Form("\n zpos %f \n",zpos));
double tanx = (parTRAP[1] - parTRAP[0]) / (2.*parTRAP[4]); // tanx = tany now
double tany = (parTRAP[3] - parTRAP[2]) / (2.*parTRAP[4]), ztmp=0.;
parPB[4] = g->GetECPbRadThick()/2.;
parSC[2] = g->GetECScintThick()/2.;
for(int iz=0; iz<g->GetNECLayers(); iz++){
- ztmp = sampleWidth*double(iz);
+ ztmp = fSampleWidth*double(iz);
parPB[0] = parTRAP[0] + tanx*ztmp;
parPB[1] = parPB[0] + tanx*g->GetECPbRadThick();
parPB[2] = parTRAP[2] + tany*ztmp;
parPB[3] = parPB[2] + tany*g->GetECPbRadThick();
gMC->Gsposp("PBTI", ++nr, name.Data(), xpos, ypos, zpos, 0, pbtiChonly.Data(), parPB, 5) ;
- printf("\n PBTI %2i | zpos %6.3f | par = ", nr, zpos);
+ AliDebug(2,Form("\n PBTI %2i | zpos %6.3f | par = ", nr, zpos));
/*
for(int i=0; i<5; i++) printf(" %9.5f ", parPB[i]);
// individual SC tile
printf("\n SCTI zpos %6.3f | par = ", zpos+g->GetECScintThick());
for(int i=0; i<3; i++) printf(" %9.5f ", parPB[i]);
*/
- zpos += sampleWidth;
+ zpos += fSampleWidth;
}
- printf("\n");
+ AliDebug(2,Form("\n"));
}
Info("PbInTrapForTrd2", "Ver. 0.03 : was tested.");
}
// 15-mar-05
-void AliEMCALv0::PbmoInTrd2(const AliEMCALGeometry * g, const Double_t parEMOD[5], Double_t parPBMO[5])
+//______________________________________________________________________
+void AliEMCALv0::PbmoInTrd2(const AliEMCALGeometry * g, const Double_t emodPar[5], Double_t parPBMO[5])
{
+ // Pb inside Trd2
Info("PbmoInTrd2"," started : geometry %s ", g->GetName());
double wallThickness = g->GetPhiModuleSize()/2. - g->GetPhiTileSize();
- printf(" wall thickness %7.5f \n", wallThickness);
+ AliDebug(2,Form(" wall thickness %7.5f \n", wallThickness));
for(int i=0; i<4; i++) {
- parPBMO[i] = parEMOD[i] - wallThickness;
- printf(" %i parPBMO %7.3f parEMOD %7.3f : dif %7.3f \n",
- i, parPBMO[i],parEMOD[i], parPBMO[i]-parEMOD[i]);
+ parPBMO[i] = emodPar[i] - wallThickness;
+ AliDebug(2,Form(" %i parPBMO %7.3f emodPar %7.3f : dif %7.3f \n",
+ i, parPBMO[i],emodPar[i], parPBMO[i]-emodPar[i]));
}
- parPBMO[4] = parEMOD[4];
- gMC->Gsvolu("PBMO", "TRD2", idtmed[idPB], parPBMO, 5);
+ parPBMO[4] = emodPar[4];
+ gMC->Gsvolu("PBMO", "TRD2", fIdTmedArr[kIdPB], parPBMO, 5);
gMC->Gspos("PBMO", 1, "EMOD", 0., 0., 0., 0, "ONLY") ;
// Division
if(g->GetNPHIdiv()==2 && g->GetNETAdiv()==2) {
Division2X2InPbmo(g, parPBMO);
- printf(" PBMO, division 2X2 | geometry |%s|\n", g->GetName());
+ AliDebug(2,Form(" PBMO, division 2X2 | geometry |%s|\n", g->GetName()));
} else {
- printf(" no division PBMO in this geometry |%s|\n", g->GetName());
+ AliDebug(2,Form(" no division PBMO in this geometry |%s|\n", g->GetName()));
assert(0);
}
}
-void AliEMCALv0::Division2X2InPbmo(const AliEMCALGeometry * g, const Double_t parPBMO[5])
+//______________________________________________________________________
+void AliEMCALv0::Division2X2InPbmo(const AliEMCALGeometry * g, const Double_t parPBMO[5])
{
+ // Division 2X2
Info("Division2X2InPbmo"," started : geometry %s ", g->GetName());
//Double_t *dummy=0;
- // gMC->Gsvolu("SCTI", "BOX", idtmed[idSC], dummy, 0);
+ // gMC->Gsvolu("SCTI", "BOX", fIdTmedArr[kIdSC], dummy, 0);
double parSC[3];
- double sampleWidth = double(g->GetECPbRadThick()+g->GetECScintThick());
double xpos = 0.0, ypos = 0.0, zpos = 0.0, ztmp=0;;
double tanx = (parPBMO[1] - parPBMO[0]) / (2.*parPBMO[4]); // tanx = tany now
double tany = (parPBMO[3] - parPBMO[2]) / (2.*parPBMO[4]);
- char name[10], named[10], named2[10];
+ const Int_t buffersize = 10;
+ char name[buffersize], named[buffersize], named2[buffersize];
- printf(" PBMO par = ");
- for(int i=0; i<5; i++) printf(" %9.5f ", parPBMO[i]);
- printf("\n");
+ AliDebug(2,Form(" PBMO par = "));
+ for(int i=0; i<5; i++) AliDebug(2,Form(" %9.5f ", parPBMO[i]));
+ AliDebug(2,Form("\n"));
parSC[2] = g->GetECScintThick()/2.;
- zpos = -sampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick() + g->GetECScintThick()/2.;
- printf(" parSC[2] %9.5f \n", parSC[2]);
+ zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick() + g->GetECScintThick()/2.;
+ AliDebug(2,Form(" parSC[2] %9.5f \n", parSC[2]));
for(int iz=0; iz<g->GetNECLayers(); iz++){
- ztmp = g->GetECPbRadThick() + sampleWidth*double(iz); // Z for previous PB
+ ztmp = g->GetECPbRadThick() + fSampleWidth*double(iz); // Z for previous PB
parSC[0] = parPBMO[0] + tanx*ztmp;
parSC[1] = parPBMO[2] + tany*ztmp;
- sprintf(name,"SC%2.2i", iz+1);
- gMC->Gsvolu(name, "BOX", idtmed[idSC], parSC, 3);
+ snprintf(name,buffersize,"SC%2.2i", iz+1);
+ gMC->Gsvolu(name, "BOX", fIdTmedArr[kIdSC], parSC, 3);
gMC->Gspos(name, 1, "PBMO", xpos, ypos, zpos, 0, "ONLY") ;
- printf("%s | zpos %6.3f | parSC[0,1]=(%7.5f,%7.5f) -> ",
- name, zpos, parSC[0], parSC[1]);
+ AliDebug(2,Form("%s | zpos %6.3f | parSC[0,1]=(%7.5f,%7.5f) -> ",
+ name, zpos, parSC[0], parSC[1]));
- sprintf(named,"SY%2.2i", iz+1);
+ snprintf(named,buffersize,"SY%2.2i", iz+1);
printf(" %s -> ", named);
gMC->Gsdvn(named,name, 2, 2);
- sprintf(named2,"SX%2.2i", iz+1);
+ snprintf(named2,buffersize,"SX%2.2i", iz+1);
printf(" %s \n", named2);
gMC->Gsdvn(named2,named, 2, 1);
- zpos += sampleWidth;
+ zpos += fSampleWidth;
+ }
+}
+
+//______________________________________________________________________
+AliEMCALShishKebabTrd1Module* AliEMCALv0::GetShishKebabModule(Int_t neta)
+{
+ // 28-oct-05
+ AliEMCALShishKebabTrd1Module* trd1=0;
+ if(fShishKebabModules && neta>=0 && neta<fShishKebabModules->GetSize()) {
+ trd1 = (AliEMCALShishKebabTrd1Module*)fShishKebabModules->At(neta);
+ }
+ return trd1;
+}
+
+//_____________________________________________________________________________
+void AliEMCALv0::AddAlignableVolumes() const
+{
+ //Add volumes which are alignable (?)
+ TString ntmp(GetTitle()); // name of EMCAL geometry
+
+ if(ntmp.Contains("WSUC")) {
+ AddAlignableVolumesInWSUC(); // WSUC case
+ } else {
+ AddAlignableVolumesInALICE(); // ALICE case
+ }
+}
+
+//______________________________________________________________________
+void AliEMCALv0::AddAlignableVolumesInALICE() const
+{
+ //
+ // Create entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path. Needs to be synchronized with
+ // eventual changes in the geometry.
+ //
+
+ Float_t pars[] = {GetGeometry()->GetSuperModulesPar(0),GetGeometry()->GetSuperModulesPar(1),GetGeometry()->GetSuperModulesPar(2)};
+ double rpos = (GetGeometry()->GetEnvelop(0) + GetGeometry()->GetEnvelop(1))/2.;
+ double phi, phiRad, xpos, ypos, zpos;
+
+ AliGeomManager::ELayerID idEMCAL = AliGeomManager::kEMCAL;
+ Int_t modUID, modnum = 0;
+ TString volpath, symname;
+
+ Int_t nSMod = GetGeometry()->GetNumberOfSuperModules();
+ for (Int_t smodnum=0; smodnum < nSMod; smodnum++) {
+ modUID = AliGeomManager::LayerToVolUID(idEMCAL,modnum++);
+ volpath = "ALIC_1/XEN1_1/SMOD_";
+ volpath += (smodnum+1);
+ symname = "EMCAL/FullSupermodule";
+ symname += (smodnum+1);
+
+ if(GetGeometry()->GetKey110DEG() && smodnum>=10) {
+ volpath = "ALIC_1/XEN1_1/SM10_";
+ volpath += (smodnum-10+1);
+ symname = "EMCAL/HalfSupermodule";
+ symname += (smodnum-10+1);
+ }
+
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data(),modUID))
+ AliFatal("AliEMCALv0::Unable to set alignable entry!!");
+
+ // Creates the Tracking to Local transformation matrix for EMCAL
+ // modules
+ TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(modUID) ;
+
+ phiRad = GetGeometry()->GetPhiCenterOfSM(smodnum); //comes in radians, not degrees
+ phi = phiRad*180./TMath::Pi(); //need degrees for rot. matrix
+ xpos = rpos * TMath::Cos(phiRad);
+ ypos = rpos * TMath::Sin(phiRad);
+ zpos = pars[2];
+ if(GetGeometry()->GetKey110DEG() && smodnum >= 10) {
+ xpos += (pars[1]/2. * TMath::Sin(phiRad));
+ ypos -= (pars[1]/2. * TMath::Cos(phiRad));
+ }
+
+ TGeoHMatrix *matTtoL;
+ TGeoHMatrix *globMatrix = alignableEntry->GetGlobalOrig();
+
+ if(smodnum%2 == 0) {
+ // pozitive z
+ TGeoTranslation geoTran0(xpos,ypos, zpos);
+ TGeoRotation geoRot0("geoRot0", 90.0, phi, 90.0, 90.0+phi, 0.0, 0.0);
+ TGeoCombiTrans mat0(geoTran0, geoRot0);
+ matTtoL = new TGeoHMatrix(mat0);
+
+ matTtoL->MultiplyLeft(&(globMatrix->Inverse()));
+ alignableEntry->SetMatrix(matTtoL);
+
+ } else {
+ // negative z
+ double phiy = 90. + phi + 180.;
+ if(phiy>=360.) phiy -= 360.;
+ TGeoTranslation geoTran1(xpos,ypos,-zpos);
+ TGeoRotation geoRot1("geoRot1", 90.0, phi, 90.0, phiy, 180.0, 0.0);
+ TGeoCombiTrans mat1(geoTran1, geoRot1);
+ matTtoL = new TGeoHMatrix(mat1);
+
+ matTtoL->MultiplyLeft(&(globMatrix->Inverse()));
+ alignableEntry->SetMatrix(matTtoL);
+
+ }
+
+ }
+
+}
+
+//______________________________________________________________________
+void AliEMCALv0::AddAlignableVolumesInWSUC() const
+{
+ //
+ // Create entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path. Needs to be synchronized with
+ // eventual changes in the geometry.
+ //
+
+ TString vpstr1 = "WSUC_1/XEN1_1/SMOD_";
+ TString snstr1 = "EMCAL/CosmicTestSupermodule";
+ TString volpath, symname;
+
+ // #SM is just one
+ for (Int_t smodnum=0; smodnum < 1; smodnum++) {
+ symname = snstr1;
+ symname += (smodnum+1);
+ volpath = vpstr1;
+ volpath += (smodnum+1);
+ if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
+ AliFatal("Unable to set alignable entry!!");
}
}