Skip to content

Commit

Permalink
Merge pull request #811 from ajgilbert/update-tutorial-for-113x
Browse files Browse the repository at this point in the history
Fix tutorial cards for part3, update docs, fix channel masks
  • Loading branch information
ajgilbert committed Jan 25, 2023
2 parents b08e1f3 + 4318102 commit 2327617
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 52 deletions.
4 changes: 2 additions & 2 deletions data/tutorials/longexercise/datacard_part3_DY_cr.txt
Expand Up @@ -12,7 +12,7 @@ process W QCD Zmumu ttbar
process 1 2 3 4 5 6
rate 59.9999 141.725 305423 34341.1 5273.43 115.34
--------------------------------------------------------------------------------
CMS_eff_m lnN - - 1.04 1.04 - -
acceptance_DY_cr lnN - - 1.02 - - -
CMS_eff_m lnN - - - 1.04 - -
acceptance_DY_cr lnN - - 1.005 - - -
lumi_13TeV lnN 1.025 - - - 1.025 1.025
* autoMCStats 0
6 changes: 3 additions & 3 deletions data/tutorials/longexercise/datacard_part3_ttbar_cr.txt
Expand Up @@ -12,9 +12,9 @@ process W QCD ttbar VV
process 1 2 3 4 5
rate 597.336 308.965 67280.4 10589.6 150.025
--------------------------------------------------------------------------------
CMS_eff_e lnN 1.02 - 1.02 1.02 1.02
CMS_eff_m lnN 1.02 - 1.02 1.02 1.02
CMS_eff_e lnN 1.02 - - 1.02 1.02
CMS_eff_m lnN 1.02 - - 1.02 1.02
acceptance_ttbar_cr lnN - - 1.01 - -
lumi_13TeV lnN 1.025 - 1.025 1.025 1.025
lumi_13TeV lnN 1.025 - - 1.025 1.025
top_pt_ttbar_shape shape - - 1 - -
* autoMCStats 0
Binary file modified docs/part3/images/impacts.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/part5/images/freeze_first_attempt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/part5/images/freeze_second_attempt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 39 additions & 42 deletions docs/part5/longexercise.md
Expand Up @@ -408,16 +408,16 @@ shapes * signal_region datacard_part3.shapes.root signal_region/$P
shapes bbHtautau signal_region datacard_part3.shapes.root signal_region/bbHtautau$MASS signal_region/bbHtautau$MASS_$SYSTEMATIC
shapes * ttbar_cr datacard_part3_ttbar_cr.shapes.root tt_control_region/$PROCESS tt_control_region/$PROCESS_$SYSTEMATIC
----------------------------------------------------------------------------------------------------------------------------------
bin signal_region ttbar_cr DY_cr
observation 3416 79251 365754
bin signal_region ttbar_cr DY_cr
observation 3416 79251 365754
----------------------------------------------------------------------------------------------------------------------------------
bin signal_region signal_region signal_region signal_region signal_region ttbar_cr ttbar_cr ttbar_cr ttbar_cr ttbar_cr DY_cr DY_cr DY_cr DY_cr DY_cr DY_cr
process bbHtautau ttbar diboson Ztautau jetFakes Ztautau ttbar VV W QCD W Ztautau VV QCD ttbar Zmumu
process 0 1 2 3 4 3 1 5 6 7 6 3 5 7 1 8
rate 198.521 683.017 96.5185 742.649 2048.94 150.025 67280.4 10589.6 597.336 308.965 59.9999 115.34 5273.43 141.725 34341.1 305423
bin signal_region signal_region signal_region signal_region signal_region ttbar_cr ttbar_cr ttbar_cr ttbar_cr ttbar_cr DY_cr DY_cr DY_cr DY_cr DY_cr DY_cr
process bbHtautau ttbar diboson Ztautau jetFakes W QCD ttbar VV Ztautau W QCD Zmumu ttbar VV Ztautau
process 0 1 2 3 4 5 6 1 7 3 5 6 8 1 7 3
rate 198.521 683.017 96.5185 742.649 2048.94 597.336 308.965 67280.4 10589.6 150.025 59.9999 141.725 305423 34341.1 5273.43 115.34
----------------------------------------------------------------------------------------------------------------------------------
CMS_eff_b lnN 1.02 1.02 1.02 1.02 - - - - - - - - - - - -
CMS_eff_e lnN - - - - - 1.02 1.02 1.02 1.02 - - - - - - -
CMS_eff_b lnN 1.02 1.02 1.02 1.02 - - - - - - - - - - - -
CMS_eff_e lnN - - - - - 1.02 - - 1.02 1.02 - - - - - -
...
```
</details>
Expand Down Expand Up @@ -546,37 +546,37 @@ root [1] limit->Scan("r:deltaNLL")
************************************
* Row * r * deltaNLL *
************************************
* 0 * 0.5010952 * 0 *
* 1 * -0.949999 * 5.0565371 *
* 2 * -0.850000 * 4.4238944 *
* 3 * -0.75 * 3.8230235 *
* 4 * -0.649999 * 3.2571268 *
* 5 * -0.550000 * 2.7290999 *
* 6 * -0.449999 * 2.2421050 *
* 7 * -0.349999 * 1.7986002 *
* 8 * -0.25 * 1.4009695 *
* 9 * -0.150000 * 1.0512697 *
* 10 * -0.050000 * 0.7508889 *
* 11 * 0.0500000 * 0.5007593 *
* 12 * 0.1500000 * 0.3015080 *
* 13 * 0.25 * 0.1530667 *
* 14 * 0.3499999 * 0.0549822 *
* 15 * 0.4499999 * 0.0062253 *
* 16 * 0.5500000 * 0.0055419 *
* 17 * 0.6499999 * 0.0512909 *
* 18 * 0.75 * 0.1416319 *
* 19 * 0.8500000 * 0.2743169 *
* 20 * 0.9499999 * 0.4471097 *
* 21 * 1.0499999 * 0.6578967 *
* 22 * 1.1499999 * 0.9042429 *
* 23 * 1.25 * 1.1838192 *
* 24 * 1.3500000 * 1.4944315 *
* 25 * 1.4500000 * 1.8335464 *
* 26 * 1.5499999 * 2.1993224 *
* 27 * 1.6499999 * 2.5896029 *
* 28 * 1.75 * 3.0024433 *
* 29 * 1.8500000 * 3.4359285 *
* 30 * 1.9500000 * 3.8883554 *
* 0 * 0.5399457 * 0 *
* 1 * -0.949999 * 5.6350698 *
* 2 * -0.850000 * 4.9482779 *
* 3 * -0.75 * 4.2942519 *
* 4 * -0.649999 * 3.6765284 *
* 5 * -0.550000 * 3.0985388 *
* 6 * -0.449999 * 2.5635135 *
* 7 * -0.349999 * 2.0743820 *
* 8 * -0.25 * 1.6337506 *
* 9 * -0.150000 * 1.2438088 *
* 10 * -0.050000 * 0.9059833 *
* 11 * 0.0500000 * 0.6215767 *
* 12 * 0.1500000 * 0.3910581 *
* 13 * 0.25 * 0.2144184 *
* 14 * 0.3499999 * 0.0911308 *
* 15 * 0.4499999 * 0.0201983 *
* 16 * 0.5500000 * 0.0002447 *
* 17 * 0.6499999 * 0.0294311 *
* 18 * 0.75 * 0.1058298 *
* 19 * 0.8500000 * 0.2272539 *
* 20 * 0.9499999 * 0.3912534 *
* 21 * 1.0499999 * 0.5952836 *
* 22 * 1.1499999 * 0.8371513 *
* 23 * 1.25 * 1.1142146 *
* 24 * 1.3500000 * 1.4240909 *
* 25 * 1.4500000 * 1.7644306 *
* 26 * 1.5499999 * 2.1329684 *
* 27 * 1.6499999 * 2.5273966 *
* 28 * 1.75 * 2.9458723 *
* 29 * 1.8500000 * 3.3863399 *
* 30 * 1.9500000 * 3.8469560 *
************************************
```
</details>
Expand Down Expand Up @@ -715,6 +715,3 @@ For a model with two POIs it is often useful to look at the how well we are able

- Run a 2D likelihood scan in `r_ggH` and `r_bbH`. You can start with around 100 points but may need to increase this later too see more detail in the resulting plot.
- Have a look at the output limit tree, it should have branches for each POI as well as the usual deltaNLL value. You can use TTree::Draw to plot a 2D histogram of deltaNLL with `r_ggH` and `r_bbH` on the axes.



8 changes: 4 additions & 4 deletions docs/part5/longexerciseanswers.md
Expand Up @@ -148,21 +148,21 @@ Only tasks, no questions in this section
<details>
<summary><b>Show answer</b></summary>

<b> As expected uncertainty you should get <code> -0.42542/+0.458748 </code> </b>
<b> As expected uncertainty you should get <code> -0.417238/+0.450593 </code> </b>

</details>
- Using the RooFitResult in the `fitdiagnostics.root` file, check the post-fit value of the rateParams. To what level are the normalisations of the DY and ttbar processes constrained?
- Using the RooFitResult in the `fitDiagnosticsTest.root` file, check the post-fit value of the rateParams. To what level are the normalisations of the DY and ttbar processes constrained?
<details>
<summary><b>Show answer</b></summary>

<b> They are constrained to around 4-5% </b>
<b> They are constrained to around 1-2% </b>

</details>
- To compare to the previous approach of fitting the SR only, with cross section and acceptance uncertainties restored, an additional card is provided: `datacard_part3_nocrs.txt`. Run the same fit on this card to verify the improvement of the SR+CR approach
<details>
<summary><b>Show answer</b></summary>

<b> The expected uncertainty is larger with only the SR: <code> -0.463273/+0.499161 </code> compared with <code> -0.42542/+0.458748 </code> in the SR+CR approach. </b>
<b> The expected uncertainty is larger with only the SR: <code> -0.465799/+0.502088 </code> compared with <code> -0.417238/+0.450593 </code> in the SR+CR approach. </b>

</details>

Expand Down
2 changes: 1 addition & 1 deletion src/Combine.cc
Expand Up @@ -341,7 +341,7 @@ void Combine::run(TString hlfFile, const std::string &dataset, double &limit, do
if (POI->getSize() > 1) std::cerr << "ModelConfig '" << modelConfigName_ << "' defines more than one parameter of interest. This is not supported in some statistical methods." << std::endl;
if (mc->GetObservables() == 0) throw std::invalid_argument("ModelConfig '"+modelConfigName_+"' does not define observables.");
if (mc->GetPdf() == 0) throw std::invalid_argument("ModelConfig '"+modelConfigName_+"' does not define a pdf.");
if (auto pdf = dynamic_cast<RooSimultaneous*>(mc->GetPdf()); pdf!=nullptr) {
if (auto pdf = dynamic_cast<RooSimultaneous*>(mc->GetPdf()); pdf!=nullptr && dynamic_cast<RooSimultaneousOpt*>(pdf)==nullptr) {
if (rebuildSimPdf_) {
pdf = utils::rebuildSimPdf(*mc->GetObservables(), pdf);
w->import(*pdf);
Expand Down

0 comments on commit 2327617

Please sign in to comment.