![]() |
TIMBER
beta
Tree Interface for Making Binned Events with RDataFrame
|
The NanoAOD format only stores the mother index of each generator particle. This often makes it difficult to traverse the decay tree in search of particles that are relevant to an analysis. GenMatching.h houses infrastructure to recreate the relevant parts of the decay chain from the information available.
Note that the classes in GenMatching.h are only useful within the context of another .cc script that is extracting information from the decay tree. There are no one-line function calls that are useful within a TIMBER Define or Cut.
Below is an example of how to isolate the three quarks in an all-hadronic top quark decay and return the number of quarks that are merged inside the reconstructed jet (this is something one has to do for applying top tagging scale factors).
First, one should construct the skeleton of the function.
Here, GenParts is an array of structs that is created dynamically by TIMBER to house the generator particle information by particle rather than by attribute. The type will not be defined prior to compilation which is why we need a template.
Adding to the rest of the code here area, we initialize the tree and some storage objects...
Now we can start filling in the tree and tracking particle we care about (W, non-top quarks)...
With the tree built and all of the Ws and non-top quarks tracked, we'll look for the bottom quark (from the matching top).
Next, look for W (from the matching top) and then get the daughter quarks.
Finally, check how many of the prongs found are within the radius of the jet and return...
At the final line, we enforce that any more than three prongs also be considered a "merged" top.
1.8.13