-
Notifications
You must be signed in to change notification settings - Fork 0
/
microbulk.rml
92 lines (78 loc) · 4.7 KB
/
microbulk.rml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" ?>
<readouts>
<globals>
<!-- The pitch value in mm -->
<variable name="PITCH" value="5" overwrite="false" />
<!-- The number of modules per axis MxM -->
<variable name="N_MODULES" value="1" overwrite="false" />
<!-- The number of pixels per side PxP -->
<variable name="N_CHANNELS" value="16" overwrite="false" />
</globals>
<TRestDetectorReadout name="microbulk" title="TREX-DM readout ${PITCH} mm-Pitch ${N_CHANNELS}+${N_CHANNELS} channels">
<constant name="pitch" value="${PITCH}" overwrite="false" />
<!-- The number of modules per axis MxM -->
<constant name="nModules" value="${N_MODULES}" overwrite="false" />
<!-- The number of pixels per side PxP -->
<constant name="nChannels" value="${N_CHANNELS}" overwrite="false" />
<constant name="pixelSize" value="${PITCH}/sqrt(2.)" />
<parameter name="mappingNodes" value="0" />
<readoutModule name="module" size="((nChannels+1)*pitch-1*pitch/2,(nChannels+1)*pitch-pitch/2-pitch/4)" tolerance="1.e-4" >
// Y-strips
<for variable="nCh" from="1" to="nChannels-2" step="1" >
<readoutChannel id="${nCh}" >
<for variable="nPix" from="0" to="nChannels-1" step="1" >
<addPixel id="${nPix}" origin="((1+${nCh})*pitch,pitch/4+${nPix}*pitch)" size="(pixelSize,pixelSize)" rotation="45" />
</for>
<addPixel id="nChannels" origin="((1+${nCh})*pitch-pitch/2,pitch/4+(nChannels-1)*pitch+pitch/2)" size="(pitch,pitch/2)" rotation="0" />
</readoutChannel>
</for>
//First strip is special (upper left corner)
<readoutChannel id="0">
<for variable="nPix" from="0" to="nChannels-1" step="1" >
<addPixel id="${nPix}" origin="((1)*pitch,pitch/4+${nPix}*pitch)" size="(pixelSize,pixelSize)" rotation="45" />
</for>
<addPixel id="nChannels" origin="((1)*pitch-pitch/2,pitch/4+(nChannels-1)*pitch+pitch/2)" size="(pitch,pitch/2)" rotation="0" />
<addPixel id="nChannels+1" origin="(pitch/2,pitch/4+(nChannels-1)*pitch+pitch)" size="(pitch/2,pitch/2)" rotation="180" triangle="true"/>
</readoutChannel>
// Last strip is special
<readoutChannel id="nChannels-1" >
<for variable="nPix" from="0" to="nChannels-1" step="1" >
<addPixel id="${nPix}" origin="(nChannels*pitch,pitch/4+${nPix}*pitch)" size="(pixelSize,pixelSize)" rotation="45" />
<addPixel id="nChannels+${nPix}" origin="(nChannels*pitch,pitch/4+${nPix}*pitch)" size="(pitch/2,pitch)" rotation="0" />
</for>
<addPixel id="2*nChannels" origin="(nChannels*pitch-pitch/2,pitch/4+(nChannels-1)*pitch+pitch/2)" size="(pitch,pitch/2)" rotation="0" />
</readoutChannel>
// X-strips
// First strip is special
<readoutChannel id="nChannels" >
<addPixel id="0" origin="(0,0)" size="(pitch/2,3*pitch/4)" rotation="0" />
<for variable="nPix" from="0" to="nChannels-1" step="1" >
<addPixel id="${nPix}+1" origin="((0.5+${nPix})*pitch,pitch-pitch/4)" size="(pixelSize,pixelSize)" rotation="-135" triangle="true"/>
</for>
<addPixel id="nChannels+1" origin="(0,0)" size="(nChannels*pitch+pitch/2,pitch/4)" rotation="0" />
</readoutChannel>
<for variable="nCh" from="1" to="nChannels-2" step="1" >
<readoutChannel id="nChannels+${nCh}" >
<addPixel id="0" origin="(0,${nCh}*pitch-pitch/4)" size="(pitch/2,pitch)" rotation="0" />
<for variable="nPix" from="0" to="nChannels-1" step="1" >
<addPixel id="${nPix}+1" origin="((0.5+${nPix})*pitch,${nCh}*pitch-pitch/4)" size="(pixelSize,pixelSize)" rotation="45" />
</for>
</readoutChannel>
</for>
//Last strip is special (upper left corner)
<readoutChannel id="nChannels+nChannels-1" >
<addPixel id="0" origin="(0,pitch/4+(nChannels-1)*pitch+pitch/2)" size="(pitch/2,pitch/2)" rotation="0" triangle="true"/>
<addPixel id="1" origin="(0,(nChannels-1)*pitch-pitch/4)" size="(pitch/2,pitch)" rotation="0" />
<for variable="nPix" from="0" to="nChannels-1" step="1" >
<addPixel id="${nPix}+2" origin="((0.5+${nPix})*pitch,(nChannels-1)*pitch-pitch/4)" size="(pixelSize,pixelSize)" rotation="45" />
</for>
</readoutChannel>
</readoutModule>
<readoutPlane position="(0,0,-160.4)mm" normal="(0,0,1)" chargeCollection="1" height="160.4mm">
<addReadoutModule id="0" name="module" origin="(-0.5*nChannels*pitch,-0.5*nChannels*pitch)" rotation="0" decodingFile="" firstDaqChannel="0" />
</readoutPlane>
<readoutPlane position="(0,0,160.4)mm" normal="(0,0,-1)" chargeCollection="1" height="160.4mm">
<addReadoutModule id="0" name="module" origin="(-0.5*nChannels*pitch,-0.5*nChannels*pitch)" rotation="0" decodingFile="" firstDaqChannel="72*8" />
</readoutPlane>
</TRestDetectorReadout>
</readouts>