4 #include <fmt/printf.h> 177 "CosThetaCS",
"DeltaEta",
"EtaMinus",
"EtaPlus",
"PhiCS",
"PhiMinus",
"PhiPlus",
"Pt"};
200 for (reco::TrackCollection::const_iterator track1 = tC.begin(); track1 != tC.end(); track1++) {
206 for (reco::TrackCollection::const_iterator track2 = track1 + 1; track2 != tC.end(); track2++) {
207 if (track1->charge() == track2->charge()) {
212 track2->px(), track2->py(), track2->pz(),
sqrt((track2->p() * track2->p()) +
mu_mass2_));
214 LV_mother = LV_track1 + LV_track2;
215 double mother_mass = LV_mother.M();
217 double mother_pt = LV_mother.Pt();
219 int charge1 = track1->charge();
220 double etaMu1 = track1->eta();
221 double phiMu1 = track1->phi();
222 double ptMu1 = track1->pt();
224 int charge2 = track2->charge();
225 double etaMu2 = track2->eta();
226 double phiMu2 = track2->phi();
227 double ptMu2 = track2->pt();
236 const auto& tplus = track1->charge() > 0 ? track1 : track2;
237 const auto& tminus = track1->charge() < 0 ? track1 : track2;
238 TLorentzVector p4_tplus(tplus->px(), tplus->py(), tplus->pz(),
sqrt((tplus->p() * tplus->p()) +
mu_mass2_));
239 TLorentzVector p4_tminus(tminus->px(), tminus->py(), tminus->pz(),
sqrt((tminus->p() * tminus->p()) +
mu_mass2_));
240 std::pair<TLorentzVector, TLorentzVector> tktk_p4 = std::make_pair(p4_tplus, p4_tminus);
253 double muplus = 1.0 /
sqrt(2.0) * (LV_track1.E() + LV_track1.Z());
254 double muminus = 1.0 /
sqrt(2.0) * (LV_track1.E() - LV_track1.Z());
255 double mubarplus = 1.0 /
sqrt(2.0) * (LV_track2.E() + LV_track2.Z());
256 double mubarminus = 1.0 /
sqrt(2.0) * (LV_track2.E() - LV_track2.Z());
258 double costhetaCS = 2.0 / LV_mother.mag() /
sqrt(
pow(LV_mother.mag(), 2) +
pow(LV_mother.Pt(), 2)) *
264 auto R = Pbeam.Vect().Cross(LV_mother.Vect());
265 auto Runit =
R.Unit();
266 auto Qt = LV_mother.Vect();
268 auto Qtunit = Qt.Unit();
273 sqrt(
pow(LV_mother.mag(), 2) +
pow(LV_mother.Pt(), 2)) / LV_mother.mag() * Dt.Dot(Runit) / Dt.Dot(Qtunit);
274 double phiCS = atan(tanphi);
297 th1f_mass =
fs->make<TH1F>(
"hMass",
"mass;m_{#mu#mu} [GeV];events", 200, 0., 200.);
299 for (
int i = 0;
i < Variable::VarNumber;
i++) {
316 TFileDirectory dirResMassVsCosThetaCSInEta =
fs->mkdir(
"TkTkMassVsCosThetaCSInEtaBins");
320 TFileDirectory dirResMassVsPhiMinusInEta =
fs->mkdir(
"TkTkMassVsPhiMinusInEtaBins");
324 TFileDirectory dirResMassVsPhiPlusInEta =
fs->mkdir(
"TkTkMassVsPhiPlusInEtaBins");
331 desc.setComment(
"Validates alignment payloads by evaluating bias in Z->mm mass distributions");
332 desc.addUntracked<
int>(
"compressionSettings", -1);
334 desc.add<
double>(
"eBeam", 3500.)->setComment(
"beam energy in GeV");
337 desc.add<
double>(
"Pair_mass_min", 60);
338 desc.add<
double>(
"Pair_mass_max", 120);
339 desc.add<
int>(
"Pair_mass_nbins", 120);
340 desc.add<
double>(
"Pair_etaminpos", -2.4);
341 desc.add<
double>(
"Pair_etamaxpos", 2.4);
342 desc.add<
double>(
"Pair_etaminneg", -2.4);
343 desc.add<
double>(
"Pair_etamaxneg", 2.4);
345 desc.add<
double>(
"Variable_CosThetaCS_xmin", -1.);
346 desc.add<
double>(
"Variable_CosThetaCS_xmax", 1.);
347 desc.add<
int>(
"Variable_CosThetaCS_nbins", 20);
349 desc.add<
double>(
"Variable_DeltaEta_xmin", -4.8);
350 desc.add<
double>(
"Variable_DeltaEta_xmax", 4.8);
351 desc.add<
int>(
"Variable_DeltaEta_nbins", 20);
353 desc.add<
double>(
"Variable_EtaMinus_xmin", -2.4);
354 desc.add<
double>(
"Variable_EtaMinus_xmax", 2.4);
355 desc.add<
int>(
"Variable_EtaMinus_nbins", 12);
357 desc.add<
double>(
"Variable_EtaPlus_xmin", -2.4);
358 desc.add<
double>(
"Variable_EtaPlus_xmax", 2.4);
359 desc.add<
int>(
"Variable_EtaPlus_nbins", 12);
361 desc.add<
double>(
"Variable_PhiCS_xmin", -
M_PI / 2);
362 desc.add<
double>(
"Variable_PhiCS_xmax",
M_PI / 2);
363 desc.add<
int>(
"Variable_PhiCS_nbins", 20);
365 desc.add<
double>(
"Variable_PhiMinus_xmin", -
M_PI);
366 desc.add<
double>(
"Variable_PhiMinus_xmax",
M_PI);
367 desc.add<
int>(
"Variable_PhiMinus_nbins", 16);
369 desc.add<
double>(
"Variable_PhiPlus_xmin", -
M_PI);
370 desc.add<
double>(
"Variable_PhiPlus_xmax",
M_PI);
371 desc.add<
int>(
"Variable_PhiPlus_nbins", 16);
373 desc.add<
double>(
"Variable_PairPt_xmin", 0.);
374 desc.add<
double>(
"Variable_PairPt_xmax", 100.);
375 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_
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.
Power< A, B >::type pow(const A &a, const B &b)
double variable_PhiPlus_xmax_
double variable_EtaMinus_xmax_