364 double PrescaleWeight = 1;
371 std::vector<reco::Muon> tagMuons;
372 for (
auto const &
m : *muoHandle ) {
376 for (
int i = 0;
i<
int(tagMuons.size());
i++) {
377 for (
auto const &
m : *muoHandle ) {
379 if ((tagMuons[
i].
pt() ==
m.pt()))
continue;
401 for (
auto const &
m : *muoHandle ) {
404 for (
auto const & m1 : *muoHandle ) {
405 if (&
m - &(*muoHandle)[0] >= &m1 - &(*muoHandle)[0])
continue;
408 if (
false && !
matchToTrigger(hltpath,m1, handleTriggerEvent))
continue;
411 if (
m.charge()*m1.charge() > 0 )
continue;
415 std::vector<reco::TransientTrack> j_tks;
418 j_tks.push_back(mu1TT);
419 j_tks.push_back(mu2TT);
425 if ( (jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0) )
426 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
432 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
433 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
435 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
436 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R()*jpperp.R());
443 double DiMuMass = (m1.p4()+
m.p4()).M();
453 if (dimuonCL <
minprob)
continue;
471 if (dimuonCL <
minprob)
continue;
478 if (dimuonCL <
minprob)
continue;
498 if (dimuonCL <
minprob)
continue;
518 if (dimuonCL <
minprob)
continue;
525 for (
auto const & m2 : *muoHandle) {
526 if (
false && !
matchToTrigger(hltpath,m2, handleTriggerEvent))
continue;
527 if (m2.pt() ==
m.pt())
continue;
554 if (dimuonCL <
minprob)
continue;
562 if (dimuonCL <
minprob)
continue;
563 if (fabs(jpsi_cos) <
mincos)
continue;
564 if ((displacementFromBeamspotJpsi.perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
continue;
569 for (
auto const &
t : *trHandle) {
583 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
584 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
594 std::vector<reco::TransientTrack> t_tks;
595 t_tks.push_back(mu1TT);
596 t_tks.push_back(mu2TT);
597 t_tks.push_back(trTT);
604 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
605 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
607 m.py() + m1.py() + itrk1.
py(),
611 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
612 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
613 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
614 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
617 float jpsiKcos = vperp.Dot(pperp) / (vperp.R()*pperp.R());
618 if (JpsiTkCL <
minprob)
continue;
619 if (fabs(jpsiKcos) <
mincos)
continue;
620 if ((displacementFromBeamspot.perp() /
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
630 if (trHandle.isValid()) {
631 for (
auto const &
t : *trHandle) {
639 double trackMass2 = kaon_mass *
kaon_mass;
640 double MuMass2 = mu_mass *
mu_mass;
641 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
642 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
648 std::vector<reco::TransientTrack> t_tks;
649 t_tks.push_back(mu2TT);
650 t_tks.push_back(trTT);
656 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
657 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
659 m1.py() + itrk1.
py(),
663 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
664 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
665 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
666 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
669 if (JpsiTkCL<
minprob)
continue;
677 case11_selection(dimuonCL, jpsi_cos, displacementFromBeamspotJpsi, jerr, trHandle, hltpath, handleTriggerEvent,
m, m1, bFieldHandle, vertexBeamSpot,
mu1Phi_.
denominator,
mu1Eta_.
denominator,
mu1Pt_.
denominator,
mu2Phi_.
denominator,
mu2Eta_.
denominator,
mu2Pt_.
denominator);
686 for (
auto const &
p : *phHandle) {
701 for (
auto const &
m : *muoHandle ) {
702 if (
false && !
matchToTrigger(hltpath1,
m, handleTriggerEvent))
continue;
704 for (
auto const & m1 : *muoHandle ) {
706 if (
m.charge()*m1.charge() > 0 )
continue;
707 if (m1.pt() ==
m.pt())
continue;
709 if (
false && !
matchToTrigger(hltpath1,m1, handleTriggerEvent))
continue;
713 std::vector<reco::TransientTrack> j_tks;
716 j_tks.push_back(mu1TT);
717 j_tks.push_back(mu2TT);
723 if ( (jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0) )
724 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
730 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
731 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
733 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
734 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R()*jpperp.R());
741 double DiMuMass = (m1.p4()+
m.p4()).M();
751 if (dimuonCL <
minprob)
continue;
770 if (dimuonCL <
minprob)
continue;
777 if (dimuonCL <
minprob)
continue;
797 if (dimuonCL <
minprob)
continue;
816 if (dimuonCL <
minprob)
continue;
823 for (
auto const & m2 : *muoHandle) {
824 if (
false && !
matchToTrigger(hltpath1,m2, handleTriggerEvent))
continue;
825 if (m2.pt() ==
m.pt())
continue;
848 if (dimuonCL <
minprob)
continue;
856 if (dimuonCL <
minprob)
continue;
857 if (fabs(jpsi_cos) <
mincos)
continue;
858 if ((displacementFromBeamspotJpsi.perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
continue;
859 if (trHandle.isValid()) {
860 for (
auto const &
t : *trHandle) {
862 if (
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
868 double trackMass2 = kaon_mass *
kaon_mass;
869 double MuMass2 = mu_mass *
mu_mass;
870 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
871 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
872 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
879 std::vector<reco::TransientTrack> t_tks;
880 t_tks.push_back(mu1TT);
881 t_tks.push_back(mu2TT);
882 t_tks.push_back(trTT);
888 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
889 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
891 m.py() + m1.py() + itrk1.
py(),
895 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
896 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
897 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
898 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
901 float jpsiKcos = vperp.Dot(pperp) / (vperp.R()*pperp.R());
902 if (JpsiTkCL<
minprob)
continue;
903 if (fabs(jpsiKcos)<
mincos)
continue;
904 if ((displacementFromBeamspot.perp() /
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
913 if (trHandle.isValid()) {
914 for (
auto const &
t : *trHandle) {
916 if (
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
922 double trackMass2 = kaon_mass *
kaon_mass;
923 double MuMass2 = mu_mass *
mu_mass;
924 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
925 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
931 std::vector<reco::TransientTrack> t_tks;
932 t_tks.push_back(mu2TT);
933 t_tks.push_back(trTT);
934 if (t_tks.size()!=2)
continue;
940 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
941 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
943 m1.py() + itrk1.
py(),
947 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
948 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
949 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
950 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
953 if (JpsiTkCL<
minprob)
continue;
961 case11_selection(dimuonCL, jpsi_cos, displacementFromBeamspotJpsi, jerr, trHandle, hltpath, handleTriggerEvent,
m, m1, bFieldHandle, vertexBeamSpot,
mu1Phi_.
numerator,
mu1Eta_.
numerator,
mu1Pt_.
numerator,
mu2Phi_.
numerator,
mu2Eta_.
numerator,
mu2Pt_.
numerator);
968 for (
auto const &
p : *phHandle) {
GlobalError positionError() const
MonitorElement * numerator
double z0() const
z coordinate
float distance() const override
StringCutObjectSelector< reco::Candidate::LorentzVector, true > DMSelection_ref
trigger::size_type sizeFilters() const
const FreeTrajectoryState & theState() const
edm::EDGetTokenT< reco::MuonCollection > muoToken_
bool matchToTrigger(const std::string &theTriggerName, T t, edm::Handle< trigger::TriggerEvent > handleTriggerEvent)
double px() const
x coordinate of momentum vector
const Vector & momentum() const
track momentum vector
edm::EDGetTokenT< trigger::TriggerEvent > hltInputTag_
edm::EDGetTokenT< reco::TrackCollection > trToken_
double dydz() const
dydz slope
void case11_selection(const float &dimuonCL, const float &jpsi_cos, const GlobalPoint &displacementFromBeamspotJpsi, const GlobalError &jerr, const edm::Handle< reco::TrackCollection > &trHandle, const std::string &hltpath, const edm::Handle< trigger::TriggerEvent > &handleTriggerEvent, const reco::Muon &m, const reco::Muon &m1, const edm::ESHandle< MagneticField > &bFieldHandle, const reco::BeamSpot &vertexBeamSpot, MonitorElement *phi1, MonitorElement *eta1, MonitorElement *pT1, MonitorElement *phi2, MonitorElement *eta2, MonitorElement *pT2)
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
GlobalPoint position() const
GenericTriggerEventFlag * den_genTriggerEventFlag_
double chi2() const
chi-squares
MonitorElement * denominator
CachingVertex< 5 > vertex(const std::vector< reco::TransientTrack > &tracks) const override
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
math::XYZPoint Point
point in the space
double dxdz() const
dxdz slope
std::vector< std::string > hltpaths_den
StringCutObjectSelector< reco::Muon, true > muoSelection_
double pz() const
z coordinate of momentum vector
edm::EDGetTokenT< reco::PhotonCollection > phToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
StringCutObjectSelector< reco::Muon, true > muoSelection_ref
XYZVectorD XYZVector
spatial vector with cartesian internal representation
T rerr(const GlobalPoint &aPoint) const
bool quality(const TrackQuality) const
Track quality.
double y0() const
y coordinate
std::vector< std::string > hltpaths_num
GenericTriggerEventFlag * num_genTriggerEventFlag_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
StringCutObjectSelector< reco::Track, true > trSelection_ref
double py() const
y coordinate of momentum vector
double x0() const
x coordinate