protodune_dataprep_tools.fcl
Go to the documentation of this file.
1 # protodune_dataprep_tools.fcl
2 #
3 # David Adams
4 # August 2019
5 #
6 # Define protodune tools.
7 
8 #include "dataprep_tools.fcl"
9 
10 ################################################################################
11 # Shared data.
12 ################################################################################
13 
14 # Flag so other fcl files can check if this file has been included.
15 have_protodune_dataprep_tools: true
16 
17 data.pd_tpsChannelRanges: [tps0, tps1, tps2, tps3, tps4, tps5]
18 data.pd_ClockUnit: "Mtick"
19 data.pd_TriggerClockRate: 50000000.0
20 data.pd_Tick0: 500
21 
22 tools.tickRanges.plotTicks.begin: 4000
23 tools.tickRanges.plotTicks.end: 5000
24 
25 ################################################################################
26 # Channel mapping.
27 ################################################################################
28 
29 tools.pd_onlineChannelMap: {
30  tool_type: ProtoduneOnlineChannel
31 }
32 
33 tools.pd_onlineChannelMapByWib: {
34  tool_type: PdspOnlineChannel
35  LogLevel: 1
36  Ordering: "WIB"
37 }
38 
39 tools.pd_onlineChannelMapByConnector: {
40  tool_type: PdspOnlineChannel
41  LogLevel: 1
42  Ordering: "connector"
43 }
44 
45 tools.pd_onlineChannelMapByFemb: {
46  tool_type: PdspOnlineChannel
47  LogLevel: 1
48  Ordering: "FEMB"
49 }
50 
51 tools.channelRangesProtodune: {
52  tool_type: ProtoDuneChannelRanges
53  LogLevel: 0
54  ExtraRanges: ""
55 }
56 
57 tools.channelRanges: @local::tools.channelRangesProtodune
58 
59 tools.channelRangesColdbox: {
60  tool_type: ApaChannelRanges
61  LogLevel: 0
62  ApaNumbers: [1]
63  ApaLocationNames: ["ColdBox"]
64  ExtraRanges: ""
65 }
66 
67 tools.channelRangesIceberg: {
68  tool_type: HalfApaChannelRanges
69  LogLevel: 0
70  ApaNumbers: [1]
71  ApaLocationNames: ["Iceberg"]
72  ExtraRanges: ""
73 }
74 
75 tools.channelGroups: {
76  tool_type: ProtoDuneChannelGroups
77  LogLevel: 0
78  IndexRangeTool: channelRanges
79 }
80 
81 tools.channelGroupsApa7: {
82  tool_type: ApaChannelGroups
83  LogLevel: 0
84  ApaNumbers: [7]
85  IndexRangeTool: channelRanges
86 }
87 
88 tools.channelGroupsIceberg: {
89  tool_type: ApaChannelGroups
90  LogLevel: 0
91  ApaNumbers: [8]
92  IndexRangeTool: channelRanges
93 }
94 
95 # Map channels to APA views: 0:U, 1:v, 2:X
96 tools.pdspChannelToPlane: {
97  tool_type: BlockIndexMapTool
98  LogLevel: 0
99  Starts: [ 0, 800, 1600]
100  Values: [ 0, 1, 2]
101  Period: 2560
102 }
103 
104 ################################################################################
105 # Reco.
106 ################################################################################
107 
108 # Fit ADC distribution to get pedestal.
109 tools.pd_adcPedestalFit: {
110  tool_type: AdcPedestalFitter
111  LogLevel: 1
112  AdcRange: 4096
113  FitOpt: 3
114  FitPrecision: 1.0
115  SkipFlags: [8, 9, 10, 11, 12]
116  AdcFitRange: 100
117  FitRmsMin: 1.0
118  FitRmsMax: 20.0
119  RemoveStickyCode: true
120  HistName: "adcped_ev%0EVENT%_ch%0CHAN%"
121  HistTitle: "ADC pedestal fit for run %RUN% event %EVENT% channel %CHAN%"
122  PlotFileName: ""
123  RootFileName: ""
124  HistManager: ""
125  PlotSizeX: 0
126  PlotSizeY: 0
127  PlotSplitX: 0
128  PlotSplitY: 0
129  PlotShowFit: 1
130 }
131 
132 # Sticky code mitigation.
133 tools.pdsp_adcMitigate: {
134  tool_type: AdcCodeMitigator
135  LogLevel: 1
136  FixFlags: []
137  InterpolateFlags: [8, 9, 10, 11, 12]
138  SkipFlags: []
139  FixedCurvThresh: 20.0
140 }
141 
142 ###########
143 
144 # Timing mitigation.
145 # Adjust the timing for FEMB 302 (aka femb 1)
146 
147 # Rough tune Dec 2018.
148 tools.pdsp_timingMitigateDec2018: {
149  tool_type: AdcTimingMitigator
150  LogLevel: 1
151  SamplingRatio: 0.9995
152  SamplingOffset: 3
153  FEMBs: [1]
154 }
155 
156 # Better tune Mar 2019.
157 # See ProtoDUNE sim/reco meeting March 27, 2019.
158 tools.pdsp_timingMitigateMar2019: {
159  tool_type: AdcTimingMitigator
160  LogLevel: 1
161  SamplingRatio: 0.9993
162  SamplingOffset: 1.0
163  FEMBs: [1]
164 }
165 
166 # Default for reco.
167 tools.pdsp_timingMitigate: @local::tools.pdsp_timingMitigateMar2019
168 
169 ###########
170 
171 # Subtract baseline after deconvolution
172 tools.adcCorrectUndershootAdc: {
173  tool_type: UndershootCorr
174  LogLevel: 1
175  SignalUnit: "ADC count"
176  CorrectFlag: [ false, false, true ] # Apply correction (U, V, and Collection)
177  SignalThreshold: [ 20, 20, 20 ] # Above this value, ticks are deweighted in fit
178  TDecayConst: [ 0.99955, 0.99955, 0.99955 ] # Corrn params (tuned for collection plane)
179  FSubConst: [ 0.0005, 0.0005, 0.0005 ] # "
180  RestoreBaseline: [ false, false, false ] # If true, add back medians to restore orig baseline
181  LCA: [ 1980, 1980, 1980 ] # Params used in fit to determine the ped and
182  LCB: [ -0.08277, -0.08277, -0.08277 ] # and initial pedestal offset
183  LCC: [ -2043.65, -2043.65 , -2043.65 ] # "
184  LCD: [ 1.03, 1.03, 1.03 ] # "
185 }
186 
187 tools.adcCorrectUndershootKe: @local::tools.adcCorrectUndershootAdc
188 tools.adcCorrectUndershootKe.SignalUnit: "ke/tick"
189 tools.adcCorrectUndershootKe.SignalThreshold: [ 0.50, 0.50, 0.50 ]
190 
191 tools.adcCorrectUndershoot: @local::tools.adcCorrectUndershootAdc
192 
193 # Signal finder to use with tail removal.
194 tools.adcTailSignalFinderAdc: {
195  tool_type: AdcThresholdSignalFinder
196  LogLevel: 1
197  Threshold: "20.0"
198  BinsBefore: 10
199  BinsAfter: 20
200  FlagPositive: true
201  FlagNegative: true
202 }
203 
204 # Tail removal 2019.
205 tools.adcTailRemovalAdc: {
206  tool_type: ExpTailRemover
207  LogLevel: 1
208  DecayTime: 2000
209  SignalFlag: 3
210  SignalIterationLimit: 10
211  SignalTool: adcTailSignalFinderAdc
212  IncludeChannelRanges: ["apa1z", "apa2z", "apa3z", "apa4z", "apa5z", "apa6z"]
213  ExcludeChannelRanges: []
214 }
215 
216 tools.adcTailSignalFinderKe: @local::tools.adcTailSignalFinderAdc
217 tools.adcTailSignalFinderKe.Threshold: 0.5
218 tools.adcTailRemovalKe: @local::tools.adcTailRemovalAdc
219 tools.adcTailRemovalKe.SignalTool: adcTailSignalFinderKe
220 
221 # Tail removal 2020.
222 tools.pdspTailPedRemovalZKe: {
223  tool_type: ExpTailPedRemover
224  LogLevel: 1
225  DecayTime: 2200
226  SignalFlag: 3
227  SignalIterationLimit: 10
228  SignalTool: adcTailSignalFinderKe
229  MaxTick: 21000
230  PedDegree: 0
231  PedTick0: 3000
232  PedFreqs: []
233  NoWarnStatuses: [1]
234  IncludeChannelRanges: ["apa1z", "apa2z", "apa3z", "apa4z", "apa5z", "apa6z",
235  "apa1c", "apa2c", "apa3c", "apa4c", "apa5c", "apa6c"]
236  ExcludeChannelRanges: []
237 }
238 
239 tools.pdspTailPedRemovalIKe: @local::tools.pdspTailPedRemovalZKe
240 tools.pdspTailPedRemovalIKe.DecayTime: 6000
241 tools.pdspTailPedRemovalIKe.IncludeChannelRanges: ["apa1i", "apa2i", "apa3i", "apa4i", "apa5i", "apa6i"]
242 
243 # Correct gain calibration for new induction capacitance and estimates
244 # of out-of-plane charge sharing.
245 # See D. Adams talk at ProtoDUNE sim/reco 8/26/2020:
246 # https://indico.fnal.gov/event/44166/contributions/195159/attachments/133594/164846/adams_dunepdsimrec_20200826_dataprep.pdf
247 tools.pdsp_gainCorrection: {
248  tool_type: AdcRangeSampleScaler
249  LogLevel: 1
250  RangeLimits: [800, 1600]
251  RangeModulus: 2560
252  ScaleFactors: [1.052, 1.030, 1.047]
253 }
254 
255 # Scale ADC to ke
256 tools.adcScaleAdcToKe.ScaleFactor: 2.401e-2 #24.01 e/ADC/ticks
257 
258 # Scale ke to ADC
259 tools.adcScaleKeToAdc.ScaleFactor: 41.649 # 24.01 e/ADC/ticks
260 
261 ################################################################################
262 # Event metrics.
263 ################################################################################
264 
265 tools.pd_evtviewNfemb: {
266  tool_type: AdcEventViewer
267  LogLevel: 2
268  EventHists: ["hnfemb:125:0:125"]
269  EventGraphs: ["event:events:1:nfemb:0:125"]
270  ChannelRanges: []
271  ChannelRangeLabel: "%CRLABEL%"
272  ClockUnit: @local::data.pd_ClockUnit
273  ClockRate: @local::data.pd_TriggerClockRate
274 }
275 
276 tools.pd_evtviewPed: {
277  tool_type: AdcEventViewer
278  LogLevel: 2
279  EventHists: ["meanPed:80:0:4000"]
280  EventGraphs: ["event:1:1:meanPed:0:0"]
281  ChannelRanges: []
282  ChannelRangeLabel: "%CRLABEL%"
283  ClockUnit: @local::data.pd_ClockUnit
284  ClockRate: @local::data.pd_TriggerClockRate
285 }
286 
287 tools.pd_evtviewPedpwr: {
288  tool_type: AdcEventViewer
289  LogLevel: 2
290  EventHists: ["rmPedPower:50:0:25"]
291  EventGraphs: ["event:1:1:rmPedPower:0:14"]
292  ChannelRanges: []
293  ChannelRangeLabel: "%CRLABEL%"
294  ClockUnit: @local::data.pd_ClockUnit
295  ClockRate: @local::data.pd_TriggerClockRate
296 }
297 
298 tools.pd_evtviewNfembByTps: {
299  tool_type: AdcEventViewer
300  LogLevel: 2
301  EventHists: ["hnfemb:21:0:21"]
302  EventGraphs: ["event:events:1:nfemb:0:21"]
303  ChannelRanges: @local::data.pd_tpsChannelRanges
304  ChannelRangeLabel: "%CRLABEL% (%CRLABEL2% %CRLABEL1%)"
305  ClockUnit: @local::data.pd_ClockUnit
306  ClockRate: @local::data.pd_TriggerClockRate
307 }
308 
309 ################################################################################
310 # Detector event display.
311 ################################################################################
312 
313 # Event display: wire coodinate vs. drift coordinate.
314 
315 # Raw data.
316 tools.rawAdcDetectorPlotColl: {
317  tool_type: AdcDetectorPlotter
318  LogLevel: 1
319  WireAngle: 0.0
320  DataType: 1
321  Tick0: @local::data.pd_Tick0
322  DriftSpeed: 0.08
323  XMin: 400.0
324  XMax: -400.0
325  ZMin: -20.0
326  ZMax: 720.0
327  SignalThreshold: 20
328  SkipChannelStatus: []
329  ShowAllTicks: false
330  FirstTick: 0
331  LastTick: 0
332  ShowWires: true
333  ShowCathode: true
334  ShowTpcSets: []
335  ShowGrid: true
336  Title: "Raw ADC collection view"
337  PlotTitle: "Run %RUN% event %EVENT% %UTCTIME2% UTC (%TRIGNAME% trigger)"
338  FileName: "detraw-run%0RUN%-evt%0EVENT%-coll.{png,tpad}"
339 }
340 tools.rawAdcDetectorPlotInd1: {
341  tool_type: AdcDetectorPlotter
342  LogLevel: 1
343  WireAngle: 0.623
344  DataType: 1
345  Tick0: @local::data.pd_Tick0
346  DriftSpeed: 0.08
347  XMin: 400.0
348  XMax: -400.0
349  ZMin: -20.0
350  ZMax: 940.0
351  SignalThreshold: 20
352  SkipChannelStatus: []
353  ShowAllTicks: false
354  FirstTick: 0
355  LastTick: 0
356  ShowWires: true
357  ShowCathode: true
358  ShowTpcSets: []
359  ShowGrid: true
360  Title: "Raw ADC induction view 1"
361  PlotTitle: "Run %RUN% event %EVENT% %UTCTIME2% UTC (%TRIGNAME% trigger)"
362  FileName: "detraw-run%0RUN%-evt%0EVENT%-ind1.{png,tpad}"
363 }
364 tools.rawAdcDetectorPlotInd2: {
365  tool_type: AdcDetectorPlotter
366  LogLevel: 1
367  WireAngle: -0.623
368  DataType: 1
369  Tick0: @local::data.pd_Tick0
370  DriftSpeed: 0.08
371  XMin: 400.0
372  XMax: -400.0
373  ZMin: -380.0
374  ZMax: 580.0
375  SignalThreshold: 20
376  SkipChannelStatus: []
377  ShowAllTicks: false
378  FirstTick: 0
379  LastTick: 0
380  ShowWires: true
381  ShowCathode: true
382  ShowTpcSets: []
383  ShowGrid: true
384  Title: "Raw ADC induction view 2"
385  PlotTitle: "Run %RUN% event %EVENT% %UTCTIME2% UTC (%TRIGNAME% trigger)"
386  FileName: "detraw-run%0RUN%-evt%0EVENT%-ind2.{png,tpad}"
387 }
388 
389 # Prepared data.
390 tools.preparedAdcDetectorPlotColl: {
391  tool_type: AdcDetectorPlotter
392  LogLevel: 1
393  WireAngle: 0.0
394  DataType: 0
395  Tick0: @local::data.pd_Tick0
396  DriftSpeed: 0.08
397  XMin: 400.0
398  XMax: -400.0
399  ZMin: -20.0
400  ZMax: 720.0
401  SignalThreshold: 5
402  SkipChannelStatus: [1]
403  ShowAllTicks: false
404  FirstTick: 0
405  LastTick: 0
406  ShowWires: true
407  ShowCathode: true
408  ShowTpcSets: []
409  ShowGrid: true
410  Title: "Prepared ADC collection view"
411  PlotTitle: "Run %RUN% event %EVENT% %UTCTIME2% UTC (%TRIGNAME% trigger)"
412  FileName: "detprep-run%0RUN%-evt%0EVENT%-coll.{png,tpad}"
413 }
414 tools.preparedAdcDetectorPlotInd1: {
415  tool_type: AdcDetectorPlotter
416  LogLevel: 1
417  WireAngle: 0.623
418  DataType: 0
419  Tick0: @local::data.pd_Tick0
420  DriftSpeed: 0.08
421  XMin: 400.0
422  XMax: -400.0
423  ZMin: -20.0
424  ZMax: 940.0
425  SignalThreshold: 5
426  SkipChannelStatus: [1]
427  ShowAllTicks: false
428  FirstTick: 0
429  LastTick: 0
430  ShowWires: true
431  ShowCathode: true
432  ShowTpcSets: []
433  ShowGrid: true
434  Title: "Prepared ADC induction view 1"
435  PlotTitle: "Run %RUN% event %EVENT% %UTCTIME2% UTC (%TRIGNAME% trigger)"
436  FileName: "detprep-run%0RUN%-evt%0EVENT%-ind1.{png,tpad}"
437 }
438 tools.preparedAdcDetectorPlotInd2: {
439  tool_type: AdcDetectorPlotter
440  LogLevel: 1
441  WireAngle: -0.623
442  DataType: 0
443  Tick0: @local::data.pd_Tick0
444  DriftSpeed: 0.08
445  XMin: 400.0
446  XMax: -400.0
447  ZMin: -380.0
448  ZMax: 580.0
449  SignalThreshold: 5
450  SkipChannelStatus: [1]
451  ShowAllTicks: false
452  FirstTick: 0
453  LastTick: 0
454  ShowWires: true
455  ShowCathode: true
456  ShowTpcSets: []
457  ShowGrid: true
458  Title: "Prepared ADC induction view 2"
459  PlotTitle: "Run %RUN% event %EVENT% %UTCTIME2% UTC (%TRIGNAME% trigger)"
460  FileName: "detprep-run%0RUN%-evt%0EVENT%-ind2.{png,tpad}"
461 }
462 
463 ################################################################################
464 # ADC channel-tick plots.
465 ################################################################################
466 
467 pdcht_template: {
468  tool_type: AdcDataPlotter
469  LogLevel: 1
470  DataType: 1 # 0 for prepared, 1 for raw-pedestal, 2 is signal
471  DataView: ""
472  TickRange: plotTicks
473  TickRebin: 1
474  ChannelRanges: []
475  ClockFactor: 0.0
476  ClockOffset: 12524
477  FembTickOffsets: []
478  MaxSignal: 50
479  SkipChannelStatus: []
480  EmptyColor: 18
481  ChannelLineModulus: 2560
482  ChannelLinePattern: []
483  ChannelLinePatternSolid: []
484  Palette: 2020
485  HistName: "hadcraw_%CRNAME%_run%0RUN%_evt%0EVENT%"
486  HistTitle: "Raw ADC"
487  PlotTitle: "Run %RUN% event %EVENT% %UTCTIME2% UTC (%TRIGNAME% trigger)"
488  PlotSizeX: 1400
489  PlotSizeY: 1000
490  PlotFileName: "adcraw_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
491  RootFileName: "" # or "adc_evt%EVENT%.root"
492 }
493 
494 # One plot for the full detector.
495 tools.pdcht_All: @local::pdcht_template
496 tools.pdcht_All.ChannelRanges: [all]
497 tools.pdcht_All.ChannelLinePattern: [0]
498 
499 # Add location for the remaining plots.
500 pdcht_template.HistTitle: "Raw ADC for %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
501 
502 # One plot for each TPS (APA).
503 tools.pdcht_Apas: @local::pdcht_template
504 tools.pdcht_Apas.ChannelRanges: [tps0, tps1, tps2, tps3, tps4, tps5]
505 tools.pdcht_Apas.ChannelLinePattern: [800, 1600, 2080]
506 
507 # One plot for each Z-plane. Z is the TPC-side collection plane.
508 tools.pdcht_Zplanes: @local::pdcht_template
509 tools.pdcht_Zplanes.ChannelRanges: [tpp0z, tpp1z, tpp2z, tpp3z, tpp4z, tpp5z]
510 tools.pdcht_Zplanes.ChannelLineModulus: 2560
511 tools.pdcht_Zplanes.ChannelLinePattern: [1648, 1696, 1744, 1792, 1840, 1888, 1936, 1984, 2032, 2080,
512  2128, 2176, 2224, 2272, 2320, 2368, 2416, 2464, 2512]
513 
514 # Plot APA3z (where the beam enters).
515 tools.pdcht_Apa3z: @local::tools.pdcht_Zplanes
516 tools.pdcht_Apa3z.ChannelRanges: [tpp0z]
517 
518 # One plot for each C-plane. C is the cryostat-side collection plane.
519 tools.pdcht_Cplanes: @local::tools.pdcht_Zplanes
520 tools.pdcht_Cplanes.ChannelRanges: [tpp0c, tpp1c, tpp2c, tpp3c, tpp4c, tpp5c]
521 
522 # One plot for each induction plane.
523 tools.pdcht_Iplanes: @local::pdcht_template
524 tools.pdcht_Iplanes.ChannelRanges: [tpp0u, tpp1u, tpp2u, tpp3u, tpp4u, tpp5u,
525  tpp0v, tpp1v, tpp2v, tpp3v, tpp4v, tpp5v]
526 tools.pdcht_Iplanes.ChannelLineModulus: 40
527 tools.pdcht_Iplanes.ChannelLinePattern: [0]
528 
529 # Plot APA3u (where the beam enters).
530 tools.pdcht_Apa3u: @local::tools.pdcht_Iplanes
531 tools.pdcht_Apa3u.ChannelRanges: [tpp0u]
532 
533 # Plot APA3v (where the beam enters).
534 tools.pdcht_Apa3v: @local::tools.pdcht_Iplanes
535 tools.pdcht_Apa3v.ChannelRanges: [tpp0v]
536 
537 # As above but for prepared data.
538 
539 pdchtp_template: @local::pdcht_template
540 pdchtp_template.DataType: 0
541 pdchtp_template.MaxSignal: 5
542 pdchtp_template.SkipChannelStatus: [1]
543 pdchtp_template.HistName: "hadcprp_%CRNAME%_run%0RUN%_evt%0EVENT%"
544 pdchtp_template. HistTitle: "Prepared ADC"
545 pdchtp_template.PlotFileName: "adcprp_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
546 
547 # One plot for the full detector.
548 tools.pdchtp_All: @local::pdchtp_template
549 tools.pdchtp_All.ChannelRanges: [all]
550 tools.pdchtp_All.ChannelLinePattern: [0]
551 
552 # Add location for the remaining plots.
553 pdchtp_template.HistTitle: "Prepared ADC for %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
554 
555 # One plot for each Z-plane. Z is the TPC-side collection plane.
556 tools.pdchtp_Zplanes: @local::pdchtp_template
557 tools.pdchtp_Zplanes.ChannelRanges: [tpp0z, tpp1z, tpp2z, tpp3z, tpp4z, tpp5z]
558 tools.pdchtp_Zplanes.ChannelLineModulus: 2560
559 tools.pdchtp_Zplanes.ChannelLinePattern: [1648, 1696, 1744, 1792, 1840, 1888, 1936, 1984, 2032, 2080,
560  2128, 2176, 2224, 2272, 2320, 2368, 2416, 2464, 2512]
561 
562 # One plot for each C-plane. C is the cryostat-side collection plane.
563 tools.pdchtp_Cplanes: @local::tools.pdchtp_Zplanes
564 tools.pdchtp_Cplanes.ChannelRanges: [tpp0c, tpp1c, tpp2c, tpp3c, tpp4c, tpp5c]
565 
566 # One plot for each induction plane.
567 tools.pdchtp_Iplanes: @local::pdchtp_template
568 tools.pdchtp_Iplanes.ChannelRanges: [tpp0u, tpp1u, tpp2u, tpp3u, tpp4u, tpp5u,
569  tpp0v, tpp1v, tpp2v, tpp3v, tpp4v, tpp5v]
570 tools.pdchtp_Iplanes.ChannelLineModulus: 40
571 tools.pdchtp_Iplanes.ChannelLinePattern: [0]
572 
573 # Plot APA3z (where the beam enters).
574 tools.pdchtp_Apa3z: @local::tools.pdchtp_Zplanes
575 tools.pdchtp_Apa3z.ChannelRanges: [tpp0z]
576 
577 ################################################################################
578 # ADC channel metric plotters.
579 ################################################################################
580 
581 # Template for metric plots by TPC set (APA)
582 chmet_pdtps_template: {
583  tool_type: AdcChannelMetric
584  LogLevel: 1
585  DataView: ""
586  PedestalReference: ""
587  MetricSummaryView: "mean:dmean"
588  MetricMin: 0.0
589  MetricBins: 0
590  ChannelRanges: [tps0, tps1, tps2, tps3, tps4, tps5]
591  ChannelLineModulus: 2560
592  ChannelLinePattern: [0, 800, 1600, 2080]
593  ChannelLinePatternSolid: []
594  PlotSizeX: 1400
595  PlotSizeY: 500
596  PlotUsesStatus: 1
597  RootFileName: ""
598  MetadataFlags: [write]
599 }
600 
601 # Template for metric plots by APA
602 chmet_pdapa_template: @local::chmet_pdtps_template
603 chmet_pdapa_template.ChannelRanges: [apa1, apa2, apa3, apa4, apa5, apa6]
604 
605 # Template for metric plots by TPC plane
606 chmet_pdtpp_template: @local::chmet_pdtps_template
607 chmet_pdtpp_template.ChannelRanges: [tpp0u, tpp1u, tpp2u, tpp3u, tpp4u, tpp5u,
608  tpp0v, tpp1v, tpp2v, tpp3v, tpp4v, tpp5v,
609  tpp0z, tpp1z, tpp2z, tpp3z, tpp4z, tpp5z,
610  tpp0c, tpp1c, tpp2c, tpp3c, tpp4c, tpp5c]
611 chmet_pdtpp_template.ChannelLinePattern: [ 40, 80, 120, 160, 200, 240, 280, 320, 360,
612  400, 440, 480, 520, 560, 600, 640, 680, 720, 760,
613  800, 840, 880, 920, 960, 1000, 1040, 1080, 1120, 1160,
614  1200, 1240, 1280, 1320, 1360, 1400, 1440, 1480, 1520, 1560,
615  1600, 1648, 1696, 1744, 1792, 1840, 1888, 1936, 1984, 2032,
616  2080, 2128, 2176, 2224, 2272, 2320, 2368, 2416, 2464, 2512]
617 
618 #
619 # Pedestal for each channel.
620 pdwz_template: {
621  tool_type: AdcChannelMetric
622  LogLevel: 1
623  DataView: ""
624  PedestalReference: ""
625  MetricSummaryView: "mean:dmean"
626  MetricBins: 0
627  MetricMin: 0.0
628  ChannelRanges: [tpp0z, tpp1z, tpp2z, tpp3z, tpp4z, tpp5z]
629  ChannelLineModulus: 2560
630  ChannelLinePattern: [2128, 2176, 2224, 2272, 2320, 2368, 2416, 2464, 2512]
631  ChannelLinePatternSolid: []
632  PlotSizeX: 1400
633  PlotSizeY: 500
634  PlotUsesStatus: 1
635  RootFileName: ""
636  MetadataFlags: []
637 }
638 
639 ######## Plots by APA #######
640 
641 # FEMB ID for each TPS channel.
642 tools.pdtps_adcChannelFembPlotter: @local::chmet_pdtps_template
643 tools.pdtps_adcChannelFembPlotter.Metric: fembID
644 tools.pdtps_adcChannelFembPlotter.MetricMax: 120
645 tools.pdtps_adcChannelFembPlotter.HistName: "hchpd%CRNAME%_femb_%0RUN%_%0EVENT%"
646 tools.pdtps_adcChannelFembPlotter.HistTitle: "FEMB IDs for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
647 tools.pdtps_adcChannelFembPlotter.MetricLabel: "FEMB ID"
648 tools.pdtps_adcChannelFembPlotter.PlotFileName: "chmet_femb_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
649 
650 # APA FEMB ID for each TPS channel.
651 tools.pdtps_adcChannelApaFembPlotter: @local::chmet_pdtps_template
652 tools.pdtps_adcChannelApaFembPlotter.Metric: apaFembID
653 tools.pdtps_adcChannelApaFembPlotter.MetricMax: 20
654 tools.pdtps_adcChannelApaFembPlotter.HistName: "hchpd%CRNAME%_apafemb_%0RUN%_%0EVENT%"
655 tools.pdtps_adcChannelApaFembPlotter.HistTitle: "APA FEMB IDs for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
656 tools.pdtps_adcChannelApaFembPlotter.MetricLabel: "APA FEMB ID"
657 tools.pdtps_adcChannelApaFembPlotter.PlotFileName: "chmet_apafemb_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
658 
659 # FEMB channel for each TPS channel.
660 tools.pdtps_adcChannelFembChannelPlotter: @local::chmet_pdtps_template
661 tools.pdtps_adcChannelFembChannelPlotter.Metric: fembChannel
662 tools.pdtps_adcChannelFembChannelPlotter.MetricMax: 128
663 tools.pdtps_adcChannelFembChannelPlotter.HistName: "hchpd%CRNAME%_fembchan_%0RUN%_%0EVENT%"
664 tools.pdtps_adcChannelFembChannelPlotter.HistTitle: "FEMB channels for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
665 tools.pdtps_adcChannelFembChannelPlotter.MetricLabel: "FEMB channel"
666 tools.pdtps_adcChannelFembChannelPlotter.PlotFileName: "chmet_fembchan_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
667 
668 # Raw tick count for each TPS channel.
669 tools.pdtps_adcChannelNrawPlotter: @local::chmet_pdtps_template
670 tools.pdtps_adcChannelNrawPlotter.Metric: nraw
671 tools.pdtps_adcChannelNrawPlotter.MetricMax: 6200
672 tools.pdtps_adcChannelNrawPlotter.HistName: "hchpd%CRNAME%_nraw_%0RUN%_%0EVENT%"
673 tools.pdtps_adcChannelNrawPlotter.HistTitle: "Raw tick count for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
674 tools.pdtps_adcChannelNrawPlotter.MetricLabel: "# ticks"
675 tools.pdtps_adcChannelNrawPlotter.PlotFileName: "chmet_nraw_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
676 
677 # Pedestal for each TPS channel.
678 tools.pdtps_adcChannelPedestalPlotter: @local::chmet_pdtps_template
679 tools.pdtps_adcChannelPedestalPlotter.Metric: pedestal
680 tools.pdtps_adcChannelPedestalPlotter.MetricMax: 4096
681 tools.pdtps_adcChannelPedestalPlotter.HistName: "hchpd%CRNAME%_ped_%0RUN%_%0EVENT%"
682 tools.pdtps_adcChannelPedestalPlotter.HistTitle: "ADC pedestals for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
683 tools.pdtps_adcChannelPedestalPlotter.MetricLabel: "Pedestal [ADC count]"
684 tools.pdtps_adcChannelPedestalPlotter.PlotFileName: "chmet_ped_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
685 
686 # Digit pedestal for each TPS channel.
687 tools.pdtps_adcChannelPedestalInpPlotter: @local::chmet_pdtps_template
688 tools.pdtps_adcChannelPedestalInpPlotter.Metric: inputPedestal
689 tools.pdtps_adcChannelPedestalInpPlotter.MetricMax: 4096
690 tools.pdtps_adcChannelPedestalInpPlotter.HistName: "hchpd%CRNAME%_pedinp_%0RUN%_%0EVENT%"
691 tools.pdtps_adcChannelPedestalInpPlotter.HistTitle: "ADC input pedestals for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
692 tools.pdtps_adcChannelPedestalInpPlotter.MetricLabel: "Pedestal [ADC count]"
693 tools.pdtps_adcChannelPedestalInpPlotter.PlotFileName: "chmet_pedinp_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
694 
695 # Undershoot correction for each TPS channel.
696 tools.pdtps_adcChannelUscPedestalPlotter: @local::chmet_pdtps_template
697 tools.pdtps_adcChannelUscPedestalPlotter.Metric: uscPedestal
698 tools.pdtps_adcChannelUscPedestalPlotter.MetricMin: -25
699 tools.pdtps_adcChannelUscPedestalPlotter.MetricMax: 25
700 tools.pdtps_adcChannelUscPedestalPlotter.HistName: "hchpd%CRNAME%_pedusc_%0RUN%_%0EVENT%"
701 tools.pdtps_adcChannelUscPedestalPlotter.HistTitle: "ADC USC pedestals for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
702 tools.pdtps_adcChannelUscPedestalPlotter.MetricLabel: "Pedestal offset [ADC count]"
703 tools.pdtps_adcChannelUscPedestalPlotter.PlotFileName: "chmet_pedusc_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
704 
705 # Undershoot correction pedestal for each TPS channel.
706 tools.pdtps_adcChannelUscOffsetPlotter: @local::chmet_pdtps_template
707 tools.pdtps_adcChannelUscOffsetPlotter.Metric: uscPedestalOffset
708 tools.pdtps_adcChannelUscOffsetPlotter.MetricMin: -25
709 tools.pdtps_adcChannelUscOffsetPlotter.MetricMax: 25
710 tools.pdtps_adcChannelUscOffsetPlotter.HistName: "hchpd%CRNAME%_pedoffusc_%0RUN%_%0EVENT%"
711 tools.pdtps_adcChannelUscOffsetPlotter.HistTitle: "ADC USC pedestal offsets for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
712 tools.pdtps_adcChannelUscOffsetPlotter.MetricLabel: "Pedestal offset [ADC count]"
713 tools.pdtps_adcChannelUscOffsetPlotter.PlotFileName: "chmet_pedoffusc_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
714 
715 # Pedestal diff for each TPS channel.
716 tools.pdtps_adcChannelPedestalDiffPlotter: @local::chmet_pdtps_template
717 tools.pdtps_adcChannelPedestalDiffPlotter.Metric: pedestalDiff
718 tools.pdtps_adcChannelPedestalDiffPlotter.MetricMin: -10
719 tools.pdtps_adcChannelPedestalDiffPlotter.MetricMax: 10
720 tools.pdtps_adcChannelPedestalDiffPlotter.HistName: "hchpd%CRNAME%_peddiff_%0RUN%_%0EVENT%"
721 tools.pdtps_adcChannelPedestalDiffPlotter.HistTitle: "ADC pedestal diffs for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
722 tools.pdtps_adcChannelPedestalDiffPlotter.MetricLabel: "#DeltaPedestal [ADC count]"
723 tools.pdtps_adcChannelPedestalDiffPlotter.PlotFileName: "chmet_peddiff_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
724 
725 # Pedestal noise for each TPS channel.
726 tools.pdtps_adcChannelPedestalNoisePlotter: @local::chmet_pdtps_template
727 tools.pdtps_adcChannelPedestalNoisePlotter.Metric: pedestalRms
728 tools.pdtps_adcChannelPedestalNoisePlotter.MetricMax: 14
729 tools.pdtps_adcChannelPedestalNoisePlotter.HistName: "hchpd%CRNAME%_pednoise_%0RUN%_%0EVENT%"
730 tools.pdtps_adcChannelPedestalNoisePlotter.HistTitle: "ADC pedestal noise for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
731 tools.pdtps_adcChannelPedestalNoisePlotter.MetricLabel: "Pedestal noise [ADC count]"
732 tools.pdtps_adcChannelPedestalNoisePlotter.PlotFileName: "chmet_pednoise_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
733 
734 # Peak out of range fraction for each TPS channel.
735 tools.pdtps_adcChannelOrfPlotter: @local::chmet_pdtps_template
736 tools.pdtps_adcChannelOrfPlotter.Metric: "fitPedFractionLow+fitPedFractionHigh"
737 tools.pdtps_adcChannelOrfPlotter.MetricMax: 1.0
738 tools.pdtps_adcChannelOrfPlotter.HistName: "hchpd%CRNAME%_pedfracout_%0RUN%_%0EVENT%"
739 tools.pdtps_adcChannelOrfPlotter.HistTitle: "ADC pedestal out-of-range fraction for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
740 tools.pdtps_adcChannelOrfPlotter.MetricLabel: "Out-of-range fraction"
741 tools.pdtps_adcChannelOrfPlotter.PlotFileName: "chmet_pedorf_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
742 
743 # Peak bin excess for each TPS channel.
744 tools.pdtps_adcChannelPeakBinFractionPlotter: @local::chmet_pdtps_template
745 tools.pdtps_adcChannelPeakBinFractionPlotter.Metric: fitPedPeakBinFraction
746 tools.pdtps_adcChannelPeakBinFractionPlotter.MetricMax: 1.0
747 tools.pdtps_adcChannelPeakBinFractionPlotter.HistName: "hchpd%CRNAME%_pedpeakfrac_%0RUN%_%0EVENT%"
748 tools.pdtps_adcChannelPeakBinFractionPlotter.HistTitle: "ADC pedestal peak bin fraction for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
749 tools.pdtps_adcChannelPeakBinFractionPlotter.MetricLabel: "Peak fraction"
750 tools.pdtps_adcChannelPeakBinFractionPlotter.PlotFileName: "chmet_pedfrac_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
751 
752 # Peak bin excess for each TPS channel.
753 tools.pdtps_adcChannelPeakBinExcessPlotter: @local::chmet_pdtps_template
754 tools.pdtps_adcChannelPeakBinExcessPlotter.Metric: fitPedPeakBinExcess
755 tools.pdtps_adcChannelPeakBinExcessPlotter.MetricMax: 1.0
756 tools.pdtps_adcChannelPeakBinExcessPlotter.HistName: "hchpd%CRNAME%_pedpeakexc_%0RUN%_%0EVENT%"
757 tools.pdtps_adcChannelPeakBinExcessPlotter.HistTitle: "ADC pedestal peak bin excess for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
758 tools.pdtps_adcChannelPeakBinExcessPlotter.MetricLabel: "Peak excess fraction"
759 tools.pdtps_adcChannelPeakBinExcessPlotter.PlotFileName: "chmet_pedexc_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
760 
761 # Peestal-subtracted ADC RMS for each TPS channel.
762 tools.pdtps_adcChannelRawRmsPlotter: @local::chmet_pdtps_template
763 tools.pdtps_adcChannelRawRmsPlotter.Metric: rawRms
764 tools.pdtps_adcChannelRawRmsPlotter.MetricMax: 40
765 tools.pdtps_adcChannelRawRmsPlotter.HistName: "hchpd%CRNAME%_rawrms_%0RUN%_%0EVENT%"
766 tools.pdtps_adcChannelRawRmsPlotter.HistTitle: "ADC RMS for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
767 tools.pdtps_adcChannelRawRmsPlotter.MetricLabel: "ADC RMS [ADC count]"
768 tools.pdtps_adcChannelRawRmsPlotter.PlotFileName: "chmet_pedrawrms_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
769 
770 # Sample RMS for each TPS channel.
771 tools.pdtps_adcChannelSamRmsPlotter: @local::chmet_pdtps_template
772 tools.pdtps_adcChannelSamRmsPlotter.Metric: samRms
773 tools.pdtps_adcChannelSamRmsPlotter.MetricMax: 1.0
774 tools.pdtps_adcChannelSamRmsPlotter.HistName: "hchpd%CRNAME%_rawrms_%0RUN%_%0EVENT%"
775 tools.pdtps_adcChannelSamRmsPlotter.HistTitle: "Sample RMS for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
776 tools.pdtps_adcChannelSamRmsPlotter.MetricLabel: "Sample RMS [ke]"
777 tools.pdtps_adcChannelSamRmsPlotter.PlotFileName: "chmet_samrms_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
778 
779 # Not-signal sample RMS for each TPS channel.
780 tools.pdtps_adcChannelNsgRmsPlotter: @local::chmet_pdtps_template
781 tools.pdtps_adcChannelNsgRmsPlotter.Metric: nsgRms
782 tools.pdtps_adcChannelNsgRmsPlotter.MetricMax: 1.0
783 tools.pdtps_adcChannelNsgRmsPlotter.HistName: "hchpd%CRNAME%_nsgrms_%0RUN%_%0EVENT%"
784 tools.pdtps_adcChannelNsgRmsPlotter.HistTitle: "Not-signal sample RMS for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
785 tools.pdtps_adcChannelNsgRmsPlotter.MetricLabel: "Not-signal sample RMS [ke]"
786 tools.pdtps_adcChannelNsgRmsPlotter.PlotFileName: "chmet_nsgrms_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
787 
788 # Tail fraction for each TPS channel.
789 tools.pdtps_adcChannelRawTailPlotter: @local::chmet_pdtps_template
790 tools.pdtps_adcChannelRawTailPlotter.Metric: rawTailFraction
791 tools.pdtps_adcChannelRawTailPlotter.MetricMax: 0.5
792 tools.pdtps_adcChannelRawTailPlotter.HistName: "hchpd%CRNAME%_rawtail_%0RUN%_%0EVENT%"
793 tools.pdtps_adcChannelRawTailPlotter.HistTitle: "ADC pedestal raw tail fraction for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
794 tools.pdtps_adcChannelRawTailPlotter.MetricLabel: "Tail fraction"
795 tools.pdtps_adcChannelRawTailPlotter.PlotFileName: "chmet_pedrawtail_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
796 
797 # Reduced chi-square for each TPS channel.
798 tools.pdtps_adcChannelReducedChiSquarePlotter: @local::chmet_pdtps_template
799 tools.pdtps_adcChannelReducedChiSquarePlotter.Metric: fitPedReducedChiSquare
800 tools.pdtps_adcChannelReducedChiSquarePlotter.MetricMax: 1000
801 tools.pdtps_adcChannelReducedChiSquarePlotter.HistName: "hchpd%CRNAME%_rchsq_%0RUN%_%0EVENT%"
802 tools.pdtps_adcChannelReducedChiSquarePlotter.HistTitle: "ADC pedestal #chi^{2}/DOF for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
803 tools.pdtps_adcChannelReducedChiSquarePlotter.MetricLabel: "#chi^{2}/DOF"
804 tools.pdtps_adcChannelReducedChiSquarePlotter.PlotFileName: "chmet_pedrchsq_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
805 
806 # ---- Here and below merging events ----
807 
808 # -- As above but including multiple events. --
809 
810 # Pedestal.
811 tools.pdmtps_adcChannelPedestalPlotter: @local::tools.pdtps_adcChannelPedestalPlotter
812 tools.pdmtps_adcChannelPedestalPlotter.HistName: "hchpd%CRNAME%_ped_%0RUN%"
813 tools.pdmtps_adcChannelPedestalPlotter.HistTitle: "ADC pedestals for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
814 tools.pdmtps_adcChannelPedestalPlotter.PlotFileName: "chmet_ped_%CRNAME%_run%0RUN%.png"
815 
816 # Pedestal noise.
817 tools.pdmtps_adcChannelPedestalNoisePlotter: @local::tools.pdtps_adcChannelPedestalNoisePlotter
818 tools.pdmtps_adcChannelPedestalNoisePlotter.HistName: "hchpd%CRNAME%_pednoise_%0RUN%"
819 tools.pdmtps_adcChannelPedestalNoisePlotter.HistTitle: "ADC pedestal noise for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
820 tools.pdmtps_adcChannelPedestalNoisePlotter.PlotFileName: "chmet_pednoise_%CRNAME%_run%0RUN%.png"
821 
822 # Out of range fraction.
823 tools.pdmtps_adcChannelOrfPlotter: @local::tools.pdtps_adcChannelOrfPlotter
824 tools.pdmtps_adcChannelOrfPlotter.HistName: "hchpd%CRNAME%_pedorf_%0RUN%"
825 tools.pdmtps_adcChannelOrfPlotter.HistTitle: "ADC pedestal out-of-range fraction for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
826 tools.pdmtps_adcChannelOrfPlotter.PlotFileName: "chmet_pedorf_%CRNAME%_run%0RUN%.png"
827 
828 # Raw RMS.
829 tools.pdmtps_adcChannelRawRmsPlotter: @local::tools.pdtps_adcChannelRawRmsPlotter
830 tools.pdmtps_adcChannelRawRmsPlotter.HistName: "hchpd%CRNAME%_pedrawrms_%0RUN%"
831 tools.pdmtps_adcChannelRawRmsPlotter.HistTitle: "ADC pedestal raw RMS for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
832 tools.pdmtps_adcChannelRawRmsPlotter.PlotFileName: "chmet_pedrawrms_%CRNAME%_run%0RUN%.png"
833 
834 # Tail fraction.
835 tools.pdmtps_adcChannelRawTailPlotter: @local::tools.pdtps_adcChannelRawTailPlotter
836 tools.pdmtps_adcChannelRawTailPlotter.HistName: "hchpd%CRNAME%_pedrawtail_%0RUN%"
837 tools.pdmtps_adcChannelRawTailPlotter.HistTitle: "ADC pedestal raw tail fraction for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
838 tools.pdmtps_adcChannelRawTailPlotter.PlotFileName: "chmet_pedrawtail_%CRNAME%_run%0RUN%.png"
839 
840 # Peak bin excess.
841 tools.pdmtps_adcChannelPeakBinExcessPlotter: @local::tools.pdtps_adcChannelPeakBinExcessPlotter
842 tools.pdmtps_adcChannelPeakBinExcessPlotter.HistName: "hchpd%CRNAME%_pedexc_%0RUN%"
843 tools.pdmtps_adcChannelPeakBinExcessPlotter.HistTitle: "ADC pedestal peak bin excess for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
844 tools.pdmtps_adcChannelPeakBinExcessPlotter.PlotFileName: "chmet_pedexc_%CRNAME%_run%0RUN%.png"
845 
846 # -- Noise signal finder plots --
847 
848 # Noise signal finder noise level at ADC scale.
849 tools.pdtps_nsfNoise: @local::chmet_pdtps_template
850 tools.pdtps_nsfNoise.Metric: nsfNoise
851 tools.pdtps_nsfNoise.MetricMax: 14
852 tools.pdtps_nsfNoise.MetricLabel: "Noise [(ADC count)/tick]"
853 tools.pdtps_nsfNoise.HistName: "hchpd%CRNAME%_nsfnoise_%0RUN%"
854 tools.pdtps_nsfNoise.HistTitle: "NSF noise for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
855 tools.pdtps_nsfNoise.PlotFileName: "chmet_nsfnoise_%CRNAME%_run%0RUN%.png"
856 
857 # Noise signal finder threshold at ADC scale.
858 tools.pdtps_nsfThresh: @local::chmet_pdtps_template
859 tools.pdtps_nsfThresh.Metric: nsfThreshold
860 tools.pdtps_nsfThresh.MetricMax: 100
861 tools.pdtps_nsfThresh.MetricLabel: "Threshold [ADC count]"
862 tools.pdtps_nsfThresh.HistName: "hchpd%CRNAME%_nsfthresh_%0RUN%"
863 tools.pdtps_nsfThresh.HistTitle: "NSF threshold for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
864 tools.pdtps_nsfThresh.PlotFileName: "chmet_nsfthresh_%CRNAME%_run%0RUN%.png"
865 
866 # Noise signal finder signal fraction.
867 tools.pdtps_nsfSigFrac: @local::chmet_pdtps_template
868 tools.pdtps_nsfSigFrac.Metric: nsfSigFrac
869 tools.pdtps_nsfSigFrac.MetricMax: 0.25
870 tools.pdtps_nsfSigFrac.MetricLabel: "Signal fraction"
871 tools.pdtps_nsfSigFrac.HistName: "hchpd%CRNAME%_nsfsigfrac_%0RUN%"
872 tools.pdtps_nsfSigFrac.HistTitle: "NSF signal fraction for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
873 tools.pdtps_nsfSigFrac.PlotFileName: "chmet_nsfsigfrac_%CRNAME%_run%0RUN%.png"
874 
875 # Noise signal finder loop count.
876 tools.pdtps_nsfNloop: @local::chmet_pdtps_template
877 tools.pdtps_nsfNloop.Metric: nsfLoopCount
878 tools.pdtps_nsfNloop.MetricMax: 21
879 tools.pdtps_nsfNloop.MetricLabel: "# loops"
880 tools.pdtps_nsfNloop.HistName: "hchpd%CRNAME%_nsfnloop_%0RUN%"
881 tools.pdtps_nsfNloop.HistTitle: "NSF loop count for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
882 tools.pdtps_nsfNloop.PlotFileName: "chmet_nsfnloop_%CRNAME%_run%0RUN%.png"
883 
884 # Noise signal finder loop count.
885 tools.pdtps_nsfNroi: @local::chmet_pdtps_template
886 tools.pdtps_nsfNroi.Metric: nsfRoiCount
887 tools.pdtps_nsfNroi.MetricMax: 12
888 tools.pdtps_nsfNroi.MetricLabel: "# ROI"
889 tools.pdtps_nsfNroi.HistName: "hchpd%CRNAME%_nsfnroi_%0RUN%"
890 tools.pdtps_nsfNroi.HistTitle: "NSF ROI count for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
891 tools.pdtps_nsfNroi.PlotFileName: "chmet_nsfnroi_%CRNAME%_run%0RUN%.png"
892 
893 # ---- End merging events ----
894 
895 # Event plots by z wire plane
896 
897 # Pedestal for each z-plane channel.
898 tools.pdwz_adcChannelPedestalPlotter: @local::tools.pdtps_adcChannelPedestalPlotter
899 tools.pdwz_adcChannelPedestalPlotter.ChannelRanges: @local::pdwz_template.ChannelRanges
900 tools.pdwz_adcChannelPedestalPlotter.ChannelLinePattern: @local::pdwz_template.ChannelLinePattern
901 
902 # Pedestal diff for each z-plane channel.
903 tools.pdwz_adcChannelPedestalDiffPlotter: @local::tools.pdtps_adcChannelPedestalDiffPlotter
904 tools.pdwz_adcChannelPedestalDiffPlotter.ChannelRanges: @local::pdwz_template.ChannelRanges
905 tools.pdwz_adcChannelPedestalDiffPlotter.ChannelLinePattern: @local::pdwz_template.ChannelLinePattern
906 
907 # Pedestal raw RMS for each z-plane channel.
908 tools.pdwz_adcChannelRawRmsPlotter: @local::tools.pdtps_adcChannelRawRmsPlotter
909 tools.pdwz_adcChannelRawRmsPlotter.ChannelRanges: @local::pdwz_template.ChannelRanges
910 tools.pdwz_adcChannelRawRmsPlotter.ChannelLinePattern: @local::pdwz_template.ChannelLinePattern
911 
912 # Pedestal noise for each TPS channel.
913 tools.pdwz_adcChannelPedestalNoisePlotter: @local::tools.pdtps_adcChannelPedestalNoisePlotter
914 tools.pdwz_adcChannelPedestalNoisePlotter.ChannelRanges: @local::pdwz_template.ChannelRanges
915 tools.pdwz_adcChannelPedestalNoisePlotter.ChannelLinePattern: @local::pdwz_template.ChannelLinePattern
916 
917 # Peak bin fraction for each z-plane channel.
918 tools.pdwz_adcChannelPeakBinFractionPlotter: @local::tools.pdtps_adcChannelPeakBinFractionPlotter
919 tools.pdwz_adcChannelPeakBinFractionPlotter.ChannelRanges: @local::pdwz_template.ChannelRanges
920 tools.pdwz_adcChannelPeakBinFractionPlotter.ChannelLinePattern: @local::pdwz_template.ChannelLinePattern
921 
922 # Peak bin excess for each channel.
923 tools.pdwz_adcChannelPeakBinExcessPlotter: @local::tools.pdtps_adcChannelPeakBinExcessPlotter
924 tools.pdwz_adcChannelPeakBinExcessPlotter.ChannelRanges: @local::pdwz_template.ChannelRanges
925 tools.pdwz_adcChannelPeakBinExcessPlotter.ChannelLinePattern: @local::pdwz_template.ChannelLinePattern
926 
927 # Summary plots by wire plane.
928 
929 # Pedestal
930 tools.pdwzs_adcChannelPedestalPlotter: @local::tools.pdwz_adcChannelPedestalPlotter
931 tools.pdwzs_adcChannelPedestalPlotter.HistName: "hchspd%CRNAME%_ped_%0RUN%"
932 tools.pdwzs_adcChannelPedestalPlotter.HistTitle: "ADC pedestals for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
933 tools.pdwzs_adcChannelPedestalPlotter.PlotFileName: "chmet_ped_%CRNAME%_run%0RUN%.png"
934 
935 # Pedestal diff
936 tools.pdwzs_adcChannelPedestalDiffPlotter: @local::tools.pdwz_adcChannelPedestalDiffPlotter
937 tools.pdwzs_adcChannelPedestalDiffPlotter.HistName: "hchspd%CRNAME%_pedd_%0RUN%"
938 tools.pdwzs_adcChannelPedestalDiffPlotter.HistTitle: "ADC pedestal diffs for run %RUN% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
939 tools.pdwzs_adcChannelPedestalDiffPlotter.PlotFileName: "chmet_pedd_%CRNAME%_run%0RUN%.png"
940 
941 ################################################################################
942 
943 pdmet_template: {
944  tool_type: AdcChannelMetric
945  LogLevel: 1
946  DataView: ""
947  MetricSummaryView: ""
948  MetricBins: 100
949  MetricMin: 0.0
950  ChannelRanges: [tps0, tps1, tps2, tps3, tps4, tps5]
951  ChannelLineModulus: 2560
952  ChannelLinePattern: [800, 1600, 2080]
953  ChannelLinePatternSolid: []
954  PlotSizeX: 700
955  PlotSizeY: 500
956  PlotUsesStatus: 1
957  RootFileName: ""
958  MetadataFlags: []
959 }
960 
961 # Pedestal for each TPS channel.
962 tools.pdmet_adcChannelPedestalPlotter: @local::pdmet_template
963 tools.pdmet_adcChannelPedestalPlotter.Metric: pedestal
964 tools.pdmet_adcChannelPedestalPlotter.MetricMax: 4096
965 tools.pdmet_adcChannelPedestalPlotter.HistName: "hpdmet%CRNAME%_ped_%0RUN%_%0EVENT%"
966 tools.pdmet_adcChannelPedestalPlotter.HistTitle: "ADC pedestals for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
967 tools.pdmet_adcChannelPedestalPlotter.MetricLabel: "Pedestal [ADC count]"
968 tools.pdmet_adcChannelPedestalPlotter.PlotFileName: "pdmet_ped_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
969 
970 # Pedestal noise for each TPS channel.
971 tools.pdmet_adcChannelPedestalNoisePlotter: @local::pdmet_template
972 tools.pdmet_adcChannelPedestalNoisePlotter.Metric: pedestalRms
973 tools.pdmet_adcChannelPedestalNoisePlotter.MetricMax: 50
974 tools.pdmet_adcChannelPedestalNoisePlotter.HistName: "hpdmet%CRNAME%_pednoise_%0RUN%_%0EVENT%"
975 tools.pdmet_adcChannelPedestalNoisePlotter.HistTitle: "ADC pedestal noise for run %RUN% event %EVENT% %CRLABEL% (%CRLABEL2%: %CRLABEL1%)"
976 tools.pdmet_adcChannelPedestalNoisePlotter.MetricLabel: "Pedestal noise [ADC count]"
977 tools.pdmet_adcChannelPedestalNoisePlotter.PlotFileName: "pdmet_pednoise_%CRNAME%_run%0RUN%_evt%0EVENT%.png"
978 
979 ################################################################################
980 # Tickmod viewer.
981 ################################################################################
982 
983 # Read in the tick offset
984 # 26sep2018 dla: Set phase to 1. It appears protoDUNE has been using this
985 # phase up til now and will presumably keep it.
986 # If not, we will have to start using run data.
987 tools.pd_tickOffset_sep26: {
988  tool_type: TimingRawDecoderOffsetTool
989  LogLevel: 1
990  TpcTickPhase: 1
991  Unit: tick
992  FembScaleIds: []
993  FembScaleValues: []
994  RunDataTool: ""
995 }
996 
997 # 15nov2018 dla: It appears the phase is 23 for the pulser runs taken Oct 25.
998 tools.pd_tickOffset_oct25: @local::tools.pd_tickOffset_sep26
999 tools.pd_tickOffset_oct25.TpcTickPhase: 23
1000 
1001 tools.pd_tickOffset: @local::tools.pd_tickOffset_oct25
1002 
1003 # Add timing scale correction for FEMB302.
1004 tools.pd_tickOffsetCorr: @local::tools.pd_tickOffset
1005 tools.pd_tickOffsetCorr.FembScaleIds: [1]
1006 tools.pd_tickOffsetCorr.FembScaleValues: [0.999293]
1007 
1008 # March 2019 from run 6690 (DLA)
1009 tools.pd_tickOffsetCorr6690: @local::tools.pd_tickOffsetCorr
1010 tools.pd_tickOffsetCorr6690.FembScaleValues: [0.9992930]
1011 
1012 # March 2019 from run 6036 (DLA)
1013 tools.pd_tickOffsetCorr6036: @local::tools.pd_tickOffsetCorr
1014 tools.pd_tickOffsetCorr6036.FembScaleValues: [0.9992927]
1015 
1016 # March 2019 from run 5531 (and 5526, 5540) (DLA)
1017 tools.pd_tickOffsetCorr5531: @local::tools.pd_tickOffsetCorr
1018 tools.pd_tickOffsetCorr5531.FembScaleValues: [0.9992961]
1019 
1020 # March 2019 from run 5954 (DLA)
1021 tools.pd_tickOffsetCorr5954: @local::tools.pd_tickOffsetCorr
1022 tools.pd_tickOffsetCorr5954.FembScaleValues: [0.9992875]
1023 
1024 # Build tickmod spectra.
1025 tools.pd_tickmodViewer: {
1026  tool_type: AdcTickModViewer
1027  LogLevel: 1
1028  TickModPeriod: 497
1029  TimeOffsetTool: pd_tickOffsetCorr
1030  FitSigmaMin: 2.0
1031  FitSigmaMax: 20.0
1032  HistName: "adctm_ch%0CHAN%_tm%0TICKMOD%"
1033  HistTitle: "ADC spectrum for channel %CHAN% tickmod %TICKMOD%"
1034  HistChannelCount: 100
1035  PlotChannels: []
1036  AllPlotFileName: ""
1037  MinPlotFileName: ""
1038  MaxPlotFileName: ""
1039  PhasePlotFileName: ""
1040  RootFileName: ""
1041  TreeFileName: ""
1042  PlotSizeX: 1400
1043  PlotSizeY: 1000
1044  PlotShowFit: 1
1045  PlotSplitX: 4
1046  PlotSplitY: 0
1047  PlotFrequency: 0
1048  PhaseVariable: phase
1049  PhaseGrouping: channel
1050  PhasePlotSizeX: 1400
1051  PhasePlotSizeY: 1000
1052  PhasePlotSplitX: 4
1053  PhasePlotSplitY: 0
1054 }
1055 
1056 # Remove coherent noise and high frequency noise with local
1057 # ROI finding at ADC scale.
1058 tools.pdsp_noiseRemovalAdc: {
1059  tool_type: PdspNoiseRemoval
1060  LogLevel: 1
1061  RemoveHighFrequency: true
1062  RemoveCoherent: true
1063  CutoffFrequency: 400 # cutoff frequency in kHz for Butterworth low-pass filter
1064  CorrMode: "median" # mean or median waveform for coherent noise determination
1065  CoherentOffline16: false # remove coherent noise for every 16 offline channels
1066  CoherentOffline16Groups: [] # remove coherent noise for all groups if list is empty
1067  CoherentDaq8: false # remove coherent noise for every 8 online DAQ channels on the same ASIC
1068  CoherentDaq8Groups: [] # remove coherent noise for all groups if list is empty
1069  CoherentDaq16: false # remove coherent noise for every 16 online DAQ channels on the same chip
1070  CoherentDaq16Groups: [] # remove coherent noise for all groups if list is empty
1071  CoherentFEMB128: true # remove coherent noise for every 128 online DAQ channels on the same FEMB
1072  CoherentFEMB128Groups: [] # remove coherent noise for all groups if list is empty
1073  UseBasicROIForCNR: true # use simple threshold ROI finder
1074  RoiStartThreshold: 20 # threshold on the leading edge
1075  RoiEndThreshold: 20 # threshold on the trailing edge
1076  RoiPadLow: 8 # low bin extension
1077  RoiPadHigh: 20 # high bin extension
1078 }
1079 
1080 # Remove coherent noise and high frequency noise with local
1081 # ROI finding at ke scale.
1082 tools.pdsp_noiseRemovalKe: @local::tools.pdsp_noiseRemovalAdc
1083 tools.pdsp_noiseRemovalKe.RoiStartThreshold: 0.5
1084 tools.pdsp_noiseRemovalKe.RoiEndThreshold: 0.5
1085 
1086 # Remove only coherent noise (no high frequency filter).
1087 tools.pdsp_fembNoiseRemovalKe: @local::tools.pdsp_noiseRemovalKe
1088 tools.pdsp_fembNoiseRemovalKe.RemoveHighFrequency: false
1089 
1090 # Remove coherent noise and high frequency noise with ROIs taken
1091 # from data.
1092 tools.pdsp_noiseRemovalData: @local::tools.pdsp_noiseRemovalAdc
1093 tools.pdsp_noiseRemovalData.UseBasicROIForCNR: false
1094 
1095 tools.pdsp_noiseRemoval: @local::tools.pdsp_noiseRemovalAdc
1096 
1097 tools.pdsp_RemoveBadChannels: {
1098  tool_type: RemoveBadChannels
1099  LogLevel: 1
1100  RemoveBadChs: true
1101  RemoveNoisyChs: false
1102 }
1103 
1104 ################################################################################
1105 # Other diagnostics.
1106 
1107 # Set uniform length for DFT analysis.
1108 tools.pdsp_setSampleLength: {
1109  tool_type: AdcChannelTrimmer
1110  LogLevel: 1
1111  Length: 6000
1112  MaxTrim: 100
1113 }
1114 
1115 ################################################################################
1116 
1117 
1118 ################################################################################