/*******************************************************************************
*         McStas instrument definition URL=http://www.mcstas.org
*
* Instrument: Test_PSD_Detector (rename also the example and DEFINE lines below)
*
* %Identification
* Written by: Thorwald van Vuure
* Date: Thorwald van Vuure
* Origin: ILL
* %INSTRUMENT_SITE: Tests_optics
*
* Test for PSD_Detector component
*
* %Description
* Test for PSD_Detector component showing charge drift
* and parallax effect when rotating detector with e.g. 'rot=10'
*
* %Example: rot=0 Detector: mydet_I=3.57344e-18
*
* %Parameters
* rot: [deg]  rotation angle of detector
*
* %Link
* The PSD_Detector component
*
* %End
*******************************************************************************/
DEFINE INSTRUMENT Test_PSD_Detector(rot=0)

TRACE

COMPONENT Origin = Progress_bar()
  AT (0,0,0) ABSOLUTE

COMPONENT mysource = Source_gen(
    lambda0 = 0.18, dlambda=0.01, focus_aw=0.0001, focus_ah=0.0001, radius=0.0001)
  AT (0, 0, 0) RELATIVE Origin
  ROTATED (0,0,0) RELATIVE Origin

COMPONENT det_pos=Arm()
AT (0, 0, 0.1) RELATIVE Origin

COMPONENT mydet = PSD_Detector(
    filename = "test_out.dat", xwidth = 0.01, yheight = .01, zdepth = 3.2e-2,
    dc=2.6e-2,
    PressureConv = 5, PressureStop = 1,
    verbose = 1, LensOn=1, nx=64, ny=32,
    FN_Conv="Gas_tables/He3inHe.table", FN_Stop="Gas_tables/He3inCF4.table",
    p_interact=0, threshold=100,
    xChDivRelSigma=0, yChDivRelSigma=0.0037)
  AT (0, 0, 0) RELATIVE det_pos
  ROTATED (0,rot,0) RELATIVE Origin

END
