All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
run_trigger_gate_simulation_icarus.fcl
Go to the documentation of this file.
1 #
2 # File: run_trigger_gate_simulation_icarus.fcl
3 # Purpose: Runs a chain to simulate ICARUS trigger primitives.
4 # Author: Gianluca Petrillo (petrillo@slac.stanford.edu)
5 # Date: December 18, 2019
6 # Version: 2.2
7 #
8 # This is a top-level configuration that can be run directly.
9 #
10 # The steps are:
11 #
12 # * pmtbaselines (PMTWaveformBaselines): computes baselines for all PMT
13 # waveforms
14 # * discrimopdaq (DiscriminatePMTwaveforms): from each PMT extracts a gate
15 # signal according to each of the configured thresholds;
16 # for each threshold all gates are stored in their own data product
17 # * lvdsgatesAND (LVDSgates): pairs each of the discriminated waveforms above
18 # to reproduce the 192 hardware channels from PMT feeding the trigger;
19 # the pairing is performed as an AND of the two gates in the pair;
20 # * lvdsgatesOR (LVDSgates): pairs each of the discriminated waveforms above
21 # to reproduce the 192 hardware channels from PMT feeding the trigger
22 # the pairing is performed as an OR of the two gates in the pair;
23 # * trigslidewindowOR (SlidingWindowTrigger): applies a sliding window of 30
24 # PMT with 50% overlap (5 windows per TPC), using the OR paired output
25 # from LVDS simulation;
26 # * trigslidewindowAND (SlidingWindowTrigger): applies a sliding window of 30
27 # PMT with 50% overlap (5 windows per TPC), using the AND paired output
28 # from LVDS simulation;
29 # * effSingleOR (MajorityTriggerEfficiencyPlots): produces plots of efficiency
30 # of a trigger requiring at least 1, 2, 3, etc. LVDS trigger primitives to
31 # be present at the same time and in coincidence with a 1.6 us beam gate;
32 # * effSingleAND (MajorityTriggerEfficiencyPlots): produces plots of efficiency
33 # of a trigger requiring at least 1, 2, 3, etc. LVDS trigger primitives to
34 # be present at the same time and in coincidence with a 1.6 us beam gate;
35 # * effSlidingOR (SlidingWindowTriggerEfficiencyPlots): produces plots of
36 # efficiency of a trigger requiring patterns of sliding window triggers,
37 # with minimum LVDS trigger primitives in each sliding window, to be
38 # present at the same time and in coincidence with a 1.6 us beam gate;
39 # * effSlidingAND (SlidingWindowTriggerEfficiencyPlots): produces plots of
40 # efficiency of a trigger requiring patterns of sliding window triggers,
41 # with minimum LVDS trigger primitives in each sliding window, to be
42 # present at the same time and in coincidence with a 1.6 us beam gate;
43 #
44 # Output
45 # -------
46 #
47 # The two `LVDSgates` module instances produce each multiple sets of trigger
48 # gates that can be used for trigger study.
49 #
50 # In addition, debugging log files are produced (settings are at the bottom).
51 #
52 # Only selected data product from the input file are retained in the output,
53 # in addition to all the ones produced by this job:
54 # * all standard products from event generation
55 # * particle propagated in argon by GEANT4 simulation
56 # * optical detector waveforms
57 #
58 #
59 # Required inputs
60 # ----------------
61 #
62 # * simulated optical detector readout: `opdaq`
63 #
64 #
65 # Required services
66 # ------------------
67 #
68 # * GeometryService (DiscriminatePMTwaveforms)
69 # * DetectorClocksService (most/all modules)
70 # * TFileService (TriggerEfficiencyPlots)
71 #
72 #
73 # Changes
74 # --------
75 #
76 # 20200917 (petrillo@slac.stanford.edu) [v2.2]
77 # : added baseline extraction
78 #
79 # 20200403 (petrillo@slac.stanford.edu) [v2.1]
80 # : fixed the labels of the trigger and end paths
81 #
82 # 20200403 (petrillo@slac.stanford.edu) [v2.0]
83 # : added sliding window trigger plots
84 #
85 # 20191218 (petrillo@slac.stanford.edu) [v1.0]
86 # : original version
87 #
88 
90 #include "rootoutput_icarus.fcl"
91 #include "trigger_icarus.fcl"
92 
93 BEGIN_PROLOG
94 
95 # settings to plot efficiency under the requirement of this number of LVDS
96 # trigger primitives to be firing during beam time
97 MinimumSingleTriggerPrimitives: [ 1, 2, 3, 4, 5, 8, 12, 20, 50 ]
98 
99 # settings for plotting efficiency under patterns of sliding window triggers
100 # firing during beam time
102  {
103  inMainWindow: 2
104  inOppositeWindow: 1
105  },
106  {
107  inMainWindow: 2
108  inOppositeWindow: 2
109  },
110  {
111  inMainWindow: 3
112  },
113  {
114  inMainWindow: 4
115  },
116  {
117  inMainWindow: 5
118  },
119  {
120  inMainWindow: 3
121  inOppositeWindow: 1
122  },
123  {
124  inMainWindow: 4
125  inOppositeWindow: 1
126  },
127  {
128  inMainWindow: 5
129  inOppositeWindow: 2
130  },
131  {
132  inMainWindow: 3
133  inOppositeWindow: 3
134  },
135  {
136  inMainWindow: 5
137  inOppositeWindow: 3
138  },
139  {
140  inMainWindow: 5
141  inOppositeWindow: 5
142  }
144 
145 END_PROLOG
146 
147 process_name: Trigger
148 
149 
150 services: {
151 
152  # this provides: file service, random management (unused),
153  # Geometry, detector properties and clocks
154  @table::icarus_common_services
155 
156  # currently unused (remove the line if they start mattering):
157  LArPropertiesService: @erase
158  DetectorPropertiesService: @erase
159 
160 
161 } # services
162 
163 
164 physics: {
165 
166  producers: {
167 
168  # --------------------------------------------------------------------------
169  pmtbaselines: {
170 
171  module_type: PMTWaveformBaselines
172 
173  # label of input digitized optical waveform data product
174  OpticalWaveforms: "daqPMT"
175 
176  # produce plots on the extracted baseline
177  PlotBaselines: true # default
178 
179  # tag of the module output to console via message facility
180  OutputCategory: "PMTWaveformBaselines" # default
181 
182  } # pmtbaselines
183 
184 
185  # --------------------------------------------------------------------------
186  discrimopdaq: {
187 
188  module_type: DiscriminatePMTwaveforms
189 
190  # input optical waveform data product tag:
191  OpticalWaveforms: "daqPMT"
192 
193  # PMT baselines
194  # Baselines: "pmtbaselines" # from data products
195  Baseline: 15000
196 
197  #
198  # choosing the discrimination algorithm: fixed length gates
199  #
200  # TriggerGateBuilder: @local::icarus_dynamictriggergate
201  TriggerGateBuilder: @local::icarus_fixedtriggergate # from trigger_icarus.fcl
202 
203 
204  # select which thresholds to save (the algorithm *must* provide them!);
205  # omitted: save all thresholds that the algorithm provides
206  # SelectThresholds: [ 5, 15 ]
207 
208  # message facility stream
209  OutputCategory: "DiscriminatePMTwaveforms"
210 
211  } # discrimopdaq
212 
213 
214  # --------------------------------------------------------------------------
215  lvdsgatesAND: {
216 
217  module_type: LVDSgates
218 
219  TriggerGatesTag: discrimopdaq
220 
221  # select the thresholds to process (mandatory)
222  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
223 
224  # CombinationMode: mostly either "AND" or "OR"
225  CombinationMode: "AND"
226 
227  # use the standard ICARUS pairing
229 
230  IgnoreChannels: @local::icarus_trigger_channel_ignore
231 
232  # message facility stream
233  LogCategory: "LVDSgatesAND"
234 
235  } # lvdsgatesAND
236 
237 
238  # --------------------------------------------------------------------------
239  trigslidewindowAND: {
240 
241  module_type: SlidingWindowTrigger
242 
243  TriggerGatesTag: "lvdsgatesAND"
244 
245  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
246 
247  MissingChannels: @local::icarus_trigger_channel_ignore
248 
249  WindowSize: 15
250 
251  # number of optical channel used as offset for sliding window [as WindowSize]
252  Stride: 15
253 
254  # name of the category used for the output
255  LogCategory: "SlidingWindowTriggerAND"
256 
257  } # trigslidewindowAND
258 
259 
260  # --------------------------------------------------------------------------
261  lvdsgatesOR: {
262 
263  module_type: LVDSgates
264 
265  TriggerGatesTag: discrimopdaq
266 
267  # select the thresholds to process (mandatory)
268  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
269 
270  # CombinationMode: mostly either "AND" or "OR"
271  CombinationMode: "OR"
272 
273  # use the standard ICARUS pairing
275 
276  IgnoreChannels: @local::icarus_trigger_channel_ignore
277 
278  # message facility stream
279  LogCategory: "LVDSgatesOR"
280 
281  } # lvdsgatesOR
282 
283 
284  # --------------------------------------------------------------------------
286 
287  module_type: SlidingWindowTrigger
288 
289  TriggerGatesTag: "lvdsgatesOR"
290 
291  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
292 
293  MissingChannels: @local::icarus_trigger_channel_ignore
294 
295  WindowSize: 15
296 
297  # number of optical channel used as offset for sliding window [as WindowSize]
298  Stride: 15
299 
300  # name of the category used for the output
301  LogCategory: "SlidingWindowTriggerOR"
302 
304 
305 
306  # --------------------------------------------------------------------------
307 
308  } # producers
309 
310 
311  analyzers: {
312 
313  # --------------------------------------------------------------------------
314  effSingleAND: {
315 
316  module_type: MajorityTriggerEfficiencyPlots
317 
318  TriggerGatesTag: lvdsgatesAND
319 
320  # select the thresholds to process (mandatory)
321  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
322 
323  # minimum number of trigger primitives required for the trigger to fire
324  MinimumPrimitives: @local::MinimumSingleTriggerPrimitives
325 
326  # duration of the beam gate (BNB: 1.6 us; NuMI: 9.5 us)
327  BeamGateDuration: "9.5 us"
328 
329  BeamGateStart: "0 us"
330 
331  # write event information in a simple for further investigation
332  #EventTreeName: "EventsSingleAND"
333 
334  # dump event information on screen (same stream as the rest)
335  EventDetailsLogCategory: ""
336 
337  # message facility stream
338  LogCategory: "MajorityTriggerEfficiencyPlotsAND"
339 
340  } # effSingleAND
341 
342  effSingleOR: {
343 
344  module_type: MajorityTriggerEfficiencyPlots
345 
346  TriggerGatesTag: lvdsgatesOR
347 
348  # select the thresholds to process (mandatory)
349  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
350 
351  # minimum number of trigger primitives required for the trigger to fire
352  MinimumPrimitives: @local::MinimumSingleTriggerPrimitives
353 
354  # duration of the beam gate (BNB: 1.6 us; NuMI: 9.5 us)
355  BeamGateDuration: "9.5 us"
356 
357  BeamGateStart: "0 us"
358 
359  # write event information in a simple tree for further investigation (disabled)
360  # EventTreeName: "EventsSingleOR"
361 
362  # dump event information on screen (disabled)
363  # EventDetailsLogCategory: ""
364 
365  # message facility stream
366  LogCategory: "MajorityTriggerEfficiencyPlotsOR"
367 
368  } # effSingleOR
369 
370 
371  # --------------------------------------------------------------------------
372  effSlidingAND: {
373 
374  module_type: SlidingWindowTriggerEfficiencyPlots
375 
376  TriggerGatesTag: trigslidewindowAND
377 
378  # select the thresholds to process (mandatory)
379  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
380 
381  # sliding window patterns to be simulated
383 
384  # duration of the beam gate (BNB: 1.6 us; NuMI: 9.5 us)
385  BeamGateDuration: "9.5 us" # from trigger_icarus.fcl
386 
387  BeamGateStart: "0 us"
388 
389  # write event information in a simple tree for further investigation
390  # EventTreeName: "EventsSlidingAND"
391 
392  # dump event information on screen (same stream as the rest)
393  # EventDetailsLogCategory: ""
394 
395  # message facility stream
396  LogCategory: "SlidingWindowTriggerEfficiencyPlotsAND"
397 
398  } # effSlidingAND
399 
400  effSlidingOR: {
401 
402  module_type: SlidingWindowTriggerEfficiencyPlots
403 
404  TriggerGatesTag: trigslidewindowOR
405 
406  # select the thresholds to process (mandatory)
407  Thresholds: @local::icarus_triggergate_basic.ChannelThresholds # from trigger_icarus.fcl
408 
409  # sliding window patterns to be simulated
411 
412  # duration of the beam gate (BNB: 1.6 us; NuMI: 9.5 us)
413  BeamGateDuration: "9.5 us" # from trigger_icarus.fcl
414 
415  BeamGateStart: "0 us"
416 
417  # write event information in a simple tree for further investigation (disabled)
418  # EventTreeName: "EventsSlidingOR"
419 
420  # dump event information on screen (disabled)
421  # EventDetailsLogCategory: ""
422 
423  # message facility stream
424  LogCategory: "SlidingWindowTriggerEfficiencyPlotsOR"
425 
426  } # effSlidingOR
427  # --------------------------------------------------------------------------
428 
429  } # analyzers
430 
431 
432  triggerAND: [ pmtbaselines, discrimopdaq, lvdsgatesAND , trigslidewindowAND ]
433  triggerOR: [ pmtbaselines, discrimopdaq, lvdsgatesOR , trigslidewindowOR ]
434 
435  plotsAND: [ effSingleAND , effSlidingAND ]
436  plotsOR: [ effSingleOR , effSlidingOR ]
437 
438  output: [ rootoutput ]
439 
440  trigger_paths: [ triggerAND, triggerOR ]
441  end_paths: [ plotsAND, plotsOR, output ]
442 
443 } # physics
444 
445 
446 outputs: {
447 
448  rootoutput: {
449 
450  @table::icarus_rootoutput # from rootoutput_icarus.fcl
451 
452  # each entry is "class_label_instance_process"
453  outputCommands: [
454  "drop *",
455  # "keep simb::MCTruths_*_*_*",
456  # "keep simb::MCFluxs_*_*_*",
457  # "keep simb::MCFluxsimb::MCTruthvoidart::Assns_*_*_*",
458  # "keep simb::GTruths_*_*_*",
459  # "keep simb::GTruthsimb::MCTruthvoidart::Assns_*_*_*",
460  # "keep simb::MCParticles_largeant__G4",
461  # "keep simb::MCParticlesimb::MCTruthsim::GeneratedParticleInfoart::Assns_largeant__G4",
462  # "keep sim::SimEnergyDeposits_largeant_*_G4",
463  # "keep sim::SimPhotonss_largeant__G4", # enable for optical efficiency studies
464  "keep *_opdaq_*_DetSim",
465  "keep *_*_*_Trigger"
466  ]
467  } # rootoutput
468 
469 } # outputs
470 
471 
472 # ------------------------------------------------------------------------------
473 # add debug output to its own file
474 #
475 #services.message.destinations.TriggerThresholdLog: {
476 # type: file
477 # filename: "TriggerThresholds.log"
478 # threshold: DEBUG
479 # categories: {
480 # DiscriminatePMTwaveforms: { limit: -1 }
481 # default: { limit: 0 }
482 # }
483 #} # services.messages.destinations.TriggerThresholdLog
484 
485 #services.message.destinations.LVDSANDLog: {
486 # type: file
487 # filename: "LVDS-AND.log"
488 # threshold: DEBUG
489 # categories: {
490 # LVDSgatesAND: { limit: -1 }
491 # default: { limit: 0 }
492 # }
493 #} # services.messages.destinations.LVDSANDLog
494 
495 #services.message.destinations.SlidingWindowANDLog: {
496 # type: file
497  # filename: "SlidingWindowTrigger-AND.log"
498  # threshold: DEBUG
499 # categories: {
500 # SlidingWindowTriggerAND: { limit: -1 }
501  # default: { limit: 0 }
502  # }
503 #} # services.messages.destinations.SlidingWindowANDLog
504 
505 #services.message.destinations.LVDSORLog: {
506 # type: file
507 # filename: "LVDS-OR.log"
508 # threshold: DEBUG
509 # categories: {
510 # LVDSgatesOR: { limit: -1 }
511 # default: { limit: 0 }
512 # }
513 #} # services.messages.destinations.LVDSORLog
514 
515 #services.message.destinations.SlidingWindowORLog: {
516 # type: file
517 # filename: "SlidingWindowTrigger-OR.log"
518  # threshold: DEBUG
519  # categories: {
520  # SlidingWindowTriggerOR: { limit: -1 }
521  # default: { limit: 0 }
522  # }
523 #} # services.messages.destinations.SlidingWindowORLog
524 
525 
526 #services.message.destinations.SingleANDplotsLog: {
527 # type: file
528 # filename: "MajorityTriggerEfficiency_Count_Plots-AND.log"
529 # threshold: DEBUG
530 # categories: {
531 # MajorityTriggerEfficiencyPlotsAND: { limit: -1 }
532 # default: { limit: 0 }
533 # }
534 #} # services.messages.destinations.SingleANDplotsLog
535 
536 #services.message.destinations.SingleORplotsLog: {
537 # type: file
538 # filename: "MajorityTriggerEfficiency_Count_Plots-OR.log"
539 # threshold: DEBUG
540 # categories: {
541 # MajorityTriggerEfficiencyPlotsOR: { limit: -1 }
542 # default: { limit: 0 }
543 # }
544 #} # services.messages.destinations.SingleORplotsLog
545 
546 #services.message.destinations.SlidingANDplotsLog: {
547  # type: file
548  # filename: "SlidingWindowTriggerEfficiency_Count_Plots-AND.log"
549  # threshold: DEBUG
550  # categories: {
551  # SlidingWindowTriggerEfficiencyPlotsAND: { limit: -1 }
552  # default: { limit: 0 }
553  # }
554 #} # services.messages.destinations.SlidingANDplotsLog
555 
556 #services.message.destinations.SlidingORplotsLog: {
557  # type: file
558  # filename: "SlidingWindowTriggerEfficiency_Count_Plots-OR.log"
559  # threshold: DEBUG
560  # categories: {
561  # SlidingWindowTriggerEfficiencyPlotsOR: { limit: -1 }
562  # default: { limit: 0 }
563  # }
564 #} # services.messages.destinations.SlidingORplotsLog
565 
566 
567 # ------------------------------------------------------------------------------
568 # --- Configuration override guide
569 # ------------------------------------------------------------------------------
570 #
571 # The default values of the trigger configuration are in one way or the other
572 # coming from `trigger_icarus.fcl`.
573 #
574 
575 # ------------------------------------------------------------------------------
576 # The "trigger builder" algorithm performs the discrimination and generates the
577 # gates.
578 #
579 
580 # Each time the waveform is beyond the set ADC threshold, a gate is opened for
581 # a certain time, that is the duration in microseconds set here:
582 
583 # physics.producers.discrimopdaq.TriggerGateBuilder.GateDuration: @local::icarus_fixedtriggergate.GateDuration
584 
585 # For studying the trigger efficiency, different thresholds must be considered;
586 # thresholds, in ADC counts from the baseline, are set here:
587 
588 # physics.producers.discrimopdaq.TriggerGateBuilder.ChannelThresholds: @local::icarus_fixedtriggergate.ChannelThresholds
589 
590 
591 # ------------------------------------------------------------------------------
592 # Channels are combined in pairs. Pairing is fixed by cabling the PMT readout
593 # boards to the PMTs. Some channels are special and are left alone.
594 #
595 # When changing these settings here, always change both lvdsgatesAND and
596 # lvdsgatesOR.
597 #
598 # The pattern is set here:
599 #
600 # physics.producers.lvdsgatesAND.ChannelPairing: @local::icarus_trigger_channel_pairings
601 # physics.producers.lvdsgatesOR.ChannelPairing: @local::icarus_trigger_channel_pairings
602 
603 # ------------------------------------------------------------------------------
BEGIN_PROLOG BeamGateDuration pmtthr physics producers trigtilewindowORS Thresholds
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics sequence::physics pathW services
BEGIN_PROLOG MinimumSingleTriggerPrimitives
BEGIN_PROLOG icarus_trigger_channel_ignore
BEGIN_PROLOG SlidingWindowTriggerPatterns
process_name drop raw::OpDetWaveforms_DataApr2016RecoStage1_saturation_ * physics
physics producers trigslidewindowOR6mW physics effSlidingOR6mW physics end_paths
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG lvdsgatesOR
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 plotsOR
BEGIN_PROLOG icarus_trigger_channel_pairings
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingOR
BEGIN_PROLOG triggeremu_data_config_icarus settings sequence::triggeremu_data_config_icarus settings PMTADCthresholds CombinationMode
BEGIN_PROLOG triggeremu_data_config_icarus settings sequence::triggeremu_data_config_icarus settings PMTADCthresholds sequence::triggeremu_data_config_icarus settings PMTADCthresholds WindowSize
outputs out1 outputCommands
physics producers discrimopdaq OpticalWaveforms
size_t Stride(bool allow_default)
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 module_type
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG trigslidewindowOR
process_name analyzers
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG discrimopdaq
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsWindowPair END_PROLOG trigslidewindowOR6m output outputs
process_name sequence::icarus_reco_cluster3d physics trigger_paths
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG process_name