LDMX-Software / ldmx-sw

The Light Dark Matter eXperiment simulation and reconstruction framework.
https://ldmx-software.github.io
GNU General Public License v3.0
22 stars 20 forks source link

Add a producer that can be used to make an ECAL preselection skim #1387

Closed tvami closed 2 months ago

tvami commented 2 months ago

Is your feature request related to a problem? Please describe.

I'd like to have a dataset that's trigger skimmed + has a minimal preselection but is before the BDT. The use case I have in mind is to run tracking on this preselection and modify the ecal veto to include the tracking information (instead of scoring plane stuff)

Describe the solution you'd like

Make a new producer that does the preselection. I propose the location in https://github.com/LDMX-Software/ldmx-sw/tree/trunk/Recon/src/Recon/Skims

Describe alternatives you've considered

One could run tracking on the whole trigger skimmed sample. That probably has some advantages, too.

Additional context

Some notes to self: The trick is

  if (passedPreselection) {
    setStorageHint(framework::hint_shouldDrop);
  } else {
    setStorageHint(framework::hint_shouldKeep);
  }

and in the config to have

p.skimDefaultIsDrop()
p.skimConsider("ecal_preselection")
tomeichlersmith commented 2 months ago

If you want to avoid typos affecting your config, you can configure the skim after creating the preselection processor.

For example, I use the following a lot to avoid the annoyance of seeing nothing being skimmed even though I thought there should be something skimmed.

p.sequence = [ PreselectionProcessor() ] # create preselection processor
p.skimDefaultIsDrop()
p.skimConsider(p.sequence[0].instanceName) # consider processor in first position of sequence

This works because skimConsider looks for processors whose instance name matches the passed regex. If the regex is just a single specific instance name then the processors with that name will be included.