TreeMakerSchema
- class coffea.nanoevents.TreeMakerSchema(base_form)[source]
Bases:
BaseSchema
TreeMaker schema builder
The TreeMaker schema is built from all branches found in the supplied file, based on the naming pattern of the branches. There are two steps of to the generation of array collections:
Objects with vector-like quantities (momentum, coordinate points) in the TreeMaker n-tuples are stored using ROOT PtEtaPhiEVectors and XYZPoint classes with maximum TTree splitting. These variable branches are grouped into a single collection with the original object name, with the corresponding coordinate variables names mapped to the standard variable names for coffea.nanoevents.methods.vector behaviors. For example: - The “Jets” branch in a TreeMaker n-tuple branch stores ‘PtEtaPhiEVector’s
corresponding to the momentum of AK4 jets. The resulting collection after this first step would contain the vector variables in the form of Jets.pt, Jets.eta, Jets.phi, Jets.energy, and addition vector quantities (px) can be accessed via the usual vector behavior methods.
The “PrimaryVertices” branch in a TreeMaker n-tuple branch stores ‘XYZPoint’s corresponding to the coordinates of the primary vertices, The resulting collection after this first step wold contain the coordinate variables in the form of PrimaryVertices.x, PrimaryVertices.y, PrimaryVertices.z.
Extended quantities of physic objects are stored in the format <Object>_<variable>, such as “Jets_jecFactor”. Such variables will be merged into the collection <Object>, so the branch “Jets_jetFactor” will be access to in the array format as “Jets.jecFactor”. An exception to the
All collections are then zipped into one
base.NanoEvents
record and returned.Attributes Summary
Behaviors necessary to implement this schema
Methods Summary
Converting a TreeMakerSchema event into something that is uproot writeable.
Attributes Documentation
- behavior
Behaviors necessary to implement this schema
Methods Documentation
- classmethod uproot_writeable()[source]
Converting a TreeMakerSchema event into something that is uproot writeable. Based off the discussion thread here [1], but added specific cased to handled the nested structures define for TreeMaker n-tuples. [1] https://github.com/CoffeaTeam/coffea/discussions/735