2024-02-21 16:34:42 +01:00
|
|
|
#include "TH1D.h"
|
|
|
|
#include "TH2D.h"
|
|
|
|
#include "THStack.h"
|
|
|
|
#include "TGraph.h"
|
|
|
|
#include "TTree.h"
|
|
|
|
#include "TChain.h"
|
|
|
|
#include "TFile.h"
|
|
|
|
#include "TCanvas.h"
|
|
|
|
#include "TROOT.h"
|
|
|
|
#include "TStyle.h"
|
|
|
|
#include "TColor.h"
|
|
|
|
#include "TLorentzVector.h"
|
|
|
|
#include "TRandom3.h"
|
|
|
|
#include "TLegend.h"
|
|
|
|
|
|
|
|
#include "RooDataHist.h"
|
|
|
|
#include "RooRealVar.h"
|
|
|
|
#include "RooPlot.h"
|
|
|
|
#include "RooGaussian.h"
|
|
|
|
#include "RooExponential.h"
|
|
|
|
#include "RooRealConstant.h"
|
|
|
|
#include "RooAddPdf.h"
|
|
|
|
#include "RooFitResult.h"
|
|
|
|
#include "RooProduct.h"
|
|
|
|
#include "RooCrystalBall.h"
|
|
|
|
#include "RooBreitWigner.h"
|
|
|
|
#include "RooArgSet.h"
|
|
|
|
#include "RooFFTConvPdf.h"
|
|
|
|
#include "RooNovosibirsk.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
|
|
|
#include <cmath>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <filesystem>
|
|
|
|
|
|
|
|
const Double_t B_MASS_VAR_MIN = 5100.;
|
|
|
|
const Double_t B_MASS_VAR_MAX = 6000.;
|
|
|
|
const Int_t B_MASS_HIST_BINS = 70;
|
|
|
|
|
|
|
|
const Double_t K_MASS = 493.677;
|
|
|
|
const Double_t PSI2S_MASS = 3686.093;
|
|
|
|
const Double_t JPSI_MASS = 3096.900;
|
|
|
|
const Double_t KSTAR_MASS = 891.760;
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
const int PID_KAON = 321;
|
|
|
|
const int PID_PION = 211;
|
|
|
|
const int PID_MUON = 13;
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
class FourVect
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
Float_t px, py, pz, energy;
|
|
|
|
|
|
|
|
Float_t *PtrPX()
|
|
|
|
{
|
|
|
|
return &px;
|
|
|
|
}
|
|
|
|
|
|
|
|
Float_t *PtrPY()
|
|
|
|
{
|
|
|
|
return &py;
|
|
|
|
}
|
|
|
|
|
|
|
|
Float_t *PtrPZ()
|
|
|
|
{
|
|
|
|
return &pz;
|
|
|
|
}
|
|
|
|
|
|
|
|
Float_t *PtrEnergy()
|
|
|
|
{
|
|
|
|
return &energy;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
static FourVect *Init(TTree *tree, const char *particle)
|
|
|
|
{
|
|
|
|
FourVect *v = new FourVect{};
|
|
|
|
tree->SetBranchAddress(TString::Format("%s_PX", particle).Data(), v->PtrPX());
|
|
|
|
tree->SetBranchAddress(TString::Format("%s_PY", particle).Data(), v->PtrPY());
|
|
|
|
tree->SetBranchAddress(TString::Format("%s_PZ", particle).Data(), v->PtrPZ());
|
|
|
|
tree->SetBranchAddress(TString::Format("%s_ENERGY", particle).Data(), v->PtrEnergy());
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
|
|
|
TLorentzVector LorentzVector()
|
|
|
|
{
|
|
|
|
return TLorentzVector(px, py, pz, energy);
|
|
|
|
}
|
|
|
|
|
|
|
|
TLorentzVector LorentzVector(double sub_mass)
|
|
|
|
{
|
|
|
|
TVector3 momentum(px, py, pz);
|
|
|
|
float energy = TMath::Sqrt(TMath::Sq(sub_mass) + momentum.Mag2());
|
|
|
|
return TLorentzVector(momentum, energy);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string ToString()
|
|
|
|
{
|
|
|
|
return TString::Format("(%f, %f, %f, %f)", px, py, pz, energy).Data();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Hlt1Decision
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
int index;
|
|
|
|
Bool_t value;
|
|
|
|
|
|
|
|
std::string GetName() const
|
|
|
|
{
|
|
|
|
return TString::Format("Hlt1%sDecision", name.c_str()).Data();
|
|
|
|
}
|
|
|
|
|
|
|
|
Bool_t *GetValuePointer()
|
|
|
|
{
|
|
|
|
return &value;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<Hlt1Decision> Hlt1Decisions{
|
|
|
|
Hlt1Decision{"DiMuonHighMass", 1},
|
|
|
|
Hlt1Decision{"DiMuonLowMass", 2},
|
|
|
|
Hlt1Decision{"DiMuonNoIP", 3},
|
|
|
|
Hlt1Decision{"DiMuonSoft", 4},
|
|
|
|
Hlt1Decision{"DisplacedLeptons", 5},
|
|
|
|
Hlt1Decision{"LowPtDiMuon", 6},
|
|
|
|
Hlt1Decision{"LowPtMuon", 7},
|
|
|
|
Hlt1Decision{"OneMuonTrackLine", 8},
|
|
|
|
Hlt1Decision{"SingleHighEt", 9},
|
|
|
|
Hlt1Decision{"SingleHighPtMuon", 10},
|
|
|
|
Hlt1Decision{"TrackMVA", 11},
|
|
|
|
Hlt1Decision{"TrackMuonMVA", 12},
|
|
|
|
Hlt1Decision{"TwoTrackMVA", 13},
|
|
|
|
};
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
struct Hlt1DecisionPlot
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
bool exclusive;
|
|
|
|
std::set<std::string> lines;
|
|
|
|
};
|
|
|
|
|
|
|
|
const std::vector<Hlt1DecisionPlot>
|
|
|
|
Hlt1DecisionSets{
|
|
|
|
Hlt1DecisionPlot{"mva_excl", true, std::set<std::string>{"TwoTrackMVA", "TrackMuonMVA", "TrackMVA"}},
|
|
|
|
|
|
|
|
Hlt1DecisionPlot{"mva_incl", false, std::set<std::string>{"TwoTrackMVA", "TrackMuonMVA", "TrackMVA"}},
|
2024-02-22 16:53:48 +01:00
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
Hlt1DecisionPlot{"pt_excl", true, std::set<std::string>{"LowPtMuon", "LowPtDiMuon", "DisplacedLeptons"}},
|
2024-02-22 16:53:48 +01:00
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
Hlt1DecisionPlot{"pt_incl", false, std::set<std::string>{"LowPtMuon", "LowPtDiMuon", "DisplacedLeptons"}},
|
2024-02-22 16:53:48 +01:00
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
Hlt1DecisionPlot{"dimu_excl", true, std::set<std::string>{"DiMuonNoIP", "DiMuonLowMass", "DiMuonHighMass"}},
|
2024-02-22 16:53:48 +01:00
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
Hlt1DecisionPlot{"dimu_incl", false, std::set<std::string>{"DiMuonNoIP", "DiMuonLowMass", "DiMuonHighMass"}},
|
2024-02-22 16:53:48 +01:00
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
Hlt1DecisionPlot{"mvapt_incl", false, std::set<std::string>{"TwoTrackMVA", "TrackMuonMVA", "TrackMVA", "LowPtMuon", "LowPtDiMuon", "DisplacedLeptons"}},
|
2024-02-22 16:53:48 +01:00
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
Hlt1DecisionPlot{"mvadimu_incl", false, std::set<std::string>{"TwoTrackMVA", "TrackMuonMVA", "TrackMVA", "DiMuonNoIP", "DiMuonLowMass", "DiMuonHighMass"}},
|
|
|
|
|
|
|
|
Hlt1DecisionPlot{"mvadimupt_incl", false, std::set<std::string>{"TwoTrackMVA", "TrackMuonMVA", "TrackMVA", "LowPtMuon", "LowPtDiMuon", "DisplacedLeptons", "DiMuonNoIP", "DiMuonLowMass", "DiMuonHighMass"}},
|
|
|
|
|
|
|
|
Hlt1DecisionPlot{"ptdimu_incl", false, std::set<std::string>{"LowPtMuon", "LowPtDiMuon", "DisplacedLeptons", "DiMuonNoIP", "DiMuonLowMass", "DiMuonHighMass"}},
|
|
|
|
|
|
|
|
};
|
2024-02-22 16:53:48 +01:00
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
bool CutHlt1DecisionsAnd(const std::set<std::string> &decision_list)
|
|
|
|
{
|
|
|
|
bool okay = true;
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (decision_list.find(var.name) != decision_list.end())
|
|
|
|
{
|
|
|
|
okay = okay && var.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return okay;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CutHlt1DecisionsOr(const std::set<std::string> &decision_list)
|
|
|
|
{
|
|
|
|
bool okay = false;
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (decision_list.find(var.name) != decision_list.end())
|
|
|
|
{
|
|
|
|
okay = okay || var.value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return okay;
|
|
|
|
}
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
bool CutHlt1DecisionsOrOnly(const std::set<std::string> &decision_list)
|
|
|
|
{
|
|
|
|
bool okay = false;
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (decision_list.find(var.name) != decision_list.end())
|
|
|
|
{
|
|
|
|
okay = okay || var.value;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (var.value)
|
|
|
|
{
|
|
|
|
okay = false;
|
2024-02-23 14:46:29 +01:00
|
|
|
break;
|
2024-02-22 16:53:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return okay;
|
|
|
|
}
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
void ConnectHlt1Decisions(TChain *chain)
|
|
|
|
{
|
|
|
|
for (auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (chain->FindBranch(var.GetName().c_str()))
|
|
|
|
chain->SetBranchAddress(var.GetName().c_str(), var.GetValuePointer());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrawInDefaultCanvas(TH1 *histogram, const char *folder, double margin_left = 0, Option_t *option = "")
|
|
|
|
{
|
|
|
|
std::filesystem::create_directory(TString::Format("output_files/analysis/%s", folder).Data());
|
|
|
|
TString name = TString::Format("%s_canvas", histogram->GetName());
|
|
|
|
TCanvas *c = new TCanvas(name, histogram->GetName(), 0, 0, 800, 600);
|
|
|
|
c->SetLeftMargin(margin_left);
|
|
|
|
histogram->SetStats(0);
|
|
|
|
histogram->Draw(option);
|
|
|
|
c->Draw();
|
|
|
|
c->SaveAs(TString::Format("output_files/analysis/%s/%s.pdf", folder, name.Data()).Data());
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrawInDefaultCanvas(RooPlot *rooPlot, const char *folder, double margin_left = 0, Option_t *option = "")
|
|
|
|
{
|
|
|
|
std::filesystem::create_directory(TString::Format("output_files/analysis/%s", folder).Data());
|
|
|
|
TString name = TString::Format("%s_canvas", rooPlot->GetName());
|
|
|
|
TCanvas *c = new TCanvas(name, rooPlot->GetName(), 0, 0, 800, 600);
|
|
|
|
c->SetLeftMargin(margin_left);
|
|
|
|
rooPlot->Draw(option);
|
|
|
|
c->Draw();
|
|
|
|
c->SaveAs(TString::Format("output_files/analysis/%s/%s.pdf", folder, name.Data()).Data());
|
|
|
|
}
|
|
|
|
|
|
|
|
void PrintProgress(const char *title, unsigned int total, unsigned int every, unsigned int current)
|
|
|
|
{
|
|
|
|
if ((current + 1) % every == 0 || current + 1 == total)
|
|
|
|
{
|
|
|
|
std::cout << "["
|
|
|
|
<< title
|
|
|
|
<< "] Processed event: " << current + 1 << " (" << TString::Format("%.2f", ((double)(current + 1) / (double)total) * 100.) << "%)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
RooPlot *CreateRooFitHistogram(TH1D *hist)
|
|
|
|
{
|
|
|
|
RooRealVar roo_var_mass("var_mass", "B Mass Variable", B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
roo_var_mass.setRange("fitting_range", B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
2024-02-21 16:34:42 +01:00
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
RooDataHist roohist_B_M("roohist_B_M", "B Mass Histogram", roo_var_mass, RooFit::Import(*hist));
|
2024-02-21 16:34:42 +01:00
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
RooPlot *roo_frame_mass = roo_var_mass.frame(RooFit::Title(hist->GetTitle()), RooFit::Name(TString::Format("%s_rplt", hist->GetName())));
|
2024-02-22 16:53:48 +01:00
|
|
|
roohist_B_M.plotOn(roo_frame_mass, RooFit::Binning(B_MASS_HIST_BINS), RooFit::Name("B Mass Distribution"));
|
|
|
|
roo_frame_mass->GetXaxis()->SetTitle(hist->GetXaxis()->GetTitle());
|
2024-02-21 16:34:42 +01:00
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
return roo_frame_mass;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CheckHlt1Decisioins(TH2D *incl_hist, TH2D *excl_hist, std::map<std::string, int> &exclusive_hits, const double reco_mass)
|
|
|
|
{
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (var.value)
|
|
|
|
{
|
|
|
|
incl_hist->Fill(reco_mass, var.name.c_str(), 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool exclusive = true;
|
|
|
|
std::string line{};
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (var.value)
|
|
|
|
{
|
|
|
|
if (!line.empty())
|
|
|
|
{
|
|
|
|
exclusive = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
line = var.name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!line.empty() && exclusive)
|
|
|
|
{
|
|
|
|
int &hits = exclusive_hits[line];
|
|
|
|
if (hits)
|
|
|
|
{
|
|
|
|
hits += 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hits = 1;
|
|
|
|
}
|
|
|
|
excl_hist->Fill(reco_mass, line.c_str(), 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<TH1D *> CreateHlt1DecisionHistos(const char *analysis_name)
|
|
|
|
{
|
2024-02-23 14:46:29 +01:00
|
|
|
std::vector<TH1D *> histos{};
|
|
|
|
for (int i = 0; i < Hlt1DecisionSets.size(); i++)
|
|
|
|
{
|
|
|
|
TH1D *h1_B_Mass_hlt1 = new TH1D(TString::Format("h1_B_Mass_hlt1_%s", Hlt1DecisionSets[i].name.c_str()), TString::Format("(%s) (%s)", Hlt1DecisionSets[i].name.c_str(), analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
histos.push_back(h1_B_Mass_hlt1);
|
|
|
|
}
|
|
|
|
|
|
|
|
return histos;
|
2024-02-22 16:53:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void FillHlt1DecisionHistos(std::vector<TH1D *> histos, double reco_mass)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < Hlt1DecisionSets.size(); i++)
|
|
|
|
{
|
2024-02-23 14:46:29 +01:00
|
|
|
if (Hlt1DecisionSets[i].exclusive)
|
2024-02-22 16:53:48 +01:00
|
|
|
{
|
2024-02-23 14:46:29 +01:00
|
|
|
if (CutHlt1DecisionsOrOnly(Hlt1DecisionSets[i].lines))
|
|
|
|
{
|
|
|
|
histos[i]->Fill(reco_mass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (CutHlt1DecisionsOr(Hlt1DecisionSets[i].lines))
|
|
|
|
{
|
|
|
|
histos[i]->Fill(reco_mass);
|
|
|
|
}
|
2024-02-22 16:53:48 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DrawHlt1DecisionHistos(const char *folder, std::vector<TH1D *> histos)
|
|
|
|
{
|
|
|
|
std::filesystem::create_directory(TString::Format("output_files/analysis/%s", folder).Data());
|
|
|
|
TString name = TString::Format("%s_canvas", "hlt1_decisions");
|
|
|
|
TCanvas *c = new TCanvas(name, "HLT 1 Decisions", 0, 0, 1200, 700);
|
2024-02-23 14:46:29 +01:00
|
|
|
c->Divide(4, 3);
|
2024-02-22 16:53:48 +01:00
|
|
|
for (int i = 0; i < histos.size(); i++)
|
|
|
|
{
|
|
|
|
c->cd(i + 1);
|
|
|
|
histos[i]->SetStats(0);
|
|
|
|
histos[i]->Draw();
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
TLegend *leg1 = new TLegend(0.58, 0.89 - (0.05 * (Hlt1DecisionSets[i].lines.size() + (int)(Hlt1DecisionSets[i].lines.size() / 3))), 0.88, 0.89);
|
|
|
|
leg1->SetFillStyle(0);
|
|
|
|
leg1->SetLineStyle(0);
|
2024-02-22 16:53:48 +01:00
|
|
|
leg1->SetMargin(0.1);
|
2024-02-23 14:46:29 +01:00
|
|
|
int index = 1;
|
|
|
|
std::for_each(Hlt1DecisionSets[i].lines.begin(), Hlt1DecisionSets[i].lines.end(), [leg1, i, &index](std::string s)
|
|
|
|
{
|
|
|
|
leg1->AddEntry((TObject *)0, s.c_str(), "");
|
|
|
|
if (index != Hlt1DecisionSets[i].lines.size() && index % 3 == 0) {
|
|
|
|
leg1->AddEntry((TObject *)0, "", "");
|
|
|
|
}
|
|
|
|
index++; });
|
2024-02-22 16:53:48 +01:00
|
|
|
leg1->AddEntry((TObject *)0, TString::Format("# Entries: %d", (int)histos[i]->GetEntries()), "");
|
|
|
|
leg1->Draw();
|
|
|
|
}
|
|
|
|
c->Draw();
|
|
|
|
c->SaveAs(TString::Format("output_files/analysis/%s/%s.pdf", folder, name.Data()).Data());
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Bu To Hp Mu Mu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
int analyze_bu2hpmumu_data()
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
|
|
|
const char *analysis_name = "BuToHpMuMu";
|
|
|
|
const char *end_state_mass_literal = "m(#pi^{+}_{(#rightarrow K^{+})}#mu^{+}#mu^{-})";
|
|
|
|
|
|
|
|
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", analysis_name));
|
|
|
|
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/spruce_magdown_2023_v0_tuple_90000000_v0r0p6288631.root");
|
|
|
|
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/spruce_magdown_2023_v0r1_tuple_90000000_2023_v0r0p6288631.root");
|
|
|
|
|
|
|
|
FourVect *l14v = FourVect::Init(data_chain, "L1");
|
|
|
|
FourVect *l24v = FourVect::Init(data_chain, "L2");
|
|
|
|
FourVect *hp4v = FourVect::Init(data_chain, "Hp");
|
|
|
|
|
|
|
|
TH1D *h1_B_Mass_jpsi = new TH1D("h1_B_Mass_jpsi", TString::Format("B Mass, J/#psi Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH1D *h1_B_Mass_psi2s = new TH1D("h1_B_Mass_psi2s", TString::Format("B Mass, #psi(2S) Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH2D *h2_Hlt1_flags_B_Mass = new TH2D("h2_Hlt1_flags_B_Mass", "Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
TH2D *h2_Hlt1_flags_excl_B_Mass = new TH2D("h2_Hlt1_flags_excl_B_Mass", "Excl Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
|
|
|
|
h1_B_Mass_jpsi->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h1_B_Mass_psi2s->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
|
|
|
|
ConnectHlt1Decisions(data_chain);
|
|
|
|
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (data_chain->FindBranch(var.GetName().c_str()))
|
|
|
|
{
|
|
|
|
h2_Hlt1_flags_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
auto hlt1_decision_histos = CreateHlt1DecisionHistos(analysis_name);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
std::map<std::string, int> exclusive_hits{};
|
|
|
|
|
|
|
|
unsigned int entries = data_chain->GetEntries();
|
|
|
|
for (unsigned int i = 0; i < entries; i++)
|
|
|
|
{
|
|
|
|
data_chain->GetEntry(i);
|
|
|
|
|
|
|
|
TLorentzVector dimuon = l14v->LorentzVector() + l24v->LorentzVector();
|
|
|
|
Double_t reconstructed_B_Mass = (hp4v->LorentzVector(K_MASS) + dimuon).M();
|
|
|
|
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
CheckHlt1Decisioins(h2_Hlt1_flags_B_Mass, h2_Hlt1_flags_excl_B_Mass, exclusive_hits, reconstructed_B_Mass);
|
|
|
|
FillHlt1DecisionHistos(hlt1_decision_histos, reconstructed_B_Mass);
|
|
|
|
}
|
2024-02-21 16:34:42 +01:00
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
if (CutHlt1DecisionsOr({"TwoTrackMuonMVA", "DiMuonHighMass"}))
|
|
|
|
{
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
h1_B_Mass_jpsi->Fill(reconstructed_B_Mass);
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
2024-02-22 16:53:48 +01:00
|
|
|
else if (TMath::Abs(dimuon.M() - PSI2S_MASS) < 100.)
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
h1_B_Mass_psi2s->Fill(reconstructed_B_Mass);
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
PrintProgress(analysis_name, entries, 10000, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cout << "# Exclusive Hits" << std::endl;
|
|
|
|
for (const auto &[line, hits] : exclusive_hits)
|
|
|
|
{
|
|
|
|
std::cout << line << ": " << hits << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_excl_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_psi2s, analysis_name, 0.1);
|
|
|
|
|
|
|
|
auto roofit_hist_jpsi = CreateRooFitHistogram(h1_B_Mass_jpsi);
|
|
|
|
auto roofit_hist_psi2s = CreateRooFitHistogram(h1_B_Mass_psi2s);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_psi2s, analysis_name, 0.1);
|
|
|
|
|
|
|
|
DrawHlt1DecisionHistos(analysis_name, hlt1_decision_histos);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int analyze_bu2hpmumu_simulation()
|
|
|
|
{
|
|
|
|
const char *analysis_name = "BuToHpMuMu_noPID";
|
|
|
|
const char *end_state_mass_literal = "m(#pi^{+}_{(#rightarrow K^{+})}#mu^{+}#mu^{-})";
|
|
|
|
|
|
|
|
TChain *sim_chain = new TChain(TString::Format("%s/DecayTree", analysis_name));
|
|
|
|
sim_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/MC/rd_btoxll_simulation_fullstream_v0r0p6671378_BuToKpMuMu_12143001_magdown.root");
|
|
|
|
|
|
|
|
FourVect *l14v = FourVect::Init(sim_chain, "L1");
|
|
|
|
FourVect *l24v = FourVect::Init(sim_chain, "L2");
|
|
|
|
FourVect *hp4v = FourVect::Init(sim_chain, "Hp");
|
|
|
|
|
|
|
|
Int_t B_BKGCAT, L1_TRUEID, L2_TRUEID, Hp_TRUEID;
|
|
|
|
|
|
|
|
sim_chain->SetBranchAddress("L1_TRUEID", &L1_TRUEID);
|
|
|
|
sim_chain->SetBranchAddress("L2_TRUEID", &L2_TRUEID);
|
|
|
|
sim_chain->SetBranchAddress("Hp_TRUEID", &Hp_TRUEID);
|
|
|
|
sim_chain->SetBranchAddress("B_BKGCAT", &B_BKGCAT);
|
|
|
|
|
|
|
|
TH1D *h1_B_Mass_jpsi = new TH1D("h1_B_Mass_jpsi", TString::Format("B Mass, J/#psi Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH1D *h1_B_Mass_psi2s = new TH1D("h1_B_Mass_psi2s", TString::Format("B Mass, #psi(2S) Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH2D *h2_Hlt1_flags_B_Mass = new TH2D("h2_Hlt1_flags_B_Mass", "Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
TH2D *h2_Hlt1_flags_excl_B_Mass = new TH2D("h2_Hlt1_flags_excl_B_Mass", "Excl Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
|
|
|
|
h1_B_Mass_jpsi->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h1_B_Mass_psi2s->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
|
|
|
|
ConnectHlt1Decisions(sim_chain);
|
|
|
|
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
if (sim_chain->FindBranch(var.GetName().c_str()))
|
|
|
|
{
|
|
|
|
h2_Hlt1_flags_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
auto hlt1_decision_histos = CreateHlt1DecisionHistos(analysis_name);
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
std::map<std::string, int> exclusive_hits{};
|
|
|
|
|
|
|
|
unsigned int entries = sim_chain->GetEntries();
|
|
|
|
for (unsigned int i = 0; i < 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)
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
|
|
|
|
TLorentzVector dimuon = l14v->LorentzVector() + l24v->LorentzVector();
|
|
|
|
Double_t reconstructed_B_Mass = (hp4v->LorentzVector(K_MASS) + dimuon).M();
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
CheckHlt1Decisioins(h2_Hlt1_flags_B_Mass, h2_Hlt1_flags_excl_B_Mass, exclusive_hits, reconstructed_B_Mass);
|
2024-02-23 14:46:29 +01:00
|
|
|
FillHlt1DecisionHistos(hlt1_decision_histos, reconstructed_B_Mass);
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
2024-02-22 16:53:48 +01:00
|
|
|
|
|
|
|
if (CutHlt1DecisionsOr({"TwoTrackMuonMVA", "DiMuonHighMass"}))
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_jpsi->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
|
|
|
else if (TMath::Abs(dimuon.M() - PSI2S_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_psi2s->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PrintProgress(analysis_name, entries, 10000, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cout << "# Exclusive Hits" << std::endl;
|
|
|
|
for (const auto &[line, hits] : exclusive_hits)
|
|
|
|
{
|
|
|
|
std::cout << line << ": " << hits << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_excl_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_psi2s, analysis_name, 0.1);
|
|
|
|
|
|
|
|
auto roofit_hist_jpsi = CreateRooFitHistogram(h1_B_Mass_jpsi);
|
|
|
|
auto roofit_hist_psi2s = CreateRooFitHistogram(h1_B_Mass_psi2s);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_psi2s, analysis_name, 0.1);
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
DrawHlt1DecisionHistos(analysis_name, hlt1_decision_histos);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% B0 To Hp Hm Mu Mu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
int analyze_b02hphmmumu()
|
|
|
|
{
|
|
|
|
const char *analysis_name = "B0ToHpHmMuMu";
|
|
|
|
const char *end_state_mass_literal = "m(#pi^{+}_{(#rightarrow K^{+})} #pi^{-} #mu^{+}#mu^{-})";
|
|
|
|
|
|
|
|
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", analysis_name));
|
|
|
|
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/spruce_magdown_2023_v0_tuple_90000000_v0r0p6288631.root");
|
|
|
|
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/spruce_magdown_2023_v0r1_tuple_90000000_2023_v0r0p6288631.root");
|
|
|
|
|
|
|
|
Double_t Hp_PID_K, Hm_PID_K, Hp_PID_PI, Hm_PID_PI;
|
|
|
|
|
|
|
|
data_chain->SetBranchAddress("Hp_PID_K", &Hp_PID_K);
|
|
|
|
data_chain->SetBranchAddress("Hm_PID_K", &Hm_PID_K);
|
|
|
|
data_chain->SetBranchAddress("Hp_PID_PI", &Hp_PID_PI);
|
|
|
|
data_chain->SetBranchAddress("Hm_PID_PI", &Hm_PID_PI);
|
|
|
|
|
|
|
|
FourVect *l14v = FourVect::Init(data_chain, "L1");
|
|
|
|
FourVect *l24v = FourVect::Init(data_chain, "L2");
|
|
|
|
FourVect *hp4v = FourVect::Init(data_chain, "Hp");
|
|
|
|
FourVect *hm4v = FourVect::Init(data_chain, "Hm");
|
|
|
|
|
|
|
|
TH1D *h1_B_Mass_jpsi = new TH1D("h1_B_Mass_jpsi", TString::Format("B Mass, J/#psi Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH1D *h1_B_Mass_psi2s = new TH1D("h1_B_Mass_psi2s", TString::Format("B Mass, #psi(2S) Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH2D *h2_Hlt1_flags_B_Mass = new TH2D("h2_Hlt1_flags_B_Mass", "Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
TH2D *h2_Hlt1_flags_excl_B_Mass = new TH2D("h2_Hlt1_flags_excl_B_Mass", "Excl Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
|
|
|
|
h1_B_Mass_jpsi->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h1_B_Mass_psi2s->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
|
|
|
|
ConnectHlt1Decisions(data_chain);
|
|
|
|
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
h2_Hlt1_flags_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
}
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
auto hlt1_decision_histos = CreateHlt1DecisionHistos(analysis_name);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
std::map<std::string, int> exclusive_hits{};
|
|
|
|
|
|
|
|
unsigned int entries = data_chain->GetEntries();
|
|
|
|
for (unsigned int i = 0; i < entries; i++)
|
|
|
|
{
|
|
|
|
data_chain->GetEntry(i);
|
|
|
|
|
|
|
|
TLorentzVector dimuon = l14v->LorentzVector() + l24v->LorentzVector();
|
|
|
|
|
|
|
|
TLorentzVector lv_hp{};
|
|
|
|
TLorentzVector lv_hm{};
|
|
|
|
|
|
|
|
if (Hp_PID_K > 0 && Hm_PID_K < 0)
|
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
continue;
|
2024-02-21 16:34:42 +01:00
|
|
|
lv_hp = hp4v->LorentzVector(K_MASS);
|
|
|
|
lv_hm = hm4v->LorentzVector();
|
|
|
|
}
|
|
|
|
else if (Hp_PID_K < 0 && Hm_PID_K > 0)
|
|
|
|
{
|
|
|
|
lv_hp = hp4v->LorentzVector();
|
|
|
|
lv_hm = hm4v->LorentzVector(K_MASS);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
Double_t reconstructed_Kstar_Mass = (lv_hp + lv_hm).M();
|
|
|
|
Double_t reconstructed_B_Mass = (lv_hp + lv_hm + dimuon).M();
|
|
|
|
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
CheckHlt1Decisioins(h2_Hlt1_flags_B_Mass, h2_Hlt1_flags_excl_B_Mass, exclusive_hits, reconstructed_B_Mass);
|
2024-02-23 14:46:29 +01:00
|
|
|
FillHlt1DecisionHistos(hlt1_decision_histos, reconstructed_B_Mass);
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
if (CutHlt1DecisionsOr({"TwoTrackMuonMVA", "DiMuonHighMass"}))
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
|
|
|
if (TMath::Abs(reconstructed_Kstar_Mass - KSTAR_MASS) < 50.)
|
|
|
|
{
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_jpsi->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
|
|
|
else if (TMath::Abs(dimuon.M() - PSI2S_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_psi2s->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PrintProgress(analysis_name, entries, 10000, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cout << "# Exclusive Hits" << std::endl;
|
|
|
|
for (const auto &[line, hits] : exclusive_hits)
|
|
|
|
{
|
|
|
|
std::cout << line << ": " << hits << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_excl_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_psi2s, analysis_name, 0.1);
|
|
|
|
|
|
|
|
auto roofit_hist_jpsi = CreateRooFitHistogram(h1_B_Mass_jpsi);
|
|
|
|
auto roofit_hist_psi2s = CreateRooFitHistogram(h1_B_Mass_psi2s);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_psi2s, analysis_name, 0.1);
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
DrawHlt1DecisionHistos(analysis_name, hlt1_decision_histos);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Hlt2RD_BuToKpMuMu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
int analyze_Hlt2RD_BuToKpMuMu()
|
|
|
|
{
|
|
|
|
const char *analysis_name = "Hlt2RD_BuToKpMuMu";
|
|
|
|
const char *end_state_mass_literal = "m(K^{+} #mu^{+}#mu^{-})";
|
|
|
|
|
|
|
|
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", analysis_name));
|
|
|
|
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/Collision23_Beam6800GeV-VeloClosed-MagDown-Excl-UT_RealData_SprucingPass23r1_94000000_RD.root");
|
|
|
|
|
|
|
|
FourVect *l14v = FourVect::Init(data_chain, "muplus");
|
|
|
|
FourVect *l24v = FourVect::Init(data_chain, "muminus");
|
|
|
|
FourVect *hp4v = FourVect::Init(data_chain, "Kplus");
|
|
|
|
|
|
|
|
TH1D *h1_B_Mass_jpsi = new TH1D("h1_B_Mass_jpsi", TString::Format("B Mass, J/#psi Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH1D *h1_B_Mass_psi2s = new TH1D("h1_B_Mass_psi2s", TString::Format("B Mass, #psi(2S) Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH2D *h2_Hlt1_flags_B_Mass = new TH2D("h2_Hlt1_flags_B_Mass", "Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
TH2D *h2_Hlt1_flags_excl_B_Mass = new TH2D("h2_Hlt1_flags_excl_B_Mass", "Excl Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
|
|
|
|
h1_B_Mass_jpsi->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h1_B_Mass_psi2s->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
|
|
|
|
ConnectHlt1Decisions(data_chain);
|
|
|
|
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
h2_Hlt1_flags_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
}
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
auto hlt1_decision_histos = CreateHlt1DecisionHistos(analysis_name);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
std::map<std::string, int> exclusive_hits{};
|
|
|
|
|
|
|
|
unsigned int entries = data_chain->GetEntries();
|
|
|
|
for (unsigned int i = 0; i < entries; i++)
|
|
|
|
{
|
|
|
|
data_chain->GetEntry(i);
|
|
|
|
|
|
|
|
TLorentzVector dimuon = l14v->LorentzVector() + l24v->LorentzVector();
|
|
|
|
|
|
|
|
TLorentzVector lv_hp = hp4v->LorentzVector();
|
|
|
|
|
|
|
|
Double_t reconstructed_B_Mass = (lv_hp + dimuon).M();
|
|
|
|
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
CheckHlt1Decisioins(h2_Hlt1_flags_B_Mass, h2_Hlt1_flags_excl_B_Mass, exclusive_hits, reconstructed_B_Mass);
|
2024-02-23 14:46:29 +01:00
|
|
|
FillHlt1DecisionHistos(hlt1_decision_histos, reconstructed_B_Mass);
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
if (CutHlt1DecisionsOr({"TwoTrackMuonMVA", "DiMuonHighMass"}))
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_jpsi->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
|
|
|
else if (TMath::Abs(dimuon.M() - PSI2S_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_psi2s->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PrintProgress("Hlt2RD_BuToKpMuMu", entries, 10000, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cout << "# Exclusive Hits" << std::endl;
|
|
|
|
for (const auto &[line, hits] : exclusive_hits)
|
|
|
|
{
|
|
|
|
std::cout << line << ": " << hits << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_excl_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_psi2s, analysis_name, 0.1);
|
|
|
|
|
|
|
|
auto roofit_hist_jpsi = CreateRooFitHistogram(h1_B_Mass_jpsi);
|
|
|
|
auto roofit_hist_psi2s = CreateRooFitHistogram(h1_B_Mass_psi2s);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_psi2s, analysis_name, 0.1);
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
DrawHlt1DecisionHistos(analysis_name, hlt1_decision_histos);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Hlt2RD_B0ToKpPimMuMu %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
int analyze_Hlt2RD_B0ToKpPimMuMu()
|
|
|
|
{
|
|
|
|
const char *analysis_name = "Hlt2RD_B0ToKpPimMuMu";
|
|
|
|
const char *end_state_mass_literal = "m(K^{+} #pi^{-} #mu^{+}#mu^{-})";
|
|
|
|
|
|
|
|
TChain *data_chain = new TChain(TString::Format("%s/DecayTree", analysis_name));
|
|
|
|
data_chain->Add("/auto/data/pfeiffer/inclusive_detached_dilepton/data_samples/Collision23_Beam6800GeV-VeloClosed-MagDown-Excl-UT_RealData_SprucingPass23r1_94000000_RD.root");
|
|
|
|
|
|
|
|
FourVect *l14v = FourVect::Init(data_chain, "muplus");
|
|
|
|
FourVect *l24v = FourVect::Init(data_chain, "muminus");
|
|
|
|
FourVect *hp4v = FourVect::Init(data_chain, "Kplus");
|
|
|
|
FourVect *hm4v = FourVect::Init(data_chain, "piminus");
|
|
|
|
|
|
|
|
TH1D *h1_B_Mass_jpsi = new TH1D("h1_B_Mass_jpsi", TString::Format("B Mass, J/#psi Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH1D *h1_B_Mass_psi2s = new TH1D("h1_B_Mass_psi2s", TString::Format("B Mass, #psi(2S) Mode (%s)", analysis_name), B_MASS_HIST_BINS, B_MASS_VAR_MIN, B_MASS_VAR_MAX);
|
|
|
|
TH2D *h2_Hlt1_flags_B_Mass = new TH2D("h2_Hlt1_flags_B_Mass", "Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
TH2D *h2_Hlt1_flags_excl_B_Mass = new TH2D("h2_Hlt1_flags_excl_B_Mass", "Excl Hlt1 Decision vs B Mass", 50, 5100, 5400, 13, 1., 14.);
|
|
|
|
|
|
|
|
h1_B_Mass_jpsi->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h1_B_Mass_psi2s->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->GetXaxis()->SetTitle(end_state_mass_literal);
|
|
|
|
|
|
|
|
ConnectHlt1Decisions(data_chain);
|
|
|
|
|
|
|
|
for (const auto &var : Hlt1Decisions)
|
|
|
|
{
|
|
|
|
h2_Hlt1_flags_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
h2_Hlt1_flags_excl_B_Mass->Fill(0., var.name.c_str(), 0.);
|
|
|
|
}
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
auto hlt1_decision_histos = CreateHlt1DecisionHistos(analysis_name);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
std::map<std::string, int> exclusive_hits{};
|
|
|
|
|
|
|
|
unsigned int entries = data_chain->GetEntries();
|
|
|
|
for (unsigned int i = 0; i < entries; i++)
|
|
|
|
{
|
|
|
|
data_chain->GetEntry(i);
|
|
|
|
|
|
|
|
TLorentzVector dimuon = l14v->LorentzVector() + l24v->LorentzVector();
|
|
|
|
|
|
|
|
TLorentzVector lv_hp = hp4v->LorentzVector();
|
|
|
|
TLorentzVector lv_hm = hm4v->LorentzVector();
|
|
|
|
|
|
|
|
Double_t reconstructed_Kstar_Mass = (lv_hp + lv_hm).M();
|
|
|
|
Double_t reconstructed_B_Mass = (lv_hp + lv_hm + dimuon).M();
|
|
|
|
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
CheckHlt1Decisioins(h2_Hlt1_flags_B_Mass, h2_Hlt1_flags_excl_B_Mass, exclusive_hits, reconstructed_B_Mass);
|
2024-02-23 14:46:29 +01:00
|
|
|
FillHlt1DecisionHistos(hlt1_decision_histos, reconstructed_B_Mass);
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|
|
|
|
|
2024-02-22 16:53:48 +01:00
|
|
|
if (CutHlt1DecisionsOr({"TwoTrackMuonMVA", "DiMuonHighMass"}))
|
2024-02-21 16:34:42 +01:00
|
|
|
{
|
|
|
|
if (TMath::Abs(reconstructed_Kstar_Mass - KSTAR_MASS) < 50.)
|
|
|
|
{
|
|
|
|
if (TMath::Abs(dimuon.M() - JPSI_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_jpsi->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
|
|
|
else if (TMath::Abs(dimuon.M() - PSI2S_MASS) < 100.)
|
|
|
|
{
|
|
|
|
h1_B_Mass_psi2s->Fill(reconstructed_B_Mass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PrintProgress(analysis_name, entries, 10000, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cout << "# Exclusive Hits" << std::endl;
|
|
|
|
for (const auto &[line, hits] : exclusive_hits)
|
|
|
|
{
|
|
|
|
std::cout << line << ": " << hits << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h2_Hlt1_flags_excl_B_Mass, analysis_name, 0.16, "COLZ");
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(h1_B_Mass_psi2s, analysis_name, 0.1);
|
|
|
|
|
|
|
|
auto roofit_hist_jpsi = CreateRooFitHistogram(h1_B_Mass_jpsi);
|
|
|
|
auto roofit_hist_psi2s = CreateRooFitHistogram(h1_B_Mass_psi2s);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_jpsi, analysis_name, 0.1);
|
|
|
|
DrawInDefaultCanvas(roofit_hist_psi2s, analysis_name, 0.1);
|
|
|
|
|
2024-02-23 14:46:29 +01:00
|
|
|
DrawHlt1DecisionHistos(analysis_name, hlt1_decision_histos);
|
|
|
|
|
2024-02-21 16:34:42 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int new_analysis()
|
|
|
|
{
|
2024-02-22 16:53:48 +01:00
|
|
|
return analyze_bu2hpmumu_data();
|
2024-02-21 16:34:42 +01:00
|
|
|
}
|