Beta version 1.1
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 whenprint(<analyzer>)
is called.- Can specify Node type as
Cut
andDefine
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 anRVec
and somyColl_var1 > 5
returns a vector the same size asmyColl_var1
but filled with bools for each entry. These bools determine which entries of theRVec
s 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 argumenttoSkip=[]
which skips plotting any nodes of types specified bytoSkip
. Note that the function checks for the type intoSkip
as a substring of the type of the Node. So if you providetoSkip=["Define"]
all nodes of type "MergeDefine" and "SubCollDefine" will also be dropped.- Also switched to using
networkx
(which usespygraphviz
).
- Also switched to using
MakeHistsWithBinning()
: Batch creates histograms at the currentActiveNode
based on the inputhistDict
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] orderbinning_tuple
is the set of arguments that would normally be passed toTH1
.
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 whenprint(<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 takesRVec
s as arguments rather than floats (returns back anRVec
ofPtEtaPhiMVector
s)
Small bug fixes
- Fix
Common.py
TIMBER imports - Make
fileName
attribute public (used for new__str__
method for printinganalyzer
object) - Add
BaseNode
toAllNodes
for tracking - Force
BaseNode
to zero children on initialization to avoid memory issues - Fix
Group
addition