+PATCH,SCT. *CMZ : 3.00/01 01/02/96 15.38.32 by A. DellAcqua +DECK,scttgeo,T=Geant. *CMZ : 15/04/96 11.17.51 by Jo Pater *-- Author : Fawzi Fares 29/07/94 ************************************************************************ Module SCTTGEO is the geometry description of the SCT tracker ************************************************************************ Author Fawzi Fares, Jo Pater Created 29-july-94 * * Modified 17 June 1997 J.Pater: * - adjusted amounts of material in cylinder end flanges and * cooling manifolds (close-outs) to match estimates in TDR * - insulator thickness 0.45 percent X0 --> 0.5 percent X0 to * match TDR estimate * - overall half-length adjusted from 76 cm to 79 cm to match TDR * this required new variable zcylend * * Modified 14 Oct 1996 J.Pater: corrected typo Attribute ZISO to * Attribute SISO * * Modified 21 Sept 1996 J.Pater: * - Adjusted amounts of support and service materials to match * latest engineers' predictions of 2.0% X0/layer normal incidence * - Adjusted the support cylinders to their proper positions. This * required a new element (ROSup) in the SCTI bank and made the * variables clarance and RSup unnecessary. * - Added the barrel cylinder-end closeouts and flanges. This required * the following modifications: * = two new geant volumes: SCLO and SCFL * = four new elements in the SCTI bank: FlLen,FlTck,COLen,COTck * = overall minimum radius of sctt volume was 26cm, now 25cm to * allow space for the innermost layer's flange. * * Modified 3 Sept 1996 S.Snow : change barrel 3 radius to 44.7 cm. * * Modified 15 March 1996 J.Pater: * - increased number of modules around layers 3 and 4 by one, * so that there is an even number in all layers * - standardised tilt angle in all layers * * Modified 13 March 1996 J.Pater: changed the tilt angle to be negative * in the SCTi bank rather than in the code * * Modified February 1996 J.Pater: * - change to Morges96 layout, required changes * to allow odd number of modules in phi, changed * division name from SECi to SSKi to reflect this * - z positions of modules calculated for equal projective * overlap rather than evenly spaced modules * - SCTG_Gap back to 0.01 but used correctly to avoid * overlap * - volume sizes calculated exactly to guard against overlap * - support positions, etc. calculated from sizes and * positions of neighboring volumes * - one cable per ski not two * - rotate and tilt the module about the center of the * silicon board * - support cylinders thicker to better match engineers' * estimates, lumped material thinner for same reason * - added insulating layer of polystyrene * * Modified 17-november-95 S.Snow changed SCTG_Gap from 0.01 to 0.02 * +CDE,AGECOM,GCONST,GCUNIT. Content SCTT,SISO,SCTI,SLAI,SSKI,TMOU,SECT,SCTB,SCTE,SCAB,SCTS,SLMP,SCLO,SCFL * * Note if you change sctg you must change it also in subroutine sctbstep * (Below) and perhaps also in scttdig.g * Structure SCTG {version,Rmin,Rmax,Hlen,Nlay,DySect,Dxyz1,Dxyz2, Dxyz3,Rtckele,Rtcklum,Wdthlum,Zovlp,Stro,Sto,Guard,Res, Elecz,gap,sep,Inn1,Out1,Inn2,Out2,Nmodz,ThInsu} * * Note if you change scti you must change it also in subroutine sctbstep * (Below) and perhaps also in scttdig.g * Structure SCTi {Lay,Rlay,Rtcksup,Tilt,LayTyp,Nmodphi, ROSup,FlLen,FlTck,COLen,COTck} * Real RadEle,RadSup,RadLum,TckEle,TckSup,TckLum,Rlump, Stra,Zsctr,ProjP,Ang,Angle,Rad1,Rad2,RadCab, lact,wact,TiltRad,zcen(20),diffang, rmin,rmax,rcab,Ycab, dxsect,dysect,dzsect,TckClo,TckFl Real dxtmou,dytmou,dztmou,alpha,xtmou,ytmou,delx,dely, wactrot,dxski,Rad0,tckiso,RadIso,interf,zcylend integer J,Nr,Is,icopy external sctbstep * ------------------------------------------------------ FILL SCTG ! general sct parameters version = 1 ! version Rmin = 25 ! overall min radius Rmax = 55 ! overall max radius Hlen = 79 ! overall half length Nlay = 4 ! Number of Layers DySect = 8.5 ! Width of a ski Dxyz1 = 0.03 ! Thickness of the Silicon Dxyz2 = 6.36 ! Width of the Silicon board Dxyz3 = 12.82 ! Length of the Silicon board Rtckele = 0.6 ! Thickness of the Electronics (in % of r.l.) Rtcklum = 1.0 ! THICKNESS OF THE LUMP (in % of r.l.) Wdthlum = 1.0 ! WIDTH OF THE LUMPED MATERIAL Zovlp = 0.0 ! min Z OVERLAP +\- 2 sigma from origin Stro = 2.29 ! STEREO ANGLE IN DEGREES for top semi-layer Sto = 0.0 ! STEREO ANGLE IN DEGREES for bot semi-layer Guard = 0.10 ! width of Guard Ring at crystal border Res = 0.05 ! width of polySi resistors at z ends of modules Elecz = 11.0 ! The Board length Gap = 0.01 ! radial sep between back to back modules Sep = 0.2 ! radial sep between modules adjacent in z Inn1 = 0.0 ! INNER RADIUS OF CABLE 1 Out1 = 0.128 ! OUTER RADIUS OF CABLE 1 Inn2 = 0.0 ! INNER RADIUS OF CABLE 2 Out2 = 0.16 ! OUTER RADIUS OF CABLE 2 Nmodz = 12 ! number of modules in z ThInsu = 0.5 ! Insulator thickness (in % of r.l.) * ------- FILL SCTi ! single layer parameters Lay = 1 ! sct layer Rlay = 30. ! Radius Rtcksup = 0.3 ! Thickness of the Supports (in % of r.l.) Tilt = -10.0 ! TILT ANGLE IN PHI Laytyp = -1 ! measurement type Nmodphi = 32 ! number of modules in phi ROSup = 28.0 ! Outer radius of support cylinder FlLen = 2.5 ! Flange length (cm) FlTck = 0.9 ! Flange thickness (in % of r.l.) COLen = 2.1 ! Cylinder Close-Out Length (cm) COTck = 1.38 ! Cylinder Close-Out thickness (% of r.l.) * ------- FILL SCTi ! single layer parameters - layer 2 Lay = 2 ! sct layer Rlay = 37.3 ! Radius Rtcksup = 0.3 ! Thickness of the Supports (in % of r.l.) Tilt = -10.0 ! TILT ANGLE IN PHI Laytyp = 1 ! measurement type Nmodphi = 40 ! number of modules in phi ROSup = 35.3 ! Outer radius of support cylinder FlLen = 3.0 ! Flange lenth (cm) FlTck = 0.9 ! Flange thickness (in % of r.l.) COLen = 2.1 ! Cylinder Close-Out Length (cm) COTck = 1.64 ! Cylinder Close-Out thickness (% of r.l.) * ------- FILL SCTi ! single layer parameters - layer 3 Lay = 3 ! sct layer Rlay = 44.7 ! Radius Rtcksup = 0.3 ! Thickness of the Supports (in % of r.l.) Tilt = -10.0 ! TILT ANGLE IN PHI Laytyp = -1 ! measurement type Nmodphi = 48 ! number of modules in phi ROSup = 42.7 ! Outer radius of support cylinder FlLen = 4.0 ! Flange lenth (cm) FlTck = 0.9 ! Flange thickness (in % of r.l.) COLen = 2.1 ! Cylinder Close-Out Length (cm) COTck = 2.22 ! Cylinder Close-Out thickness (% of r.l.) * ------- FILL SCTi ! single layer parameters - layer 4 Lay = 4 ! sct layer Rlay = 52.0 ! Radius Rtcksup = 0.3 ! Thickness of the Supports (in % of r.l.) Tilt = -10.0 ! TILT ANGLE IN PHI Laytyp = 1 ! measurement type Nmodphi = 56 ! number of modules in phi ROSup = 50.0 ! Outer radius of support cylinder FlLen = 4.0 ! Flange lenth (cm) FlTck = 0.9 ! Flange thickness (in % of r.l.) COLen = 2.1 ! Cylinder Close-Out Length (cm) COTck = 2.54 ! Cylinder Close-Out thickness (% of r.l.) * USE SCTG version=1 * - - - - - - - Create and position SCTT in INNE konly='MANY' * ----------------------------------------------------------------------------- Block SCTT is the Silicon barrel tracker Material Air Medium Atlas attribute sctt seen=0 colo=2 Shape TUBE Rmin=sctg_Rmin Rmax=sctg_Rmax dZ=sctg_Hlen * the insulating layer - note that the vertical bit at the cylinder ends doesn't * really exist however the interlink wheel which should be right there is * the same amount of material so leave it (at least for now). JRP 17-06-97 Create SISO TckIso = sctg_ThInsu * RadIso /100 Position SISO Z=+(sctg_Hlen-tckiso/2) dz=tckiso/2 Position SISO Z=-(sctg_Hlen-tckiso/2) dz=tckiso/2 zcylend = sctg_Hlen-tckiso Position SISO dz=zcylend Rmin=sctg_Rmax-tckiso * create auxillary elements and save their rad.length Create SLMP Create SCTE Create SCTS Create SCLO Create SCAB * * Calculate the half-dimensions of the box to put the wafer+electronics in. * Leave a bit of breathing space (half the separation of the * two back to back wafers) all around dxsect = sctg_Dxyz1/2 + sctg_Gap/2 dysect = sctg_DySect-sctg_Dxyz2/2+sctg_Gap/2 dzsect = sctg_Dxyz3/2 + sctg_Gap/2 * Calculate the half-dimensions of the box to put the module in. * It is wider than it has to be so that the center of the silicon board * can be at the center of the box. don't forget the extra width and * length for stereo angle rotation. Again leave a little breathing space * (ten percent of the separation between modules adjacent in z) Stra = max(abs(sctg_Stro),abs(sctg_Sto))*DegRad dxtmou = 2*dxsect + 0.1*sctg_Sep dytmou = dysect*COS(Stra) + dzsect*SIN(Stra) + 0.1*sctg_Sep dztmou = dysect*SIN(Stra) + dzsect*COS(Stra) + 0.1*sctg_Sep * calculate the z positions of the modules * taking into account the minimum desired overlap in z for tracks * from origin and from +/- 2 sigma from origin * need the inner and outer barrel radii USE SCTi Lay=1 rmin = scti_Rlay USE SCTi Lay=sctg_Nlay rmax = scti_Rlay lact = sctg_dxyz3 - 2.*(sctg_Guard+sctg_Res) Prin2 lact; ('Input to sczpos: lact =',F10.4) Prin2 sctg_Zovlp; (' ovlp =',F10.4) Prin2 rmin; (' rmin =',F10.4) Prin2 rmax; (' rmax =',F10.4) Prin2 sctg_sep; (' sep =',F10.4) call sczpos(nint(sctg_Nmodz),lact,sctg_zovlp,rmin,rmax,sctg_sep,zcen,zsctr) Prin2 ;('Output from zpos:') do j=1,sctg_Nmodz Prin2 j,zcen(j); (' zcen(',I2,')=',f8.3) enddo Prin2 zsctr; (' half-length before addition of dead end=',f8.3) * zsctr is the ACTIVE half-length, we want overall halflength * so add the dead edge bits zsctr = zsctr + sctg_Guard + sctg_Res Prin2 zsctr; (' half-length after addition of dead end=',f8.3) * and don't forget the module rotation zsctr = zsctr+(dztmou-sctg_Dxyz3/2) Prin2 zsctr; (' half-length after considering module rotation=',f8.3) * scream blue murder if the modules overlap with the isolation layer if (zsctr.gt.(sctg_Hlen-tckiso)) then interf=zsctr-zcylend Prin0 interf; _ (' WARNING! barrel modules extend into isolation layer',F8.4) endif Prin2 RadLum,RadEle,RadSup; ('RadLum,RadEle,RadSup = ',3f7.3) * Do J=1,nint(sctg_NLAY) USE SCTi Lay=J * - - - - - TckLum = sctg_RTckLum * RadLum /100 TckEle = sctg_RTckEle * RadEle /100 TckSup = scti_RTckSup * RadSup /100 TckFl = scti_FlTck * RadSup /100 TckClo = scti_COTck * RadSup /100 Prin2 J,TckLum,TckEle,TckSup,TckClo,TckFl; ('layer ',I1, _ ': TckLum,TckEle,TckSup,TckClo,TckFl = ',5f7.3) Create SCTi Position SCTi * position the end flanges for each layer Create SCFL Position SCFL Rmax=SCTI_ROSup, Rmin=SCTI_ROSup-SCTI_FlLen, Z=zcylend-(TckFl/2), Dz=TckFl/2 Position SCFL Rmax=SCTI_ROSup, Rmin=SCTI_ROSup-SCTI_FlLen, Z=-(zcylend-(TckFl/2)), Dz=TckFl/2 Enddo * Endblock * ----------------------------------------------------------------------------- Block SCTi is one physical layer of the SCT tracker * ANGLE = TwoPi/scti_Nmodphi ! angle in phi between skis * check that there is overlap of the active width - use the * outer modules, don't forget tilt, ignore thickness of modules wact = sctg_dxyz2 - (2*sctg_Guard) TiltRad = scti_tilt*DegRad PROJP = wact * cos(TiltRad) ANG = 2*ATAN(PROJP/2/(scti_RLAY+0.5*sctg_Sep)) if (ANG.LT.ANGLE) then diffang = (ANGLE-ANG)/DegRad ! in degrees for printout Prin0 J; ('WARNING: NO PHI OVERLAP in barrel sct layer ', I2) Prin0 diffang;('gap is ',F7.4, ' degrees between adjacent modules') endif * ski thickness is two modules separated by some open space dxski = sctg_Sep/2+dxtmou * outer radius for the region to hold the skis: RAD2 = sqrt((scti_Rlay+dxski*cos(TiltRad)-dytmou*sin(TiltRad))**2 _ + (dxski*sin(TiltRad)+dytmou*cos(TiltRad))**2) * inner radius for the region to hold the skis. This is overkill for most * configurations of tilt angle + radius but safe for all. RAD1=scti_RLAY-(RAD2-scti_RLAY) * Leave enough room for the lumped material and cables. RAD1=sqrt(RAD1**2 - (sctg_WdthLum/2)**2) - max(TckLum,sctg_OUT2*2) * scream if RAD1 is smaller than SCTI_ROSup if (RAD1.le.SCTI_ROSup) then print *, 'scttgeo> WARNING: SLAI volume overlaps support volume' endif RAD0 = min(SCTI_ROSup-TckSup,SCTI_ROSup-TckClo) attribute scti seen=0 colo=2 Shape TUBE Rmin=RAD0 Rmax=RAD2+0.5 Dz=zcylend prin2 j,rad0,rad1,rad2; ('layer ',I1,': rad0,rad1,rad2:',3F7.2) Create SLAi Position SLAi IF (TckSup > 0) THEN Create SCTS Position SCTS Rmax=SCTI_ROSup, Rmin=SCTI_ROSup-TckSup, Dz=zcylend-SCTI_COLen-TckFl Create SCLO Position SCLO Rmax=SCTI_ROSup, Rmin=SCTI_ROSup-TckClo, Z=zcylend-TckFl-(SCTI_COLen/2), Dz=SCTI_COLen/2 Position SCLO Rmax=SCTI_ROSup, Rmin=SCTI_ROSup-TckClo, Z=-(zcylend-TckFl-(SCTI_COLen/2)), Dz=SCTI_COLen/2 ENDIF EndBlock * ----------------------------------------------------------------------------- Block SLAi is an overlapping copy of rotated skis attribute slai seen=0 colo=4 Shape TUBE Rmin=RAD1 Create SSKi EndBlock * ----------------------------------------------------------------------------- Block SSKi is an azimuthal sector of a layer to contain a ski attribute sski seen=0 colo=5 Shape Division Ndiv=scti_Nmodphi Iaxis=2 Create TMOU * We have to trick geant because TMOU is wider than the division: * place TMOU TWICE for each division, once so the active region * just touches the edge of the division, then once rotated by * the division angle. This will require shenanigans in the digi code. * determine the angle to rotate it about wactrot = sctg_Dxyz3*SIN(Stra)+sctg_Dxyz2*COS(Stra) * innermost module determines rotation delx = scti_Rlay + (-dxski*cos(TiltRad)+(wactrot/2)*sin(TiltRad)) dely = dxski*sin(TiltRad)+(wactrot/2)*cos(TiltRad) alpha=ANGLE/2-atan(dely/delx) do icopy = 1,2 ! trick Geant do NR=1,sctg_Nmodz * stagger in z xtmou=scti_RLAY + (-1)**(NR)*sctg_Sep/2 * rotate to keep active area inside division ytmou = xtmou*sin(alpha) xtmou = xtmou*cos(alpha) Position TMOU x=xtmou y=ytmou z=zcen(NR) , AlfaZ=scti_Tilt+alpha/DegRad enddo * for the second set, rotate through ANGLE-alpha alpha = ANGLE-abs(alpha) enddo * this is a box to position the lumped support; RLUMP = RAD1 + Tcklum/2 Position SLMP x=Rlump dx=TckLum/2 dy=sctg_WdthLum/2 * this is a cable cone; Attribute SCAB dz=zcylend/2 Rmn1=sctg_INN1 Rmx1=sctg_OUT1, Rmn2=sctg_INN2 Rmx2=sctg_OUT2 Rcab = RAD1 + sctg_OUT2 Ycab = max(sctg_WdthLum/2,Rcab*TAN(ANGLE/4)) Position SCAB x=RCab y=YCab z=zcylend/2 Position SCAB x=RCab y=YCab z=-zcylend/2 AlfaY=180 EndBlock * ---------------------------------------------------------------------------- Block TMOU is a SCT board mount with back-to-back modules inside IF (scti_LAYTYP= 1) THEN is=+1 ELSE is=-1 ENDIF attribute tmou seen=0 colo=1 serial=is Shape BOX dx=dxtmou dy=dytmou dz=dztmou Create SECT Position SECT x=-(sctg_Gap+sctg_Dxyz1)/2 AlfaX=sctg_Stro*is Position SECT x=+(sctg_Gap+sctg_Dxyz1)/2 AlfaX=-sctg_Sto*is EndBlock * ----------------------------------------------------------------------------- Block SECT is one radial section of an SCT counter attribute SECT seen=0 colo=7 serial=0 * make it wide enough to put the center of SCTB at the center * give a bit extra space all around (half the gap) Shape BOX dx=dxsect dy=dysect dz=dzsect Create SCTB Position SCTB x=0 y=0 Position SCTE x=0 y=-sctg_DySect/2 EndBlock * ---------------------------------------------------------------------------- Block SCTB is the SCT sensetive detector * The funky material definition and the call to GSTPAR are needed to coax * Geant to use PAI struggling, to get dE/dx right. Material Silicon Material SctSili dens=ag_dens Medium sensetive Isvol=1 SteMax=0.008 attribute SCTB seen=1 colo=6 Shape BOX dx=sctg_Dxyz1/2 dy=sctg_Dxyz2/2 dz=sctg_Dxyz3/2 prin5 ag_imed; (' sctt silicon imed=',I3) CALL GSTPAR(ag_imed,'STRA',1.) HITS SCTB x:0.001: y:0.0005: z:0.01: Cx:0.01: Cy:0.01: _ Cz:0.01: Step:0.0005: user:1: Eloss:0: EndBlock * --------------------------------------------------------------------------- Block SCTE is the SCT electronics board Material Copper Radele = ag_RADL attribute SCTE seen=1 colo=2 TckEle = sctg_RTckEle * RadEle /100 Shape BOX dx=TCKELE/2 dy=(sctg_DySect-sctg_Dxyz2)/2, dz=sctg_ELECZ/2 EndBlock * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block SCAB is a cone to position the power cable support * the material of this should be the same as that of the electronics; Material Copper attribute SCAB seen=1 colo=2 Shape CONE Dz=0 Rmn1=0 Rmx1=0 Rmn2=0 Rmx2=0 Radcab = ag_RADL EndBlock * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block SCTS is a SCT supporting structure Material Carbon Medium support SteMax=0.01 attribute SCTS seen=1 colo=3 Shape TUBE Rmin=0 Rmax=0 Dz=0 Radsup = ag_RADL EndBlock * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block SCFL is the end flange for a layer Material Carbon Medium support SteMax=0.01 attribute SCTS seen=1 colo=3 Shape TUBE Rmin=0 Rmax=0 Dz=0 EndBlock * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block SCLO is the close-out at the end of a cylinder Material Carbon Medium support SteMax=0.01 attribute SCLO seen=1 colo=4 Shape TUBE Rmin=0 Rmax=0 Dz=0 EndBlock * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block SLMP is a box to position the lumped support * the material of this should be the same as that of the support; Material Carbon attribute SLMP seen=1 colo=3 Shape BOX Dx=0 dy=0 dz=0 RadLum = ag_RADL EndBlock * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Block SISO is the insulating layer surrounding the barrel SCT * choice of material not so important, just get the material in there. Material Polystyren Attribute SISO seen=1 colo=1 Shape TUBE Rmin=0 Rmax=0 DZ=0 RadIso = ag_RADL EndBlock *----------------------------------------------------------------------------- END * *------------------------------------------------------------------ Subroutine sczpos(nmod,lct,overlap,radi,rado,rsep,zcen,zsctr) *------------------------------------------------------------------ * Author: John Baines Jan. 1996 * * Calculate the end positions of the Barrel Si Modules * * Input Paramaters: * nmod : no modules in z * lct : active module length * radi : nominal radius of inner barrel * rado : nominal radius of outer barrel * rsep : radial stagger of adjacent modules in z * * Output Parameters: * zcen(imod) = z position of centers of modules * zsctr = overall half length of the active barrel *----------------------------------------------------------------- Implicit None Integer nmod Real lct, overlap,radi,rado,rsep,zcen(*),zsctr real z(2,20),r(20) real dz,zz,offset integer imod,ip,iter,iprin/1/ +CDE,GCONST,GCUNIT. * zv : 2* Sigma(Vertex) * overlap : Overlap of active area. Note at 40mRad stereo angle * 2.4mm would be required to remove all gaps in * coverage real zv parameter (zv=11.2) integer niter parameter (niter=5) * Process can be iteratated in order to get a barrel with an * equal length +z and -z * But 1 iteration, and then a shift works almost as well. do iter = 1,niter if (iter .eq. 1) then If (mod(nmod,2) .eq. 0) then * Even no wafers : fix position of wafer nmod/2 ip = nmod/2 r(ip) = rsep/2. z(2,ip) = overlap/2. z(1,ip) = z(2,ip) - lct Else * Odd no. wafers : middle wafer central ip = (nmod+1)/2 r(ip) = rsep/2. z(1,ip) = -1.*lct/2. z(2,ip) = lct/2. EndIf else ip = (nmod+1)/2 offset = (z(1,1)+z(2,nmod))/2. z(1,ip) = z(1,ip) - offset z(2,ip) = z(1,ip) + lct endif * first +z modules do imod = ip+1,nmod zz = z(2,imod-1) - overlap/2. If (r(imod-1) .gt. 0.) then * ---- dz -ve : Biggest |dz| gives most overlap => -z vertex,inner barrel * ---- r(imod) = -1.*rsep/2. dz = -1. * rsep * (zz+zv) / (radi+rsep/2.) If (dz .gt.0) then Prin0 dz; (' Error in fpos at 1, dz=',f10.4) endif Else r(imod) = rsep/2. If (zz .ge. zv) Then * --- dz +ve : Smallest dz gives most overlap => +z vertex,outer barrel * --- dz = rsep * (zz-zv) / (rado-rsep/2.) If (dz .lt. 0) then Prin0 dz; (' Error in fpos at 2, dz=',f10.4) endif Else * --- Wafer end between 0 and +z vertex : dz -ve : => inner barrel * --- dz = rsep * (zz-zv) / (radi-rsep/2.) If (dz .gt. 0) then Prin0 dz; (' Error in fpos at 3, dz=',f10.4) endif EndIf endif z(1,imod) = zz + dz - overlap/2. z(2,imod) = z(1,imod) + lct enddo * now -z modules do imod = ip-1,1,-1 zz = z(1,imod+1) + overlap/2. if (r(imod+1) .gt. 0.) then * ---- Biggest dz gives most overlap => +z vertex, inner barrel * ---- dz +ve r(imod) = -1.*rsep/2. dz = -1.*rsep * (zz-zv) / (radi+rsep/2.) If (dz .lt. 0) then Prin0 dz; ( ' Error in fpos at 4, dz=',F10.4) endif else r(imod) = rsep/2. If (zz .le. -zv) Then * --- Smallest dz gives most overlap => -z vertex, outer barrel * --- dz -ve dz = rsep * (zz+zv) / (rado-rsep/2.) If (dz .gt. 0) then Prin0 dz; (' Error in fpos at 5, dz=',f10.4) endif Else * ---- Wafer end between -z vertex and 0 => inner barrel * ---- dz +ve dz = rsep * (zz+zv) / (radi-rsep/2.) If (dz .lt. 0) then Prin0 dz;(' Error in fpos at 6, dz=',F10.4) endif EndIf endif z(2,imod) = zz + dz + overlap/2. z(1,imod) = z(2,imod) - lct enddo enddo * Shift to be same length + and - z. offset = (z(1,1)+z(2,nmod))/2. Do Imod = 1, nmod z(1,imod) = z(1,imod) - offset z(2,imod) = z(2,imod) - offset EndDo * now return the z position of the centers of the modules... do Imod = 1,nmod zcen(Imod) = z(1,imod) + lct/2.0 enddo * ...and the overall active halflength of the detector: zsctr = MAX (abs(z(1,1)),abs(z(2,nmod))) return end *------------------------------------------------------------------ subroutine sctbstep(j,hit) *----------------------------------------------------------------- * Authors: Pavel Nevski, Jo Pater 29 Feb 1996 * * Modified 19 Sep 1996 J.Pater: updated SCTi structure * * Modified 01 Mar 1996 Jo Pater: changed to be compatible with * switched order of volume creation in scttgeo so * that TMOUs would be numbered sequentially *----------------------------------------------------------------- +cde,typing,GCSETS. Structure SCTG {version,Rmin,Rmax,Hlen,Nlay,DySect,Dxyz1,Dxyz2, Dxyz3,Rtckele,Rtcklum,Wdthlum,Zovlp,Stro,Sto,Guard,Res, Elecz,gap,sep,Inn1,Out1,Inn2,Out2,Nmodz,ThInsu} Structure SCTi {Lay,Rlay,Rtcksup,Tilt,LayTyp,Nmodphi, ROSup,FlLen,FlTck,COLen,COTck} Integer j,ilay,ist integer ndiv(4)/4*0/ ! this must be dimensioned to sctg_Nlay Logical First/.true./ real hit USE SCTTGEO/SCTG Version=1 if (first) then first=.false. do ilay=1,sctg_Nlay use SCTTGEO/SCTG/SCTi lay=ilay stat=ist check ist==0 ndiv(ilay)=nint(scti_Nmodphi) enddo endif * select only modules with number > sctg_Nmodz if (NumBv(3).ge.sctg_Nmodz) then NumBv(3)=NumBv(3)-nint(sctg_Nmodz) ! decrease module number NumBv(2)=NumBv(2)+1 ! increase ski number ilay=NumBv(1)+1 ! get layer number if (NumBv(2).ge.ndiv(ilay)) then NumBv(2)=0 ! modulo number of skis endif endif hit = 0 end