-//
-// Note: all chambers have the same structure, which could be
-// easily parameterised. This was intentionally not done in order
-// to give a starting point for the implementation of the actual
-// design of each station.
- Int_t *idtmed = fIdtmed->GetArray()-1099;
-
-// Distance between Stations
-//
- Float_t bpar[3];
- Float_t tpar[3];
-// Float_t pgpar[10];
- Float_t zpos1, zpos2, zfpos;
- // Outer excess and inner recess for mother volume radius
- // with respect to ROuter and RInner
- Float_t dframep=.001; // Value for station 3 should be 6 ...
- // Width (RdPhi) of the frame crosses for stations 1 and 2 (cm)
-// Float_t dframep1=.001;
- Float_t dframep1 = 11.0;
-// Bool_t frameCrosses=kFALSE;
- Bool_t frameCrosses=kTRUE;
- Float_t *dum=0;
-
-// Float_t dframez=0.9;
- // Half of the total thickness of frame crosses (including DAlu)
- // for each chamber in stations 1 and 2:
- // 3% of X0 of composite material,
- // but taken as Aluminium here, with same thickness in number of X0
- Float_t dframez = 3. * 8.9 / 100;
-// Float_t dr;
- Float_t dstation;
-
-//
-// Rotation matrices in the x-y plane
- Int_t idrotm[1199];
-// phi= 0 deg
- AliMatrix(idrotm[1100], 90., 0., 90., 90., 0., 0.);
-// phi= 90 deg
- AliMatrix(idrotm[1101], 90., 90., 90., 180., 0., 0.);
-// phi= 180 deg
- AliMatrix(idrotm[1102], 90., 180., 90., 270., 0., 0.);
-// phi= 270 deg
- AliMatrix(idrotm[1103], 90., 270., 90., 0., 0., 0.);
-//
- Float_t phi=2*TMath::Pi()/12/2;
-
-//
-// pointer to the current chamber
-// pointer to the current chamber
- Int_t idAlu1=idtmed[1103]; // medium 4
- Int_t idAlu2=idtmed[1104]; // medium 5
-// Int_t idAlu1=idtmed[1100];
-// Int_t idAlu2=idtmed[1100];
- Int_t idAir=idtmed[1100]; // medium 1
-// Int_t idGas=idtmed[1105]; // medium 6 = Ar-isoC4H10 gas
- Int_t idGas=idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
-
-
- AliMUONChamber *iChamber, *iChamber1, *iChamber2;
- Int_t stations[5] = {1, 1, 1, 1, 1};
-
- if (stations[0]) {
-
-//********************************************************************
-// Station 1 **
-//********************************************************************
-// CONCENTRIC
- // indices 1 and 2 for first and second chambers in the station
- // iChamber (first chamber) kept for other quanties than Z,
- // assumed to be the same in both chambers
- iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[0];
- iChamber2 =(AliMUONChamber*) (*fChambers)[1];
- zpos1=iChamber1->Z();
- zpos2=iChamber2->Z();
- dstation = zpos2 - zpos1;
- // DGas decreased from standard one (0.5)
- iChamber->SetDGas(0.4); iChamber2->SetDGas(0.4);
- // DAlu increased from standard one (3% of X0),
- // because more electronics with smaller pads
- iChamber->SetDAlu(3.5 * 8.9 / 100.); iChamber2->SetDAlu(3.5 * 8.9 / 100.);
- zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
-
-//
-// Mother volume
- tpar[0] = iChamber->RInner()-dframep;
- tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
- tpar[2] = dstation/5;
-
- gMC->Gsvolu("S01M", "TUBE", idAir, tpar, 3);
- gMC->Gsvolu("S02M", "TUBE", idAir, tpar, 3);
- gMC->Gspos("S01M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
- gMC->Gspos("S02M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
-// // Aluminium frames
-// // Outer frames
-// pgpar[0] = 360/12/2;
-// pgpar[1] = 360.;
-// pgpar[2] = 12.;
-// pgpar[3] = 2;
-// pgpar[4] = -dframez/2;
-// pgpar[5] = iChamber->ROuter();
-// pgpar[6] = pgpar[5]+dframep1;
-// pgpar[7] = +dframez/2;
-// pgpar[8] = pgpar[5];
-// pgpar[9] = pgpar[6];
-// gMC->Gsvolu("S01O", "PGON", idAlu1, pgpar, 10);
-// gMC->Gsvolu("S02O", "PGON", idAlu1, pgpar, 10);
-// gMC->Gspos("S01O",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S01O",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
-// gMC->Gspos("S02O",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S02O",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
-// //
-// // Inner frame
-// tpar[0]= iChamber->RInner()-dframep1;
-// tpar[1]= iChamber->RInner();
-// tpar[2]= dframez/2;
-// gMC->Gsvolu("S01I", "TUBE", idAlu1, tpar, 3);
-// gMC->Gsvolu("S02I", "TUBE", idAlu1, tpar, 3);
-
-// gMC->Gspos("S01I",1,"S01M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S01I",2,"S01M", 0.,0.,+zfpos, 0,"ONLY");
-// gMC->Gspos("S02I",1,"S02M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S02I",2,"S02M", 0.,0.,+zfpos, 0,"ONLY");
-//
-// Frame Crosses
- if (frameCrosses) {
- // outside gas
- // security for inside mother volume
- bpar[0] = (iChamber->ROuter() - iChamber->RInner())
- * TMath::Cos(TMath::ASin(dframep1 /
- (iChamber->ROuter() - iChamber->RInner())))
- / 2.0;
- bpar[1] = dframep1/2;
- // total thickness will be (4 * bpar[2]) for each chamber,
- // which has to be equal to (2 * dframez) - DAlu
- bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
- gMC->Gsvolu("S01B", "BOX", idAlu1, bpar, 3);
- gMC->Gsvolu("S02B", "BOX", idAlu1, bpar, 3);
-
- gMC->Gspos("S01B",1,"S01M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S01B",2,"S01M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S01B",3,"S01M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S01B",4,"S01M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S01B",5,"S01M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S01B",6,"S01M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S01B",7,"S01M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S01B",8,"S01M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
-
- gMC->Gspos("S02B",1,"S02M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S02B",2,"S02M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S02B",3,"S02M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S02B",4,"S02M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S02B",5,"S02M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S02B",6,"S02M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S02B",7,"S02M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S02B",8,"S02M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
- }
-//
-// Chamber Material represented by Alu sheet
- tpar[0]= iChamber->RInner();
- tpar[1]= iChamber->ROuter();
- tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
- gMC->Gsvolu("S01A", "TUBE", idAlu2, tpar, 3);
- gMC->Gsvolu("S02A", "TUBE",idAlu2, tpar, 3);
- gMC->Gspos("S01A", 1, "S01M", 0., 0., 0., 0, "ONLY");
- gMC->Gspos("S02A", 1, "S02M", 0., 0., 0., 0, "ONLY");
-//
-// Sensitive volumes
- // tpar[2] = iChamber->DGas();
- tpar[2] = iChamber->DGas()/2;
- gMC->Gsvolu("S01G", "TUBE", idGas, tpar, 3);
- gMC->Gsvolu("S02G", "TUBE", idGas, tpar, 3);
- gMC->Gspos("S01G", 1, "S01A", 0., 0., 0., 0, "ONLY");
- gMC->Gspos("S02G", 1, "S02A", 0., 0., 0., 0, "ONLY");
-//
-// Frame Crosses to be placed inside gas
- // NONE: chambers are sensitive everywhere
-// if (frameCrosses) {
-
-// dr = (iChamber->ROuter() - iChamber->RInner());
-// bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
-// bpar[1] = dframep1/2;
-// bpar[2] = iChamber->DGas()/2;
-// gMC->Gsvolu("S01F", "BOX", idAlu1, bpar, 3);
-// gMC->Gsvolu("S02F", "BOX", idAlu1, bpar, 3);
-
-// gMC->Gspos("S01F",1,"S01G", +iChamber->RInner()+bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S01F",2,"S01G", -iChamber->RInner()-bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S01F",3,"S01G", 0, +iChamber->RInner()+bpar[0] , 0,
-// idrotm[1101],"ONLY");
-// gMC->Gspos("S01F",4,"S01G", 0, -iChamber->RInner()-bpar[0] , 0,
-// idrotm[1101],"ONLY");
-
-// gMC->Gspos("S02F",1,"S02G", +iChamber->RInner()+bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S02F",2,"S02G", -iChamber->RInner()-bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S02F",3,"S02G", 0, +iChamber->RInner()+bpar[0] , 0,
-// idrotm[1101],"ONLY");
-// gMC->Gspos("S02F",4,"S02G", 0, -iChamber->RInner()-bpar[0] , 0,
-// idrotm[1101],"ONLY");
-// }
- }
- if (stations[1]) {
-
-//********************************************************************
-// Station 2 **
-//********************************************************************
- // indices 1 and 2 for first and second chambers in the station
- // iChamber (first chamber) kept for other quanties than Z,
- // assumed to be the same in both chambers
- iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[2];
- iChamber2 =(AliMUONChamber*) (*fChambers)[3];
- zpos1=iChamber1->Z();
- zpos2=iChamber2->Z();
- dstation = zpos2 - zpos1;
- // DGas and DAlu not changed from standard values
- zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2;
-
-//
-// Mother volume
- tpar[0] = iChamber->RInner()-dframep;
- tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
- tpar[2] = dstation/5;
-
- gMC->Gsvolu("S03M", "TUBE", idAir, tpar, 3);
- gMC->Gsvolu("S04M", "TUBE", idAir, tpar, 3);
- gMC->Gspos("S03M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
- gMC->Gspos("S04M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
- gMC->Gsbool("S03M", "L3DO");
- gMC->Gsbool("S03M", "L3O1");
- gMC->Gsbool("S03M", "L3O2");
- gMC->Gsbool("S04M", "L3DO");
- gMC->Gsbool("S04M", "L3O1");
- gMC->Gsbool("S04M", "L3O2");
-
-// // Aluminium frames
-// // Outer frames
-// pgpar[0] = 360/12/2;
-// pgpar[1] = 360.;
-// pgpar[2] = 12.;
-// pgpar[3] = 2;
-// pgpar[4] = -dframez/2;
-// pgpar[5] = iChamber->ROuter();
-// pgpar[6] = pgpar[5]+dframep;
-// pgpar[7] = +dframez/2;
-// pgpar[8] = pgpar[5];
-// pgpar[9] = pgpar[6];
-// gMC->Gsvolu("S03O", "PGON", idAlu1, pgpar, 10);
-// gMC->Gsvolu("S04O", "PGON", idAlu1, pgpar, 10);
-// gMC->Gspos("S03O",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S03O",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
-// gMC->Gspos("S04O",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S04O",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
-// //
-// // Inner frame
-// tpar[0]= iChamber->RInner()-dframep;
-// tpar[1]= iChamber->RInner();
-// tpar[2]= dframez/2;
-// gMC->Gsvolu("S03I", "TUBE", idAlu1, tpar, 3);
-// gMC->Gsvolu("S04I", "TUBE", idAlu1, tpar, 3);
-
-// gMC->Gspos("S03I",1,"S03M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S03I",2,"S03M", 0.,0.,+zfpos, 0,"ONLY");
-// gMC->Gspos("S04I",1,"S04M", 0.,0.,-zfpos, 0,"ONLY");
-// gMC->Gspos("S04I",2,"S04M", 0.,0.,+zfpos, 0,"ONLY");
-//
-// Frame Crosses
- if (frameCrosses) {
- // outside gas
- // security for inside mother volume
- bpar[0] = (iChamber->ROuter() - iChamber->RInner())
- * TMath::Cos(TMath::ASin(dframep1 /
- (iChamber->ROuter() - iChamber->RInner())))
- / 2.0;
- bpar[1] = dframep1/2;
- // total thickness will be (4 * bpar[2]) for each chamber,
- // which has to be equal to (2 * dframez) - DAlu
- bpar[2] = (2.0 * dframez - iChamber->DAlu()) / 4.0;
- gMC->Gsvolu("S03B", "BOX", idAlu1, bpar, 3);
- gMC->Gsvolu("S04B", "BOX", idAlu1, bpar, 3);
-
- gMC->Gspos("S03B",1,"S03M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S03B",2,"S03M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S03B",3,"S03M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S03B",4,"S03M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S03B",5,"S03M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S03B",6,"S03M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S03B",7,"S03M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S03B",8,"S03M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
-
- gMC->Gspos("S04B",1,"S04M", +iChamber->RInner()+bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S04B",2,"S04M", -iChamber->RInner()-bpar[0] , 0,-zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S04B",3,"S04M", 0, +iChamber->RInner()+bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S04B",4,"S04M", 0, -iChamber->RInner()-bpar[0] ,-zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S04B",5,"S04M", +iChamber->RInner()+bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S04B",6,"S04M", -iChamber->RInner()-bpar[0] , 0,+zfpos,
- idrotm[1100],"ONLY");
- gMC->Gspos("S04B",7,"S04M", 0, +iChamber->RInner()+bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
- gMC->Gspos("S04B",8,"S04M", 0, -iChamber->RInner()-bpar[0] ,+zfpos,
- idrotm[1101],"ONLY");
- }
-//
-// Chamber Material represented by Alu sheet
- tpar[0]= iChamber->RInner();
- tpar[1]= iChamber->ROuter();
- tpar[2] = (iChamber->DGas()+iChamber->DAlu())/2;
- gMC->Gsvolu("S03A", "TUBE", idAlu2, tpar, 3);
- gMC->Gsvolu("S04A", "TUBE", idAlu2, tpar, 3);
- gMC->Gspos("S03A", 1, "S03M", 0., 0., 0., 0, "ONLY");
- gMC->Gspos("S04A", 1, "S04M", 0., 0., 0., 0, "ONLY");
-//
-// Sensitive volumes
- // tpar[2] = iChamber->DGas();
- tpar[2] = iChamber->DGas()/2;
- gMC->Gsvolu("S03G", "TUBE", idGas, tpar, 3);
- gMC->Gsvolu("S04G", "TUBE", idGas, tpar, 3);
- gMC->Gspos("S03G", 1, "S03A", 0., 0., 0., 0, "ONLY");
- gMC->Gspos("S04G", 1, "S04A", 0., 0., 0., 0, "ONLY");
-//
-// Frame Crosses to be placed inside gas
- // NONE: chambers are sensitive everywhere
-// if (frameCrosses) {
-
-// dr = (iChamber->ROuter() - iChamber->RInner());
-// bpar[0] = TMath::Sqrt(dr*dr-dframep1*dframep1/4)/2;
-// bpar[1] = dframep1/2;
-// bpar[2] = iChamber->DGas()/2;
-// gMC->Gsvolu("S03F", "BOX", idAlu1, bpar, 3);
-// gMC->Gsvolu("S04F", "BOX", idAlu1, bpar, 3);
-
-// gMC->Gspos("S03F",1,"S03G", +iChamber->RInner()+bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S03F",2,"S03G", -iChamber->RInner()-bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S03F",3,"S03G", 0, +iChamber->RInner()+bpar[0] , 0,
-// idrotm[1101],"ONLY");
-// gMC->Gspos("S03F",4,"S03G", 0, -iChamber->RInner()-bpar[0] , 0,
-// idrotm[1101],"ONLY");
-
-// gMC->Gspos("S04F",1,"S04G", +iChamber->RInner()+bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S04F",2,"S04G", -iChamber->RInner()-bpar[0] , 0, 0,
-// idrotm[1100],"ONLY");
-// gMC->Gspos("S04F",3,"S04G", 0, +iChamber->RInner()+bpar[0] , 0,
-// idrotm[1101],"ONLY");
-// gMC->Gspos("S04F",4,"S04G", 0, -iChamber->RInner()-bpar[0] , 0,
-// idrotm[1101],"ONLY");
-// }
- }
- // define the id of tracking media:
- Int_t idCopper = idtmed[1110];
- Int_t idGlass = idtmed[1111];
- Int_t idCarbon = idtmed[1112];
- Int_t idRoha = idtmed[1113];
-
- // sensitive area: 40*40 cm**2
- const Float_t sensLength = 40.;
- const Float_t sensHeight = 40.;
- const Float_t sensWidth = 0.5; // according to TDR fig 2.120
- const Int_t sensMaterial = idGas;
- const Float_t yOverlap = 1.5;
-
- // PCB dimensions in cm; width: 30 mum copper
- const Float_t pcbLength = sensLength;
- const Float_t pcbHeight = 60.;
- const Float_t pcbWidth = 0.003;
- const Int_t pcbMaterial = idCopper;
-
- // Insulating material: 200 mum glass fiber glued to pcb
- const Float_t insuLength = pcbLength;
- const Float_t insuHeight = pcbHeight;
- const Float_t insuWidth = 0.020;
- const Int_t insuMaterial = idGlass;
-
- // Carbon fiber panels: 200mum carbon/epoxy skin
- const Float_t panelLength = sensLength;
- const Float_t panelHeight = sensHeight;
- const Float_t panelWidth = 0.020;
- const Int_t panelMaterial = idCarbon;
-
- // rohacell between the two carbon panels
- const Float_t rohaLength = sensLength;
- const Float_t rohaHeight = sensHeight;
- const Float_t rohaWidth = 0.5;
- const Int_t rohaMaterial = idRoha;
-
- // Frame around the slat: 2 sticks along length,2 along height
- // H: the horizontal ones
- const Float_t hFrameLength = pcbLength;
- const Float_t hFrameHeight = 1.5;
- const Float_t hFrameWidth = sensWidth;
- const Int_t hFrameMaterial = idGlass;
-
- // V: the vertical ones
- const Float_t vFrameLength = 4.0;
- const Float_t vFrameHeight = sensHeight + hFrameHeight;
- const Float_t vFrameWidth = sensWidth;
- const Int_t vFrameMaterial = idGlass;
-
- // B: the horizontal border filled with rohacell
- const Float_t bFrameLength = hFrameLength;
- const Float_t bFrameHeight = (pcbHeight - sensHeight)/2. - hFrameHeight;
- const Float_t bFrameWidth = hFrameWidth;
- const Int_t bFrameMaterial = idRoha;
-
- // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
- const Float_t nulocLength = 2.5;
- const Float_t nulocHeight = 7.5;
- const Float_t nulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
- const Int_t nulocMaterial = idCopper;
-
- const Float_t slatHeight = pcbHeight;
- const Float_t slatWidth = sensWidth + 2.*(pcbWidth + insuWidth +
- 2.* panelWidth + rohaWidth);
- const Int_t slatMaterial = idAir;
- const Float_t dSlatLength = vFrameLength; // border on left and right
-
- Float_t spar[3];
- Int_t i, j;
-
- // the panel volume contains the rohacell
-
- Float_t twidth = 2 * panelWidth + rohaWidth;
- Float_t panelpar[3] = { panelLength/2., panelHeight/2., twidth/2. };
- Float_t rohapar[3] = { rohaLength/2., rohaHeight/2., rohaWidth/2. };
-
- // insulating material contains PCB-> gas-> 2 borders filled with rohacell
-
- twidth = 2*(insuWidth + pcbWidth) + sensWidth;
- Float_t insupar[3] = { insuLength/2., insuHeight/2., twidth/2. };
- twidth -= 2 * insuWidth;
- Float_t pcbpar[3] = { pcbLength/2., pcbHeight/2., twidth/2. };
- Float_t senspar[3] = { sensLength/2., sensHeight/2., sensWidth/2. };
- Float_t theight = 2*hFrameHeight + sensHeight;
- Float_t hFramepar[3]={hFrameLength/2., theight/2., hFrameWidth/2.};
- Float_t bFramepar[3]={bFrameLength/2., bFrameHeight/2., bFrameWidth/2.};
- Float_t vFramepar[3]={vFrameLength/2., vFrameHeight/2., vFrameWidth/2.};
- Float_t nulocpar[3]={nulocLength/2., nulocHeight/2., nulocWidth/2.};
- Float_t xx;
- Float_t xxmax = (bFrameLength - nulocLength)/2.;
- Int_t index=0;
-
- if (stations[2]) {
-
-//********************************************************************
-// Station 3 **
-//********************************************************************
- // indices 1 and 2 for first and second chambers in the station
- // iChamber (first chamber) kept for other quanties than Z,
- // assumed to be the same in both chambers
- iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[4];
- iChamber2 =(AliMUONChamber*) (*fChambers)[5];
- zpos1=iChamber1->Z();
- zpos2=iChamber2->Z();
- dstation = zpos2 - zpos1;
-
-// zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
-//
-// Mother volume
- tpar[0] = iChamber->RInner()-dframep;
- tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
- tpar[2] = dstation/5;
-
- char *slats5Mother = "S05M";
- char *slats6Mother = "S06M";
- Float_t zoffs5 = 0;
- Float_t zoffs6 = 0;
-
- if (gAlice->GetModule("DIPO")) {
- slats5Mother="DDIP";
- slats6Mother="DDIP";
-
- zoffs5 = zpos1;
- zoffs6 = zpos2;
- }
- else {
- gMC->Gsvolu("S05M", "TUBE", idAir, tpar, 3);
- gMC->Gsvolu("S06M", "TUBE", idAir, tpar, 3);
- gMC->Gspos("S05M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
- gMC->Gspos("S06M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
- }
-
- // volumes for slat geometry (xx=5,..,10 chamber id):
- // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
- // SxxG --> Sensitive volume (gas)
- // SxxP --> PCB (copper)
- // SxxI --> Insulator (vetronite)
- // SxxC --> Carbon panel
- // SxxR --> Rohacell
- // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
- // SB5x --> Volumes for the 35 cm long PCB
- // slat dimensions: slat is a MOTHER volume!!! made of air
-
- // only for chamber 5: slat 1 has a PCB shorter by 5cm!
-
- Float_t tlength = 35.;
- Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
- Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
- Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
- Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
- Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
- Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
- Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
-
- const Int_t nSlats3 = 5; // number of slats per quadrant
- const Int_t nPCB3[nSlats3] = {3,3,4,3,2}; // n PCB per slat
- const Float_t xpos3[nSlats3] = {31., 40., 0., 0., 0.};
- Float_t slatLength3[nSlats3];
-
- // create and position the slat (mother) volumes
-
- char volNam5[5];
- char volNam6[5];
- Float_t xSlat3;
-
- Float_t spar2[3];
- for (i = 0; i<nSlats3; i++){
- slatLength3[i] = pcbLength * nPCB3[i] + 2. * dSlatLength;
- xSlat3 = slatLength3[i]/2. - vFrameLength/2. + xpos3[i];
- if (i==1 || i==0) slatLength3[i] -= 2. *dSlatLength; // frame out in PCB with circular border
- Float_t ySlat31 = sensHeight * i - yOverlap * i;
- Float_t ySlat32 = -sensHeight * i + yOverlap * i;
- spar[0] = slatLength3[i]/2.;
- spar[1] = slatHeight/2.;
- spar[2] = slatWidth/2. * 1.01;
- // take away 5 cm from the first slat in chamber 5
- Float_t xSlat32 = 0;
- if (i==1 || i==2) { // 1 pcb is shortened by 5cm
- spar2[0] = spar[0]-5./2.;
- xSlat32 = xSlat3 - 5/2.;
- }
- else {
- spar2[0] = spar[0];
- xSlat32 = xSlat3;
- }
- spar2[1] = spar[1];
- spar2[2] = spar[2];
- Float_t dzCh3=spar[2] * 1.01;
- // zSlat to be checked (odd downstream or upstream?)
- Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
- sprintf(volNam5,"S05%d",i);
- gMC->Gsvolu(volNam5,"BOX",slatMaterial,spar2,3);
- gMC->Gspos(volNam5, i*4+1,slats5Mother, xSlat32, ySlat31, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
- gMC->Gspos(volNam5, i*4+2,slats5Mother,-xSlat32, ySlat31, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
-
- if (i>0) {
- gMC->Gspos(volNam5, i*4+3,slats5Mother, xSlat32, ySlat32, zoffs5+zSlat+2.*dzCh3, 0, "ONLY");
- gMC->Gspos(volNam5, i*4+4,slats5Mother,-xSlat32, ySlat32, zoffs5+zSlat-2.*dzCh3, 0, "ONLY");
- }
- sprintf(volNam6,"S06%d",i);
- gMC->Gsvolu(volNam6,"BOX",slatMaterial,spar,3);
- gMC->Gspos(volNam6, i*4+1,slats6Mother, xSlat3, ySlat31, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
- gMC->Gspos(volNam6, i*4+2,slats6Mother,-xSlat3, ySlat31, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
- if (i>0) {
- gMC->Gspos(volNam6, i*4+3,slats6Mother, xSlat3, ySlat32, zoffs6+zSlat+2.*dzCh3, 0, "ONLY");
- gMC->Gspos(volNam6, i*4+4,slats6Mother,-xSlat3, ySlat32, zoffs6+zSlat-2.*dzCh3, 0, "ONLY");
- }
- }
-
- // create the panel volume
-
- gMC->Gsvolu("S05C","BOX",panelMaterial,panelpar,3);
- gMC->Gsvolu("SB5C","BOX",panelMaterial,panelpar2,3);
- gMC->Gsvolu("S06C","BOX",panelMaterial,panelpar,3);
-
- // create the rohacell volume
-
- gMC->Gsvolu("S05R","BOX",rohaMaterial,rohapar,3);
- gMC->Gsvolu("SB5R","BOX",rohaMaterial,rohapar2,3);
- gMC->Gsvolu("S06R","BOX",rohaMaterial,rohapar,3);
-
- // create the insulating material volume
-
- gMC->Gsvolu("S05I","BOX",insuMaterial,insupar,3);
- gMC->Gsvolu("SB5I","BOX",insuMaterial,insupar2,3);
- gMC->Gsvolu("S06I","BOX",insuMaterial,insupar,3);
-
- // create the PCB volume
-
- gMC->Gsvolu("S05P","BOX",pcbMaterial,pcbpar,3);
- gMC->Gsvolu("SB5P","BOX",pcbMaterial,pcbpar2,3);
- gMC->Gsvolu("S06P","BOX",pcbMaterial,pcbpar,3);
-
- // create the sensitive volumes,
- gMC->Gsvolu("S05G","BOX",sensMaterial,dum,0);
- gMC->Gsvolu("S06G","BOX",sensMaterial,dum,0);
-
-
- // create the vertical frame volume
-
- gMC->Gsvolu("S05V","BOX",vFrameMaterial,vFramepar,3);
- gMC->Gsvolu("S06V","BOX",vFrameMaterial,vFramepar,3);
-
- // create the horizontal frame volume
-
- gMC->Gsvolu("S05H","BOX",hFrameMaterial,hFramepar,3);
- gMC->Gsvolu("SB5H","BOX",hFrameMaterial,hFramepar2,3);
- gMC->Gsvolu("S06H","BOX",hFrameMaterial,hFramepar,3);
-
- // create the horizontal border volume
-
- gMC->Gsvolu("S05B","BOX",bFrameMaterial,bFramepar,3);
- gMC->Gsvolu("SB5B","BOX",bFrameMaterial,bFramepar2,3);
- gMC->Gsvolu("S06B","BOX",bFrameMaterial,bFramepar,3);
-
- index=0;
- for (i = 0; i<nSlats3; i++){
- sprintf(volNam5,"S05%d",i);
- sprintf(volNam6,"S06%d",i);
- Float_t xvFrame = (slatLength3[i] - vFrameLength)/2.;
- Float_t xvFrame2 = xvFrame;
- if ( i==1 || i ==2 ) xvFrame2 -= 5./2.;
- // position the vertical frames
- if (i!=1 && i!=0) {
- gMC->Gspos("S05V",2*i-1,volNam5, xvFrame2, 0., 0. , 0, "ONLY");
- gMC->Gspos("S05V",2*i ,volNam5,-xvFrame2, 0., 0. , 0, "ONLY");
- gMC->Gspos("S06V",2*i-1,volNam6, xvFrame, 0., 0. , 0, "ONLY");
- gMC->Gspos("S06V",2*i ,volNam6,-xvFrame, 0., 0. , 0, "ONLY");
- }
- // position the panels and the insulating material
- for (j=0; j<nPCB3[i]; j++){
- index++;
- Float_t xx = sensLength * (-nPCB3[i]/2.+j+.5);
- Float_t xx2 = xx + 5/2.;
-
- Float_t zPanel = spar[2] - panelpar[2];
- if ( (i==1 || i==2) && j == nPCB3[i]-1) { // 1 pcb is shortened by 5cm
- gMC->Gspos("SB5C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
- gMC->Gspos("SB5C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
- gMC->Gspos("SB5I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
- }
- else if ( (i==1 || i==2) && j < nPCB3[i]-1) {
- gMC->Gspos("S05C",2*index-1,volNam5, xx2, 0., zPanel , 0, "ONLY");
- gMC->Gspos("S05C",2*index ,volNam5, xx2, 0.,-zPanel , 0, "ONLY");
- gMC->Gspos("S05I",index ,volNam5, xx2, 0., 0 , 0, "ONLY");
- }
- else {
- gMC->Gspos("S05C",2*index-1,volNam5, xx, 0., zPanel , 0, "ONLY");
- gMC->Gspos("S05C",2*index ,volNam5, xx, 0.,-zPanel , 0, "ONLY");
- gMC->Gspos("S05I",index ,volNam5, xx, 0., 0 , 0, "ONLY");
- }
- gMC->Gspos("S06C",2*index-1,volNam6, xx, 0., zPanel , 0, "ONLY");
- gMC->Gspos("S06C",2*index ,volNam6, xx, 0.,-zPanel , 0, "ONLY");
- gMC->Gspos("S06I",index,volNam6, xx, 0., 0 , 0, "ONLY");
- }
- }
-
- // position the rohacell volume inside the panel volume
- gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
- gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
-
- // position the PCB volume inside the insulating material volume
- gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
- gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
- // position the horizontal frame volume inside the PCB volume
- gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
- gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
- // position the sensitive volume inside the horizontal frame volume
- gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
- gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
- gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
- // position the border volumes inside the PCB volume
- Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
- gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
- gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
- gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
- gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
-
- // create the NULOC volume and position it in the horizontal frame
-
- gMC->Gsvolu("S05N","BOX",nulocMaterial,nulocpar,3);
- gMC->Gsvolu("S06N","BOX",nulocMaterial,nulocpar,3);
- index = 0;
- Float_t xxmax2 = xxmax - 5./2.;
- for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
- index++;
- gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
- gMC->Gspos("S05N",2*index ,"S05B", xx, 0., bFrameWidth/4., 0, "ONLY");
- if (xx > -xxmax2 && xx< xxmax2) {
- gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
- gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., bFrameWidth/4., 0, "ONLY");
- }
- gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
- gMC->Gspos("S06N",2*index ,"S06B", xx, 0., bFrameWidth/4., 0, "ONLY");
- }
-
- // position the volumes approximating the circular section of the pipe
- Float_t yoffs = sensHeight/2. - yOverlap;
- Float_t epsilon = 0.001;
- Int_t ndiv=6;
- Float_t divpar[3];
- Double_t dydiv= sensHeight/ndiv;
- Double_t ydiv = yoffs -dydiv;
- Int_t imax=0;
- imax = 1;
- Float_t rmin = 33.;
- Float_t z1 = spar[2], z2=2*spar[2]*1.01;
- for (Int_t idiv=0;idiv<ndiv; idiv++){
- ydiv+= dydiv;
- Float_t xdiv = 0.;
- if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
- divpar[0] = (pcbLength-xdiv)/2.;
- divpar[1] = dydiv/2. - epsilon;
- divpar[2] = sensWidth/2.;
- Float_t xvol=(pcbLength+xdiv)/2.+1.999;
- Float_t yvol=ydiv + dydiv/2.;
- //printf ("y ll = %f y ur = %f \n",yvol - divpar[1], yvol + divpar[1]);
- gMC->Gsposp("S05G",imax+4*idiv+1,slats5Mother, xvol, yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S06G",imax+4*idiv+1,slats6Mother, xvol, yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S05G",imax+4*idiv+2,slats5Mother, xvol,-yvol, zoffs5+z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S06G",imax+4*idiv+2,slats6Mother, xvol,-yvol, zoffs6+z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S05G",imax+4*idiv+3,slats5Mother,-xvol, yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S06G",imax+4*idiv+3,slats6Mother,-xvol, yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S05G",imax+4*idiv+4,slats5Mother,-xvol,-yvol, zoffs5+z1-z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S06G",imax+4*idiv+4,slats6Mother,-xvol,-yvol, zoffs6+z1-z2, 0, "ONLY",divpar,3);
- }
- }
-
- if (stations[3]) {
-
-//********************************************************************
-// Station 4 **
-//********************************************************************
- // indices 1 and 2 for first and second chambers in the station
- // iChamber (first chamber) kept for other quanties than Z,
- // assumed to be the same in both chambers
- iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[6];
- iChamber2 =(AliMUONChamber*) (*fChambers)[7];
- zpos1=iChamber1->Z();
- zpos2=iChamber2->Z();
- dstation = zpos2 - zpos1;
-// zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
-
-//
-// Mother volume
- tpar[0] = iChamber->RInner()-dframep;
- tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
- tpar[2] = dstation/4;
-
- gMC->Gsvolu("S07M", "TUBE", idAir, tpar, 3);
- gMC->Gsvolu("S08M", "TUBE", idAir, tpar, 3);
- gMC->Gspos("S07M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
- gMC->Gspos("S08M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
-
-
- const Int_t nSlats4 = 6; // number of slats per quadrant
- const Int_t nPCB4[nSlats4] = {4,4,5,5,4,3}; // n PCB per slat
- const Float_t xpos4[nSlats4] = {38.5, 40., 0., 0., 0., 0.};
- Float_t slatLength4[nSlats4];
-
- // create and position the slat (mother) volumes
-
- char volNam7[5];
- char volNam8[5];
- Float_t xSlat4;
- Float_t ySlat4;
-
- for (i = 0; i<nSlats4; i++){
- slatLength4[i] = pcbLength * nPCB4[i] + 2. * dSlatLength;
- xSlat4 = slatLength4[i]/2. - vFrameLength/2. + xpos4[i];
- if (i==1) slatLength4[i] -= 2. *dSlatLength; // frame out in PCB with circular border
- ySlat4 = sensHeight * i - yOverlap *i;
-
- spar[0] = slatLength4[i]/2.;
- spar[1] = slatHeight/2.;
- spar[2] = slatWidth/2.*1.01;
- Float_t dzCh4=spar[2]*1.01;
- // zSlat to be checked (odd downstream or upstream?)
- Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
- sprintf(volNam7,"S07%d",i);
- gMC->Gsvolu(volNam7,"BOX",slatMaterial,spar,3);
- gMC->Gspos(volNam7, i*4+1,"S07M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
- gMC->Gspos(volNam7, i*4+2,"S07M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
- if (i>0) {
- gMC->Gspos(volNam7, i*4+3,"S07M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
- gMC->Gspos(volNam7, i*4+4,"S07M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
- }
- sprintf(volNam8,"S08%d",i);
- gMC->Gsvolu(volNam8,"BOX",slatMaterial,spar,3);
- gMC->Gspos(volNam8, i*4+1,"S08M", xSlat4, ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
- gMC->Gspos(volNam8, i*4+2,"S08M",-xSlat4, ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
- if (i>0) {
- gMC->Gspos(volNam8, i*4+3,"S08M", xSlat4,-ySlat4, zSlat+2.*dzCh4, 0, "ONLY");
- gMC->Gspos(volNam8, i*4+4,"S08M",-xSlat4,-ySlat4, zSlat-2.*dzCh4, 0, "ONLY");
- }
- }
-
-
- // create the panel volume
-
- gMC->Gsvolu("S07C","BOX",panelMaterial,panelpar,3);
- gMC->Gsvolu("S08C","BOX",panelMaterial,panelpar,3);
-
- // create the rohacell volume
-
- gMC->Gsvolu("S07R","BOX",rohaMaterial,rohapar,3);
- gMC->Gsvolu("S08R","BOX",rohaMaterial,rohapar,3);
-
- // create the insulating material volume
-
- gMC->Gsvolu("S07I","BOX",insuMaterial,insupar,3);
- gMC->Gsvolu("S08I","BOX",insuMaterial,insupar,3);
-
- // create the PCB volume
-
- gMC->Gsvolu("S07P","BOX",pcbMaterial,pcbpar,3);
- gMC->Gsvolu("S08P","BOX",pcbMaterial,pcbpar,3);
-
- // create the sensitive volumes,
-
- gMC->Gsvolu("S07G","BOX",sensMaterial,dum,0);
- gMC->Gsvolu("S08G","BOX",sensMaterial,dum,0);
-
- // create the vertical frame volume
-
- gMC->Gsvolu("S07V","BOX",vFrameMaterial,vFramepar,3);
- gMC->Gsvolu("S08V","BOX",vFrameMaterial,vFramepar,3);
-
- // create the horizontal frame volume
-
- gMC->Gsvolu("S07H","BOX",hFrameMaterial,hFramepar,3);
- gMC->Gsvolu("S08H","BOX",hFrameMaterial,hFramepar,3);
-
- // create the horizontal border volume
-
- gMC->Gsvolu("S07B","BOX",bFrameMaterial,bFramepar,3);
- gMC->Gsvolu("S08B","BOX",bFrameMaterial,bFramepar,3);
-
- index=0;
- for (i = 0; i<nSlats4; i++){
- sprintf(volNam7,"S07%d",i);
- sprintf(volNam8,"S08%d",i);
- Float_t xvFrame = (slatLength4[i] - vFrameLength)/2.;
- // position the vertical frames
- if (i!=1 && i!=0) {
- gMC->Gspos("S07V",2*i-1,volNam7, xvFrame, 0., 0. , 0, "ONLY");
- gMC->Gspos("S07V",2*i ,volNam7,-xvFrame, 0., 0. , 0, "ONLY");
- gMC->Gspos("S08V",2*i-1,volNam8, xvFrame, 0., 0. , 0, "ONLY");
- gMC->Gspos("S08V",2*i ,volNam8,-xvFrame, 0., 0. , 0, "ONLY");
- }
- // position the panels and the insulating material
- for (j=0; j<nPCB4[i]; j++){
- index++;
- Float_t xx = sensLength * (-nPCB4[i]/2.+j+.5);
-
- Float_t zPanel = spar[2] - panelpar[2];
- gMC->Gspos("S07C",2*index-1,volNam7, xx, 0., zPanel , 0, "ONLY");
- gMC->Gspos("S07C",2*index ,volNam7, xx, 0.,-zPanel , 0, "ONLY");
- gMC->Gspos("S08C",2*index-1,volNam8, xx, 0., zPanel , 0, "ONLY");
- gMC->Gspos("S08C",2*index ,volNam8, xx, 0.,-zPanel , 0, "ONLY");
-
- gMC->Gspos("S07I",index,volNam7, xx, 0., 0 , 0, "ONLY");
- gMC->Gspos("S08I",index,volNam8, xx, 0., 0 , 0, "ONLY");
- }
- }
-
- // position the rohacell volume inside the panel volume
- gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
-
- // position the PCB volume inside the insulating material volume
- gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
- // position the horizontal frame volume inside the PCB volume
- gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
- gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
- // position the sensitive volume inside the horizontal frame volume
- gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
- gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
- // position the border volumes inside the PCB volume
- Float_t yborder = ( pcbHeight - bFrameHeight ) / 2.;
- gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
- gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
- gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
- gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
-
- // create the NULOC volume and position it in the horizontal frame
-
- gMC->Gsvolu("S07N","BOX",nulocMaterial,nulocpar,3);
- gMC->Gsvolu("S08N","BOX",nulocMaterial,nulocpar,3);
- index = 0;
- for (xx = -xxmax; xx<=xxmax; xx+=2*nulocLength) {
- index++;
- gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
- gMC->Gspos("S07N",2*index ,"S07B", xx, 0., bFrameWidth/4., 0, "ONLY");
- gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-bFrameWidth/4., 0, "ONLY");
- gMC->Gspos("S08N",2*index ,"S08B", xx, 0., bFrameWidth/4., 0, "ONLY");
- }
-
- // position the volumes approximating the circular section of the pipe
- Float_t yoffs = sensHeight/2. - yOverlap;
- Float_t epsilon = 0.001;
- Int_t ndiv=6;
- Float_t divpar[3];
- Double_t dydiv= sensHeight/ndiv;
- Double_t ydiv = yoffs -dydiv;
- Int_t imax=0;
- imax = 1;
- Float_t rmin = 40.;
- Float_t z1 = -spar[2], z2=2*spar[2]*1.01;
- for (Int_t idiv=0;idiv<ndiv; idiv++){
- ydiv+= dydiv;
- Float_t xdiv = 0.;
- if (ydiv<rmin) xdiv= rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
- divpar[0] = (pcbLength-xdiv)/2.;
- divpar[1] = dydiv/2. - epsilon;
- divpar[2] = sensWidth/2.;
- Float_t xvol=(pcbLength+xdiv)/2.+1.999;
- Float_t yvol=ydiv + dydiv/2.;
- gMC->Gsposp("S07G",imax+4*idiv+1,"S07M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S08G",imax+4*idiv+1,"S08M", xvol, yvol, z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S07G",imax+4*idiv+2,"S07M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S08G",imax+4*idiv+2,"S08M", xvol,-yvol, z1+z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S07G",imax+4*idiv+3,"S07M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S08G",imax+4*idiv+3,"S08M",-xvol, yvol, z1-z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S07G",imax+4*idiv+4,"S07M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
- gMC->Gsposp("S08G",imax+4*idiv+4,"S08M",-xvol,-yvol, z1-z2, 0, "ONLY",divpar,3);
- }
-
-
-
-
-
- }
-
- if (stations[4]) {
-
-
-//********************************************************************
-// Station 5 **
-//********************************************************************
- // indices 1 and 2 for first and second chambers in the station
- // iChamber (first chamber) kept for other quanties than Z,
- // assumed to be the same in both chambers
- iChamber1 = iChamber = (AliMUONChamber*) (*fChambers)[8];
- iChamber2 =(AliMUONChamber*) (*fChambers)[9];
- zpos1=iChamber1->Z();
- zpos2=iChamber2->Z();
- dstation = zpos2 - zpos1;
-// zfpos=-(iChamber->DGas()+dframez+iChamber->DAlu())/2; // not used any more
-
-//
-// Mother volume
- tpar[0] = iChamber->RInner()-dframep;
- tpar[1] = (iChamber->ROuter()+dframep)/TMath::Cos(phi);
- tpar[2] = dstation/5.;
-
- gMC->Gsvolu("S09M", "TUBE", idAir, tpar, 3);
- gMC->Gsvolu("S10M", "TUBE", idAir, tpar, 3);
- gMC->Gspos("S09M", 1, "ALIC", 0., 0., zpos1 , 0, "ONLY");
- gMC->Gspos("S10M", 1, "ALIC", 0., 0., zpos2 , 0, "ONLY");
-
-
- const Int_t nSlats5 = 7; // number of slats per quadrant
- const Int_t nPCB5[nSlats5] = {5,5,6,6,5,4,3}; // n PCB per slat
- const Float_t xpos5[nSlats5] = {38.5, 40., 0., 0., 0., 0., 0.};
- Float_t slatLength5[nSlats5];
- char volNam9[5];
- char volNam10[5];
- Float_t xSlat5;
- Float_t ySlat5;
-
- for (i = 0; i<nSlats5; i++){
- slatLength5[i] = pcbLength * nPCB5[i] + 2. * dSlatLength;
- xSlat5 = slatLength5[i]/2. - vFrameLength/2. +xpos5[i];
- if (i==1 || i==0) slatLength5[i] -= 2. *dSlatLength; // frame out in PCB with circular border
- ySlat5 = sensHeight * i - yOverlap * i;
- spar[0] = slatLength5[i]/2.;
- spar[1] = slatHeight/2.;
- spar[2] = slatWidth/2. * 1.01;
- Float_t dzCh5=spar[2]*1.01;
- // zSlat to be checked (odd downstream or upstream?)
- Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
- sprintf(volNam9,"S09%d",i);
- gMC->Gsvolu(volNam9,"BOX",slatMaterial,spar,3);
- gMC->Gspos(volNam9, i*4+1,"S09M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
- gMC->Gspos(volNam9, i*4+2,"S09M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
- if (i>0) {
- gMC->Gspos(volNam9, i*4+3,"S09M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
- gMC->Gspos(volNam9, i*4+4,"S09M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
- }
- sprintf(volNam10,"S10%d",i);
- gMC->Gsvolu(volNam10,"BOX",slatMaterial,spar,3);
- gMC->Gspos(volNam10, i*4+1,"S10M", xSlat5, ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
- gMC->Gspos(volNam10, i*4+2,"S10M",-xSlat5, ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
- if (i>0) {
- gMC->Gspos(volNam10, i*4+3,"S10M", xSlat5,-ySlat5, zSlat+2.*dzCh5, 0, "ONLY");
- gMC->Gspos(volNam10, i*4+4,"S10M",-xSlat5,-ySlat5, zSlat-2.*dzCh5, 0, "ONLY");
- }
- }
-
- // create the panel volume
-
- gMC->Gsvolu("S09C","BOX",panelMaterial,panelpar,3);
- gMC->Gsvolu("S10C","BOX",panelMaterial,panelpar,3);
-
- // create the rohacell volume
-
- gMC->Gsvolu("S09R","BOX",rohaMaterial,rohapar,3);
- gMC->Gsvolu("S10R","BOX",rohaMaterial,rohapar,3);
-
- // create the insulating material volume
-
- gMC->Gsvolu("S09I","BOX",insuMaterial,insupar,3);
- gMC->Gsvolu("S10I","BOX",insuMaterial,insupar,3);
-
- // create the PCB volume
-
- gMC->Gsvolu("S09P","BOX",pcbMaterial,pcbpar,3);
- gMC->Gsvolu("S10P","BOX",pcbMaterial,pcbpar,3);
-
- // create the sensitive volumes,
-
- gMC->Gsvolu("S09G","BOX",sensMaterial,dum,0);
- gMC->Gsvolu("S10G","BOX",sensMaterial,dum,0);
-
- // create the vertical frame volume
-
- gMC->Gsvolu("S09V","BOX",vFrameMaterial,vFramepar,3);
- gMC->Gsvolu("S10V","BOX",vFrameMaterial,vFramepar,3);
-
- // create the horizontal frame volume
-
- gMC->Gsvolu("S09H","BOX",hFrameMaterial,hFramepar,3);
- gMC->Gsvolu("S10H","BOX",hFrameMaterial,hFramepar,3);
-
- // create the horizontal border volume
-
- gMC->Gsvolu("S09B","BOX",bFrameMaterial,bFramepar,3);
- gMC->Gsvolu("S10B","BOX",bFrameMaterial,bFramepar,3);
-
- index=0;
- for (i = 0; i<nSlats5; i++){
- sprintf(volNam9,"S09%d",i);
- sprintf(volNam10,"S10%d",i);
- Float_t xvFrame = (slatLength5[i] - vFrameLength)/2.;
- // position the vertical frames
- if (i!=1 && i!=0) {
- gMC->Gspos("S09V",2*i-1,volNam9, xvFrame, 0., 0. , 0, "ONLY");
- gMC->Gspos("S09V",2*i ,volNam9,-xvFrame, 0., 0. , 0, "ONLY");
- gMC->Gspos("S10V",2*i-1,volNam10, xvFrame, 0., 0. , 0, "ONLY");
- gMC->Gspos("S10V",2*i ,volNam10,-xvFrame, 0., 0. , 0, "ONLY");
- }
-
- // position the panels and the insulating material
- for (j=0; j<nPCB5[i]; j++){
- index++;
- Float_t xx = sensLength * (-nPCB5[i]/2.+j+.5);
-
- Float_t zPanel = spar[2] - panelpar[2];
- gMC->Gspos("S09C",2*index-1,volNam9, xx, 0., zPanel , 0, "ONLY");
- gMC->Gspos("S09C",2*index ,volNam9, xx, 0.,-zPanel , 0, "ONLY");
- gMC->Gspos("S10C",2*index-1,volNam10, xx, 0., zPanel , 0, "ONLY");
- gMC->Gspos("S10C",2*index ,volNam10, xx, 0.,-zPanel , 0, "ONLY");