/*:>-------------------------------------------------------------------- **: FILE: mMvdSetGeo.c.template **: HISTORY: **: 00jan93-v000a-hpl- Created by stic Version **: Id: idl.y,v 1.17 1997/03/25 19:22:52 ward Exp **:<------------------------------------------------------------------*/ #include "mMvdSetGeo.h" extern void MvdMess_(char *name_of_function, short ierror, short level, char *message, ...); #define NO_ERROR 0 /* used for mesage output with no error */ #define LOUD 2 /* messages which are usually output */ #define QUIET 1 /* used for messages which are output at default setting */ #define SILENT 0 /* for messages which are usually not output */ long mMvdSetGeo_( TABLE_HEAD_ST *Geo_h, DMVDGEO_ST *Geo , TABLE_HEAD_ST *bGeo_h, DMVBGEO_ST *bGeo , TABLE_HEAD_ST *cGeo_h, DMVCGEO_ST *cGeo , TABLE_HEAD_ST *Par_h, DMVDPAR_ST *Par , TABLE_HEAD_ST *bPar_h, DMVBPAR_ST *bPar , TABLE_HEAD_ST *cPar_h, DMVCPAR_ST *cPar ) { /*:>-------------------------------------------------------------------- **: ROUTINE : mMvdSetGeo_ **: DESCRIPTION: Initialize vertex detector geometry parameters. **: **: AUTHOR : J.H.Park, S.S.Ryu (YonSei Univ.) (Nov 10 97) **: Translated from the original Fortran version VER_INI.f **: written by J.P.Sullivan **: **: ARGUMENTS: **: IN: **: INOUT: **: Geo - Geant MVD geometry **: Geo_h - header Structure for Geo **: bGeo - barrel detector geometric values **: bGeo_h - header Structure for bGeo **: cGeo - pad detector geometric values **: cGeo_h - header Structure for cGeo **: Par - mvd uncalibration parameters **: Par_h - header Structure for Par **: bPar - barrel detector geometry parameters **: bPar_h - header Structure for bPar **: cPar - endcap detector geometry parameters **: cPar_h - header Structure for cPar **: OUT: **: RETURNS: STAF Condition Value **: **: HISTORY : Feb-10-98 S.S.Ryu **: notifities that cGeo->pad_z[0] and cGeo->pad_z[1] **: was interchanged in the previous version, so **: fixes them. **: Apr-09-98 J.P.Sullivan **: replace printf with MvdMess calls **: **:>------------------------------------------------------------------*/ /* internal variables */ float sleng,ztmp; short ioff,i,j,iz,itemp,ij; MvdMess_("mMvdSetGeo",NO_ERROR,LOUD,"\nmMvdSetGeo{"); /* dMvdPar : setup Parameters used in digitizing hits */ if ( Par_h->nok==0 ){ Par->zoff =Geo->dvisl[2]; Par->xnum_mip =25000; Par->smax_mip =8.0; Par->skev_mip =119.; Par->smax_kev =Par->smax_mip*Par->skev_mip; Par->skev_noise =0.1*Par->skev_mip; Par->full_scale =255.; Par->ver_thrsh_mip=0.25; Par->ver_thrsh =Par->ver_thrsh_mip*Par->skev_mip; Par->maxadc_ver =255; Par->factor_noise =5.0; Par_h->nok=1; } /* dMvbPar : setup parameters of Barrels */ if ( bPar_h->nok==0 ){ bPar->NZDIM=3072; bPar->NZBIG=3200; bPar->NCHDIM=12; bPar->NPHUSE=6; bPar->NPHDIM=6; bPar_h->nok=1; } /* dMvbGeo : setup Geometry of Barrels */ sleng=Geo->nstrip*Geo->pitch/2.; for(i=0;i< Geo->nwperp;i++){ bGeo->zcell[i]=i*(2.*Geo->dvwr1[2])+Geo->dvwr1[2]-Par->zoff; ioff=i*Geo->nstrip; ztmp=bGeo->zcell[i]-sleng+(Geo->pitch/2.); for(j=0;j< Geo->nstrip;j++){ iz=ioff+j; bGeo->zstrip[iz]=ztmp+j*Geo->pitch; } } bGeo_h->nok=1; /* dMvcPar : setup parameters of Endcaps */ if ( cPar_h->nok ==0){ cPar->NVPAD_SEGS =12; cPar->NVPAD_SEGS2 =12; cPar->NVPAD_PHI =cPar->NVPAD_SEGS*cPar->NVPAD_SEGS2; cPar->NVPAD_RBINS =21; cPar->NVPAD_RBINS1=22; cPar->VPAD_DELPHI =2.*3.141592654/cPar->NVPAD_SEGS; cPar->VPAD_PHI1 =cPar->VPAD_DELPHI/2.; cPar->VPAD_DELPHI2=2.4/57.295779513; cPar_h->nok=1; } /* dMvcGeo : setup Geometry of Endcaps */ if (cGeo_h->nok ==0 ){ cGeo->rcuts[0]=5.25; cGeo->rcuts[1]=5.45; cGeo->rcuts[2]=5.65; cGeo->rcuts[3]=5.85; cGeo->rcuts[4]=6.10; cGeo->rcuts[5]=6.35; cGeo->rcuts[6]=6.60; cGeo->rcuts[7]=6.90; cGeo->rcuts[8]=7.20; cGeo->rcuts[9]=7.50; cGeo->rcuts[10]=7.80; cGeo->rcuts[11]=8.10; cGeo->rcuts[12]=8.40; cGeo->rcuts[13]=8.75; cGeo->rcuts[14]=9.10; cGeo->rcuts[15]=9.45; cGeo->rcuts[16]=9.80; cGeo->rcuts[17]=10.20; cGeo->rcuts[18]=10.60; cGeo->rcuts[19]=11.00; cGeo->rcuts[20]=11.45; cGeo->rcuts[21]=11.90; } for(i=0;i< cPar->NVPAD_RBINS;i++){ cGeo->rvals[i]=(cGeo->rcuts[i]+cGeo->rcuts[i+1])/2.; } for(i=0; i< cPar->NVPAD_SEGS;i++){ cGeo->phi_cent[i]=cPar->VPAD_PHI1+i*cPar->VPAD_DELPHI; } for (i=0;i NVPAD_SEGS;i++) for (j=0; j< cPar->NVPAD_SEGS2;j++){ ij=i*cPar->NVPAD_SEGS2+j; cGeo->phivals[ij]=cGeo->phi_cent[i] +(2*(j+1)-cPar->NVPAD_SEGS2-1) *cPar->VPAD_DELPHI2/2.; } cGeo->pad_z[0]=Geo->ver_z_center-Geo->z_ver_pad; /* 0: -z(south) pad */ cGeo->pad_z[1]=Geo->ver_z_center+Geo->z_ver_pad; /* 1: +z(north) pad */ cGeo_h->nok=1; MvdMess_("mMvdSetGeo",NO_ERROR,LOUD,"}"); return STAFCV_OK; }