394 double PrescaleWeight = 1;
401 std::vector<reco::Muon> tagMuons;
402 for (
auto const &
m : *muoHandle ) {
406 for (
int i = 0;
i<
int(tagMuons.size());
i++) {
407 for (
auto const &
m : *muoHandle ) {
409 if ((tagMuons[
i].
pt() ==
m.pt()))
continue;
431 for (
auto const &
m : *muoHandle ) {
434 for (
auto const & m1 : *muoHandle ) {
435 if (&
m - &(*muoHandle)[0] >= &m1 - &(*muoHandle)[0])
continue;
438 if (
false && !
matchToTrigger(hltpath,m1, handleTriggerEvent))
continue;
441 if (
m.charge()*m1.charge() > 0 )
continue;
445 std::vector<reco::TransientTrack> j_tks;
448 j_tks.push_back(mu1TT);
449 j_tks.push_back(mu2TT);
455 if ( (jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0) )
456 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
462 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
463 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
465 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
466 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R()*jpperp.R());
473 double DiMuMass = (m1.p4()+
m.p4()).M();
483 if (dimuonCL <
minprob)
continue;
501 if (dimuonCL <
minprob)
continue;
508 if (dimuonCL <
minprob)
continue;
528 if (dimuonCL <
minprob)
continue;
548 if (dimuonCL <
minprob)
continue;
555 for (
auto const & m2 : *muoHandle) {
556 if (
false && !
matchToTrigger(hltpath,m2, handleTriggerEvent))
continue;
557 if (m2.pt() ==
m.pt())
continue;
584 if (dimuonCL <
minprob)
continue;
592 if (dimuonCL <
minprob)
continue;
593 if (fabs(jpsi_cos) <
mincos)
continue;
594 if ((displacementFromBeamspotJpsi.perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
continue;
599 for (
auto const &
t : *trHandle) {
613 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
614 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
624 std::vector<reco::TransientTrack> t_tks;
625 t_tks.push_back(mu1TT);
626 t_tks.push_back(mu2TT);
627 t_tks.push_back(trTT);
634 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
635 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
637 m.py() + m1.py() + itrk1.
py(),
641 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
642 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
643 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
644 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
647 float jpsiKcos = vperp.Dot(pperp) / (vperp.R()*pperp.R());
648 if (JpsiTkCL <
minprob)
continue;
649 if (fabs(jpsiKcos) <
mincos)
continue;
650 if ((displacementFromBeamspot.perp() /
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
660 if (trHandle.isValid()) {
661 for (
auto const &
t : *trHandle) {
669 double trackMass2 = kaon_mass *
kaon_mass;
670 double MuMass2 = mu_mass *
mu_mass;
671 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
672 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
678 std::vector<reco::TransientTrack> t_tks;
679 t_tks.push_back(mu2TT);
680 t_tks.push_back(trTT);
686 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
687 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
689 m1.py() + itrk1.
py(),
693 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
694 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
695 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
696 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
699 if (JpsiTkCL<
minprob)
continue;
707 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);
717 for (
auto const &
p : *phHandle) {
742 for (
auto const &
m : *muoHandle ) {
743 if (
false && !
matchToTrigger(hltpath1,
m, handleTriggerEvent))
continue;
745 for (
auto const & m1 : *muoHandle ) {
747 if (
m.charge()*m1.charge() > 0 )
continue;
748 if (m1.pt() ==
m.pt())
continue;
750 if (
false && !
matchToTrigger(hltpath1,m1, handleTriggerEvent))
continue;
754 std::vector<reco::TransientTrack> j_tks;
757 j_tks.push_back(mu1TT);
758 j_tks.push_back(mu2TT);
764 if ( (jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0) )
765 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
771 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
772 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
774 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
775 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R()*jpperp.R());
782 double DiMuMass = (m1.p4()+
m.p4()).M();
792 if (dimuonCL <
minprob)
continue;
811 if (dimuonCL <
minprob)
continue;
818 if (dimuonCL <
minprob)
continue;
838 if (dimuonCL <
minprob)
continue;
857 if (dimuonCL <
minprob)
continue;
864 for (
auto const & m2 : *muoHandle) {
865 if (
false && !
matchToTrigger(hltpath1,m2, handleTriggerEvent))
continue;
866 if (m2.pt() ==
m.pt())
continue;
889 if (dimuonCL <
minprob)
continue;
897 if (dimuonCL <
minprob)
continue;
898 if (fabs(jpsi_cos) <
mincos)
continue;
899 if ((displacementFromBeamspotJpsi.perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
continue;
900 if (trHandle.isValid()) {
901 for (
auto const &
t : *trHandle) {
903 if (
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
909 double trackMass2 = kaon_mass *
kaon_mass;
910 double MuMass2 = mu_mass *
mu_mass;
911 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
912 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
913 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
920 std::vector<reco::TransientTrack> t_tks;
921 t_tks.push_back(mu1TT);
922 t_tks.push_back(mu2TT);
923 t_tks.push_back(trTT);
929 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
930 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
932 m.py() + m1.py() + itrk1.
py(),
936 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
937 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
938 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
939 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
942 float jpsiKcos = vperp.Dot(pperp) / (vperp.R()*pperp.R());
943 if (JpsiTkCL<
minprob)
continue;
944 if (fabs(jpsiKcos)<
mincos)
continue;
945 if ((displacementFromBeamspot.perp() /
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
954 if (trHandle.isValid()) {
955 for (
auto const &
t : *trHandle) {
957 if (
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
963 double trackMass2 = kaon_mass *
kaon_mass;
964 double MuMass2 = mu_mass *
mu_mass;
965 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
966 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
972 std::vector<reco::TransientTrack> t_tks;
973 t_tks.push_back(mu2TT);
974 t_tks.push_back(trTT);
975 if (t_tks.size()!=2)
continue;
981 if ((vertex.
chi2() >= 0.0) && (vertex.
ndof() > 0) )
982 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
984 m1.py() + itrk1.
py(),
988 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
989 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
990 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
991 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
994 if (JpsiTkCL<
minprob)
continue;
1002 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);
1009 if ( phHandle.isValid() ) {
1010 for (
auto const &
p : *phHandle) {
1011 if (
false && !
matchToTrigger(hltpath,
p, handleTriggerEvent))
continue;
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_
edm::InputTag bsInputTag_
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
std::vector< bool > warningPrinted4token_
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
edm::InputTag muoInputTag_
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
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
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
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.
edm::InputTag trInputTag_
double y0() const
y coordinate
std::vector< std::string > hltpaths_num
edm::InputTag phInputTag_
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