ldmx-sw icon indicating copy to clipboard operation
ldmx-sw copied to clipboard

patch drop keep rules and add some safe guards

Open tomeichlersmith opened this issue 1 year ago • 1 comments

While writing up notes on the drop keep rules for the website, I wrote an example and tried testing it.

p.keep = [ 'drop .*ScoringPlane.*', 'keep EcalScoring.*']

This did not work. All of the scoring planes were dropped from the output file which I think we can patch. The same affect can still happen with

p.keep = [
  'drop MagnetScoringPlane.*',
  'drop HcalScoringPlane.*',
  # ... list all non-Ecal scoring plane
]

but it kinda defeats the purpose of supporting regex at all.

Besides patching this "exception-based" dropping, I also think we could add some safe guards into the drop keep rules. For example,

  • Never allow EventHeader to be dropped, it is necessary to be re-read by Framework so it should not be removable
  • Warn/Error if all collections are being dropped, why even run?

Whomever works on this should also update the associated doc page.

tomeichlersmith avatar Jan 21 '24 19:01 tomeichlersmith

Thanks for bringing this up @tomeichlersmith. I'll add to the list of curious/unwanted behaviors that I have never been able to drop Ecal simhits, explicitly or by wildcarding on simhits in general.

bryngemark avatar Jan 22 '24 12:01 bryngemark