-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTutorial.html
937 lines (672 loc) · 25.3 KB
/
Tutorial.html
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
<h2 id="tutorial">Tutorial for <a href="https://github.com/samdejong86/CAEN-v1730-DAQ" target="_blank">CAEN v1730 Digitizer DAQ</a></h2>
<p>For installation instuctions, see the <a href="https://github.com/samdejong86/CAEN-v1730-DAQ#installation" target="_blank"> README</a></p>
<h3 id="runningtheprogram">Running the program</h3>
<p>To display the DAQ command line parameters, run</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -h
</code></pre>
<p>There are two ways to set the digitizer parameters: through the command line, or via an XML file. A simple run example is:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq --outfile FILE.root --duration 1000 --ch 0 --polarity0 POSITIVE --threshold0 100 --trslope0 POSITIVE
</code></pre>
<p>These same parameters can be set via an xml file:</p>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
</Active>
</xml>
</code></pre>
<p>which can be run with this command:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -x XMLFILE.xml
</code></pre>
<p>assuming the xml file is named XMLFILE.xml. Any other command line arguments which set digitizer settings will be ignored if an xml file is specified.</p>
<p>Note that the xml tags are the same as the command line options, eg:</p>
<pre style="background-color: #F7F7F7"><code>
--outfile FILE.root
</code></pre>
<p>on the command line is equivalent to</p>
<pre style="background-color: #F7F7F7"><code>
<outfile>
FILE.root
</outfile>
</code></pre>
<p>in the xml file.</p>
<p><details style="background-color: #F7F7F7">
<summary><strong>XML File Generation</strong></summary>
<p>The xml files used by the DAQ software can be created using a text editior, or by using the <code>--xmlout</code> command line argument. This argument will take the digitizer settings set at the command line and save them as an xml file:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq --outfile myfile.root --duration 3000 --ch 4 --polarity4 NEGATIVE --threshold4 100 --trslope4 NEGATIVE --xmlout mySettings.xml
</code></pre>
<p>will produce mySettings.xml, which will look like this:</p>
<pre style="background-color: #F2F2F2"><code>
<xml>
<Active>
<outfile>
myfile.root
</outfile>
<duration>
3000
</duration>
<ch4>
1
</ch4>
<polarity4>
NEGATIVE
</polarity4>
<threshold4>
100
</threshold4>
<trslope4>
NEGATIVE
</trslope4>
</Active>
</xml>
</code></pre>
<p>Adding <code>-q</code> on the command line will quit the DAQ after generating the xml file.</p>
<p></details></p>
<h3 id="Duration">Duration</h3>
<p>There are two ways of using the duration option.</p>
<details><summary><strong>Number of events</strong></summary>
<hr>
<p>If an integer is used as the parameter, that many events will be recorded. Example command:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq --duration 1000
</code></pre>
<p>or in XML:</p>
<pre style="background-color: #F7F7F7"><code>
<duration>
1000
</duration>
</code></pre>
<p>will collect 1000 events before closing</p>
<hr>
</details>
<details style="background-color: #F7F7F7"><summary><strong>Timed acquisition</strong></summary>
<hr>
<p> If a time is specified in HH:MM:SS, events will be collected for that amount of time. Example command:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq --duration 01:30:00
</code></pre>
<p>or in XML:</p>
<pre style="background-color: #F2F2F2"><code>
<duration>
01:30:00
</duration>
</code></pre>
<p>will collect events for 90 minutes before closing</p>
<hr>
</details>
<h3 id="pulseandtriggerpolarity">Pulse and Trigger Polarity</h3>
<p>For a positive pulse, polarity<CH> should be set to POSITIVE, and for a negative pulse, it should be set to NEGATIVE. trslope<CH> may be set to POSITIVE or NEGATIVE depending on where the desired trigger point is. A general rule of thumb is that the trigger polarity and the pulse polarity should be the same.</p>
<details>
<summary><strong>Positive pulse with positive trigger</strong></summary>
<p><img src="img/PosPulsePosTrig.png" alt="Positive Pulse with Positive Trigger" title="Positive Pulse with Positive Trigger" /></p>
<p>Trigger will occur when the signal <strong>rises above</strong> 100. The red line is the trigger point.</p>
<p>Example command line arguments:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 POSITIVE --threshold0 100 --trslope0 POSITIVE
</code></pre>
<p><details><summary>Example xml file (xml/PositivePulsePositiveTrigger.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
</Active>
</xml>
</code></pre>
<p></details></p>
<hr>
<p></details>
<details style="background-color: #F7F7F7"> <summary><strong>Positive pulse with negative trigger</strong></summary>
<p><img src="img/PosPulseNegTrig.png" alt="Positive Pulse with Negative Trigger" title="Positive Pulse with Negative Trigger" /></p>
<p>Trigger will occur when the signal <strong>falls below</strong> 100. The red line is the trigger point.</p>
<p>Example command line arguments:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 POSITIVE --threshold0 100 --trslope0 NEGATIVE
</code></pre>
<p><details><summary>Example xml file (xml/PositivePulseNegativeTrigger.xml)</summary>
<pre style="background-color: #F2F2F2"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
NEGATIVE
</trslope0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details> <summary><strong>Negative pulse with positive trigger</strong></summary>
<p><img src="img/NegPulsePosTrig.png" alt="Negative Pulse with Positive Trigger" title="Negative Pulse with Positive Trigger" /></p>
<p>Trigger will occur when the signal <strong>rises above</strong> 100. The red line is the trigger point.</p>
<p>Example command line arguments:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 NEGATIVE --threshold0 100 --trslope0 POSITIVE
</code></pre>
<p><details><summary>Example xml file xml/NegativePulsePositiveTrigger.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
NEGATIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details style="background-color: #F7F7F7"> <summary><strong>Negative pulse with negative trigger</strong></summary>
<p><img src="img/NegPulseNegTrig.png" alt="Negative Pulse with Negative Trigger" title="Negative Pulse with Negative Trigger" /></p>
<p>Trigger will occur when the signal <strong>falls below</strong> 100. The red line is the trigger point.</p>
<p>Example command line arguments:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 NEGATIVE --threshold0 100 --trslope0 NEGATIVE
</code></pre>
<p><details> <summary>Example xml file (xml/NegativePulseNegativeTrigger.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
NEGATIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
NEGATIVE
</trslope0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<h3 id="recordlength">Record length</h3>
<p>The record length setting sets the number of samples in a waveform. A higher number will create a longer waveform.</p>
<details> <summary><strong> Low record length </strong></summary>
<p>In this example the record length is set to 512 samples.</p>
<p><img src="img/reclen_512.png" alt="Low record length" title="512 sample record length" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --reclen 512 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/RecordLength_512.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<reclen>
512
</reclen>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details style="background-color: #F7F7F7"> <summary><strong> Medium record length </strong></summary>
<p>In this example the record length is set to 1024 samples (the default).</p>
<p><img src="img/reclen_1024.png" alt="mid record length" title="1024 sample record length" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --reclen 1024 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/RecordLength_1024.xml)</summary>
<pre style="background-color: #F2F2F2"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<reclen>
1024
</reclen>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details> <summary><strong> High record length </strong></summary>
<p>In this example the record length is set to 2048 samples.</p>
<p><img src="img/reclen_2048.png" alt="high record length" title="2048 sample record length" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --reclen 2048 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/RecordLength_2048.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<reclen>
2048
</reclen>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<h3 id="posttrigger">Post Trigger</h3>
<p>The post trigger setting sets how much of the waveform will be after the trigger occurs. valid settings are 0 to 100. Setting this to 50 is a good rule of thumb.</p>
<details style="background-color: #F7F7F7"> <summary><strong> Post trigger of 0 </strong></summary>
<p><img src="img/postTrig_0.png" alt="post trigger 0" title="Post Trigger set to 0" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 0 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/PostTrigger_0.xml)</summary>
<pre style="background-color: #F2F2F2"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
0
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details> <summary><strong> Post trigger of 25 </strong></summary>
<p><img src="img/postTrig_25.png" alt="post trigger 25" title="Post Trigger set to 25" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 25 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/PostTrigger_25.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
25
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details style="background-color: #F7F7F7"> <summary><strong> Post trigger of 50 (the default setting)</strong></summary>
<p><img src="img/postTrig_50.png" alt="post trigger 50" title="Post Trigger set to 50" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 50 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/PostTrigger_50.xml)</summary>
<pre style="background-color: #F2F2F2"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
50
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details> <summary><strong> Post trigger of 75 </strong></summary>
<p><img src="img/postTrig_75.png" alt="post trigger 75" title="Post Trigger set to 75" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 75 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/PostTrigger_75.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
75
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<details style="background-color: #F7F7F7"> <summary><strong> Post trigger of 100 </strong></summary>
<p><img src="img/postTrig_100.png" alt="post trigger 100" title="Post Trigger set to 010" /></p>
<p>Example command line arguments:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 100 --threshold0 100
</code></pre>
<details> <summary>Example xml file (xml/PostTrigger_100.xml)</summary>
<pre style="background-color: #F2F2F2"><code>
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
100
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
</code></pre>
</details>
<hr>
</details>
<h3 id="multichanneltriggering">Multi-Channel Triggering</h3>
<p>If mutiple channels have <code>threshold<CH></code> set, the triggers will be combined. There are two possibe modes for combining multiple trigger channels: <strong>AND</strong> and <strong>OR</strong>. The trigger mode is set with the <code>triggermode</code> setting</p>
<details> <summary><strong> Combining triggers with <strong>AND</strong></strong></summary>
<p>Triggering will only occur when the trigger conditions are satisfied on all channels with <code>threshold<CH></code> set. For example:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d1000 --ch 0 --ch 1 --polarity0 POSITIVE --polarity1 POSITIVE --threshold0 100 --threshold1 100 \\
--trslope0 POSITIVE --trslope1 POSITIVE --triggermode AND
</code></pre>
<details> <summary>Example xml file (xml/ANDtrigger.xml)</summary>
<pre style="background-color: #F7F7F7"><code>
<xml>
<Active>
<duration>
00:01:00
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
<ch1>
1
</ch1>
<polarity1>
POSITIVE
</polarity1>
<threshold1>
100
</threshold1>
<trslope1>
POSITIVE
</trslope1>
<triggermode>
AND
</triggermode>
</Active>
</xml>
</code></pre>
</details>
<p>This will trigger when both channel 0 and channel 1 go above 100 ADC counts.</p>
<p>Note: AND is the default setting for the <code>triggermode</code> setting</p>
<h4 id="coincidencewindow">Coincidence Window</h4>
<p>The <code>coincidencewindow</code> can be used to set the length of the window where the coincident triggers must occur, in units of 8ns. It takes an integer less than or equal to 15. For example:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq --triggermode AND --coincidencewindow 12
</code></pre>
<p>or in XML:</p>
<pre style="background-color: #F7F7F7"><code>
<triggermode>
AND
</triggermode>
<coincidencewindow>
12
</coincidencewindow>
</code></pre>
<p>will require a trigger on each trigger enabled channel within 96ns. The default value for this parameter is 10, or 80ns.</p>
</details>
<details style="background-color: #F7F7F7"> <summary><strong> Combining triggers with <strong>OR</strong></strong></summary>
<p>Triggering will occur when the trigger conditions are satisfied on any channel. For example:</p>
<pre style="background-color: #F2F2F2"><code>
CAENdaq -o FILE.root -d1000 --ch 0 --ch 2 --polarity0 POSITIVE --polarity2 POSITIVE --threshold0 100 --threshold2 100 \\
--trslope0 POSITIVE --trslope2 POSITIVE --triggermode OR
</code></pre>
<details> <summary>Example xml file (xml/ORtrigger.xml)</summary>
<pre style="background-color: #F2F2F2"><code>
<xml>
<Active>
<duration>
00:01:00
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
<ch2>
1
</ch2>
<polarity2>
POSITIVE
</polarity2>
<threshold2>
100
</threshold2>
<trslope2>
POSITIVE
</trslope2>
<triggermode>
OR
</triggermode>
</Active>
</xml>
</code></pre>
</details>
<p>will trigger when either of channel 0 or channel 2 go abouve 100 ADC counts</p>
<h4 id="channelpairs">Channel Pairs</h4>
<p>The digitizer channels are paired together: 0&1, 2&3, 4&5, 6&7. If the triggermode is set to OR and triggering is enabled on both channels of a pair, the even channel is ignored and only the odd channel has a trigger applied. If OR triggering on multiple channels is required, the trigger must be applied on channels from seperate pairs. This is due to a limitation on the digitizer firmware.</p>
<p>For example:</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d1000 --ch 0 --ch 1 --threshold0 100 --threshold1 100 --triggermode OR
</code></pre>
<p>will only apply the trigger to channel 1, but</p>
<pre style="background-color: #F7F7F7"><code>
CAENdaq -o FILE.root -d1000 --ch 0 --ch 2 --threshold0 100 --threshold2 100 --triggermode OR
</code></pre>
<p>will apply the trigger correctly to both channel 0 and channel 2</p>
</details>
<h3 id="datarecoveryincaseofprogramcrash">Data Recovery in Case of Program Crash</h3>
<p>When the program starts, it will create a temporary directory called <code>FILE_<timestamp></code>, where <code><timestamp></code> is the unix time when the program started. Temporary root files containing <code><saveInterval></code> (set by the <code>saveInterval</code> parameter at the command line or in an xml file) events will be saved here.</p>
<p>When the program exits safely these files will be merged together, with the resulting file moved to the working directory. The temporary directory will then be removed. </p>
<p>If the program crashes, the temporary files will not be removed, so most of the data from the run can be recovered by looking in this directory.</p>
<h3 id="waveformdrawingscript">Waveform Drawing Script</h3>
<p>There is a ROOT script included with the repository called <code>draw.C</code>. This script can be used to display a waveform from a ROOT file created by the DAQ.</p>
<p>Usage:</p>
<pre style="background-color: #F7F7F7"><code>
root[0] .x draw.C("FILE.root", channel, event)
</code></pre>
<p>where channel and event are integers for the channel number and event number.</p>
<p>This script can also be used as an example showing how to load waveforms, for use in an analysis.</p>
<h3 id="Calibration">Calibration</h3>
<p>A quick calibration was performed, yeilding this equation for converting ADC counts to mV:</p>
<pre style="background-color: #F7F7F7"><code>
[Signal (mV)] = (0.1342 ± 0.0005996)x[Signal (ADC counts)] - (1100 ± 5.399)
</code></pre>
<p>and for converting mV to ADC counts:
<pre style="background-color: #F7F7F7"><code>
[Signal (ADC counts)]=(7.451 ± 0.0333)*[Signal (mV)] + (8203 ± 16.1)
</code></pre>
<p> If you are using this to determine a threshold, be aware that the value specified as the <code>threshold<CH></code> is the ADC counts <strong>above (or below) the baseline</strong>. If you are converting a threshold in ADC counts to mV, you need to add 8192 to the threshold (or subtract from 8192 if <code>polarity<CH></code> is negative) before applying the equation. If you are converting a threshold in mV to ADC counts, subtract 8192 from the result to get the value for <code>threshold<CH></code> (or subtract the result from 8192 if <code>polarity<CH></code> is negative).</p>
<details> <summary>Example</summary>
<p>A threshold of -20mV is required, with a negative polarity.</p>
<pre style="background-color: #F7F7F7"><code>
7.451 x -20mV + 8203 = 8053.98
8192 - 8053.98 = 138.02
</code></pre>
<p>So <code>threshold<CH></code> is set to 138, with <code>polarity<CH></code> set to NEGATIVE.</p>
</details>
<p> <strong>This calibration should not be trusted to high accuracy. </strong> If you require the voltage to be very accurate, you are advised to perform the calibration yourself.</p>