Skip to content
Snippets Groups Projects
Unverified Commit 4a94ff9e authored by lcorcodilos's avatar lcorcodilos Committed by GitHub
Browse files

Merge pull request #19 from lcorcodilos/module_dev

# Change log
Added tested C++ modules (with documentation) and documented those that existed without docs. Testing obviously led to other fixes and improvements throughout.

## Setup/install
- Added `boost` dependency information to main README.md (needed for `LumiFilter.h`)

## Modules
- Added **GenMatching.h** which can be used to reconstruct the entire generator particle decay tree from the mother indexes stored in the NanoAOD. This is useful for traversing the entire decay chain with relative ease. Example added in `How to use GenMatching.h`.
- Added **LumiFilter.h** which can be used in conjunction with the newly added golden JSONs to filter data based on the JSONs.
- Added **HistLoader.h** which can be used to load in a histogram once before processing, with access to the histogram via the class methods while looping over the RDataFrame entries. The `eval` module returns based on the input axis value and `eval_bybin` returns based on the provided bin number.
- Added **TopPt_weight.cc** which calculates the top pT correction from the [TOP group](https://twiki.cern.ch/twiki/bin/viewauth/CMS/TopPtReweighting) based on the data/POWHEG+Pythia8 fit. The nominal correction is calculated with the `corr()` method and variations of the constants in the exponential form can be calculated using the `alpha()` and `beta()` methods.
- Added **Trigger_weight.cc** which is uses `HistLoader.h` to load a trigger efficiency histogram. The `eval()` method returns the efficiency for that event (based on the input variable, of course) and calculates the uncertainty as one-half the trigger inefficiency.
- **Rename "analyzer" namespace to "hardware" in `common.h`**. Done for clarity in the documentation to avoid confusion with the `Analyzer` python namespace (aka Analyzer.py). 
- Change `hardware::invariantMass()` argument to be a vector of Lorentz vectors. Invariant mass of all provided vectors is calculated.
- Moved `Framework/src/Collection.cc` to `Framework/include/Collection.h`

## Testing
- Added a draft of **test_modules.py** which features an example for TopPt_weight.cc but it is currently commented out because the test file does not have the `GenPart` collection or the `FatJet` collection (and is also not a ttbar set)
- Added **make_test_file.py** to make a small testing histogram.
- Added small testing histogram generated by `make_test_file.py`.

## Data
- Added golden JSONs for 2017 and 2018 and added info to the README ledger. It seems 2016 does not have a golden JSON anymore (?)

## Analyzer
- Add `corr` type for `Correction()` class. It represents a corrections with no uncertainty. The clang parsing CANNOT currently derive it automatically from the C++ script but it can be assigned as the `corrtype` via the argument to `Correction()` constructor.
- Optimized `MakeTemplateHistos()` to book histogram actions before looping. They previously looped over the dataframe one after the other. This provides a significant speed up.

## More documentation
- Added page on how to use GenMatching.h in a custom C++ module with the example of finding how many prongs are merged in a top jet.
- Added docs to `Pythonic.h`
- Added docs to `common.h`
- Added docs to `PDFweight_uncert.cc`
- Added docs to `SJBtag_SF.cc`
- Consolidate the READMEs for sections so the webpage makes more sense.
- Switch to MathJax for formula rendering

## Small bug fixes
- More robust python version checking for ASCII encoding in `OpenJSON()`.
parents 9a2f8696 171519ba
Branches
Tags v0.1.2
No related merge requests found
Showing
with 1266 additions and 200 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment