Defined in uproot.writing.identify on line 30.

uproot.writing.identify.add_to_directory(obj, name, directory, streamers)
  • obj – Object to attempt to recognize as something that can be written to a ROOT file.

  • name (str or None) – Name to assign to the writable object.

  • directory (uproot.WritableDirectory) – Directory to add the object to, if successful.

  • streamers (list of uproot.streamers.Model_TStreamerInfo, uproot.writable._cascade.RawStreamerInfo, or constructor arguments for the latter) – Collects streamers to add to the output file so that all objects in it can be read in any version of ROOT.

This function performs two tasks: it attempts to recognize obj as a writable object and, if successful, writes it to a directory.

It can recognize dynamic TTrees and static objects such as histograms. For only static objects, without the additional concern of writing the resulting object in a directory, see uproot.to_writable.

Raises TypeError if obj is not recognized as writable data.