- Int_t inum;
- Float_t xcor, zcor, ytop, ycoor;
- Float_t zazor, dx, dy, dz, xp, yp, zp, ywidth;
- Int_t ink;
- Float_t par[10];
- Int_t inz, nxp, npx, npz;
- Float_t xsz, ysz, zsz;
- Int_t nzp0, nzp1, nzp2;
-
- Int_t *idtmed = fIdtmed->GetArray()-499;
-
- // X size of PPC plate
- xsz = 60.;
- // Y size of PPC plate
- ysz = .2;
- // Z size of PPC plate
- zsz = 50.;
- // Width of DME box
- ywidth = 4.;
- // Frame width along X,Y and Z axis of RPC chambers
- dx = 0.;
- dy = .2;
- // + 0.1cm (Zagreev)
- dz = 0.;
- // gap in RPC chamber
- zazor = .03;
- // X size of RPC chamber
- // XP=3.06 ! + 0.06cm (Zagreev)
- xp = 3.9;
- // Y size of RPC chamber
- yp = zazor + dy * 2;
- // YP=0.32
- // Z size of RPC chamber
- // ZP=3.06 ! + 0.06cm (Zagreev)
- // (Zagreev)
- zp = 4.1;
- // No sensitive volumes with DME
- par[0] = xm / 2.;
- par[1] = ywidth / 2.;
- par[2] = zm0 / 2.;
- ycoor = ym / 3. - ywidth / 2.;
- gMC->Gsvolu("FBT1", "BOX ", idtmed[505], par, 3);
- gMC->Gspos("FBT1", 0, "FTO1", 0., 0., 0., 0, "ONLY");
- par[2] = zm1 / 2.;
- gMC->Gsvolu("FBT2", "BOX ", idtmed[505], par, 3);
- gMC->Gspos("FBT2", 1, "FTO2", 0., 0., 0., 0, "ONLY");
- par[2] = zm2 / 2.;
- gMC->Gsvolu("FBT3", "BOX ", idtmed[505], par, 3);
- gMC->Gspos("FBT3", 2, "FTO3", 0., 0., 0., 0, "ONLY");
- // Electronic plate
- par[1] = ysz / 2.;
- par[2] = zm0 / 2.;
- ycoor = ywidth / 2. - ysz / 2.;
- gMC->Gsvolu("FPE1", "BOX ", idtmed[504], par, 3);
- gMC->Gspos("FPE1", 0, "FBT1", 0., ycoor, 0., 0, "ONLY");
- gMC->Gspos("FPE1", 1, "FBT1", 0., -ycoor, 0., 0, "ONLY");
- par[2] = zm1 / 2.;
- gMC->Gsvolu("FPE2", "BOX ", idtmed[504], par, 3);
- gMC->Gspos("FPE2", 0, "FBT2", 0., ycoor, 0., 0, "ONLY");
- gMC->Gspos("FPE2", 1, "FBT2", 0., -ycoor, 0., 0, "ONLY");
- par[2] = zm2 / 2.;
- gMC->Gsvolu("FPE3", "BOX ", idtmed[504], par, 3);
- gMC->Gspos("FPE3", 0, "FBT3", 0., ycoor, 0., 0, "ONLY");
- gMC->Gspos("FPE3", 1, "FBT3", 0., -ycoor, 0., 0, "ONLY");
- // Electronic insensitive volumes
- par[1] = yp / 2.;
- par[2] = zm0 / 2.;
- ytop = ywidth / 2. - (ysz * 2 + yp) / 2.;
- gMC->Gsvolu("FLT1", "BOX ", idtmed[505], par, 3);
- gMC->Gspos("FLT1", 0, "FBT1", 0., -ytop, 0., 0, "ONLY");
- par[2] = zm1 / 2.;
- gMC->Gsvolu("FLT2", "BOX ", idtmed[505], par, 3);
- gMC->Gspos("FLT2", 0, "FBT2", 0., -ytop, 0., 0, "ONLY");
- par[2] = zm2 / 2.;
- gMC->Gsvolu("FLT3", "BOX ", idtmed[505], par, 3);
- gMC->Gspos("FLT3", 0, "FBT3", 0., -ytop, 0., 0, "ONLY");
- // PPC-plate number along X axis
- nxp = Int_t (xm / xsz);
- // PPC-plate number along Z axis
- nzp0 = Int_t (zm0 / zsz);
- nzp1 = Int_t (zm1 / zsz);
- nzp2 = Int_t (zm2 / zsz);
- // Position of PPC-plates
- par[0] = xm * .5 / nxp;
- par[2] = zm0 * .5 / nzp0;
- gMC->Gsvolu("FLK1", "BOX ", idtmed[505], par, 3);
- inum = 0;
- for (ink = 1; ink <= nxp; ++ink) {
- xcor = xm * .5 * ((ink * 2 - 1) / (Float_t) nxp -
- 1.);
- for (inz = 1; inz <= nzp0; ++inz) {
- zcor = zm0 * .5 * ((inz * 2 - 1) / (Float_t) nzp0 - 1.);
- ++inum;
- gMC->Gspos("FLK1", inum, "FLT1", xcor, 0., zcor, 0, "ONLY");
+ par[2] = (zFLTA *0.5);
+ gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon
+ gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY");
+
+ par[2] = (zFLTB * 0.5);
+ gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon
+ gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY");
+
+ par[2] = (zFLTC * 0.5);
+ gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon
+ gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY");
+
+ ///// Layers of Aluminum before and after detector /////
+ ///// Aluminum Box for Modules (1.8 mm thickness) /////
+ ///// lateral walls not simulated for the time being
+ //const Float_t khAlWall = 0.18;
+ // fp to be checked
+ const Float_t khAlWall = 0.11;
+ par[0] = xFLT*0.5;
+ par[1] = khAlWall/2.;//cm
+ ycoor = -yFLT/2 + par[1];
+ par[2] = (zFLTA *0.5);
+ gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium
+ gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY");
+ gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY");
+ par[2] = (zFLTB *0.5);
+ gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium
+ gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY");
+ gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY");
+ par[2] = (zFLTC *0.5);
+ gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium
+ gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY");
+ gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY");
+
+ ///////////////// Detector itself //////////////////////
+
+ const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge
+ //and the boundary of the strip
+ const Int_t knx = fNpadX; // number of pads along x
+ const Int_t knz = fNpadZ; // number of pads along z
+ const Float_t kspace = fSpace; //cm distance from the front plate of the box
+
+ Float_t zSenStrip = fZpad*fNpadZ;//cm
+ Float_t stripWidth = zSenStrip + 2*kdeadBound;
+
+ par[0] = xFLT*0.5;
+ par[1] = yPad*0.5;
+ par[2] = stripWidth*0.5;
+
+ // new description for strip volume -double stack strip-
+ // -- all constants are expressed in cm
+ // heigth of different layers
+ const Float_t khhony = 0.8 ; // heigth of HONY Layer
+ const Float_t khpcby = 0.08 ; // heigth of PCB Layer
+ const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer
+ const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer
+ const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm)
+ const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture
+ const Float_t kwsensmz = 2*3.5 ; // cm
+ const Float_t klsensmx = 48*2.5; // cm
+ const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume
+ const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume
+
+ // heigth of the FSTR Volume (the strip volume)
+ const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy;
+ // width of the FSTR Volume (the strip volume)
+ const Float_t kwstripz = 10.;
+ // length of the FSTR Volume (the strip volume)
+ const Float_t klstripx = 122.;
+
+ Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
+ // coordinates of the strip center in the strip reference frame; used for positioning
+ // internal strip volumes
+ Float_t posfp[3]={0.,0.,0.};
+
+
+ // FSTR volume definition and filling this volume with non sensitive Gas Mixture
+ gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3);
+ //-- HONY Layer definition
+ // parfp[0] = -1;
+ parfp[1] = khhony*0.5;
+ // parfp[2] = -1;
+ gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3);
+ // positioning 2 HONY Layers on FSTR volume
+
+ posfp[1]=-khstripy*0.5+parfp[1];
+ gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+
+ //-- PCB Layer definition
+ parfp[1] = khpcby*0.5;
+ gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3);
+ // positioning 2 PCB Layers on FSTR volume
+ posfp[1]=-khstripy*0.5+khhony+parfp[1];
+ gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+ // positioning the central PCB layer
+ gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY");
+
+
+
+ //-- MYLAR Layer definition
+ parfp[1] = khmyly*0.5;
+ gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3);
+ // positioning 2 MYLAR Layers on FSTR volume
+ posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
+ gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+ // adding further 2 MYLAR Layers on FSTR volume
+ posfp[1] = khpcby*0.5+parfp[1];
+ gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+
+
+ //-- Graphite Layer definition
+ parfp[1] = khgraphy*0.5;
+ gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3);
+ // positioning 2 Graphite Layers on FSTR volume
+ posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1];
+ gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+ // adding further 2 Graphite Layers on FSTR volume
+ posfp[1] = khpcby*0.5+khmyly+parfp[1];
+ gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+
+
+ //-- Glass (EXT. +Semi INT.) Layer definition
+ parfp[1] = khglasseiy*0.5;
+ gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3);
+ // positioning 2 Glass Layers on FSTR volume
+ posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1];
+ gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+ // adding further 2 Glass Layers on FSTR volume
+ posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1];
+ gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
+
+
+ //-- Sensitive Mixture Layer definition
+ parfp[0] = klsensmx*0.5;
+ parfp[1] = khsensmy*0.5;
+ parfp[2] = kwsensmz*0.5;
+ gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3);
+ gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3);
+ // positioning 2 gas Layers on FSTR volume
+ // the upper is insensitive freon
+ // while the remaining is sensitive
+ posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1];
+ gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY");
+ gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY");
+
+ // dividing FSEN along z in knz=2 and along x in knx=48
+ gMC->Gsdvn("FSEZ","FSEN",knz,3);
+ gMC->Gsdvn("FSEX","FSEZ",knx,1);
+
+ // FPAD volume definition
+ parfp[0] = klpadx*0.5;
+ parfp[1] = khsensmy*0.5;
+ parfp[2] = kwpadz*0.5;
+ gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3);
+ // positioning the FPAD volumes on previous divisions
+ gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY");
+
+ //// Positioning the Strips (FSTR) in the FLT volumes /////
+
+ // Plate A (Central)
+
+ Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel
+
+ Float_t gap = fGapA+0.5; //cm updated distance between the strip axis
+ Float_t zpos = 0;
+ Float_t ang = 0;
+ Int_t j=1; // AdC
+ nrot = 0;
+ zcoor = 0;
+ ycoor = -14.5 + kspace ; //2 cm over front plate
+
+ AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.);
+
+ Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC
+
+ //gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY");
+
+ if(fDebug) {
+ printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
+ printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);
+ }
+
+ zcoor -= zSenStrip;
+ //j++; // AdC
+ Int_t upDown = -1; // upDown=-1 -> Upper strip
+ // upDown=+1 -> Lower strip
+ do{
+ ang = atan(zcoor/radius);
+ ang *= kRaddeg;
+ AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.);
+ AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.);
+ ang /= kRaddeg;
+ ycoor = -14.5+ kspace; //2 cm over front plate
+ ycoor += (1-(upDown+1)/2)*gap;
+ //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY");
+ //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY");
+ gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC
+ gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC
+
+ if(fDebug>=1) {
+ printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC
+ printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos);