7.4.2. (Advanced) user mDST files#

You can also save events to your own mDST or user-defined dst (uDST) output files. These files are also created by the Skims but the functional code is part of Analysis.

User-defined DST Output#

This module defines the uDST (user-defined data summary table) file format. A uDST contains all dataobjects from mdst plus Particles and ParticleLists.

udst.add_skimmed_udst_output(path, skimDecayMode, skimParticleLists=None, outputParticleLists=None, additionalBranches=None, outputFile=None, dataDescription=None, mc=True)[source]#

Create a new path for events that contain a non-empty particle list specified via skimParticleLists. Write the accepted events as a udst file, saving only particles from skimParticleLists and from outputParticleLists. Additional Store Arrays and Relations to be stored can be specified via additionalBranches list argument.

Parameters
  • path (basf2.Path) – Path to add the skim output to.

  • skimDecayMode (str) – Name of the skim. If no outputFile is given this is also the name of the output filename. This name will be added to the FileMetaData as an extra data description “skimDecayMode”

  • skimParticleLists (list(str)) – Names of the particle lists to skim for. An event will be accepted if at least one of the particle lists is not empty

  • outputParticleLists (list(str)) – Names of the particle lists to store in the output in addition to the ones in skimParticleLists

  • additionalBranches (list(str)) – datastore arrays/objects to write to the output file in addition to mdst and particle information

  • outputFile (str) – Name of the output file if different from the skim name

  • dataDescription (dict) – Additional data descriptions to add to the output file. For example {“mcEventType”:”mixed”}

  • mc (bool) – Save Monte Carlo quantities? (MCParticles and corresponding relations)

udst.add_udst_dump(path, print_untested=False)[source]#

Add a PrintObjectsModule to a path for printing the uDST contents to test and maintain backwards compatibility.

See also: mdst.add_mdst_dump

Parameters
  • path (basf2.Path) – Path to add modules to

  • print_untested (bool) – If True print the names of all methods which are not explicitly printed to make sure we don’t miss addition of new members

udst.add_udst_output(path, filename, particleLists=None, additionalBranches=None, dataDescription=None, mc=True)[source]#

Save uDST (user-defined Data Summary Tables) = MDST + Particles + ParticleLists The charge-conjugate lists of those given in particleLists are also stored. Additional Store Arrays and Relations to be stored can be specified via additionalBranches list argument.

See also: mdst.add_mdst_output

Note

that this does not reduce the amount of Particle objects saved, see udst.add_skimmed_udst_output for a function that does.

Parameters
  • path (basf2.Path) – Path to add the output modules to.

  • filename (str) – Name of the output file.

  • particleLists (list(str)) – Names of the particle lists to write out.

  • additionalBranches (list(str)) – datastore arrays/objects to write to the output file in addition to mdst and particle information

  • dataDescription (dict) – Additional data descriptions to add to the output file. For example {“mcEventType”:”mixed”}

  • mc (bool) – Save Monte Carlo quantities? (MCParticles and corresponding relations)