394 std::vector<reco::Muon> tagMuons;
395 for (
auto const &
m : *muoHandle ) {
399 for (
int i = 0;
i<
int(tagMuons.size());
i++){
400 for (
auto const &
m : *muoHandle ) {
402 if ((tagMuons[
i].
pt() ==
m.pt()))
continue;
424 for (
auto const &
m : *muoHandle ) {
427 for (
auto const & m1 : *muoHandle ) {
428 if (m1.pt() ==
m.pt())
continue;
430 if(
false && !
matchToTrigger(hltpath,m1, handleTriggerEvent))
continue;
433 if (
m.charge()*m1.charge()>0 )
continue;
437 std::vector<reco::TransientTrack> j_tks;
440 j_tks.push_back(mu1TT);
441 j_tks.push_back(mu2TT);
447 if( (jpsivertex.
chi2()>=0) && (jpsivertex.
ndof()>0) )
448 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
454 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
455 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
457 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
458 float jpsi_cos = vperpj.Dot(jpperp)/(vperpj.R()*jpperp.R());
465 double DiMuMass = (m1.p4()+
m.p4()).M();
547 for (
auto const & m2 : *muoHandle) {
548 if(
false && !
matchToTrigger(hltpath,m2, handleTriggerEvent))
continue;
549 if (m2.pt() ==
m.pt())
continue;
585 if (fabs(jpsi_cos)<
mincos)
continue;
586 if ((displacementFromBeamspotJpsi.perp()/
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)))<
minDS)
continue;
591 for (
auto const &
t : *trHandle) {
605 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
606 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
616 std::vector<reco::TransientTrack> t_tks;
617 t_tks.push_back(mu1TT);
618 t_tks.push_back(mu2TT);
619 t_tks.push_back(trTT);
626 if ((vertex.
chi2()>=0.0) && (vertex.
ndof()>0) )
627 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
629 m.py() + m1.py() + itrk1.
py(),
633 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
634 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
635 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
636 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
639 float jpsiKcos = vperp.Dot(pperp)/(vperp.R()*pperp.R());
641 if (fabs(jpsiKcos)<
mincos)
continue;
642 if ((displacementFromBeamspot.perp()/
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
652 if (trHandle.isValid()){
653 for (
auto const &
t : *trHandle) {
661 double trackMass2 = kaon_mass *
kaon_mass;
662 double MuMass2 = mu_mass *
mu_mass;
663 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
664 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
670 std::vector<reco::TransientTrack> t_tks;
671 t_tks.push_back(mu2TT);
672 t_tks.push_back(trTT);
678 if ((vertex.
chi2()>=0.0) && (vertex.
ndof()>0) )
679 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
681 m1.py() + itrk1.
py(),
685 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
686 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
687 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
688 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
700 if (fabs(jpsi_cos)<
mincos)
continue;
701 if ((displacementFromBeamspotJpsi.perp()/
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)))<
minDS)
continue;
702 if (trHandle.isValid()){
704 for (
auto const &
t : *trHandle) {
707 for (
auto const & t1 : *trHandle) {
709 if(
false && !
matchToTrigger(hltpath,t1, handleTriggerEvent))
continue;
718 double trackMass2 = kaon_mass *
kaon_mass;
719 double MuMass2 = mu_mass *
mu_mass;
720 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
721 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
722 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
728 pB = p1 + p2 + p3 +
p4;
732 std::vector<reco::TransientTrack> t_tks;
733 t_tks.push_back(mu1TT);
734 t_tks.push_back(mu2TT);
735 t_tks.push_back(trTT);
736 t_tks.push_back(tr1TT);
742 if ((vertex.
chi2()>=0.0) && (vertex.
ndof()>0) )
743 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
745 m.py() + m1.py() + itrk1.
py() + itrk2.
py(),
749 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
750 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
751 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
752 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
755 float jpsiKcos = vperp.Dot(pperp)/(vperp.R()*pperp.R());
757 if (fabs(jpsiKcos)<
mincos)
continue;
758 if ((displacementFromBeamspot.perp()/
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
777 for (
auto const &
p : *phHandle) {
792 for (
auto const &
m : *muoHandle ) {
795 for (
auto const & m1 : *muoHandle ) {
797 if (
m.charge()*m1.charge()>0 )
continue;
798 if (m1.pt() ==
m.pt())
continue;
800 if(
false && !
matchToTrigger(hltpath1,m1, handleTriggerEvent))
continue;
804 std::vector<reco::TransientTrack> j_tks;
807 j_tks.push_back(mu1TT);
808 j_tks.push_back(mu2TT);
814 if( (jpsivertex.
chi2()>=0) && (jpsivertex.
ndof()>0) )
815 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof() );
821 GlobalPoint displacementFromBeamspotJpsi( -1*((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
822 -1*((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
824 reco::Vertex::Point vperpj(displacementFromBeamspotJpsi.x(), displacementFromBeamspotJpsi.y(), 0.);
825 float jpsi_cos = vperpj.Dot(jpperp)/(vperpj.R()*jpperp.R());
832 double DiMuMass = (m1.p4()+
m.p4()).M();
914 for (
auto const & m2 : *muoHandle) {
915 if(
false && !
matchToTrigger(hltpath1,m2, handleTriggerEvent))
continue;
916 if (m2.pt() ==
m.pt())
continue;
948 if (fabs(jpsi_cos)<
mincos)
continue;
949 if ((displacementFromBeamspotJpsi.perp()/
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)))<
minDS)
continue;
950 if (trHandle.isValid()){
951 for (
auto const &
t : *trHandle) {
959 double trackMass2 = kaon_mass *
kaon_mass;
960 double MuMass2 = mu_mass *
mu_mass;
961 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
962 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
963 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
970 std::vector<reco::TransientTrack> t_tks;
971 t_tks.push_back(mu1TT);
972 t_tks.push_back(mu2TT);
973 t_tks.push_back(trTT);
979 if ((vertex.
chi2()>=0.0) && (vertex.
ndof()>0) )
980 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
982 m.py() + m1.py() + itrk1.
py(),
986 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
987 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
988 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
989 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
992 float jpsiKcos = vperp.Dot(pperp)/(vperp.R()*pperp.R());
994 if (fabs(jpsiKcos)<
mincos)
continue;
995 if ((displacementFromBeamspot.perp()/
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
1004 if (trHandle.isValid()){
1005 for (
auto const &
t : *trHandle) {
1007 if(
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
1013 double trackMass2 = kaon_mass *
kaon_mass;
1014 double MuMass2 = mu_mass *
mu_mass;
1015 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
1016 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
1022 std::vector<reco::TransientTrack> t_tks;
1023 t_tks.push_back(mu2TT);
1024 t_tks.push_back(trTT);
1025 if (t_tks.size()!=2)
continue;
1031 if ((vertex.
chi2()>=0.0) && (vertex.
ndof()>0) )
1032 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
1034 m1.py() + itrk1.
py(),
1038 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
1039 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
1040 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
1041 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
1044 if (JpsiTkCL<
minprob)
continue;
1052 if (dimuonCL<
minprob)
continue;
1053 if (fabs(jpsi_cos)<
mincos)
continue;
1054 if ((displacementFromBeamspotJpsi.perp()/
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)))<
minDS)
continue;
1055 if (trHandle.isValid()){
1056 for (
auto const &
t : *trHandle) {
1058 if(
false && !
matchToTrigger(hltpath1,
t, handleTriggerEvent))
continue;
1059 for (
auto const & t1 : *trHandle) {
1061 if(
false && !
matchToTrigger(hltpath1,t1, handleTriggerEvent))
continue;
1071 double trackMass2 = kaon_mass *
kaon_mass;
1072 double MuMass2 = mu_mass *
mu_mass;
1073 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2 );
1074 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2 );
1075 double e3 =
sqrt(itrk1.
momentum().Mag2() + trackMass2 );
1076 double e4 =
sqrt(itrk2.
momentum().Mag2() + trackMass2 );
1081 pB = p1 + p2 + p3 +
p4;
1085 std::vector<reco::TransientTrack> t_tks;
1086 t_tks.push_back(mu1TT);
1087 t_tks.push_back(mu2TT);
1088 t_tks.push_back(trTT);
1089 t_tks.push_back(tr1TT);
1095 if ((vertex.
chi2()>=0.0) && (vertex.
ndof()>0) )
1096 JpsiTkCL = TMath::Prob(vertex.
chi2(), vertex.
ndof() );
1098 m.py() + m1.py() + itrk1.
py() + itrk2.
py(),
1102 GlobalPoint displacementFromBeamspot( -1*((vertexBeamSpot.
x0() - secondaryVertex.
x()) +
1103 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
1104 -1*((vertexBeamSpot.
y0() - secondaryVertex.
y()) +
1105 (secondaryVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
1108 float jpsiKcos = vperp.Dot(pperp)/(vperp.R()*pperp.R());
1109 if (JpsiTkCL<
minprob)
continue;
1110 if (fabs(jpsiKcos)<
mincos)
continue;
1111 if ((displacementFromBeamspot.perp()/
sqrt(err.
rerr(displacementFromBeamspot)))<
minDS)
continue;
1128 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
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