umd-lhcb / lhcb-ntuples-gen

ntuples generation with DaVinci and in-house offline components
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Fake D** pi0pi0 component in D** heavy MC #121

Closed yipengsun closed 1 year ago

yipengsun commented 1 year ago

Due to a bug in the $D^{**}$ heavy .dec file, no $D^{**} \pi^0 \pi^0$ event is generated. According to the Clebsch-Gordon table, the $\pi^0 \pi^0$ vs. $\pi^+ \pi^-$ should be about 1/2.

We can fake the $\pi^0 \pi^0$ component by randomly selecting 1/3 of $\pi^+ \pi^-$, and set its isolation BDT score to 0 (i.e. isolated).

This is a bug spotted by @CoffeeIntoScience when looking at step-3 fit log.

@afernez I'm looking at our truth-matching nomenclature again: https://umd-lhcb.github.io/lhcb-ntuples-gen/technical_concepts/truth_matching/

It seems that we don't differentiate between $\pi^0 \pi^0$ and $\pi^+ \pi^-$ right? This is not a problem, as RD+'s tuple tool extract truth info up to B grand-daughter, and the dec file (12675010) seems to have NO cascade $\pi \pi$ decay so looking at a heavy $D^{**}$ should be sufficient (as Phoebe pointed out):

Decay B-sig 

  0.05  MyD*(2S)0      mu-  anti-nu_mu         PHOTOS  ISGW2;
  0.45  MyD(2S)0       mu-  anti-nu_mu         PHOTOS  ISGW2;
  0.45  MyD(2750)0     mu-  anti-nu_mu         PHOTOS  ISGW2;
  0.05  MyD(3000)0     mu-  anti-nu_mu         PHOTOS  ISGW2;

Enddecay
CDecay B+sig

Decay MyD*(2S)0 
0.08     MyD0 pi+ pi-                     PHOTOS PHSP;
Enddecay
CDecay MyAntiD*(2S)0

Decay MyD(2S)0 
0.08     MyD0 pi+ pi-                     PHOTOS PHSP;
Enddecay
CDecay MyAntiD(2S)0

Decay MyD(2750)0 
0.08     MyD0 pi+ pi-                     PHOTOS PHSP;
Enddecay
CDecay MyAntiD(2750)0

Decay MyD(3000)0 
0.08     MyD0 pi+ pi-                     PHOTOS PHSP;
Enddecay
CDecay MyAntiD(3000)0

Decay MyD0
  1.00   K-  pi+                           PHOTOS PHSP;
Enddecay
CDecay MyAntiD0
yipengsun commented 1 year ago

I think I can get away by just checking the third digit from Alex's truthmatching code.

yipengsun commented 1 year ago

I used the correct truth-matching code, and it looks like it's working: iso_bdt iso_bdt_diff iso_bdt_raw

yipengsun commented 1 year ago

@afernez I think the truth-matching document needs updating/clarification: https://umd-lhcb.github.io/lhcb-ntuples-gen/technical_concepts/truth_matching/

I was led to believe that $D^{**}$ heavy should have a truth-matching code of 400, instead of 400400 (even though the example below listed the correct value). Can you update on why b1b2 can be non-0?

yipengsun commented 1 year ago

Oh I see, I was wrong. You stated that for $D^{**}$ heavy, the left-most digit would be either 3 or 4. My bad.

yipengsun commented 1 year ago

Looking at some updated $D^{**}$ heavy templates:

d0_dsthmudst

The ISO changed shape (due to addition of fake $D^{**} (\text{heavy}) \pi^0 \pi^0$, but the rest 3 do not change much.

I think this makes sense, as we randomly (uniformly) select 1/3 of total sample to fake, so there should be about 1/3 of samples in each skim that got chosen.

yipengsun commented 1 year ago

Not all $D^{**}$ heavy are $\pi^+ \pi^-$. Some of them are $\pi^+ \pi^0$. So I need to make sure the $\pi^+ \pi^0$ are not affect by this faking procedure.

yipengsun commented 1 year ago

CTRL

Previously, in the control fit:

103: fpipiratio1OS           = 1.11625 +/- 0.56278
104: fpipiratio2OS           = 0.182803 +/- 0.0803794
105: fpipiratioDD            = 1.65124 +/- 0.47471
106: fppipiratio1OS          = 0.000100246 +/- 0.0915764
107: fppipiratio2OS          = 0.000100001 +/- 0.0337221
108: fppipiratioDD           = 0.400168 +/- 0.24407
109: fzpipiratio1OS          = 0.688618 +/- 0.624178
110: fzpipiratio2OS          = 0.626734 +/- 0.0761429
111: fzpipiratioDD           = 0.88695 +/- 0.390446

Now:

103: fpipiratio1OS           = 0.733319 +/- 0.362797
104: fpipiratio2OS           = 0.187967 +/- 0.0687233
105: fpipiratioDD            = 1.48643 +/- 0.372764
106: fppipiratio1OS          = 0.0145499 +/- 0.411652
107: fppipiratio2OS          = 0.0001 +/- 0.0560909
108: fppipiratioDD           = 1.06207 +/- 0.274902
109: fzpipiratio1OS          = 1.93883 +/- 0.275578
110: fzpipiratio2OS          = 0.805841 +/- 0.0657347
111: fzpipiratioDD           = 0.737627 +/- 0.345952

SIG

Previous:

59: fpipiratio           = 3.13383 +/- 0.474439
60: fppipiratio          = 0.00010083 +/- 0.0524455
61: fzpipiratio          = 0.000100711 +/- 2.08884

Now:

59: fpipiratio           = 9.4741 +/- 0.240307
60: fppipiratio          = 0.000100889 +/- 0.254852
61: fzpipiratio          = 0.000110212 +/- 2.12116

It's not significantly better.

yipengsun commented 1 year ago

The histogram comparisons: comp_no_pi0pi0_fix.pdf

yipengsun commented 1 year ago

Phoebe will do a similar comparison on her templates w/ and w/o pi0pi0 fix to see if the effects are similar to us.

yipengsun commented 1 year ago

Tried to allow fzpipi, fppipi go negative. Doesn't work for step-3 signal fit: https://github.com/umd-lhcb/rdx-run2-analysis/issues/80#issuecomment-1295992823

yipengsun commented 1 year ago

Just checked again: Running the pi0pi0 faking procedure on 2 MC:

12675011

Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, but don't change isolation.
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated
Found a heavy D**: Event pi+pi- only, set to isolated

11674401

Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
Found a heavy D**: Event contains a pi0, skipping...
yipengsun commented 1 year ago

Phoebe shared her templates w/ and w/o pi0pi0 fix for D** heavy.

We should put them in our rdx-run2-analysis repo:

And define the spec.yml accordingly.

Then generate comparison slides (run inside fit/inputs):

plot_diff_fit_templates.py  <pi0pi0_fix> <no_pi0pi0_fix>   ../gen -N "run 1" -R "run 1 no fix" -a 
yipengsun commented 1 year ago

@afernez For now it's on Alex's plate.

afernez commented 1 year ago

Sorry, I think you said Phoebe's shared ntuples were on CERNBox, but I think I'm looking in the wrong place. Can you link to where they are?

afernez commented 1 year ago

Nevermind... got them.

afernez commented 1 year ago

Here comp_no_pi0pi0_fix_run1.pdf are the comparison histograms for run1 (Phoebe's $D^{**}_{H}$ templates with and without faked $\pi^+ \pi^- \rightarrow \pi^0 \pi^0$ fix), generated using histos-noHeavyDstst2Xpi0pi0 and histos-withHeavyDstst2Xpi0pi0faked from this shared CERNBox folder.

In general, the run1 and run2 (plots in file linked to in Yipeng's comment above in issue) show similar trends:

yipengsun commented 1 year ago

Good job! I think at this point we can say that our $\pi^0\pi^0$ fix is probably bug-free.

yipengsun commented 1 year ago

Reported in GM and consider this done.