1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+
3+ <!--
4+
5+ Copyright (c) 2018 Brett Gedvilas, University of Colorado Denver
6+
7+ Permission is hereby granted, free of charge, to any person obtaining a copy
8+ of this software and associated documentation files (the "Software"), to deal
9+ in the Software without restriction, including without limitation the rights
10+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+ copies of the Software, and to permit persons to whom the Software is
12+ furnished to do so, subject to the following conditions:
13+
14+ The above copyright notice and this permission notice shall be included in all
15+ copies or substantial portions of the Software.
16+
17+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+ SOFTWARE.
24+
25+ -->
26+
27+ <!-- This dfdl schema file defines the base MIDAS Bank Structure and encapsulates the scdms version 4 format within the BANK32 midas structure -->
28+
29+ <!-- TODO Size of data block? Or is it implicitly figured out by the scdms format? -->
30+
31+
32+ <xs : schema xmlns : xs =" http://www.w3.org/2001/XMLSchema"
33+ xmlns : dfdl =" http://www.ogf.org/dfdl/dfdl-1.0/" >
34+
35+ <xs : include schemaLocation =" org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
36+
37+ <xs : annotation >
38+ <xs : appinfo source =" http://www.ogf.org/dfdl/" >
39+ <dfdl : format ref =" GeneralFormat"
40+ representation =" binary" alignmentUnits =" bits" lengthUnits =" bits"
41+ byteOrder =" littleEndian" bitOrder =" leastSignificantBitFirst" lengthKind =" explicit" />
42+ </xs : appinfo >
43+ </xs : annotation >
44+
45+ <xs : element name =" midas_event" dfdl : lengthKind =" implicit" >
46+ <xs : complexType >
47+ <xs : sequence >
48+ <xs : element name =" midas_event_header" dfdl : lengthKind =" implicit" >
49+ <xs : complexType >
50+ <xs : element name =" trigger_mask" type =" xs:unsignedInt" dfdl : length =" 16" />
51+ <xs : element name =" event_id" type =" xs:unsignedInt" dfdl : length =" 16" />
52+ <xs : element name =" serial_number" type =" xs:unsignedInt" dfdl : length =" 32" />
53+ <xs : element name =" time_stamp" type =" xs:unsignedInt" dfdl : length =" 32" />
54+ <xs : element name =" event_size_bytes" type =" xs:unsignedInt" dfdl : length =" 32" />
55+ </xs : complexType >
56+ </xs : element >
57+ <xs : element name =" bank_header" dfdl : lengthKind =" implicit" >
58+ <xs : complexType >
59+ <xs : element name =" all_bank_size" type =" xs:unsignedInt" dfdl : length =" 32" />
60+ <xs : element name =" flags" type =" xs:unsignedInt" dfdl : length =" 32" />
61+ </xs : complexType >
62+ </xs : element >
63+
64+ <xs : element name =" bank32" dfdl : lengthkind =" implicit" >
65+ <xs : complexType >
66+ <xs : sequence >
67+ <xs : element name =" bank_name" type =" xs:unsignedInt" dfdl : length =" 32" />
68+ <xs : element name =" type" type =" xs:unsignedInt" dfdl : length =" 32" />
69+ <xs : element name =" bank_size_bytes" type =" xs:unsignedInt" dfdl : length =" 32" />
70+ <xs : element name =" scdms_event_v4" dfdl : lengthKind =" implicit" >
71+ <xs : complexType >
72+ <xs : sequence >
73+ <xs : element name =" Event_Header" dfdl : occursCountKind =" fixed" dfdl : lengthKind =" implicit" >
74+ <xs : complexType >
75+ <xs : sequence >
76+ <xs : element name =" total_triggers" type =" xs:unsignedInt" dfdl : length =" 12" />
77+ <xs : element name =" format_version" type =" xs:unsignedInt" dfdl : length =" 16" />
78+ <xs : element name =" overall_header" type =" xs:unsignedInt" dfdl : length =" 4" />
79+ </xs : sequence >
80+ </xs : complexType >
81+ </xs : element >
82+ <xs : element name =" Trigger" dfdl : occursCountKind =" expression" dfdl : lengthKind =" implicit" dfdl : occursCount =" {../Event_Header/total_triggers}" >
83+ <xs : complexType >
84+ <xs : sequence >
85+ <xs : element name =" event_size" type =" xs:unsignedInt" dfdl : length =" 28" />
86+ <xs : element name =" trigger_header" type =" xs:unsignedInt" dfdl : length =" 4" />
87+
88+ <xs : element name =" trigger_ID" type =" xs:unsignedInt" dfdl : length =" 32" />
89+
90+ <xs : element name =" event_number" type =" xs:unsignedInt" dfdl : length =" 32" />
91+
92+ <xs : element name =" trigger_type" type =" xs:unsignedInt" dfdl : length =" 8" />
93+ <xs : element name =" readout_type" type =" xs:unsignedInt" dfdl : length =" 24" />
94+
95+ <xs : element name =" timestamp_low" type =" xs:unsignedInt" dfdl : length =" 32" />
96+
97+ <xs : element name =" timestamp_high" type =" xs:unsignedInt" dfdl : length =" 32" />
98+
99+ <xs : element name =" polling_cycle_end_time_seconds" type =" xs:unsignedInt" dfdl : length =" 16" />
100+
101+ <xs : element name =" blank" type =" xs:unsignedInt" dfdl : length =" 16" />
102+
103+ <xs : element name =" time_fraction_polling_cycle_end_time" type =" xs:unsignedInt" dfdl : length =" 32" />
104+
105+ <xs : element name =" n_prims_in_event" type =" xs:unsignedInt" dfdl : length =" 28" />
106+ <xs : element name =" primitive_header" type =" xs:unsignedInt" dfdl : length =" 4" />
107+
108+ <xs : element name =" entry_length" type =" xs:unsignedInt" dfdl : length =" 32" />
109+
110+ <xs : element name =" Primitive" dfdl : occursCountKind =" expression" dfdl : lengthKind =" implicit" dfdl : occursCount =" {../n_prims_in_event}" >
111+ <xs : complexType >
112+ <xs : sequence >
113+ <xs : element name =" index" type =" xs:unsignedInt" dfdl : length =" 2" />
114+ <xs : element name =" detector_id" type =" xs:unsignedInt" dfdl : length =" 8" />
115+ <xs : element name =" pileup" type =" xs:unsignedInt" dfdl : length =" 2" />
116+ <xs : element name =" trig_status" type =" xs:unsignedInt" dfdl : length =" 4" />
117+ <xs : element name =" blank" type =" xs:unsignedInt" dfdl : length =" 12" />
118+ <xs : element name =" prim_DCRC_header" type =" xs:unsignedInt" dfdl : length =" 4" />
119+
120+ <xs : element name =" ut" type =" xs:unsignedInt" dfdl : length =" 32" />
121+
122+ <xs : element name =" rt_time_fraction" type =" xs:unsignedInt" dfdl : length =" 24" />
123+ <xs : element name =" blank" type =" xs:unsignedInt" dfdl : length =" 8" />
124+
125+ <xs : element name =" rt_time_sec" type =" xs:unsignedInt" dfdl : length =" 16" />
126+ <xs : element name =" trigger_time_sec" type =" xs:unsignedInt" dfdl : length =" 16" />
127+
128+ <xs : element name =" time_fraction_of_trigger" type =" xs:unsignedInt" dfdl : length =" 24" />
129+ <xs : element name =" mask_pairs" type =" xs:unsignedInt" dfdl : length =" 8" />
130+
131+ <xs : element name =" blank" type =" xs:unsignedInt" dfdl : length =" 16" />
132+ <xs : element name =" trigger_word" type =" xs:unsignedInt" dfdl : length =" 16" />
133+
134+ <xs : element name =" peak_amplitude" type =" xs:unsignedInt" dfdl : length =" 32" />
135+
136+ </xs : sequence >
137+ </xs : complexType >
138+ </xs : element >
139+
140+ <xs : element name =" num_detectors_in_event" type =" xs:unsignedInt" dfdl : length =" 28" />
141+ <xs : element name =" detector_header" type =" xs:unsignedInt" dfdl : length =" 4" />
142+
143+ <xs : element name =" Detector" dfdl : occursCountKind =" expression" dfdl : lengthKind =" implicit" dfdl : occursCount =" {../num_detectors_in_event}" >
144+ <xs : complexType >
145+ <xs : sequence >
146+ <xs : element name =" index" type =" xs:unsignedInt" dfdl : length =" 2" />
147+ <xs : element name =" detector_id" type =" xs:unsignedInt" dfdl : length =" 8" />
148+ <xs : element name =" detector_type" type =" xs:unsignedInt" dfdl : length =" 18" />
149+ <xs : element name =" DCRC_header" type =" xs:unsignedInt" dfdl : length =" 4" />
150+
151+ <xs : element name =" DCRC0_version" type =" xs:unsignedInt" dfdl : length =" 8" />
152+ <xs : element name =" DCRC0_serial_num" type =" xs:unsignedInt" dfdl : length =" 8" />
153+ <xs : element name =" DCRC1_version" type =" xs:unsignedInt" dfdl : length =" 8" />
154+ <xs : element name =" DCRC1_serial_num" type =" xs:unsignedInt" dfdl : length =" 8" />
155+
156+ <xs : element name =" series_time_sec" type =" xs:unsignedInt" dfdl : length =" 16" />
157+ <xs : element name =" readout_status" type =" xs:unsignedInt" dfdl : length =" 12" />
158+ <xs : element name =" readout_header" type =" xs:unsignedInt" dfdl : length =" 4" />
159+
160+ <xs : element name =" series_time_fraction" type =" xs:unsignedInt" dfdl : length =" 24" />
161+ <xs : element name =" blank" type =" xs:unsignedInt" dfdl : length =" 8" />
162+
163+ <xs : element name =" waveform_read_end_time_sec" type =" xs:unsignedInt" dfdl : length =" 16" />
164+
165+ <xs : element name =" waveform_read_start_time_sec" type =" xs:unsignedInt" dfdl : length =" 16" />
166+
167+ <xs : element name =" time_fraction_of_waveform_read_start" type =" xs:unsignedInt" dfdl : length =" 32" />
168+
169+ <xs : element name =" time_fraction_of_waveform_read_end" type =" xs:unsignedInt" dfdl : length =" 32" />
170+
171+
172+ <xs : element name =" n_channels_to_follow" type =" xs:unsignedInt" dfdl : length =" 28" />
173+ <xs : element name =" channel_header" type =" xs:unsignedInt" dfdl : length =" 4" />
174+
175+ <xs : element name =" Channel" dfdl : lengthKind =" implicit" minOccurs =" 0" maxOccurs =" unbounded"
176+ dfdl : occursCountKind =" expression" dfdl : occursCount =" { ../num_channels }" >
177+ <xs : complexType >
178+ <xs : sequence >
179+ <xs : element name =" channel_type" type =" xs:unsignedInt" dfdl : length =" 2" />
180+ <xs : element name =" channel_number" type =" xs:unsignedInt" dfdl : length =" 4" />
181+ <xs : element name =" pre_trig_offset" type =" xs:unsignedInt" dfdl : length =" 22" />
182+ <xs : element name =" waveform_header" type =" xs:unsignedInt" dfdl : length =" 4" />
183+
184+ <xs : element name =" num_pre_pulse_samples" type =" xs:unsignedInt" dfdl : length =" 32" />
185+ <xs : element name =" num_on_pulse_samples" type =" xs:unsignedInt" dfdl : length =" 32" />
186+ <xs : element name =" num_post_pulse_samples" type =" xs:unsignedInt" dfdl : length =" 32" />
187+
188+ <xs : element name =" sampling_rate_low" type =" xs:unsignedInt" dfdl : length =" 16" />
189+ <xs : element name =" sampling_rate_high" type =" xs:unsignedInt" dfdl : length =" 16" />
190+
191+ <xs : element name =" sample" type =" xs:unsignedInt" dfdl : length =" 16" minOccurs =" 0" maxOccurs =" unbounded" dfdl : occursCountKind =" expression" dfdl : occursCount =" { ../num_pre_pulse_samples + ../num_on_pulse_samples + ../num_post_pulse_samples }" />
192+ </xs : sequence >
193+ </xs : complexType >
194+ </xs : element >
195+ </xs : sequence >
196+ </xs : complexType >
197+ </xs : element >
198+ </xs : sequence >
199+
200+ </xs : complexType >
201+ </xs : element > <!-- End of Trigger -->
202+
203+ <xs : element name =" Footer" dfdl : lengthKind =" implicit" >
204+ <xs : complexType >
205+ <xs : sequence >
206+ <xs : element name =" num_preceeding_triggers" type =" xs:unsignedInt" dfdl : length =" 28" />
207+ <xs : element name =" trailer" type =" xs:unsignedInt" dfdl : length =" 4" />
208+ </xs : sequence >
209+ </xs : complexType >
210+ </xs : element >
211+ </xs : sequence >
212+ </xs : complexType >
213+ </xs : element >
214+ </xs : sequence >
215+ </xs : complexType >
216+ </xs : element >
217+
218+ </xs : sequence >
219+ </xs : complexType >
220+
221+
222+ </xs : schema >
0 commit comments