Skip to content

Commit

Permalink
introduce 3D Histograms for 2D maps of bias vs track eta and phi
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed May 20, 2024
1 parent 50a8396 commit 921e90b
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions Alignment/OfflineValidation/plugins/DiMuonValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ class DiMuonValidation : public edm::one::EDAnalyzer<edm::one::SharedResources>

TH1F* th1f_mass;
TH2D* th2d_mass_variables_[Variable::VarNumber]; // actual histograms
TH3D* th3d_mass_vs_eta_phi_plus_; // 3D histogram for scatter plot vs eta / phi (mu+)
TH3D* th3d_mass_vs_eta_phi_minus_; // 3D histogram for scatter plot vs eta / phi (mu-)

std::string variables_name_[Variable::VarNumber] = {
"CosThetaCS", "DeltaEta", "EtaMinus", "EtaPlus", "PhiCS", "PhiMinus", "PhiPlus", "Pt"};
Expand Down Expand Up @@ -291,6 +293,9 @@ void DiMuonValidation::analyze(const edm::Event& iEvent, const edm::EventSetup&
th2d_mass_variables_[Variable::PhiMinus]->Fill(mother_mass, phiMu2, 1);
th2d_mass_variables_[Variable::PhiPlus]->Fill(mother_mass, phiMu1, 1);
th2d_mass_variables_[Variable::Pt]->Fill(mother_mass, mother_pt, 1);

th3d_mass_vs_eta_phi_plus_->Fill(mother_mass, etaMu1, phiMu1);
th3d_mass_vs_eta_phi_minus_->Fill(mother_mass, etaMu2, phiMu2);
}
}
}
Expand All @@ -309,7 +314,7 @@ void DiMuonValidation::beginJob() {
std::string th2d_name = fmt::sprintf("th2d_mass_%s", variables_name_[i].c_str());
th2d_mass_variables_[i] =
fs->make<TH2D>(th2d_name.c_str(),
fmt::format("{};M_{{#mu^{{-}}#mu^{{+}}}};{}", th2d_name, variables_title_[i]).c_str(),
fmt::format("{};M_{{#mu^{{-}}#mu^{{+}}}} [GeV];{}", th2d_name, variables_title_[i]).c_str(),
pair_mass_nbins_,
pair_mass_min_,
pair_mass_max_,
Expand All @@ -318,6 +323,34 @@ void DiMuonValidation::beginJob() {
variables_max_[i]);
}

// 3D histogram for eta/phi map (mu+)
th3d_mass_vs_eta_phi_plus_ =
fs->make<TH3D>("th3d_mass_vs_eta_phi_plus",
"th3d_mass_vs_eta_phi_plus;M_{#mu^{-}#mu^{+}} [GeV];#mu^{+} #eta;#mu^{+} #phi [rad]",
pair_mass_nbins_,
pair_mass_min_,
pair_mass_max_,
variables_bins_number_[Variable::EtaPlus],
variables_min_[Variable::EtaPlus],
variables_max_[Variable::EtaPlus],
variables_bins_number_[Variable::PhiPlus],
variables_min_[Variable::PhiPlus],
variables_max_[Variable::PhiPlus]);

// 3D histogram for eta/phi map (mu+)
th3d_mass_vs_eta_phi_minus_ =
fs->make<TH3D>("th3d_mass_vs_eta_phi_minus",
"th3d_mass_vs_eta_phi_minus;M_{#mu^{-}#mu^{+}} [GeV];#mu^{-} #eta;#mu^{-} #phi [rad]",
pair_mass_nbins_,
pair_mass_min_,
pair_mass_max_,
variables_bins_number_[Variable::EtaMinus],
variables_min_[Variable::EtaMinus],
variables_max_[Variable::EtaMinus],
variables_bins_number_[Variable::PhiMinus],
variables_min_[Variable::PhiMinus],
variables_max_[Variable::PhiMinus]);

// Z-> mm mass in eta bins
TFileDirectory dirResMassEta = fs->mkdir("TkTkMassInEtaBins");
InvMassInEtaBins.bookSet(dirResMassEta, th1f_mass);
Expand All @@ -344,8 +377,8 @@ void DiMuonValidation::fillDescriptions(edm::ConfigurationDescriptions& descript
desc.add<double>("eBeam", 3500.)->setComment("beam energy in GeV");
desc.add<std::string>("TkTag", "ALCARECOTkAlZMuMu");

desc.add<double>("Pair_mass_min", 60);
desc.add<double>("Pair_mass_max", 120);
desc.add<double>("Pair_mass_min", 60.);
desc.add<double>("Pair_mass_max", 120.);
desc.add<int>("Pair_mass_nbins", 120);
desc.add<double>("Pair_etaminpos", -2.4);
desc.add<double>("Pair_etamaxpos", 2.4);
Expand Down

0 comments on commit 921e90b

Please sign in to comment.