All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
magic_raw_to_triggeremu_icarus_Run1_data.fcl
Go to the documentation of this file.
1 #
2 # File: magic_raw_to_triggeremu_icarus_Run1_data.fcl
3 # Purpose: Writes a trigger emulation tree out of a ICARUS raw data file.
4 # Authors: Gianluca Petrillo (petrillo@slac.stanford.edu),
5 # Date: July 28, 2022
6 #
7 # Kind of nuts.
8 # Runs the regular Stage0, Stage1 and then the rest that it takes.
9 #
10 # Enabling art/ROOT output will write files on which the emulation can be run on
11 # again. This is to enable that output:
12 #
13 # physics.end_paths: [ @sequence::physics.end_paths, streams ]
14 #
15 #
16 #
17 
18 # ==============================================================================
19 # trigger emulation settings, chapter 1: The Untouchables
20 # ==============================================================================
21 
22 BEGIN_PROLOG
23 ###
24 ### fix settings (so that will not be overridden later);
25 ### these are defined in `triggeremu_data_config_icarus.fcl`
26 ###
27 
28 # do not emulate any fixed level threshold (only `pmtthr`)
29 triggeremu_data_config_icarus.settings.PMTADCthresholds @protect_ignore: []
30 
31 END_PROLOG
32 
33 
34 # ==============================================================================
35 # === configuration inclusion
36 # ==============================================================================
37 
38 #include "stage0_icarus_defs.fcl"
39 #include "stage1_icarus_defs.fcl"
40 
43 
44 #include "trigger_icarus.fcl"
47 #include "calorimetry_icarus.fcl"
48 #include "rootoutput_icarus.fcl"
49 
50 
51 # ==============================================================================
52 # trigger emulation settings, chapter 2: The Great Override
53 # ==============================================================================
54 
55 BEGIN_PROLOG
56 
58  module_type: "TimeTrackTreeStorage"
59  BeamGateProducer: "daqTrigger"
60  TriggerProducer: "daqTrigger"
61 }
62 
64 
65  module_type: BeamGateInfoFromTracks
66 
67  GateStartOffset: "-15 us"
68  GateEndOffset: "+5 us"
69 
70  T0Producer: @nil # must override
71  T0selProducer: @nil # must override
72 
74 
75 
76 t0TreeStore_icarus: {
77 
79 
80  MODA: 0.930
81  MODB: 0.212
82  Wion: 0.0000236016
83  Efield: 0.5
84  ForceDowngoing: true
85 
86 } # t0TreeStore_icarus
87 
88 
89 END_PROLOG
90 
91 # ==============================================================================
92 # === Stage 0
93 # ==============================================================================
94 
95 services: {
96  IICARUSChannelMap: @local::icarus_channelmappinggservice
97  @table::icarus_wirecalibration_minimum_services
98 }
99 
100 physics.producers: {
101  @table::icarus_stage0_producers
102 }
103 physics.filters: {
104  @table::icarus_stage0_filters
105 }
106 physics.stage0base: [
109  , daqTPCROI
111  ]
112 physics.pathE: [
113  @sequence::physics.stage0base, opflashCryoE
115  ]
116 physics.pathW: [
117  @sequence::physics.stage0base, opflashCryoW
119  ]
120 
121 # "remove" unused modules
122 physics.producers.purityana0.module_type: DummyProducer
123 physics.producers.purityana1.module_type: DummyProducer
124 
125 
126 # ==============================================================================
127 # === Stage 1
128 # ==============================================================================
129 
130 services: {
132  SpaceChargeService: @local::icarus_spacecharge
133 }
134 
135 physics.producers: {
136  @table::physics.producers
138 }
139 physics.filters: {
140  @table::physics.filters
141  @table::icarus_stage1_filters
142 }
143 
144 # from `stage1_multiTPC_nofilter_icarus_gauss.fcl` (v09_55_01)
145 
146 physics.pathE: [
147  @sequence::physics.pathE
150  , fmatchCryoE
153  ]
154 physics.pathW: [
155  @sequence::physics.pathW
156  , @sequence::icarus_filter_cluster3DCryoW
157  , @sequence::icarus_reco_pandoraGausCryoW
158  , fmatchCryoW
161  ]
162 physics.path:
163  [ @sequence::physics.pathE, @sequence::physics.pathW ]
164 
165 
166 # ==============================================================================
167 # trigger emulation part
168 # ==============================================================================
169 services: {
171 
172  @table::triggeremu_data_config_icarus.services # from triggeremu_data_config_icarus.fcl
173 
174  TimeTracker: {}
175  TFileService: { fileName: "timedtracks_store_triggeremu.root" }
176 
177 } # services
178 
179 # customization of message destinations from trigger emulation (if needed)
180 # services.message.destinations: {
181 # @table::services.message.destinations
182 # @table::triggeremu_data_config_icarus.messagedestinations
183 # }
184 
185 
186 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
187 physics.producers: {
188  @table::physics.producers
189 
190  gatesFromTracksE: {
192 
193  T0Producer: pandoraGausCryoE
194  T0selProducer: t0selectorE
195  }
196 
197  gatesFromTracksW: {
199 
200  T0Producer: pandoraGausCryoW
201  T0selProducer: t0selectorW
202  }
203 
204  @table::triggeremu_data_config_icarus.producers # from triggeremu_data_config_icarus.fcl
205 
206 } # producers
207 
208 
209 # we only discriminate against the native PMT thresholds, no fixed one is used;
210 # the fixed threshold discriminator requires thresholds to be present,
211 # so it can't be run in dummy mode; removing it from the existing path sequence
212 # is error-prone in FHiCL, so we rather turn it into a different (dummy) module:
213 physics.producers.pmtfixedthr.module_type: DummyProducer
214 
215 
216 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
217 physics.filters: {
218  @table::physics.filters
219 
220  t0selectorW: {
221  module_type: TimedTrackSelector
222  TrackTimeTags: [ pandoraGausCryoW ]
223  } # t0selectorW
224 
225  t0selectorE: {
226  module_type: TimedTrackSelector
227  TrackTimeTags: [ pandoraGausCryoE ]
228  }
229 
230 } # filters
231 
232 
233 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
234 physics.analyzers: {
235 
236  t0TreeStoreW: {
237  @table::t0TreeStore_icarus
238 
239  PFPproducer: "pandoraGausCryoW"
240  T0Producer: "pandoraGausCryoW"
241  T0selProducer: "t0selectorW"
242  TrackProducer: "pandoraTrackGausCryoW"
243  TrackFitterProducer: "pandoraTrackGausCryoW"
244  CaloProducer: "caloskimCalorimetryCryoW"
245  FlashProducer: "opflashCryoW"
246  EmulatedTriggers: [
247  { Name: "M1" TriggerTag: "simTiledORM1W" },
248  { Name: "S3" TriggerTag: "simTiledORS3W" },
249  { Name: "S5" TriggerTag: "simTiledORS5W" },
250  { Name: "S8" TriggerTag: "simTiledORS8W" },
251  { Name: "S10" TriggerTag: "simTiledORS10W" },
252  { Name: "S15" TriggerTag: "simTiledORS15W" },
253  { Name: "M1s" TriggerTag: "simSlidingORM1W" },
254  { Name: "S3s" TriggerTag: "simSlidingORS3W" },
255  { Name: "S5s" TriggerTag: "simSlidingORS5W" },
256  { Name: "S8s" TriggerTag: "simSlidingORS8W" },
257  { Name: "S10s" TriggerTag: "simSlidingORS10W" },
258  { Name: "S15s" TriggerTag: "simSlidingORS15W" }
259  ]
260  LogCategory: "TimeTrackTreeStorageCryoW"
261 
262  # do not process the events which did not complete the West processing path
263  SelectEvents: [ 'processpathW' ]
264 
265  } # t0TreeStoreW
266 
267 
268  t0TreeStoreE: {
269  @table::t0TreeStore_icarus
270 
271  PFPproducer: "pandoraGausCryoE"
272  T0Producer: "pandoraGausCryoE"
273  T0selProducer: "t0selectorE"
274  TrackProducer: "pandoraTrackGausCryoE"
275  TrackFitterProducer: "pandoraTrackGausCryoE"
276  CaloProducer: "caloskimCalorimetryCryoE"
277  FlashProducer: "opflashCryoE"
278  EmulatedTriggers: [
279  { Name: "M1" TriggerTag: "simTiledORM1E" },
280  { Name: "S3" TriggerTag: "simTiledORS3E" },
281  { Name: "S5" TriggerTag: "simTiledORS5E" },
282  { Name: "S8" TriggerTag: "simTiledORS8E" },
283  { Name: "S10" TriggerTag: "simTiledORS10E" },
284  { Name: "S15" TriggerTag: "simTiledORS15E" },
285  { Name: "M1s" TriggerTag: "simSlidingORM1E" },
286  { Name: "S3s" TriggerTag: "simSlidingORS3E" },
287  { Name: "S5s" TriggerTag: "simSlidingORS5E" },
288  { Name: "S8s" TriggerTag: "simSlidingORS8E" },
289  { Name: "S10s" TriggerTag: "simSlidingORS10E" },
290  { Name: "S15s" TriggerTag: "simSlidingORS15E" }
291  ]
292  LogCategory: "TimeTrackTreeStorageCryoE"
293 
294  # do not process the events which did not complete the East processing path
295  SelectEvents: [ 'processpathE' ]
296 
297  } # t0TreeStoreE
298 
299 } # analyzers
300 
301 
302 physics.selectionW: [
303  "t0selectorW"
304  , "gatesFromTracksW"
305  , @sequence::triggeremu_data_config_icarus.producerpathW
306 ]
307 
308 physics.selectionE: [
309  "t0selectorE"
310  , "gatesFromTracksE"
311  , @sequence::triggeremu_data_config_icarus.producerpathE
312 ]
313 
314 physics.processpathE:
315  [ @sequence::physics.pathE, @sequence::physics.selectionE ]
316 physics.processpathW:
317  [ @sequence::physics.pathW, @sequence::physics.selectionW ]
318 
319 physics.emutreesE: [ t0TreeStoreE ]
320 physics.emutreesW: [ t0TreeStoreW ]
321 physics.emutrees: [ @sequence::physics.emutreesE, @sequence::physics.emutreesW ]
322 
323 
324 # ==============================================================================
325 # === Wrap up
326 # ==============================================================================
327 
328 process_name: TrgEmu
329 
330 # ------------------------------------------------------------------------------
331 services.message: @local::icarus_message_services_interactive
332 
333 
334 # ------------------------------------------------------------------------------
335 physics.streams: [ "rootoutput" ]
336 
337 physics.trigger_paths: [ processpathE, processpathW ] # only one cryostat
338 # physics.trigger_paths: [ processpathE ]
339 
340 physics.end_paths: [ "emutrees", "streams" ]
341 # physics.end_paths: [ "emutreesE", "streams" ] # only one cryostat
342 # physics.end_paths: [ "emutrees" ] # no art/ROOT output
343 
344 
345 # ------------------------------------------------------------------------------
346 outputs: {
347  rootoutput: {
348  @table::icarus_rootoutput
349 
350  fileProperties: { maxInputFiles: 1 }
351  checkFileName: false
352 
353  # these data products are enough to rerun this job (until hits are needed):
354  outputCommands: [
355  "drop *"
356 
357  # stage 0
358  , "keep sbn::PMTconfiguration_*_*_*"
359  , "keep *_daqTrigger_*_*"
360  , "keep *_pmtthr_*_*"
361  , "keep *_opflashCryo*_*_*"
362 
363  # stage 1
364  , "keep *_pandoraGausCryo*_*_*", "drop *recob::SpacePoint*_pandoraGausCryo*_*_*"
365  , "keep *_pandoraTrackGausCryo*_*_*"
366  , "keep *_pandoraKalmanTrackGausCryo*_*_*"
367  , "keep *_cluster3DCryo*_*_*", "drop *recob::SpacePoint*_cluster3DCryo*_*_*"
368  , "keep *_caloskimCalorimetryCryo*_*_*"
369  , "keep *_fmatchCryo*_*_*"
370 
371  # trigger emulation
372  , "keep *_lvdsgates*_*_*"
373  , "keep *_t0selector*_*_*"
374  , "keep *_gatesFromTracks*_*_*"
375  , "keep *_trig*_*_*"
376  , "keep *_simTiled*_*_*", "keep *_simSliding*_*_*"
377  ]
378 
379  }
380 }
381 
382 
383 # ==============================================================================
384 # === Afterthoughts
385 # ==============================================================================
386 
387 # FIXME for development and DEBUG only:
388 # services.message: @local::icarus_message_services_interactive_debug
389 
BEGIN_PROLOG opflashCryoE TPCHitFilterCryoW icarus_filter_cluster3DCryoE
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
process_name local::throughgoing_selection SelectEvents
float MODB
Definition: dedx.py:124
Module which does nothing.
BEGIN_PROLOG opflashCryoW opflashCryoW triggerfilterBNB triggerfilterNuMI triggerfilterOffbeamBNB triggerfilterOffbeamNuMI triggerfilterUnknown roifinder roifinder2d gaushitTPCEE icarus_stage0_WestHits_TPC
BEGIN_PROLOG opflashCryoW opflashCryoW triggerfilterBNB triggerfilterNuMI triggerfilterOffbeamBNB triggerfilterOffbeamNuMI triggerfilterUnknown roifinder roifinder2d icarus_stage0_EastHits_TPC
float MODA
Definition: dedx.py:123
process_name drop raw::OpDetWaveforms_DataApr2016RecoStage1_saturation_ * physics
process_name gaushitTPC3 gaushitTPC3 filters
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds daqTPCROI
BEGIN_PROLOG opflashCryoE TPCHitFilterCryoW TPCHitFilterCryoE sequence::icarus_filter_cluster3DCryoE SBNShowerGausCryoW icarus_reco_pandoraGausCryoE
float Efield
Definition: dedx.py:126
process_name caloskimCalorimetryCryoE
process_name caloskimCalorimetryCryoW
BEGIN_PROLOG gatesFromTracks_icarus
BEGIN_PROLOG vertical distance to the surface Name
BEGIN_PROLOG BeamGateDuration protect_ignore
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 fmatchCryoE
BEGIN_PROLOG opflashCryoE TPCHitFilterCryoW TPCHitFilterCryoE sequence::icarus_filter_cluster3DCryoE SBNShowerGausCryoW SBNShowerGausCryoE sequence::icarus_reco_pandoraGausCryoW sequence::icarus_reco_pandoraGausCryoE sequence::icarus_reco_pandoraGausCryoW fmatchCryoW icarus_crthit
BEGIN_PROLOG timetracktreestorage_base
then echo Cowardly refusing to create a new FHiCL file with the same name as the original one('${SourceName}')." >&2 exit 1 fi echo "'$
outputs out1 outputCommands
BEGIN_PROLOG opflashCryoW opflashCryoW triggerfilterBNB triggerfilterNuMI triggerfilterOffbeamBNB triggerfilterOffbeamNuMI triggerfilterUnknown roifinder roifinder2d gaushitTPCEE gaushitTPCWE purityana1 opflashCryoW flashfilterBNB flashfilterNuMI sequence::icarus_purity_monitor sequence::icarus_purity_monitor icarus_stage0_crt
process_name drop *_gatesFromTracks *_ *_ drop simTiled *_ *_ *_ drop simSliding *_ *_ *_ *physics analyzers t0TreeStoreE CaloProducer
BEGIN_PROLOG opflashCryoW opflashCryoW triggerfilterBNB triggerfilterNuMI triggerfilterOffbeamBNB triggerfilterOffbeamNuMI triggerfilterUnknown icarus_stage0_multiTPC_TPC
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
int Wion
Definition: dedx.py:125
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics opflashCryoW
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 fmatchCryoW
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics opflashCryoE
process_name analyzers
BEGIN_PROLOG icarus_stage1_producers
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsWindowPair END_PROLOG trigslidewindowOR6m output outputs
BEGIN_PROLOG opflashCryoW opflashCryoW triggerfilterBNB triggerfilterNuMI triggerfilterOffbeamBNB triggerfilterOffbeamNuMI triggerfilterUnknown roifinder roifinder2d gaushitTPCEE gaushitTPCWE purityana1 icarus_stage0_PMT
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG process_name