374 std::vector<reco::Muon> tagMuons;
375 for (
auto const &
m : *muoHandle ) {
379 for (
int i = 0;
i<
int(tagMuons.size());
i++) {
380 for (
auto const &
m : *muoHandle ) {
382 if ((tagMuons[
i].
pt() ==
m.pt()))
continue;
404 for (
auto const &
m : *muoHandle ) {
407 for (
auto const & m1 : *muoHandle ) {
408 if (&
m - &(*muoHandle)[0] >= &m1 - &(*muoHandle)[0])
continue;
411 if (
false && !
matchToTrigger(hltpath,m1, handleTriggerEvent))
continue;
414 if (
m.charge()*m1.charge() > 0 )
continue;
418 std::vector<reco::TransientTrack> j_tks;
421 j_tks.push_back(mu1TT);
422 j_tks.push_back(mu2TT);
428 if ( (jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0) )
429 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
435 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
436 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
438 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
439 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R()*jpperp.R());
446 double DiMuMass = (m1.p4()+
m.p4()).M();
456 if (dimuonCL <
minprob)
continue;
474 if (dimuonCL <
minprob)
continue;
481 if (dimuonCL <
minprob)
continue;
501 if (dimuonCL <
minprob)
continue;
521 if (dimuonCL <
minprob)
continue;
528 for (
auto const & m2 : *muoHandle) {
529 if (
false && !
matchToTrigger(hltpath,m2, handleTriggerEvent))
continue;
530 if (m2.pt() ==
m.pt())
continue;
557 if (dimuonCL <
minprob)
continue;
565 if (dimuonCL <
minprob)
continue;
566 if (fabs(jpsi_cos) <
mincos)
continue;
567 if ((displacementFromBeamspotJpsi.perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
continue;
572 for (
auto const &
t : *trHandle) {
586 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
587 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
597 std::vector<reco::TransientTrack> t_tks;
598 t_tks.push_back(mu1TT);
599 t_tks.push_back(mu2TT);
600 t_tks.push_back(trTT);
607 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
608 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
610 m.py() + m1.py() + itrk1.
py(),
614 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
615 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
616 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
617 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
620 float jpsiKcos = vperp.Dot(pperp) / (vperp.R()*pperp.R());
621 if (JpsiTkCL <
minprob)
continue;
622 if (fabs(jpsiKcos) <
mincos)
continue;
623 if ((displacementFromBeamspot.perp() /
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
633 if (trHandle.isValid()) {
634 for (
auto const &
t : *trHandle) {
642 double trackMass2 = kaon_mass *
kaon_mass;
643 double MuMass2 = mu_mass *
mu_mass;
644 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
645 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
651 std::vector<reco::TransientTrack> t_tks;
652 t_tks.push_back(mu2TT);
653 t_tks.push_back(trTT);
659 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
660 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
662 m1.py() + itrk1.
py(),
666 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
667 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
668 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
669 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
672 if (JpsiTkCL<
minprob)
continue;
680 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);
689 for (
auto const &
p : *phHandle) {
704 for (
auto const &
m : *muoHandle ) {
705 if (
false && !
matchToTrigger(hltpath1,
m, handleTriggerEvent))
continue;
707 for (
auto const & m1 : *muoHandle ) {
709 if (
m.charge()*m1.charge() > 0 )
continue;
710 if (m1.pt() ==
m.pt())
continue;
712 if (
false && !
matchToTrigger(hltpath1,m1, handleTriggerEvent))
continue;
716 std::vector<reco::TransientTrack> j_tks;
719 j_tks.push_back(mu1TT);
720 j_tks.push_back(mu2TT);
726 if ( (jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0) )
727 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
733 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
734 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
736 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
737 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R()*jpperp.R());
744 double DiMuMass = (m1.p4()+
m.p4()).M();
754 if (dimuonCL <
minprob)
continue;
773 if (dimuonCL <
minprob)
continue;
780 if (dimuonCL <
minprob)
continue;
800 if (dimuonCL <
minprob)
continue;
819 if (dimuonCL <
minprob)
continue;
826 for (
auto const & m2 : *muoHandle) {
827 if (
false && !
matchToTrigger(hltpath1,m2, handleTriggerEvent))
continue;
828 if (m2.pt() ==
m.pt())
continue;
851 if (dimuonCL <
minprob)
continue;
859 if (dimuonCL <
minprob)
continue;
860 if (fabs(jpsi_cos) <
mincos)
continue;
861 if ((displacementFromBeamspotJpsi.perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
continue;
862 if (trHandle.isValid()) {
863 for (
auto const &
t : *trHandle) {
865 if (
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
871 double trackMass2 = kaon_mass *
kaon_mass;
872 double MuMass2 = mu_mass *
mu_mass;
873 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
874 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
875 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
882 std::vector<reco::TransientTrack> t_tks;
883 t_tks.push_back(mu1TT);
884 t_tks.push_back(mu2TT);
885 t_tks.push_back(trTT);
891 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
892 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
894 m.py() + m1.py() + itrk1.
py(),
898 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
899 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
900 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
901 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
904 float jpsiKcos = vperp.Dot(pperp) / (vperp.R()*pperp.R());
905 if (JpsiTkCL<
minprob)
continue;
906 if (fabs(jpsiKcos)<
mincos)
continue;
907 if ((displacementFromBeamspot.perp() /
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
916 if (trHandle.isValid()) {
917 for (
auto const &
t : *trHandle) {
919 if (
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
925 double trackMass2 = kaon_mass *
kaon_mass;
926 double MuMass2 = mu_mass *
mu_mass;
927 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
928 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
934 std::vector<reco::TransientTrack> t_tks;
935 t_tks.push_back(mu2TT);
936 t_tks.push_back(trTT);
937 if (t_tks.size()!=2)
continue;
943 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
944 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
946 m1.py() + itrk1.
py(),
950 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
951 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
952 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
953 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
956 if (JpsiTkCL<
minprob)
continue;
964 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);
971 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
int prescaleWeight(const edm::Event &event, const edm::EventSetup &setup)
const FreeTrajectoryState & theState() const
edm::EDGetTokenT< reco::MuonCollection > muoToken_
PrescaleWeightProvider * prescaleWeightProvider_
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