Browse Source

pid mu cuts in sum, MeV in axis title, move PID cuts on data before BDT

master
Marius Pfeiffer 6 months ago
parent
commit
d6623b8e45
  1. 48
      B0ToHpHmMuMu_results.txt
  2. 58
      B0ToKpPimMuMu_results.txt
  3. 64
      BuToHpMuMu_results.txt
  4. 40
      BuToKpMuMu_results.txt
  5. 8
      mapmc_b02hphmmumu.cpp
  6. 2
      mapmc_bu2hpmumu.cpp
  7. 31
      new_analysis_b02hphmmumu.cpp
  8. 10
      new_analysis_b02kppimmumu.cpp
  9. 28
      new_analysis_bu2hpmumu.cpp
  10. 8
      new_analysis_bu2kpmumu.cpp

48
B0ToHpHmMuMu_results.txt

@ -1,11 +1,11 @@
#### B0ToHpHmMuMu @ Tue Apr 2 10:44:44 2024 ####
J/Psi Mode: 341 #pm 23 / 185 #pm 23
Sig/Bkg: 1.85 #pm 0.26
Psi(2S) Mode: 23 #pm 6 / 43 #pm 11
Sig/Bkg: 0.54 #pm 0.19
Mode Yield Ratio: 0.068 #pm 0.018
#### B0ToHpHmMuMu @ Tue Apr 16 10:40:41 2024 ####
J/Psi Mode: 341 #pm 23 / 202 #pm 25
Sig/Bkg: 1.69 #pm 0.24
Psi(2S) Mode: 25 #pm 7 / 40 #pm 9
Sig/Bkg: 0.62 #pm 0.21
Mode Yield Ratio: 0.072 #pm 0.019
Rel Br Frac MuMu: 7.701 #pm 0.804
Rel Br Frac: 0.522 #pm 0.149
Rel Br Frac: 0.554 #pm 0.157
Fitted Parameters: Simulation
@ -20,13 +20,13 @@ n_{R} = 5.67 \pm 0.73
Fitted Parameters: J/PSI
N_{Sig} = 341 \pm 23
N_{Bkg} = 185 \pm 23
N_{Bkg,2#sigma} = 97 \pm 6
N_{Sig}/N_{Bkg} = 1.85 \pm 0.26
N_{Sig}/N_{Bkg,2#sigma} = 3.53 \pm 0.32
#lambda = -0.00217 \pm 0.00066
#mu = 5270.03 \pm 1.92
#sigma_{LR} = 26.26 \pm 1.98
N_{Bkg} = 202 \pm 25
N_{Bkg,2#sigma} = 95 \pm 6
N_{Sig}/N_{Bkg} = 1.69 \pm 0.23
N_{Sig}/N_{Bkg,2#sigma} = 3.59 \pm 0.32
#lambda = -0.00188 \pm 0.00064
#mu = 5269.98 \pm 1.88
#sigma_{LR} = 26.06 \pm 1.94
#alpha_{L} = 1.72 (c)
n_{L} = 3.34 (c)
#alpha_{R} = 1.76 (c)
@ -34,14 +34,14 @@ n_{R} = 5.67 (c)
Fitted Parameters: PSI(2S)
N_{Sig} = 23 \pm 6
N_{Bkg} = 43 \pm 10
N_{Bkg,2#sigma} = 12 \pm 2
N_{Sig}/N_{Bkg} = 0.54 \pm 0.19
N_{Sig}/N_{Bkg,2#sigma} = 1.93 \pm 0.60
#lambda = -0.00202 \pm 0.00120
#mu = 5267.35 \pm 7.06
#sigma_{LR} = 26.26 (c)
N_{Sig} = 25 \pm 6
N_{Bkg} = 40 \pm 9
N_{Bkg,2#sigma} = 14 \pm 2
N_{Sig}/N_{Bkg} = 0.62 \pm 0.20
N_{Sig}/N_{Bkg,2#sigma} = 1.79 \pm 0.54
#lambda = -0.00355 \pm 0.00217
#mu = 5269.38 \pm 7.62
#sigma_{LR} = 26.06 (c)
#alpha_{L} = 1.72 (c)
n_{L} = 3.34 (c)
#alpha_{R} = 1.76 (c)
@ -50,11 +50,11 @@ n_{R} = 5.67 (c)
# J/psi
\begin{tabular}{c|c}
$N_{Sig}$ & $N_{Bkg}$\\\hline
$341 \pm 23$ & $185 \pm 23$
$341 \pm 23$ & $202 \pm 25$
\end{tabular}
# psi(2S)
\begin{tabular}{c|c}
$N_{Sig}$ & $N_{Bkg}$\\\hline
$23 \pm 6$ & $43 \pm 10$
$25 \pm 6$ & $40 \pm 9$
\end{tabular}

58
B0ToKpPimMuMu_results.txt

@ -1,25 +1,25 @@
#### B0ToKpPimMuMu @ Tue Apr 2 10:46:02 2024 ####
#### B0ToKpPimMuMu @ Wed Apr 10 13:49:34 2024 ####
J/Psi Mode: 305 #pm 21 / 175 #pm 21
Sig/Bkg: 1.74 #pm 0.24
Psi(2S) Mode: 26 #pm 7 / 68 #pm 19
Sig/Bkg: 0.39 #pm 0.15
Psi(2S) Mode: 26 #pm 7 / 67 #pm 18
Sig/Bkg: 0.39 #pm 0.14
Mode Yield Ratio: 0.086 #pm 0.022
Rel Br Frac MuMu: 7.701 #pm 0.804
Rel Br Frac: 0.662 #pm 0.179
Rel Br Frac: 0.661 #pm 0.179
Params from Sim:
aL: 1.74
nL: 3.27
aR: 1.82
nR: 5.82
S: 25.50
nL: 3.47
aR: 1.80
nR: 6.03
S: 25.48
#mu = 5278.97 \pm 0.13
#sigma_{LR} = 15.77 \pm 0.15
#mu = 5278.94 \pm 0.13
#sigma_{LR} = 15.76 \pm 0.15
#alpha_{L} = 1.74 \pm 0.06
n_{L} = 3.27 \pm 0.30
#alpha_{R} = 1.82 \pm 0.07
n_{R} = 5.82 \pm 0.81
n_{L} = 3.47 \pm 0.33
#alpha_{R} = 1.80 \pm 0.07
n_{R} = 6.03 \pm 0.86
Fitted Parameters: J/PSI
@ -27,29 +27,29 @@ N_{Sig} = 305 \pm 21
N_{Bkg} = 175 \pm 20
N_{Bkg,2#sigma} = 98 \pm 6
N_{Sig}/N_{Bkg} = 1.74 \pm 0.23
N_{Sig}/N_{Bkg,2#sigma} = 3.12 \pm 0.28
#lambda = -0.00332 \pm 0.00062
#mu = 5269.84 \pm 1.85
#sigma_{LR} = 25.50 \pm 1.77
N_{Sig}/N_{Bkg,2#sigma} = 3.11 \pm 0.28
#lambda = -0.00333 \pm 0.00062
#mu = 5269.83 \pm 1.85
#sigma_{LR} = 25.48 \pm 1.78
#alpha_{L} = 1.74 (c)
n_{L} = 3.27 (c)
#alpha_{R} = 1.82 (c)
n_{R} = 5.82 (c)
n_{L} = 3.47 (c)
#alpha_{R} = 1.80 (c)
n_{R} = 6.03 (c)
Fitted Parameters: PSI(2S)
N_{Sig} = 26 \pm 6
N_{Bkg} = 68 \pm 19
N_{Bkg} = 67 \pm 18
N_{Bkg,2#sigma} = 11 \pm 2
N_{Sig}/N_{Bkg} = 0.39 \pm 0.14
N_{Sig}/N_{Bkg,2#sigma} = 2.44 \pm 0.78
#lambda = -0.00003 \pm 0.00398
#mu = 5276.41 \pm 6.20
#sigma_{LR} = 25.50 (c)
N_{Sig}/N_{Bkg,2#sigma} = 2.43 \pm 0.76
#lambda = -0.00006 \pm 0.00328
#mu = 5276.43 \pm 6.20
#sigma_{LR} = 25.48 (c)
#alpha_{L} = 1.74 (c)
n_{L} = 3.27 (c)
#alpha_{R} = 1.82 (c)
n_{R} = 5.82 (c)
n_{L} = 3.47 (c)
#alpha_{R} = 1.80 (c)
n_{R} = 6.03 (c)
# J/psi
\begin{tabular}{c|c}
@ -60,5 +60,5 @@ $305 \pm 21$ & $175 \pm 20$
# psi(2S)
\begin{tabular}{c|c}
$N_{Sig}$ & $N_{Bkg}$\\\hline
$26 \pm 6$ & $68 \pm 19$
$26 \pm 6$ & $67 \pm 18$
\end{tabular}

64
BuToHpMuMu_results.txt

@ -1,64 +1,64 @@
#### BuToHpMuMu @ Tue Apr 2 10:44:14 2024 ####
J/Psi Mode: 897 #pm 34 / 402 #pm 30
Sig/Bkg: 2.23 #pm 0.19
Psi(2S) Mode: 69 #pm 12 / 233 #pm 26
Sig/Bkg: 0.30 #pm 0.06
#### BuToHpMuMu @ Tue Apr 16 10:26:25 2024 ####
J/Psi Mode: 919 #pm 35 / 364 #pm 29
Sig/Bkg: 2.52 #pm 0.22
Psi(2S) Mode: 71 #pm 12 / 211 #pm 24
Sig/Bkg: 0.34 #pm 0.07
Mode Yield Ratio: 0.077 #pm 0.013
Rel Br Frac MuMu: 7.701 #pm 0.804
Rel Br Frac: 0.594 #pm 0.116
Rel Br Frac: 0.596 #pm 0.114
Params from Sim:
aL: 1.76
nL: 4.02
nL: 4.01
aR: 1.93
nR: 4.33
S: 23.48
nR: 4.36
S: 23.72
#mu = 5278.16 \pm 0.05
#sigma_{LR} = 16.43 \pm 0.05
#alpha_{L} = 1.76 \pm 0.02
n_{L} = 4.02 \pm 0.16
n_{L} = 4.01 \pm 0.16
#alpha_{R} = 1.93 \pm 0.03
n_{R} = 4.33 \pm 0.19
n_{R} = 4.36 \pm 0.19
Fitted Parameters: J/PSI
N_{Sig} = 897 \pm 34
N_{Bkg} = 402 \pm 30
N_{Bkg,2#sigma} = 246 \pm 9
N_{Sig}/N_{Bkg} = 2.23 \pm 0.19
N_{Sig}/N_{Bkg,2#sigma} = 3.64 \pm 0.19
#lambda = -0.00350 \pm 0.00041
#mu = 5271.03 \pm 0.96
#sigma_{LR} = 23.48 \pm 0.90
N_{Sig} = 919 \pm 34
N_{Bkg} = 364 \pm 28
N_{Bkg,2#sigma} = 250 \pm 9
N_{Sig}/N_{Bkg} = 2.52 \pm 0.22
N_{Sig}/N_{Bkg,2#sigma} = 3.68 \pm 0.19
#lambda = -0.00373 \pm 0.00042
#mu = 5271.10 \pm 0.95
#sigma_{LR} = 23.72 \pm 0.88
#alpha_{L} = 1.76 (c)
n_{L} = 4.02 (c)
n_{L} = 4.01 (c)
#alpha_{R} = 1.93 (c)
n_{R} = 4.33 (c)
n_{R} = 4.36 (c)
Fitted Parameters: PSI(2S)
N_{Sig} = 69 \pm 11
N_{Bkg} = 233 \pm 26
N_{Sig} = 71 \pm 11
N_{Bkg} = 211 \pm 24
N_{Bkg,2#sigma} = 44 \pm 4
N_{Sig}/N_{Bkg} = 0.30 \pm 0.06
N_{Sig}/N_{Bkg,2#sigma} = 1.56 \pm 0.29
#lambda = -0.00142 \pm 0.00056
#mu = 5263.32 \pm 4.14
#sigma_{LR} = 23.48 (c)
N_{Sig}/N_{Bkg} = 0.34 \pm 0.06
N_{Sig}/N_{Bkg,2#sigma} = 1.62 \pm 0.29
#lambda = -0.00169 \pm 0.00058
#mu = 5264.61 \pm 4.01
#sigma_{LR} = 23.72 (c)
#alpha_{L} = 1.76 (c)
n_{L} = 4.02 (c)
n_{L} = 4.01 (c)
#alpha_{R} = 1.93 (c)
n_{R} = 4.33 (c)
n_{R} = 4.36 (c)
# J/psi
\begin{tabular}{c|c}
$N_{Sig}$ & $N_{Bkg}$\\\hline
$897 \pm 34$ & $402 \pm 30$
$919 \pm 34$ & $364 \pm 28$
\end{tabular}
# psi(2S)
\begin{tabular}{c|c}
$N_{Sig}$ & $N_{Bkg}$\\\hline
$69 \pm 11$ & $233 \pm 26$
$71 \pm 11$ & $211 \pm 24$
\end{tabular}

40
BuToKpMuMu_results.txt

@ -1,4 +1,4 @@
#### BuToKpMuMu @ Tue Apr 2 10:45:35 2024 ####
#### BuToKpMuMu @ Wed Apr 10 13:49:05 2024 ####
J/Psi Mode: 815 #pm 35 / 743 #pm 45
Sig/Bkg: 1.10 #pm 0.09
Psi(2S) Mode: 69 #pm 12 / 290 #pm 30
@ -9,32 +9,32 @@ Rel Br Frac: 0.654 #pm 0.132
Params from Sim:
aL: 1.77
nL: 3.86
aR: 1.96
nR: 4.43
S: 24.12
nL: 3.96
aR: 1.95
nR: 4.62
S: 24.11
#mu = 5278.10 \pm 0.05
#sigma_{LR} = 16.35 \pm 0.05
#sigma_{LR} = 16.34 \pm 0.05
#alpha_{L} = 1.77 \pm 0.02
n_{L} = 3.86 \pm 0.16
#alpha_{R} = 1.96 \pm 0.03
n_{R} = 4.43 \pm 0.20
n_{L} = 3.96 \pm 0.16
#alpha_{R} = 1.95 \pm 0.03
n_{R} = 4.62 \pm 0.22
Fitted Parameters: J/PSI
N_{Sig} = 815 \pm 34
N_{Bkg} = 743 \pm 44
N_{Bkg,2#sigma} = 259 \pm 9
N_{Bkg,2#sigma} = 258 \pm 9
N_{Sig}/N_{Bkg} = 1.10 \pm 0.08
N_{Sig}/N_{Bkg,2#sigma} = 3.15 \pm 0.18
#lambda = -0.00207 \pm 0.00031
#mu = 5271.47 \pm 1.08
#sigma_{LR} = 24.12 \pm 1.02
#sigma_{LR} = 24.11 \pm 1.02
#alpha_{L} = 1.77 (c)
n_{L} = 3.86 (c)
#alpha_{R} = 1.96 (c)
n_{R} = 4.43 (c)
n_{L} = 3.96 (c)
#alpha_{R} = 1.95 (c)
n_{R} = 4.62 (c)
Fitted Parameters: PSI(2S)
@ -43,13 +43,13 @@ N_{Bkg} = 290 \pm 30
N_{Bkg,2#sigma} = 53 \pm 5
N_{Sig}/N_{Bkg} = 0.24 \pm 0.05
N_{Sig}/N_{Bkg,2#sigma} = 1.32 \pm 0.25
#lambda = -0.00130 \pm 0.00051
#mu = 5268.10 \pm 4.25
#sigma_{LR} = 24.12 (c)
#lambda = -0.00131 \pm 0.00051
#mu = 5268.09 \pm 4.24
#sigma_{LR} = 24.11 (c)
#alpha_{L} = 1.77 (c)
n_{L} = 3.86 (c)
#alpha_{R} = 1.96 (c)
n_{R} = 4.43 (c)
n_{L} = 3.96 (c)
#alpha_{R} = 1.95 (c)
n_{R} = 4.62 (c)
# J/psi
\begin{tabular}{c|c}

8
mapmc_b02hphmmumu.cpp

@ -69,7 +69,9 @@ int mapmc_b02hphmmumu()
Double_t B0_CHI2_in, B0_CHI2DOF_in,
Jpsi_CHI2_in, Jpsi_CHI2DOF_in,
Hp_PROBNN_K_in, Hp_PID_K_in,
Hm_PROBNN_K_in, Hm_PID_K_in;
Hm_PROBNN_K_in, Hm_PID_K_in,
L1_PID_MU_in,
L2_PID_MU_in;
sim_chain->SetBranchAddress("B0_PT", &B0_PT_in);
sim_chain->SetBranchAddress("B0_BPVFDCHI2", &B0_BPVFDCHI2_in);
@ -99,9 +101,11 @@ int mapmc_b02hphmmumu()
sim_chain->SetBranchAddress("L1_BPVIPCHI2", &L1_BPVIPCHI2_in);
sim_chain->SetBranchAddress("L1_PT", &L1_PT_in);
sim_chain->SetBranchAddress("L1_PID_MU", &L1_PID_MU_in);
sim_chain->SetBranchAddress("L2_BPVIPCHI2", &L2_BPVIPCHI2_in);
sim_chain->SetBranchAddress("L2_PT", &L2_PT_in);
sim_chain->SetBranchAddress("L2_PID_MU", &L2_PID_MU_in);
TTree *output_tree = new TTree("DecayTree", "DecayTree");
@ -192,7 +196,7 @@ int mapmc_b02hphmmumu()
for (unsigned int i = 0; i < sim_entries; i++)
{
sim_chain->GetEntry(i);
if (B_BKGCAT == 30 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && ((TMath::Abs(Hp_TRUEID) == PID_KAON && TMath::Abs(Hm_TRUEID) == PID_PION) || (TMath::Abs(Hp_TRUEID) == PID_PION && TMath::Abs(Hm_TRUEID) == PID_KAON)))
if (B_BKGCAT == 30 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && ((TMath::Abs(Hp_TRUEID) == PID_KAON && TMath::Abs(Hm_TRUEID) == PID_PION) || (TMath::Abs(Hp_TRUEID) == PID_PION && TMath::Abs(Hm_TRUEID) == PID_KAON)) && L1_PID_MU_in > -3. && L2_PID_MU_in > -3.)
{
B0_PT_out = B0_PT_in;
B0_BPVFDCHI2_out = B0_BPVFDCHI2_in;

2
mapmc_bu2hpmumu.cpp

@ -163,7 +163,7 @@ int mapmc_bu2hpmumu()
for (unsigned int i = 0; i < sim_entries; i++)
{
sim_chain->GetEntry(i);
if (B_BKGCAT == 30 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && TMath::Abs(Hp_TRUEID) == PID_KAON)
if (B_BKGCAT == 30 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && TMath::Abs(Hp_TRUEID) == PID_KAON && L1_PID_MU_in > -3. && L2_PID_MU_in > -3.)
{
B_PT_out = B_PT_in;
B_BPVFDCHI2_out = B_BPVFDCHI2_in;

31
new_analysis_b02hphmmumu.cpp

@ -49,8 +49,8 @@ int new_analysis_b02hphmmumu()
const char *analysis_name = "B0ToHpHmMuMu";
const char *data_tree_name = "SpruceRD_B0ToHpHmMuMu";
const char *sim_tree_name = "B0ToHpHmMuMu_noPID_mapped";
const char *end_state_mass_literal = "m(#pi^{+}#pi^{-}_{(#rightarrow K^{-})}#mu^{+}#mu^{-} & #pi^{+}_{(#rightarrow K^{+})}#pi^{-}#mu^{+}#mu^{-})";
const bool retrain_bdt = false;
const char *end_state_mass_literal = "m(#pi^{+}#pi^{-}_{(#rightarrow K^{-})}#mu^{+}#mu^{-} & #pi^{+}_{(#rightarrow K^{+})}#pi^{-}#mu^{+}#mu^{-}) [MeV]";
const bool retrain_bdt = true;
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", data_tree_name));
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/Collision23_Beam6800GeV-VeloClosed-MagDown-Excl-UT_RealData_Sprucing23r1_90000000_RD.root");
@ -231,16 +231,18 @@ int new_analysis_b02hphmmumu()
FillHlt1DecisionHistos(hlt1_decision_histos, reconstructed_B_Mass);
}
double mva_response = reader->EvaluateMVA("BDT");
h1_bdt_probs->Fill(mva_response);
h1_B_Mass_unf->Fill(reconstructed_B_Mass);
if (mva_response > mva_cut_value && kplus_pid_k_var->GetDataDouble() > -3 && (kplus_pid_k_var->GetDataDouble() - piminus_PID_K) > 0)
if (kplus_pid_k_var->GetDataDouble() > -3 && (kplus_pid_k_var->GetDataDouble() - piminus_PID_K) > 0 && TMath::Abs(reconstructed_Kstar.M() - KSTAR_MASS) < 100. && ((TMath::Abs(dimuon.M() - JPSI_MASS) < 100.) || (TMath::Abs(dimuon.M() - PSI2S_MASS) < 100.)))
{
h1_B_Mass_bdtf->Fill(reconstructed_B_Mass);
if (TMath::Abs(reconstructed_Kstar.M() - KSTAR_MASS) < 100.)
double mva_response = reader->EvaluateMVA("BDT");
h1_bdt_probs->Fill(mva_response);
if (mva_response > mva_cut_value)
{
h1_B_Mass_bdtf->Fill(reconstructed_B_Mass);
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
{
B_Mass_jpsi_var = reconstructed_B_Mass;
@ -308,23 +310,30 @@ int new_analysis_b02hphmmumu()
res_file << "Rel Br Frac MuMu: " << ErrToStr(mumu_br_frac, 3) << std::endl;
auto br_frac = MultWithErr(signal_ratio.first, signal_ratio.second, mumu_br_frac.first, mumu_br_frac.second);
res_file << "Rel Br Frac: " << ErrToStr(br_frac, 3) << std::endl << std::endl;
res_file << "Rel Br Frac: " << ErrToStr(br_frac, 3) << std::endl
<< std::endl;
res_file << std::endl << "Fitted Parameters: Simulation" << std::endl << std::endl;
res_file << std::endl
<< "Fitted Parameters: Simulation" << std::endl
<< std::endl;
for (const auto &par : roofit_hist_sim.fitted_params)
{
res_file << par.ToString(true).c_str() << std::endl;
}
res_file << std::endl << "Fitted Parameters: J/PSI" << std::endl << std::endl;
res_file << std::endl
<< "Fitted Parameters: J/PSI" << std::endl
<< std::endl;
for (const auto &par : roofit_hist_jpsi_fitsum.fitted_params)
{
res_file << par.ToString(true).c_str() << std::endl;
}
res_file << std::endl << "Fitted Parameters: PSI(2S)" << std::endl << std::endl;
res_file << std::endl
<< "Fitted Parameters: PSI(2S)" << std::endl
<< std::endl;
for (const auto &par : roofit_hist_psi2s_fitsum.fitted_params)
{

10
new_analysis_b02kppimmumu.cpp

@ -49,7 +49,7 @@ int new_analysis_b02kppimmumu()
const char *analysis_name = "B0ToKpPimMuMu";
const char *data_tree_name = "Hlt2RD_B0ToKpPimMuMu";
const char *sim_tree_name = "B0ToKpPimMuMu_noPID";
const char *end_state_mass_literal = "m(K^{+}#pi^{-}#mu^{+}#mu^{-})";
const char *end_state_mass_literal = "m(K^{+}#pi^{-}#mu^{+}#mu^{-}) [MeV]";
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", data_tree_name));
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/Collision23_Beam6800GeV-VeloClosed-MagDown-Excl-UT_RealData_SprucingPass23r1_94000000_RD.root");
@ -72,12 +72,17 @@ int new_analysis_b02kppimmumu()
FourVect *hm4v_sim = FourVect::Init(sim_chain, "Pi");
Int_t B_BKGCAT, L1_TRUEID, L2_TRUEID, Hp_TRUEID, Hm_TRUEID;
Double_t L1_PID_MU, L2_PID_MU, K_PID_K, PI_PID_K;
sim_chain->SetBranchAddress("L1_TRUEID", &L1_TRUEID);
sim_chain->SetBranchAddress("L2_TRUEID", &L2_TRUEID);
sim_chain->SetBranchAddress("K_TRUEID", &Hp_TRUEID);
sim_chain->SetBranchAddress("Pi_TRUEID", &Hm_TRUEID);
sim_chain->SetBranchAddress("B0_BKGCAT", &B_BKGCAT);
sim_chain->SetBranchAddress("L1_PID_MU", &L1_PID_MU);
sim_chain->SetBranchAddress("L2_PID_MU", &L2_PID_MU);
sim_chain->SetBranchAddress("K_PID_K", &K_PID_K);
sim_chain->SetBranchAddress("Pi_PID_K", &PI_PID_K);
Double_t B_Mass_jpsi_var, B_Mass_psi2s_var, B_Mass_sim_var;
TString B_Mass_jpsi_var_name = "B_Mass_jpsi_var";
@ -115,7 +120,8 @@ int new_analysis_b02kppimmumu()
sim_chain->GetEntry(i);
Double_t reconstructed_B_Mass = (hp4v_sim->LorentzVector() + hm4v_sim->LorentzVector() + l14v_sim->LorentzVector() + l24v_sim->LorentzVector()).M();
h1_B_Mass_sim_unf->Fill(reconstructed_B_Mass);
if (B_BKGCAT == 0 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && TMath::Abs(Hp_TRUEID) == PID_KAON && TMath::Abs(Hm_TRUEID) == PID_PION)
if (B_BKGCAT == 0 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && L1_PID_MU > -3. && L2_PID_MU > -3.
&& TMath::Abs(Hp_TRUEID) == PID_KAON && TMath::Abs(Hm_TRUEID) == PID_PION && K_PID_K > -4. && PI_PID_K < 4.)
{
B_Mass_sim_var = reconstructed_B_Mass;
tree_B_Mass_sim->Fill();

28
new_analysis_bu2hpmumu.cpp

@ -49,8 +49,8 @@ int new_analysis_bu2hpmumu()
const char *analysis_name = "BuToHpMuMu";
const char *data_tree_name = "SpruceRD_BuToHpMuMu";
const char *sim_tree_name = "BuToHpMuMu_noPID_mapped";
const char *end_state_mass_literal = "m(#pi^{+}_{(#rightarrow K^{+})}#mu^{+}#mu^{-})";
const bool retrain_bdt = false;
const char *end_state_mass_literal = "m(#pi^{+}_{(#rightarrow K^{+})}#mu^{+}#mu^{-}) [MeV]";
const bool retrain_bdt = true;
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", data_tree_name));
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/Collision23_Beam6800GeV-VeloClosed-MagDown-Excl-UT_RealData_Sprucing23r1_90000000_RD.root");
@ -222,12 +222,14 @@ int new_analysis_bu2hpmumu()
FillHlt1DecisionHistos(hlt1_decision_histos, reconstructed_B_Mass);
}
h1_B_Mass_unf->Fill(reconstructed_B_Mass);
if (kplus_pid_k_var->GetDataDouble() > -3 && ((TMath::Abs(dimuon.M() - JPSI_MASS) < 100.) || (TMath::Abs(dimuon.M() - PSI2S_MASS) < 100.)))
{
double mva_response = reader->EvaluateMVA("BDT");
h1_bdt_probs->Fill(mva_response);
h1_B_Mass_unf->Fill(reconstructed_B_Mass);
if (mva_response > mva_cut_value && kplus_pid_k_var->GetDataDouble() > -3)
if (mva_response > mva_cut_value)
{
h1_B_Mass_bdtf->Fill(reconstructed_B_Mass);
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
@ -241,6 +243,7 @@ int new_analysis_bu2hpmumu()
tree_B_Mass_psi2s->Fill();
}
}
}
PrintProgress(TString::Format("%s BDT Evaluation", analysis_name), data_entries, 10000, i);
}
@ -296,30 +299,35 @@ int new_analysis_bu2hpmumu()
res_file << "Rel Br Frac MuMu: " << ErrToStr(mumu_br_frac, 3) << std::endl;
auto br_frac = MultWithErr(signal_ratio.first, signal_ratio.second, mumu_br_frac.first, mumu_br_frac.second);
res_file << "Rel Br Frac: " << ErrToStr(br_frac, 3) << std::endl << std::endl;
res_file << "Rel Br Frac: " << ErrToStr(br_frac, 3) << std::endl
<< std::endl;
res_file << "Params from Sim:" << std::endl << roofit_hist_sim.shape_parameters.ToString() << std::endl;
res_file << "Params from Sim:" << std::endl
<< roofit_hist_sim.shape_parameters.ToString() << std::endl;
for (const auto &par : roofit_hist_sim.fitted_params)
{
res_file << par.ToString(true).c_str() << std::endl;
}
res_file << std::endl << "Fitted Parameters: J/PSI" << std::endl << std::endl;
res_file << std::endl
<< "Fitted Parameters: J/PSI" << std::endl
<< std::endl;
for (const auto &par : roofit_hist_jpsi_fitsum.fitted_params)
{
res_file << par.ToString(true).c_str() << std::endl;
}
res_file << std::endl << "Fitted Parameters: PSI(2S)" << std::endl << std::endl;
res_file << std::endl
<< "Fitted Parameters: PSI(2S)" << std::endl
<< std::endl;
for (const auto &par : roofit_hist_psi2s_fitsum.fitted_params)
{
res_file << par.ToString(true).c_str() << std::endl;
}
auto print_table = [&res_file](std::string name, std::pair<double, double> sig, std::pair<double, double> bkg)
{
res_file << std::endl;

8
new_analysis_bu2kpmumu.cpp

@ -49,7 +49,7 @@ int new_analysis_bu2kpmumu()
const char *analysis_name = "BuToKpMuMu";
const char *data_tree_name = "Hlt2RD_BuToKpMuMu";
const char *sim_tree_name = "BuToKpMuMu_noPID";
const char *end_state_mass_literal = "m(K^{+}#mu^{+}#mu^{-})";
const char *end_state_mass_literal = "m(K^{+}#mu^{+}#mu^{-}) [MeV]";
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", data_tree_name));
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/Collision23_Beam6800GeV-VeloClosed-MagDown-Excl-UT_RealData_SprucingPass23r1_94000000_RD.root");
@ -66,11 +66,15 @@ int new_analysis_bu2kpmumu()
FourVect *hp4v_sim = FourVect::Init(sim_chain, "K");
Int_t B_BKGCAT, L1_TRUEID, L2_TRUEID, Hp_TRUEID;
Double_t L1_PID_MU, L2_PID_MU, K_PID_K;
sim_chain->SetBranchAddress("L1_TRUEID", &L1_TRUEID);
sim_chain->SetBranchAddress("L2_TRUEID", &L2_TRUEID);
sim_chain->SetBranchAddress("K_TRUEID", &Hp_TRUEID);
sim_chain->SetBranchAddress("B_BKGCAT", &B_BKGCAT);
sim_chain->SetBranchAddress("L1_PID_MU", &L1_PID_MU);
sim_chain->SetBranchAddress("L2_PID_MU", &L2_PID_MU);
sim_chain->SetBranchAddress("K_PID_K", &K_PID_K);
Double_t B_Mass_jpsi_var, B_Mass_psi2s_var, B_Mass_sim_var;
TString B_Mass_jpsi_var_name = "B_Mass_jpsi_var";
@ -108,7 +112,7 @@ int new_analysis_bu2kpmumu()
sim_chain->GetEntry(i);
Double_t reconstructed_B_Mass = (hp4v_sim->LorentzVector() + l14v_sim->LorentzVector() + l24v_sim->LorentzVector()).M();
h1_B_Mass_sim_unf->Fill(reconstructed_B_Mass);
if (B_BKGCAT == 0 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && TMath::Abs(Hp_TRUEID) == PID_KAON)
if (B_BKGCAT == 0 && TMath::Abs(L1_TRUEID) == PID_MUON && L2_TRUEID == -L1_TRUEID && TMath::Abs(Hp_TRUEID) == PID_KAON && L1_PID_MU > -4. && L2_PID_MU > -4. && K_PID_K > -4.)
{
B_Mass_sim_var = reconstructed_B_Mass;
tree_B_Mass_sim->Fill();

Loading…
Cancel
Save