SUBROUTINE VER(FULL,NH) C ============================================================ C IMPLICIT NONE C C Description:- C ============= C This subroutine defines the geometry for the PHENIX MVD C C Author:- C ======== C JHK C C Creation Date: 17-Apr-1992 C =========================== C C Revisions:- C =========== C Date Name Description C ---- ---- ---------------------------------------- C 5-22-92 TKH Renamed include file GCONST.INC to C lower case gconst.inc C C 5-22-92 TKH Moved data statements BEYOND all declarations C (i.e. VERY last thing before executables). C Listings in older, more logical positions C are retained behind comment marks. c 9/28/92 JHK make compatible with the PISA Release 2 C C 12/16/92 JPS make the detector cover the full azimuth. C This involved adding loops from 1 to NPH_SEGS C when positioning the active elements, the C electronics, and the rhoacell support -- 3 loops. C The number of rotation matrices defined was reduced C in the process since there are only 6 different C ones used. C 12/17/92 JPS replace namelist input parameter SV1PH (real) C with NPH_SEGS -- allowing the user to define C the number of phi segments (6=full coverage) C in the vertex detector. This required changing C the corresponding variable in the phnx.par file. C SV1PH remains, as before, the azimuthal angle of C the first ladder. C C 3/17/93 JPS Change geometry to be more like the version in the CDR C including arranging the electronics packages to be C in a radial orientation relative to be beam. C In the process some comments were added and some old code C which was commented out was removed. Also, move the code to C save the geometric parameters into subroutine VER_PARS. C Previously, but the geometry of the rhoacell support C was calculated from the detector geometry of the detectors C after the parameters had been saved -- therefore the C rhoacell support geometry was not stored in the output C zebra bank. C C 1/4/94 JPS Add MVD enclosure and mother board for (MVD) pad detectors. C C 7/28/94 JPS Use the FULL input variable instead of CVOLU_OPT(1,1), C add more calling parameters to VER_PADS in order to define hits C for pads, pass position of MVD center to VER_PARS. C 5/8/94 JPS Add call to VERMATDEF which defines materials for MVD. C C 1/2/96 JPS Put in some changes which I had been testing C (21 Mar 95) in the cmz version of this code. The C plena around the electronics are now included (for C cooling air) and individual mcm chips are positioned C rather than a single large block which previously C approximated all the MCM s in each ladder. Also put C in commented out code to put in the cables. This code C caused the code to crash before, but I do not know C why. C C 2/1/96 JPS Moved code which defines the electronics and associated C cooling plenum into subroutine VER_PLEN. Also, add the C code which defines the kapton cables which go from C the detector wafers to the MCM s. c c 2/7/96 CFM Put in continuation line for VER_SIZ_CAB4(3) c evaluation; original line went beyond column 72 C C 14-Sep-00 JPS Extensively rewritten. The basic organization C is now as in the real detector -- based on C C-cages, not ladders. This caused a reorganization C of the hits structures. However, the output C hits information should be the same as before. C C 18-Sep-00 JPS Moce PAD_INSTALL_FLG to ver_pars.f C C C Arguments:- C =========== C FULL = "FULL" if the hits are turned "on" C NH = expected number of elements per hit -- VNH is the number C of hit elements defined internally. The smaller of the two C is used. C C Implicit inputs, outputs, side effects:- C ======================================== C C Called by: GUGEOM C Calls : GSDET, GSDETH, VER_PARS, VER_CABL, VER_PLEN, VER_FRAM, C VER_ENCL, VER_CCAGE, VER_PADS, VER_BHITS, VERMATDEF C Side effects: Numerous changes to Geant GEOM, HITS, JMATE banks. C C Global Specifications:- C ======================= C include 'g77trigdef.inc' C include 'gugeom.inc' include 'gcunit.inc' C include 'fstore.inc' include 'sublink.inc' include 'fpvlink.inc' C C External Specifications:- C ========================= C None C C Local Specifications:- C ====================== C C Define dimensions of an (inner) Si wafer C REAL DVWR1(3) ! Box with X, Y, Z INTEGER COLOR_VER ! Color (visible/invisible) C C stuff to define hits structures: C CHARACTER*4 SET_ID !Set identifier: C INTEGER*4 NH ! set before call in gugeom INTEGER*4 NHH ! smaller of VNH and NH CHARACTER*4 FULL ! set before call in gugeom INTEGER VNH ! special NH for VER PARAMETER ( VNH = 11 ) ! number of elements per hit C INTEGER IX_IX , IX_IY , IX_IZ , & IX_DE , IX_TF , IX_ID , & IX_PX , IX_PY , IX_PZ , IX_PL, IX_ET PARAMETER ( IX_IX = 1 ) !indices of entrance position PARAMETER ( IX_IY = 2 ) !in local coord. (cm) PARAMETER ( IX_IZ = 3 ) PARAMETER ( IX_DE = 4 ) !dE/dx (keV) PARAMETER ( IX_TF = 5 ) !TOF (ns) PARAMETER ( IX_ID = 6 ) !particle ID (GEANT) PARAMETER ( IX_PX = 7 ) !local momentum components PARAMETER ( IX_PY = 8 ) ! (GeV/c) PARAMETER ( IX_PZ = 9 ) ! PARAMETER ( IX_PL =10 ) !path length (cm) PARAMETER ( IX_ET =11 ) !Total energy (GeV) c c cfm: name change for special Vertex resolution factors and origins c REAL VFACT ( VNH ) ! Multiplier for hit elements REAL VORIG ( VNH ) ! Offset for each hit element INTEGER NBITSH_V( VNH ) ! # bits per element C C end stuff to define hits structures C INTEGER I ! Loop index C INTEGER N_CAGES !total number of cages to be positioned INTEGER N_CAGE_DIM !max number of cages PARAMETER (N_CAGE_DIM=24) INTEGER N_CAGE_TYPE(N_CAGE_DIM) !0-6 = # Si detectors on cage REAL XYZ_CAGE(3,N_CAGE_DIM) !xyz positions of the cages INTEGER ORIENTATION(N_CAGE_DIM) !0=null rotation, 1=rotated INTEGER IZ !used in calculation of z of cage C C------------------------------------------------------------------------- C DATA SET_ID / 'VER ' / C C--> Set offsets for zebra storage. Only positve #s can be stored. C So add largest expected neg number to number stored. It is subtracted C on fetch so user never sees it. C DATA VORIG( IX_IX ) / 80.0 / ! -80 cm X min (OK for ver) DATA VORIG( IX_IY ) / 80.0 / ! -80 cm Y min (OK for ver) DATA VORIG( IX_IZ ) / 80.0 / ! -80 cm Z min (OK for ver) DATA VORIG( IX_DE ) / 0.0 / ! DELE always > 0 DATA VORIG( IX_TF ) / 0.0 / ! TOF always > 0 DATA VORIG( IX_ID ) / 0.0 / ! P_ID always > 0 DATA VORIG( IX_PX ) / 500.0 / ! -500 GeV/c Px min DATA VORIG( IX_PY ) / 500.0 / ! -500 GeV/c Py min DATA VORIG( IX_PZ ) / 500.0 / ! -500 GeV/c Pz min DATA VORIG( IX_PL ) / 0.0 / ! Path length always > 0 DATA VORIG( IX_ET ) / 0.0 / ! Total energy always > 0 C C--> Set the factors for Hit storage. This determines the resolution C--> for hits inforamtion because these are stored as integers. Again C on fetching they are divided so it is transparent to user C DATA VFACT( IX_IX ) / 100000.0 / ! one-tenth micron resolution DATA VFACT( IX_IY ) / 100000.0 / ! one-tenth micron resolution DATA VFACT( IX_IZ ) / 100000.0 / ! one-tenth micron resolution DATA VFACT( IX_DE ) / 1.0E+7 / ! 0.1 keV resolution DATA VFACT( IX_TF ) / 100.0 / ! 10 picosecond timing DATA VFACT( IX_ID ) / 1. / ! IDs are integers DATA VFACT( IX_PX ) / 1000.0 / ! 1.0 MeV/c momentum resolution DATA VFACT( IX_PY ) / 1000.0 / ! 1.0 MeV/c momentum resolution DATA VFACT( IX_PZ ) / 1000.0 / ! 1.0 MeV/c momentum resolution DATA VFACT( IX_PL ) / 10000.0 / ! 1 micron path resolution DATA VFACT( IX_ET ) / 2000.0 / ! 0.5 MeV total energy resolution C C--> The max number of bits needed for any element of the hits array, C combined with the offset (VORIG which sets a minimum value) and C resolution (controlled by VFACT), this sets the maximum value of C any hit element. C DATA NBITSH_V( IX_IX ) / 24 / ! max x is about 80cm DATA NBITSH_V( IX_IY ) / 24 / ! max y is about 80cm DATA NBITSH_V( IX_IZ ) / 24 / ! max z is about 80cm DATA NBITSH_V( IX_DE ) / 20 / ! max dE is about 100MeV DATA NBITSH_V( IX_TF ) / 16 / ! max TOF is 640ns DATA NBITSH_V( IX_ID ) / 8 / ! max PID is 256 DATA NBITSH_V( IX_PX ) / 20 / ! max px is 500GeV DATA NBITSH_V( IX_PY ) / 20 / ! max py is 500GeV DATA NBITSH_V( IX_PZ ) / 20 / ! max pz is 500GeV DATA NBITSH_V( IX_PL ) / 20 / ! max path in detector is 5cm DATA NBITSH_V( IX_ET ) / 20 / ! 512GeV max C C------------------------------------------------------------------------- C C Executable Statements:- C ======================= C C Read the vertex geometry parameters and save them in a Zebra bank. C CALL VER_PARS ( COLOR_VER,POS_VERT(3) ) C C--> Booking only when volume option was chosen for this detector 'VER' C IF (FULL.NE.'FULL' .AND. FULL.NE.'VOLS') THEN RETURN ENDIF C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C Define tracking media (and some materials) used in the MVD: C CALL VERMATDEF C C Size of an (inner) Si wafer C DVWR1(1) = QF(LFV_PARA + OFVA_DVWR1) DVWR1(2) = QF(LFV_PARA + OFVA_DVWR1+1) DVWR1(3) = QF(LFV_PARA + OFVA_DVWR1+2) C C extract cage-type C N_CAGES = NINT(QF(LFV_PARA + OFVA_N_CAGES)) DO I=1,N_CAGES N_CAGE_TYPE(I) = NINT(QF(LFV_PARA + OFVA_CAGE_TYPE+I-1)) IF ( I.GT.12 ) THEN ORIENTATION(I) = 1 ELSE ORIENTATION(I) = 0 END IF END DO C C calculate location of each c-cage C DO I=1,N_CAGES XYZ_CAGE(1,I) = 0. XYZ_CAGE(2,I) = 0. IZ = MOD ( I-1,12 ) XYZ_CAGE(3,I) = (FLOAT(IZ)-5.5)*(DVWR1(3)*2.) END DO C C Define the kapton cables C CALL VER_CABL ( N_CAGES, N_CAGE_TYPE, XYZ_CAGE, x ORIENTATION ) C C=========================================================================== C C Define volumes for the plena containing the electronics MCM s C CALL VER_PLEN ( COLOR_VER, N_CAGES, N_CAGE_TYPE, XYZ_CAGE, x ORIENTATION ) C C define the "frame" C CALL VER_FRAM ( COLOR_VER ) C C Create and position the enclosure C CALL VER_ENCL( COLOR_VER ) C C Create the C-cages C CALL VER_CCAGE ( N_CAGE_TYPE, N_CAGES, XYZ_CAGE, x ORIENTATION ) C C------------------------------------------------------------------- C--> Book hit structure for the sensitive volume in the barrel: C------------------------------------------------------------------- C NHH = MIN ( NH, VNH ) C CALL VER_BHITS ( FULL,SET_ID,N_CAGES,N_CAGE_TYPE, x NHH, NAMESH, NBITSH_V, VORIG, VFACT ) C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C MVD endcap pads -- defines geometry and hits structures C CALL VER_PADS ( COLOR_VER, FULL, SET_ID, x NHH, NAMESH, NBITSH_V, VORIG, VFACT ) C RETURN END