4 #include <fmt/printf.h> 179 "CosThetaCS",
"DeltaEta",
"EtaMinus",
"EtaPlus",
"PhiCS",
"PhiMinus",
"PhiPlus",
"Pt"};
182 "#Delta#eta(#mu^{-},#mu^{+})",
186 "#mu^{-} #phi [rad]",
187 "#mu^{+} #phi [rad]",
211 for (reco::TrackCollection::const_iterator track1 = tC.begin(); track1 != tC.end(); track1++) {
217 for (reco::TrackCollection::const_iterator track2 = track1 + 1; track2 != tC.end(); track2++) {
218 if (track1->charge() == track2->charge()) {
223 track2->px(), track2->py(), track2->pz(),
sqrt((track2->p() * track2->p()) +
mu_mass2_));
225 LV_mother = LV_track1 + LV_track2;
226 double mother_mass = LV_mother.M();
228 double mother_pt = LV_mother.Pt();
230 int charge1 = track1->charge();
231 double etaMu1 = track1->eta();
232 double phiMu1 = track1->phi();
233 double ptMu1 = track1->pt();
235 int charge2 = track2->charge();
236 double etaMu2 = track2->eta();
237 double phiMu2 = track2->phi();
238 double ptMu2 = track2->pt();
247 const auto& tplus = track1->charge() > 0 ? track1 : track2;
248 const auto& tminus = track1->charge() < 0 ? track1 : track2;
249 TLorentzVector p4_tplus(tplus->px(), tplus->py(), tplus->pz(),
sqrt((tplus->p() * tplus->p()) +
mu_mass2_));
250 TLorentzVector p4_tminus(tminus->px(), tminus->py(), tminus->pz(),
sqrt((tminus->p() * tminus->p()) +
mu_mass2_));
251 std::pair<TLorentzVector, TLorentzVector> tktk_p4 = std::make_pair(p4_tplus, p4_tminus);
264 double muplus = 1.0 /
sqrt(2.0) * (LV_track1.E() + LV_track1.Z());
265 double muminus = 1.0 /
sqrt(2.0) * (LV_track1.E() - LV_track1.Z());
266 double mubarplus = 1.0 /
sqrt(2.0) * (LV_track2.E() + LV_track2.Z());
267 double mubarminus = 1.0 /
sqrt(2.0) * (LV_track2.E() - LV_track2.Z());
269 double costhetaCS = 2.0 / LV_mother.mag() /
sqrt(
pow(LV_mother.mag(), 2) +
pow(LV_mother.Pt(), 2)) *
275 auto R = Pbeam.Vect().Cross(LV_mother.Vect());
276 auto Runit =
R.Unit();
277 auto Qt = LV_mother.Vect();
279 auto Qtunit = Qt.Unit();
284 sqrt(
pow(LV_mother.mag(), 2) +
pow(LV_mother.Pt(), 2)) / LV_mother.mag() * Dt.Dot(Runit) / Dt.Dot(Qtunit);
285 double phiCS = atan(tanphi);
311 th1f_mass =
fs->make<TH1F>(
"hMass",
"mass;m_{#mu#mu} [GeV];events", 200, 0., 200.);
313 for (
int i = 0;
i < Variable::VarNumber;
i++) {
316 fs->make<TH2D>(th2d_name.c_str(),
328 fs->make<TH3D>(
"th3d_mass_vs_eta_phi_plus",
329 "th3d_mass_vs_eta_phi_plus;M_{#mu^{-}#mu^{+}} [GeV];#mu^{+} #eta;#mu^{+} #phi [rad]",
342 fs->make<TH3D>(
"th3d_mass_vs_eta_phi_minus",
343 "th3d_mass_vs_eta_phi_minus;M_{#mu^{-}#mu^{+}} [GeV];#mu^{-} #eta;#mu^{-} #phi [rad]",
359 TFileDirectory dirResMassVsCosThetaCSInEta =
fs->mkdir(
"TkTkMassVsCosThetaCSInEtaBins");
363 TFileDirectory dirResMassVsPhiMinusInEta =
fs->mkdir(
"TkTkMassVsPhiMinusInEtaBins");
367 TFileDirectory dirResMassVsPhiPlusInEta =
fs->mkdir(
"TkTkMassVsPhiPlusInEtaBins");
374 desc.setComment(
"Validates alignment payloads by evaluating bias in Z->mm mass distributions");
375 desc.addUntracked<
int>(
"compressionSettings", -1);
377 desc.add<
double>(
"eBeam", 3500.)->setComment(
"beam energy in GeV");
380 desc.add<
double>(
"Pair_mass_min", 60.);
381 desc.add<
double>(
"Pair_mass_max", 120.);
382 desc.add<
int>(
"Pair_mass_nbins", 120);
383 desc.add<
double>(
"Pair_etaminpos", -2.4);
384 desc.add<
double>(
"Pair_etamaxpos", 2.4);
385 desc.add<
double>(
"Pair_etaminneg", -2.4);
386 desc.add<
double>(
"Pair_etamaxneg", 2.4);
388 desc.add<
double>(
"Variable_CosThetaCS_xmin", -1.);
389 desc.add<
double>(
"Variable_CosThetaCS_xmax", 1.);
390 desc.add<
int>(
"Variable_CosThetaCS_nbins", 20);
392 desc.add<
double>(
"Variable_DeltaEta_xmin", -4.8);
393 desc.add<
double>(
"Variable_DeltaEta_xmax", 4.8);
394 desc.add<
int>(
"Variable_DeltaEta_nbins", 20);
396 desc.add<
double>(
"Variable_EtaMinus_xmin", -2.4);
397 desc.add<
double>(
"Variable_EtaMinus_xmax", 2.4);
398 desc.add<
int>(
"Variable_EtaMinus_nbins", 12);
400 desc.add<
double>(
"Variable_EtaPlus_xmin", -2.4);
401 desc.add<
double>(
"Variable_EtaPlus_xmax", 2.4);
402 desc.add<
int>(
"Variable_EtaPlus_nbins", 12);
404 desc.add<
double>(
"Variable_PhiCS_xmin", -
M_PI / 2);
405 desc.add<
double>(
"Variable_PhiCS_xmax",
M_PI / 2);
406 desc.add<
int>(
"Variable_PhiCS_nbins", 20);
408 desc.add<
double>(
"Variable_PhiMinus_xmin", -
M_PI);
409 desc.add<
double>(
"Variable_PhiMinus_xmax",
M_PI);
410 desc.add<
int>(
"Variable_PhiMinus_nbins", 16);
412 desc.add<
double>(
"Variable_PhiPlus_xmin", -
M_PI);
413 desc.add<
double>(
"Variable_PhiPlus_xmax",
M_PI);
414 desc.add<
int>(
"Variable_PhiPlus_nbins", 16);
416 desc.add<
double>(
"Variable_PairPt_xmin", 0.);
417 desc.add<
double>(
"Variable_PairPt_xmax", 100.);
418 desc.add<
int>(
"Variable_PairPt_nbins", 100);
double variable_PhiMinus_xmax_
int variable_CosThetaCS_nbins_
static const std::string kSharedResource
int variable_DeltaEta_nbins_
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
int variable_EtaPlus_nbins_
double variable_PairPt_xmax_
DiLeptonHelp::PlotsVsDiLeptonRegion InvMassVsPhiMinusInEtaBins
DiMuonValidation(const edm::ParameterSet &pset)
static constexpr double mu_mass2_
void fillTH1Plots(const float val, const std::pair< TLorentzVector, TLorentzVector > &momenta)
double variable_EtaPlus_xmin_
double variable_DeltaEta_xmax_
double variable_CosThetaCS_xmax_
std::vector< Track > TrackCollection
collection of Tracks
double variable_PhiMinus_xmin_
DiLeptonHelp::PlotsVsDiLeptonRegion InvMassVsCosThetaCSInEtaBins
double variable_PhiPlus_xmin_
int variable_PhiMinus_nbins_
void swap(Association< C > &lhs, Association< C > &rhs)
int variable_PairPt_nbins_
double variable_CosThetaCS_xmin_
double variable_EtaMinus_xmin_
DiLeptonHelp::PlotsVsDiLeptonRegion InvMassInEtaBins
TH2D * th2d_mass_variables_[Variable::VarNumber]
void bookSet(const TFileDirectory &fs, const TH1 *histo)
std::string variables_name_[Variable::VarNumber]
double variable_PhiCS_xmax_
#define DEFINE_FWK_MODULE(type)
double variable_PairPt_xmin_
TH3D * th3d_mass_vs_eta_phi_minus_
TH3D * th3d_mass_vs_eta_phi_plus_
double variable_EtaPlus_xmax_
double variables_min_[Variable::VarNumber]
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
DecomposeProduct< arg, typename Div::arg > D
int variable_EtaMinus_nbins_
DiLeptonHelp::PlotsVsDiLeptonRegion InvMassVsPhiPlusInEtaBins
double variable_PhiCS_xmin_
int variable_PhiCS_nbins_
double variables_max_[Variable::VarNumber]
void analyze(const edm::Event &, const edm::EventSetup &) override
int variables_bins_number_[Variable::VarNumber]
reco::Particle::LorentzVector LV
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken_
~DiMuonValidation() override=default
int variable_PhiPlus_nbins_
double variable_DeltaEta_xmin_
void fillTH2Plots(const float valX, const float valY, const std::pair< TLorentzVector, TLorentzVector > &momenta)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::string variables_title_[Variable::VarNumber]
Power< A, B >::type pow(const A &a, const B &b)
double variable_PhiPlus_xmax_
double variable_EtaMinus_xmax_