Skip to content

Beta version 1.1

Compare
Choose a tag to compare
@lcorcodilos lcorcodilos released this 26 Oct 14:38
· 324 commits to master since this release
620df99

NOTE: These are copied excerpts from #16

Benchmarks

  • Benchmarks 1-9 added in benchmarks/ex*.py. Some internal comments included about what was done. The CMS Open Data sample included in the examples/ folder does not have electrons so it was not used for benchmarks 7 or 8 (these need the tester to use their own private file which this repo does not provide).
  • Filled out more of the general testing with pytest.

New to analyzer

  • Close(): Implemented to safely delete an analyzer instance.
  • __str__: Implemented to provide an informational printout when print(<analyzer>) is called.
  • Can specify Node type as Cut and Define argument if you have a specific type you'd like to track.
  • SubCollection(): Creates a named sub-collection based on some discriminant where the sub-collection has all of the same branches as the parent but only includes vector entries that passed the discriminant.
    NOTE: myColl_var1 is an RVec and so myColl_var1 > 5 returns a vector the same size as myColl_var1 but filled with bools for each entry. These bools determine which entries of the RVecs of the sub-collection branches are made.
a = analyzer(...)
# Say there is a collection "myColl" with branches "myColl_var1", "myColl_var2", "myColl_var3"
a.SubCollection("mySubColl","myColl","myColl_var1 > 5")
# Now there is a new collection "mySubColl" with branches "mySubColl_var1", "mySubColl_var2", "mySubColl_var3"
# which only have values where myColl_var1 > 5
  • MergeCollections(): Creates a new collection which is a merge of all provided collections. New collection has variables that are common between collections being merged.
  • CommonVars(): Finds the common variables between a set of collections (provided as a list of names).
  • PrintNodeTree(): Added optional argument toSkip=[] which skips plotting any nodes of types specified by toSkip. Note that the function checks for the type in toSkip as a substring of the type of the Node. So if you provide toSkip=["Define"] all nodes of type "MergeDefine" and "SubCollDefine" will also be dropped.
    • Also switched to using networkx (which uses pygraphviz).
  • MakeHistsWithBinning(): Batch creates histograms at the current ActiveNode based on the input histDict which is formatted as {[<column name>]: <binning tuple>}. The dimensions of the returned histograms are determined from the size of [<column name>].
    • [<column name>] is a list of column names that you'd like to plot against each other in [x,y,z] order
    • binning_tuple is the set of arguments that would normally be passed to TH1.

New to Node

  • Add "types" to Nodes to denote what was done to produce the Node. Currently used for controlling nodes present in PrintNodeTree() output. Current possible types are "Define", "Cut", "MergeDefine", "SubCollDefine", "Correction".
  • Close(): Implemented to safely delete a Node instance.
  • __str__: Implemented to provide an informational printout when print(<node>) is called.

New to HistGroup

  • Merge(): Adds together all of the histograms in the group and returns the output histogram.

New to C++ Code

common.h

  • transverseMass() to get transverse mass of MET + one object. Could be more generalized.
  • 2nd constructor for TLvector() that takes RVecs as arguments rather than floats (returns back an RVec of PtEtaPhiMVectors)

Small bug fixes

  • Fix Common.py TIMBER imports
  • Make fileName attribute public (used for new __str__ method for printing analyzer object)
  • Add BaseNode to AllNodes for tracking
  • Force BaseNode to zero children on initialization to avoid memory issues
  • Fix Group addition