21 #include "Math/VectorUtil.h"
36 #define SET_LABEL(NAME, PSET) (NAME = PSET.getParameter<string>(#NAME))
41 #define CAT3(A, B, C) A##B##C
42 #define STRING_NX(A) #A
43 #define STRING(A) STRING_NX(A)
44 #define CHK_TRIG(RESULTS, NAMES, INDEX, PATH) \
45 if (NAMES[INDEX].find(STRING(CAT3(HLT_, PATH, _v))) == 0) { \
46 flag_##PATH = RESULTS->accept(INDEX); \
56 TVector3 disp(svtx->
x() - pvtx->
x(), svtx->
y() - pvtx->
y(), 0);
57 TVector3 cmom(
px,
py, 0);
58 return disp.Dot(cmom) / (disp.Perp() * cmom.Perp());
61 TVector3 disp(svtx->
x() - pvtx->
x(), svtx->
y() - pvtx->
y(), 0);
62 return disp.Dot(cmom) / (disp.Perp() * cmom.Perp());
71 dist2D(pvtx, svtx,
px,
py, cAlpha(pvtx, svtx,
px,
py),
mass, ctauPV, ctauErrPV);
82 TVector3 cmom(
px,
py, 0);
86 ctauPV = distXY.
value() * cosAlpha *
mass / cmom.Perp();
90 ctauErrPV =
sqrt(ROOT::Math::Similarity(vmom, vXYe)) *
mass / cmom.Perp2();
112 const objRef* ref =
cand.userData<objRef>(
name);
127 int n =
cand.numberOfDaughters();
128 vector<const reco::Candidate*>
v;
130 for (
i = 0;
i <
n; ++
i) {
143 int cutPixelLayers = 0,
146 bool goodMuon =
true,
147 bool highPurity =
true)
148 : cutTL(cutTrackerLayers), cutPL(cutPixelLayers), maxXY(
maxDxy),
maxZ(
maxDz), gM(goodMuon), hP(highPurity) {}
156 if (
p->innerTrack()->hitPattern().trackerLayersWithMeasurement() <= cutTL)
158 if (
p->innerTrack()->hitPattern().pixelLayersWithMeasurement() <= cutPL)
165 if (fabs(
p->innerTrack()->dxy(
pos)) >= maxXY)
167 if (fabs(
p->innerTrack()->dz(
pos)) >=
maxZ)
189 : pLMin(ptMinLoose), pTMin(ptMinTight), eLMax(etaMaxLoose), eTMax(etaMaxTight), sms(softMuonselector) {}
192 return accept(
cand, pLMin, pTMin, eLMax, eTMax,
pv, sms);
203 if (dptr0 ==
nullptr)
205 if (dptr1 ==
nullptr)
207 float pt0 = dptr0->
pt();
208 float pt1 = dptr1->
pt();
209 if ((pt0 < ptMinLoose) || (
pt1 < ptMinLoose))
211 if ((pt0 < ptMinTight) && (
pt1 < ptMinTight))
213 float eta0 = fabs(dptr0->
eta());
214 float eta1 = fabs(dptr1->
eta());
215 if ((etaMaxLoose > 0) && ((eta0 > etaMaxLoose) || (
eta1 > etaMaxLoose)))
217 if ((etaMaxTight > 0) && ((eta0 > etaMaxTight) && (
eta1 > etaMaxTight)))
219 if (softMuonselector !=
nullptr) {
220 const reco::Vertex* pvtx = BPHUserData::getByRef<reco::Vertex>(
cand,
"primaryVertex");
223 if (!softMuonselector->accept(*dptr0, pvtx))
225 if (!softMuonselector->accept(*dptr1, pvtx))
246 if (((mMin > 0) && (mMax < 0)) || ((mMin < 0) && (mMax > 0)) || ((mMin > 0) && (mMax > 0) && (mMin < mMax))) {
250 if ((mMax > 0) && (
mass > mMax))
276 if (!
cand.hasUserFloat(
"fitMass"))
278 float mass =
cand.userFloat(
"fitMass");
279 if (((mMin > 0) && (mMax < 0)) || ((mMin < 0) && (mMax > 0)) || ((mMin > 0) && (mMax > 0) && (mMin < mMax))) {
282 if ((mMax > 0) && (
mass > mMax))
301 float r =
log((
e + z) / (
e - z)) / 2;
330 svtx = BPHUserData::get<reco::Vertex>(
cand,
"vertex");
336 svtx = BPHUserData::get<reco::Vertex>(
cand,
"fitVertex");
339 BPHUserData::get<Vector3DBase<float, GlobalTag>>(
cand,
"fitMomentum");
345 if (!
cand.hasUserFloat(
"fitMass"))
358 if ((cMin > -1.0) || (sMin > 0)) {
376 dTest = ctauPV / ctauErrPV;
394 useTrig = (!
SET_LABEL(trigResultsLabel, ps).empty());
395 useOnia = (!
SET_LABEL(oniaCandsLabel, ps).empty());
396 useSd = (!
SET_LABEL(sdCandsLabel, ps).empty());
397 useSs = (!
SET_LABEL(ssCandsLabel, ps).empty());
398 useBu = (!
SET_LABEL(buCandsLabel, ps).empty());
399 useBd = (!
SET_LABEL(bdCandsLabel, ps).empty());
400 useBs = (!
SET_LABEL(bsCandsLabel, ps).empty());
401 useK0 = (!
SET_LABEL(k0CandsLabel, ps).empty());
402 useL0 = (!
SET_LABEL(l0CandsLabel, ps).empty());
403 useB0 = (!
SET_LABEL(b0CandsLabel, ps).empty());
404 useLb = (!
SET_LABEL(lbCandsLabel, ps).empty());
405 useBc = (!
SET_LABEL(bcCandsLabel, ps).empty());
406 useX3872 = (!
SET_LABEL(x3872CandsLabel, ps).empty());
408 consume<edm::TriggerResults>(trigResultsToken, trigResultsLabel);
410 consume<vector<pat::CompositeCandidate>>(oniaCandsToken, oniaCandsLabel);
412 consume<vector<pat::CompositeCandidate>>(sdCandsToken, sdCandsLabel);
414 consume<vector<pat::CompositeCandidate>>(ssCandsToken, ssCandsLabel);
416 consume<vector<pat::CompositeCandidate>>(buCandsToken, buCandsLabel);
418 consume<vector<pat::CompositeCandidate>>(bdCandsToken, bdCandsLabel);
420 consume<vector<pat::CompositeCandidate>>(bsCandsToken, bsCandsLabel);
422 consume<vector<pat::CompositeCandidate>>(k0CandsToken, k0CandsLabel);
424 consume<vector<pat::CompositeCandidate>>(l0CandsToken, l0CandsLabel);
426 consume<vector<pat::CompositeCandidate>>(b0CandsToken, b0CandsLabel);
428 consume<vector<pat::CompositeCandidate>>(lbCandsToken, lbCandsLabel);
430 consume<vector<pat::CompositeCandidate>>(bcCandsToken, bcCandsLabel);
432 consume<vector<pat::CompositeCandidate>>(x3872CandsToken, x3872CandsLabel);
438 double phiIMassMin = 0.85;
439 double phiIMassMax = 1.20;
440 double phiIPtMin = 18.0;
441 double phiIEtaMax = -1.0;
442 double phiIYMax = -1.0;
443 double phiBMassMin = 0.85;
444 double phiBMassMax = 1.20;
445 double phiBPtMin = 14.0;
446 double phiBEtaMax = -1.0;
447 double phiBYMax = 1.25;
448 double jPsiIMassMin = 2.80;
449 double jPsiIMassMax = 3.40;
450 double jPsiIPtMin = 25.0;
451 double jPsiIEtaMax = -1.0;
452 double jPsiIYMax = -1.0;
453 double jPsiBMassMin = 2.80;
454 double jPsiBMassMax = 3.40;
455 double jPsiBPtMin = 20.0;
456 double jPsiBEtaMax = -1.0;
457 double jPsiBYMax = 1.25;
458 double psi2IMassMin = 3.40;
459 double psi2IMassMax = 4.00;
460 double psi2IPtMin = 18.0;
461 double psi2IEtaMax = -1.0;
462 double psi2IYMax = -1.0;
463 double psi2BMassMin = 3.40;
464 double psi2BMassMax = 4.00;
465 double psi2BPtMin = 10.0;
466 double psi2BEtaMax = -1.0;
467 double psi2BYMax = 1.25;
468 double upsIMassMin = 8.50;
469 double upsIMassMax = 11.0;
470 double upsIPtMin = 15.0;
471 double upsIEtaMax = -1.0;
472 double upsIYMax = -1.0;
473 double upsBMassMin = 8.50;
474 double upsBMassMax = 11.0;
475 double upsBPtMin = 12.0;
478 double upsBEtaMax = -1.0;
479 double upsBYMax = 1.4;
481 double oniaProbMin = 0.005;
482 double oniaCosMin = -2.0;
483 double oniaSigMin = -1.0;
485 double oniaMuPtMinLoose = 2.0;
486 double oniaMuPtMinTight = -1.0;
487 double oniaMuEtaMaxLoose = -1.0;
488 double oniaMuEtaMaxTight = -1.0;
492 jPsiIBasicSelect =
new BPHCompositeBasicSelect(jPsiIMassMin, jPsiIMassMax, jPsiIPtMin, jPsiIEtaMax, jPsiIYMax);
493 jPsiBBasicSelect =
new BPHCompositeBasicSelect(jPsiBMassMin, jPsiBMassMax, jPsiBPtMin, jPsiBEtaMax, jPsiBYMax);
494 psi2IBasicSelect =
new BPHCompositeBasicSelect(psi2IMassMin, psi2IMassMax, psi2IPtMin, psi2IEtaMax, psi2IYMax);
495 psi2BBasicSelect =
new BPHCompositeBasicSelect(psi2BMassMin, psi2BMassMax, psi2BPtMin, psi2BEtaMax, psi2BYMax);
501 new BPHDaughterSelect(oniaMuPtMinLoose, oniaMuPtMinTight, oniaMuEtaMaxLoose, oniaMuEtaMaxTight, sms);
505 double npJPsiPtMin = 8.0;
506 double npJPsiEtaMax = -1.0;
507 double npJPsiYMax = -1.0;
508 double npMuPtMinLoose = 4.0;
509 double npMuPtMinTight = -1.0;
510 double npMuEtaMaxLoose = 2.2;
511 double npMuEtaMaxTight = -1.0;
513 npJPsiBasicSelect =
new BPHCompositeBasicSelect(npJPsiMassMin, npJPsiMassMax, npJPsiPtMin, npJPsiEtaMax, npJPsiYMax);
514 npJPsiDaughterSelect =
new BPHDaughterSelect(npMuPtMinLoose, npMuPtMinTight, npMuEtaMaxLoose, npMuEtaMaxTight, sms);
518 double buIMassMin = 0.0;
519 double buIMassMax = 999999.0;
520 double buIPtMin = 27.0;
521 double buIEtaMax = -1.0;
522 double buIYMax = -1.0;
525 double buIJPsiPtMin = 25.0;
526 double buIJPsiEtaMax = -1.0;
527 double buIJPsiYMax = -1.0;
528 double buIProbMin = 0.15;
529 double buICosMin = -2.0;
530 double buISigMin = -1.0;
538 buIBasicSelect =
new BPHFittedBasicSelect(buIMassMin, buIMassMax, buIPtMin, buIEtaMax, buIYMax);
542 buIJPsiDaughterSelect =
nullptr;
547 double buDMassMin = 0.0;
548 double buDMassMax = 999999.0;
549 double buDPtMin = 10.0;
550 double buDEtaMax = -1.0;
551 double buDYMax = -1.0;
554 double buDJPsiPtMin = 8.0;
555 double buDJPsiEtaMax = -1.0;
556 double buDJPsiYMax = -1.0;
557 double buDProbMin = 0.10;
558 double buDCosMin = 0.99;
559 double buDSigMin = 3.0;
567 buDBasicSelect =
new BPHFittedBasicSelect(buDMassMin, buDMassMax, buDPtMin, buDEtaMax, buDYMax);
571 buDJPsiDaughterSelect =
nullptr;
578 double bdIMassMin = 0.0;
579 double bdIMassMax = 999999.0;
580 double bdIPtMin = 27.0;
581 double bdIEtaMax = -1.0;
582 double bdIYMax = -1.0;
585 double bdIJPsiPtMin = 25.0;
586 double bdIJPsiEtaMax = -1.0;
587 double bdIJPsiYMax = -1.0;
590 double bdIKx0PtMin = -1.0;
591 double bdIKx0EtaMax = -1.0;
592 double bdIKx0YMax = -1.0;
593 double bdIProbMin = 0.15;
594 double bdICosMin = -2.0;
595 double bdISigMin = -1.0;
601 bdIBasicSelect =
new BPHFittedBasicSelect(bdIMassMin, bdIMassMax, bdIPtMin, bdIEtaMax, bdIYMax);
604 bdIKx0BasicSelect =
new BPHCompositeBasicSelect(bdIKx0MassMin, bdIKx0MassMax, bdIKx0PtMin, bdIKx0EtaMax, bdIKx0YMax);
606 bdIJPsiDaughterSelect =
nullptr;
611 double bdDMassMin = 0.0;
612 double bdDMassMax = 999999.0;
613 double bdDPtMin = 10.0;
614 double bdDEtaMax = -1.0;
615 double bdDYMax = -1.0;
618 double bdDJPsiPtMin = 8.0;
619 double bdDJPsiEtaMax = -1.0;
620 double bdDJPsiYMax = -1.0;
623 double bdDKx0PtMin = -1.0;
624 double bdDKx0EtaMax = -1.0;
625 double bdDKx0YMax = -1.0;
626 double bdDProbMin = 0.10;
627 double bdDCosMin = 0.99;
628 double bdDSigMin = 3.0;
634 bdDBasicSelect =
new BPHFittedBasicSelect(bdDMassMin, bdDMassMax, bdDPtMin, bdDEtaMax, bdDYMax);
637 bdDKx0BasicSelect =
new BPHCompositeBasicSelect(bdDKx0MassMin, bdDKx0MassMax, bdDKx0PtMin, bdDKx0EtaMax, bdDKx0YMax);
639 bdDJPsiDaughterSelect =
nullptr;
646 double bsIMassMin = 0.0;
647 double bsIMassMax = 999999.0;
648 double bsIPtMin = 27.0;
649 double bsIEtaMax = -1.0;
650 double bsIYMax = -1.0;
653 double bsIJPsiPtMin = 25.0;
654 double bsIJPsiEtaMax = -1.0;
655 double bsIJPsiYMax = -1.0;
658 double bsIPhiPtMin = -1.0;
659 double bsIPhiEtaMax = -1.0;
660 double bsIPhiYMax = -1.0;
661 double bsIProbMin = 0.15;
662 double bsICosMin = -2.0;
663 double bsISigMin = -1.0;
669 bsIBasicSelect =
new BPHFittedBasicSelect(bsIMassMin, bsIMassMax, bsIPtMin, bsIEtaMax, bsIYMax);
672 bsIPhiBasicSelect =
new BPHCompositeBasicSelect(bsIPhiMassMin, bsIPhiMassMax, bsIPhiPtMin, bsIPhiEtaMax, bsIPhiYMax);
674 bsIJPsiDaughterSelect =
nullptr;
679 double bsDMassMin = 0.0;
680 double bsDMassMax = 999999.0;
681 double bsDPtMin = 10.0;
682 double bsDEtaMax = -1.0;
683 double bsDYMax = -1.0;
686 double bsDJPsiPtMin = 8.0;
687 double bsDJPsiEtaMax = -1.0;
688 double bsDJPsiYMax = -1.0;
691 double bsDPhiPtMin = -1.0;
692 double bsDPhiEtaMax = -1.0;
693 double bsDPhiYMax = -1.0;
694 double bsDProbMin = 0.10;
695 double bsDCosMin = 0.99;
696 double bsDSigMin = 3.0;
702 bsDBasicSelect =
new BPHFittedBasicSelect(bsDMassMin, bsDMassMax, bsDPtMin, bsDEtaMax, bsDYMax);
705 bsDPhiBasicSelect =
new BPHCompositeBasicSelect(bsDPhiMassMin, bsDPhiMassMax, bsDPhiPtMin, bsDPhiEtaMax, bsDPhiYMax);
707 bsDJPsiDaughterSelect =
nullptr;
714 double b0IMassMin = 0.0;
715 double b0IMassMax = 999999.0;
716 double b0IPtMin = 27.0;
717 double b0IEtaMax = -1.0;
718 double b0IYMax = -1.0;
721 double b0IJPsiPtMin = 25.0;
722 double b0IJPsiEtaMax = -1.0;
723 double b0IJPsiYMax = -1.0;
726 double b0IK0sPtMin = -1.0;
727 double b0IK0sEtaMax = -1.0;
728 double b0IK0sYMax = -1.0;
729 double b0IProbMin = 0.15;
730 double b0ICosMin = -2.0;
731 double b0ISigMin = -1.0;
737 b0IBasicSelect =
new BPHFittedBasicSelect(b0IMassMin, b0IMassMax, b0IPtMin, b0IEtaMax, b0IYMax);
740 b0IK0sBasicSelect =
new BPHFittedBasicSelect(b0IK0sMassMin, b0IK0sMassMax, b0IK0sPtMin, b0IK0sEtaMax, b0IK0sYMax);
742 b0IJPsiDaughterSelect =
nullptr;
747 double b0DMassMin = 0.0;
748 double b0DMassMax = 999999.0;
749 double b0DPtMin = 10.0;
750 double b0DEtaMax = -1.0;
751 double b0DYMax = -1.0;
754 double b0DJPsiPtMin = 8.0;
755 double b0DJPsiEtaMax = -1.0;
756 double b0DJPsiYMax = -1.0;
759 double b0DK0sPtMin = -1.0;
760 double b0DK0sEtaMax = -1.0;
761 double b0DK0sYMax = -1.0;
762 double b0DProbMin = 0.10;
763 double b0DCosMin = 0.99;
764 double b0DSigMin = 3.0;
770 b0DBasicSelect =
new BPHFittedBasicSelect(b0DMassMin, b0DMassMax, b0DPtMin, b0DEtaMax, b0DYMax);
773 b0DK0sBasicSelect =
new BPHFittedBasicSelect(b0DK0sMassMin, b0DK0sMassMax, b0DK0sPtMin, b0DK0sEtaMax, b0DK0sYMax);
775 b0DJPsiDaughterSelect =
nullptr;
782 double lbIMassMin = 0.0;
783 double lbIMassMax = 999999.0;
784 double lbIPtMin = 27.0;
785 double lbIEtaMax = -1.0;
786 double lbIYMax = -1.0;
789 double lbIJPsiPtMin = 25.0;
790 double lbIJPsiEtaMax = -1.0;
791 double lbIJPsiYMax = -1.0;
794 double lbILambda0PtMin = -1.0;
795 double lbILambda0EtaMax = -1.0;
796 double lbILambda0YMax = -1.0;
797 double lbIProbMin = 0.10;
798 double lbICosMin = -2.0;
799 double lbISigMin = -1.0;
805 lbIBasicSelect =
new BPHFittedBasicSelect(lbIMassMin, lbIMassMax, lbIPtMin, lbIEtaMax, lbIYMax);
808 lbILambda0BasicSelect =
809 new BPHFittedBasicSelect(lbILambda0MassMin, lbILambda0MassMax, lbILambda0PtMin, lbILambda0EtaMax, lbILambda0YMax);
811 lbIJPsiDaughterSelect =
nullptr;
816 double lbDMassMin = 0.0;
817 double lbDMassMax = 999999.0;
818 double lbDPtMin = 10.0;
819 double lbDEtaMax = -1.0;
820 double lbDYMax = -1.0;
823 double lbDJPsiPtMin = 8.0;
824 double lbDJPsiEtaMax = -1.0;
825 double lbDJPsiYMax = -1.0;
828 double lbDLambda0PtMin = -1.0;
829 double lbDLambda0EtaMax = -1.0;
830 double lbDLambda0YMax = -1.0;
831 double lbDProbMin = 0.10;
832 double lbDCosMin = 0.99;
833 double lbDSigMin = 3.0;
839 lbDBasicSelect =
new BPHFittedBasicSelect(lbDMassMin, lbDMassMax, lbDPtMin, lbDEtaMax, lbDYMax);
842 lbDLambda0BasicSelect =
843 new BPHFittedBasicSelect(lbDLambda0MassMin, lbDLambda0MassMax, lbDLambda0PtMin, lbDLambda0EtaMax, lbDLambda0YMax);
845 lbDJPsiDaughterSelect =
nullptr;
852 double bcIMassMin = 0.0;
853 double bcIMassMax = 999999.0;
854 double bcIPtMin = 27.0;
855 double bcIEtaMax = -1.0;
856 double bcIYMax = -1.0;
859 double bcIJPsiPtMin = 25.0;
860 double bcIJPsiEtaMax = -1.0;
861 double bcIJPsiYMax = -1.0;
862 double bcIJPsiProbMin = 0.005;
863 double bcIProbMin = 0.10;
864 double bcICosMin = -2.0;
865 double bcISigMin = -1.0;
866 double bcIDistMin = 0.01;
874 bcIBasicSelect =
new BPHFittedBasicSelect(bcIMassMin, bcIMassMax, bcIPtMin, bcIEtaMax, bcIYMax);
879 bcIJPsiDaughterSelect =
nullptr;
884 double bcDMassMin = 0.0;
885 double bcDMassMax = 999999.0;
886 double bcDPtMin = 8.0;
887 double bcDEtaMax = -1.0;
888 double bcDYMax = -1.0;
891 double bcDJPsiPtMin = 7.0;
892 double bcDJPsiEtaMax = -1.0;
893 double bcDJPsiYMax = -1.0;
894 double bcDJPsiProbMin = 0.005;
895 double bcDProbMin = 0.10;
896 double bcDCosMin = 0.99;
897 double bcDSigMin = 3.0;
906 bcDBasicSelect =
new BPHFittedBasicSelect(bcDMassMin, bcDMassMax, bcDPtMin, bcDEtaMax, bcDYMax);
911 bcDJPsiDaughterSelect =
nullptr;
918 double x3872IMassMin = 0.0;
919 double x3872IMassMax = 999999.0;
920 double x3872IPtMin = 27.0;
921 double x3872IEtaMax = -1.0;
922 double x3872IYMax = -1.0;
925 double x3872IJPsiPtMin = 25.0;
926 double x3872IJPsiEtaMax = -1.0;
927 double x3872IJPsiYMax = -1.0;
928 double x3872IJPsiProbMin = 0.10;
929 double x3872IProbMin = 0.10;
930 double x3872ICosMin = -2.0;
931 double x3872ISigMin = -1.0;
932 double x3872IDistMin = 0.01;
938 x3872JPsiDcaMax = 0.5;
941 x3872IBasicSelect =
new BPHFittedBasicSelect(x3872IMassMin, x3872IMassMax, x3872IPtMin, x3872IEtaMax, x3872IYMax);
943 x3872IJPsiMassMin, x3872IJPsiMassMax, x3872IJPsiPtMin, x3872IJPsiEtaMax, x3872IJPsiYMax);
945 x3872IVertexSelect =
new BPHGenericVertexSelect(
'f', x3872IProbMin, x3872ICosMin, x3872ISigMin, x3872IDistMin);
946 x3872IJPsiDaughterSelect =
nullptr;
952 double x3872DMassMin = 0.0;
953 double x3872DMassMax = 999999.0;
954 double x3872DPtMin = 8.0;
955 double x3872DEtaMax = -1.0;
956 double x3872DYMax = -1.0;
959 double x3872DJPsiPtMin = 7.0;
960 double x3872DJPsiEtaMax = -1.0;
961 double x3872DJPsiYMax = -1.0;
962 double x3872DJPsiProbMin = 0.10;
963 double x3872DProbMin = 0.10;
964 double x3872DCosMin = 0.99;
965 double x3872DSigMin = 3.0;
973 x3872DBasicSelect =
new BPHFittedBasicSelect(x3872DMassMin, x3872DMassMax, x3872DPtMin, x3872DEtaMax, x3872DYMax);
975 x3872DJPsiMassMin, x3872DJPsiMassMax, x3872DJPsiPtMin, x3872DJPsiEtaMax, x3872DJPsiYMax);
978 x3872DJPsiDaughterSelect =
nullptr;
986 delete phiIBasicSelect;
987 delete phiBBasicSelect;
988 delete jPsiIBasicSelect;
989 delete jPsiBBasicSelect;
990 delete psi2IBasicSelect;
991 delete psi2BBasicSelect;
992 delete upsIBasicSelect;
993 delete upsBBasicSelect;
994 delete oniaVertexSelect;
995 delete oniaDaughterSelect;
997 delete npJPsiBasicSelect;
998 delete npJPsiDaughterSelect;
1000 delete buIBasicSelect;
1001 delete buIJPsiBasicSelect;
1002 delete buIVertexSelect;
1003 delete buIJPsiDaughterSelect;
1004 delete buDBasicSelect;
1005 delete buDJPsiBasicSelect;
1006 delete buDVertexSelect;
1007 delete buDJPsiDaughterSelect;
1009 delete bdIBasicSelect;
1010 delete bdIJPsiBasicSelect;
1011 delete bdIKx0BasicSelect;
1012 delete bdIVertexSelect;
1013 delete bdIJPsiDaughterSelect;
1014 delete bdDBasicSelect;
1015 delete bdDJPsiBasicSelect;
1016 delete bdDKx0BasicSelect;
1017 delete bdDVertexSelect;
1018 delete bdDJPsiDaughterSelect;
1020 delete bsIBasicSelect;
1021 delete bsIJPsiBasicSelect;
1022 delete bsIPhiBasicSelect;
1023 delete bsIVertexSelect;
1024 delete bsIJPsiDaughterSelect;
1025 delete bsDBasicSelect;
1026 delete bsDJPsiBasicSelect;
1027 delete bsDPhiBasicSelect;
1028 delete bsDVertexSelect;
1029 delete bsDJPsiDaughterSelect;
1031 delete b0IBasicSelect;
1032 delete b0IJPsiBasicSelect;
1033 delete b0IK0sBasicSelect;
1034 delete b0IVertexSelect;
1035 delete b0IJPsiDaughterSelect;
1036 delete b0DBasicSelect;
1037 delete b0DJPsiBasicSelect;
1038 delete b0DK0sBasicSelect;
1039 delete b0DVertexSelect;
1040 delete b0DJPsiDaughterSelect;
1042 delete lbIBasicSelect;
1043 delete lbIJPsiBasicSelect;
1044 delete lbILambda0BasicSelect;
1045 delete lbIVertexSelect;
1046 delete lbIJPsiDaughterSelect;
1047 delete lbDBasicSelect;
1048 delete lbDJPsiBasicSelect;
1049 delete lbDLambda0BasicSelect;
1050 delete lbDVertexSelect;
1051 delete lbDJPsiDaughterSelect;
1053 delete bcIBasicSelect;
1054 delete bcIJPsiBasicSelect;
1055 delete bcIJPsiVertexSelect;
1056 delete bcIVertexSelect;
1057 delete bcIJPsiDaughterSelect;
1058 delete bcDBasicSelect;
1059 delete bcDJPsiBasicSelect;
1060 delete bcDJPsiVertexSelect;
1061 delete bcDVertexSelect;
1062 delete bcDJPsiDaughterSelect;
1064 delete x3872IBasicSelect;
1065 delete x3872IJPsiBasicSelect;
1066 delete x3872IJPsiVertexSelect;
1067 delete x3872IVertexSelect;
1068 delete x3872IJPsiDaughterSelect;
1069 delete x3872DBasicSelect;
1070 delete x3872DJPsiBasicSelect;
1071 delete x3872DJPsiVertexSelect;
1072 delete x3872DVertexSelect;
1073 delete x3872DJPsiDaughterSelect;
1078 desc.add<
string>(
"trigResultsLabel",
"");
1079 desc.add<
string>(
"oniaCandsLabel",
"");
1080 desc.add<
string>(
"sdCandsLabel",
"");
1081 desc.add<
string>(
"ssCandsLabel",
"");
1082 desc.add<
string>(
"buCandsLabel",
"");
1083 desc.add<
string>(
"bdCandsLabel",
"");
1084 desc.add<
string>(
"bsCandsLabel",
"");
1085 desc.add<
string>(
"k0CandsLabel",
"");
1086 desc.add<
string>(
"l0CandsLabel",
"");
1087 desc.add<
string>(
"b0CandsLabel",
"");
1088 desc.add<
string>(
"lbCandsLabel",
"");
1089 desc.add<
string>(
"bcCandsLabel",
"");
1090 desc.add<
string>(
"x3872CandsLabel",
"");
1091 descriptions.
add(
"process.bphHistoSpecificDecay",
desc);
1096 createHisto(
"massDIPhi", 50, 0.90, 1.15);
1097 createHisto(
"massTIPhi", 50, 0.90, 1.15);
1098 createHisto(
"massDBPhi", 50, 0.90, 1.15);
1099 createHisto(
"massTBPhi", 50, 0.90, 1.15);
1100 createHisto(
"massDIJPsi", 35, 2.95, 3.30);
1101 createHisto(
"massTIJPsi", 35, 2.95, 3.30);
1102 createHisto(
"massDBJPsi", 35, 2.95, 3.30);
1103 createHisto(
"massTBJPsi", 35, 2.95, 3.30);
1104 createHisto(
"massDIPsi2", 60, 3.40, 4.00);
1105 createHisto(
"massTIPsi2", 60, 3.40, 4.00);
1106 createHisto(
"massDBPsi2", 60, 3.40, 4.00);
1107 createHisto(
"massTBPsi2", 60, 3.40, 4.00);
1108 createHisto(
"massDIUps123", 115, 8.70, 11.0);
1109 createHisto(
"massTIUps123", 115, 8.70, 11.0);
1110 createHisto(
"massDBUps123", 115, 8.70, 11.0);
1111 createHisto(
"massTBUps123", 115, 8.70, 11.0);
1112 createHisto(
"massDIBu", 100, 5.00, 6.00);
1113 createHisto(
"massTIBu", 100, 5.00, 6.00);
1114 createHisto(
"massDDBu", 100, 5.00, 6.00);
1115 createHisto(
"massTDBu", 100, 5.00, 6.00);
1116 createHisto(
"massDIBd", 100, 5.00, 6.00);
1117 createHisto(
"massTIBd", 100, 5.00, 6.00);
1118 createHisto(
"massDDBd", 100, 5.00, 6.00);
1119 createHisto(
"massTDBd", 100, 5.00, 6.00);
1120 createHisto(
"massDIBs", 100, 5.00, 6.00);
1121 createHisto(
"massTIBs", 100, 5.00, 6.00);
1122 createHisto(
"massDDBs", 100, 5.00, 6.00);
1123 createHisto(
"massTDBs", 100, 5.00, 6.00);
1124 createHisto(
"massDIBc", 100, 6.00, 7.00);
1125 createHisto(
"massTIBc", 100, 6.00, 7.00);
1126 createHisto(
"massDDBc", 100, 6.00, 7.00);
1127 createHisto(
"massTDBc", 100, 6.00, 7.00);
1128 createHisto(
"massDIX3872", 40, 3.60, 4.00);
1129 createHisto(
"massTIX3872", 40, 3.60, 4.00);
1130 createHisto(
"massDDX3872", 40, 3.60, 4.00);
1131 createHisto(
"massTDX3872", 40, 3.60, 4.00);
1132 createHisto(
"mfitDIBu", 100, 5.00, 6.00);
1133 createHisto(
"mfitTIBu", 100, 5.00, 6.00);
1134 createHisto(
"mfitDDBu", 100, 5.00, 6.00);
1135 createHisto(
"mfitTDBu", 100, 5.00, 6.00);
1136 createHisto(
"mfitDIBd", 100, 5.00, 6.00);
1137 createHisto(
"mfitTIBd", 100, 5.00, 6.00);
1138 createHisto(
"mfitDDBd", 100, 5.00, 6.00);
1139 createHisto(
"mfitTDBd", 100, 5.00, 6.00);
1140 createHisto(
"mfitDIBs", 100, 5.00, 6.00);
1141 createHisto(
"mfitTIBs", 100, 5.00, 6.00);
1142 createHisto(
"mfitDDBs", 100, 5.00, 6.00);
1143 createHisto(
"mfitTDBs", 100, 5.00, 6.00);
1144 createHisto(
"mfitDIBc", 100, 6.00, 7.00);
1145 createHisto(
"mfitTIBc", 100, 6.00, 7.00);
1146 createHisto(
"mfitDDBc", 100, 6.00, 7.00);
1147 createHisto(
"mfitTDBc", 100, 6.00, 7.00);
1148 createHisto(
"mfitDIX3872", 40, 3.60, 4.00);
1149 createHisto(
"mfitTIX3872", 40, 3.60, 4.00);
1150 createHisto(
"mfitDDX3872", 40, 3.60, 4.00);
1151 createHisto(
"mfitTDX3872", 40, 3.60, 4.00);
1152 createHisto(
"massDIBuJPsi", 35, 2.95, 3.30);
1153 createHisto(
"massTIBuJPsi", 35, 2.95, 3.30);
1154 createHisto(
"massDDBuJPsi", 35, 2.95, 3.30);
1155 createHisto(
"massTDBuJPsi", 35, 2.95, 3.30);
1156 createHisto(
"massDIBdJPsi", 35, 2.95, 3.30);
1157 createHisto(
"massTIBdJPsi", 35, 2.95, 3.30);
1158 createHisto(
"massDDBdJPsi", 35, 2.95, 3.30);
1159 createHisto(
"massTDBdJPsi", 35, 2.95, 3.30);
1160 createHisto(
"massDIBdKx0", 50, 0.80, 1.05);
1161 createHisto(
"massTIBdKx0", 50, 0.80, 1.05);
1162 createHisto(
"massDDBdKx0", 50, 0.80, 1.05);
1163 createHisto(
"massTDBdKx0", 50, 0.80, 1.05);
1164 createHisto(
"massDIBsJPsi", 35, 2.95, 3.30);
1165 createHisto(
"massTIBsJPsi", 35, 2.95, 3.30);
1166 createHisto(
"massDDBsJPsi", 35, 2.95, 3.30);
1167 createHisto(
"massTDBsJPsi", 35, 2.95, 3.30);
1168 createHisto(
"massDIBsPhi", 50, 1.01, 1.03);
1169 createHisto(
"massTIBsPhi", 50, 1.01, 1.03);
1170 createHisto(
"massDDBsPhi", 50, 1.01, 1.03);
1171 createHisto(
"massTDBsPhi", 50, 1.01, 1.03);
1172 createHisto(
"massDIBcJPsi", 35, 2.95, 3.30);
1173 createHisto(
"massTIBcJPsi", 35, 2.95, 3.30);
1174 createHisto(
"massDDBcJPsi", 35, 2.95, 3.30);
1175 createHisto(
"massTDBcJPsi", 35, 2.95, 3.30);
1176 createHisto(
"massDIX3JPsi", 35, 2.95, 3.30);
1177 createHisto(
"massTIX3JPsi", 35, 2.95, 3.30);
1178 createHisto(
"massDDX3JPsi", 35, 2.95, 3.30);
1179 createHisto(
"massTDX3JPsi", 35, 2.95, 3.30);
1180 createHisto(
"massDK0s", 50, 0.40, 0.60);
1181 createHisto(
"mfitDK0s", 50, 0.40, 0.60);
1182 createHisto(
"massDLambda0", 60, 1.00, 1.30);
1183 createHisto(
"mfitDLambda0", 60, 1.00, 1.30);
1184 createHisto(
"massDIB0", 50, 5.00, 6.00);
1185 createHisto(
"massTIB0", 50, 5.00, 6.00);
1186 createHisto(
"massDDB0", 50, 5.00, 6.00);
1187 createHisto(
"massTDB0", 50, 5.00, 6.00);
1188 createHisto(
"mfitDIB0", 50, 5.00, 6.00);
1189 createHisto(
"mfitTIB0", 50, 5.00, 6.00);
1190 createHisto(
"mfitDDB0", 50, 5.00, 6.00);
1191 createHisto(
"mfitTDB0", 50, 5.00, 6.00);
1192 createHisto(
"massDIB0JPsi", 35, 2.95, 3.30);
1193 createHisto(
"massTIB0JPsi", 35, 2.95, 3.30);
1194 createHisto(
"massDDB0JPsi", 35, 2.95, 3.30);
1195 createHisto(
"massTDB0JPsi", 35, 2.95, 3.30);
1196 createHisto(
"massDIB0K0s", 50, 0.40, 0.60);
1197 createHisto(
"massTIB0K0s", 50, 0.40, 0.60);
1198 createHisto(
"massDDB0K0s", 50, 0.40, 0.60);
1199 createHisto(
"massTDB0K0s", 50, 0.40, 0.60);
1200 createHisto(
"mfitDIB0K0s", 50, 0.40, 0.60);
1201 createHisto(
"mfitTIB0K0s", 50, 0.40, 0.60);
1202 createHisto(
"mfitDDB0K0s", 50, 0.40, 0.60);
1203 createHisto(
"mfitTDB0K0s", 50, 0.40, 0.60);
1204 createHisto(
"massDILambdab", 25, 5.00, 6.00);
1205 createHisto(
"massTILambdab", 25, 5.00, 6.00);
1206 createHisto(
"massDDLambdab", 25, 5.00, 6.00);
1207 createHisto(
"massTDLambdab", 25, 5.00, 6.00);
1208 createHisto(
"mfitDILambdab", 25, 5.00, 6.00);
1209 createHisto(
"mfitTILambdab", 25, 5.00, 6.00);
1210 createHisto(
"mfitDDLambdab", 25, 5.00, 6.00);
1211 createHisto(
"mfitTDLambdab", 25, 5.00, 6.00);
1212 createHisto(
"massDILbJPsi", 35, 2.95, 3.30);
1213 createHisto(
"massTILbJPsi", 35, 2.95, 3.30);
1214 createHisto(
"massDDLbJPsi", 35, 2.95, 3.30);
1215 createHisto(
"massTDLbJPsi", 35, 2.95, 3.30);
1216 createHisto(
"massDILbL0", 60, 1.00, 1.30);
1217 createHisto(
"massTILbL0", 60, 1.00, 1.30);
1218 createHisto(
"massDDLbL0", 60, 1.00, 1.30);
1219 createHisto(
"massTDLbL0", 60, 1.00, 1.30);
1220 createHisto(
"mfitDILbL0", 60, 1.00, 1.30);
1221 createHisto(
"mfitTILbL0", 60, 1.00, 1.30);
1222 createHisto(
"mfitDDLbL0", 60, 1.00, 1.30);
1223 createHisto(
"mfitTDLbL0", 60, 1.00, 1.30);
1225 createHisto(
"massFull", 200, 2.00, 12.0);
1227 createHisto(
"ctauDIJPsi", 60, -0.05, 0.25);
1228 createHisto(
"ctauTIJPsi", 60, -0.05, 0.25);
1229 createHisto(
"ctauDBJPsi", 60, -0.05, 0.25);
1230 createHisto(
"ctauTBJPsi", 60, -0.05, 0.25);
1231 createHisto(
"ctauDIBu", 60, -0.05, 0.25);
1232 createHisto(
"ctauTIBu", 60, -0.05, 0.25);
1233 createHisto(
"ctauDDBu", 60, -0.05, 0.25);
1234 createHisto(
"ctauTDBu", 60, -0.05, 0.25);
1235 createHisto(
"ctauDIBd", 60, -0.05, 0.25);
1236 createHisto(
"ctauTIBd", 60, -0.05, 0.25);
1237 createHisto(
"ctauDDBd", 60, -0.05, 0.25);
1238 createHisto(
"ctauTDBd", 60, -0.05, 0.25);
1239 createHisto(
"ctauDIBs", 60, -0.05, 0.25);
1240 createHisto(
"ctauTIBs", 60, -0.05, 0.25);
1241 createHisto(
"ctauDDBs", 60, -0.05, 0.25);
1242 createHisto(
"ctauTDBs", 60, -0.05, 0.25);
1243 createHisto(
"ctauDIB0", 60, -0.05, 0.25);
1244 createHisto(
"ctauTIB0", 60, -0.05, 0.25);
1245 createHisto(
"ctauDDB0", 60, -0.05, 0.25);
1246 createHisto(
"ctauTDB0", 60, -0.05, 0.25);
1247 createHisto(
"ctauDILambdab", 60, -0.05, 0.25);
1248 createHisto(
"ctauTILambdab", 60, -0.05, 0.25);
1249 createHisto(
"ctauDDLambdab", 60, -0.05, 0.25);
1250 createHisto(
"ctauTDLambdab", 60, -0.05, 0.25);
1253 tree = fs->make<TTree>(
"BPHReco",
"BPHReco");
1254 b_runNumber =
tree->Branch(
"runNumber", &
runNumber,
"runNumber/i");
1255 b_lumiSection =
tree->Branch(
"lumiSection", &lumiSection,
"lumiSection/i");
1256 b_eventNumber =
tree->Branch(
"eventNumber", &eventNumber,
"eventNumber/i");
1257 b_recoName =
tree->Branch(
"recoName", &recoName, 8192, 99);
1258 b_recoMass =
tree->Branch(
"recoMass", &recoMass,
"recoMass/F");
1259 b_recoTime =
tree->Branch(
"recoTime", &recoTime,
"recoTime/F");
1260 b_recoErrT =
tree->Branch(
"recoErrT", &recoErrT,
"recoErrT/F");
1268 static map<string, ofstream*> ofMap;
1269 if (ofMap.empty()) {
1270 ofMap[
"BarPhi"] =
nullptr;
1271 ofMap[
"IncJPsi"] =
nullptr;
1272 ofMap[
"BarJPsi"] =
nullptr;
1273 ofMap[
"IncPsi2"] =
nullptr;
1274 ofMap[
"BarPsi2"] =
nullptr;
1275 ofMap[
"BarUpsilon123"] =
nullptr;
1276 ofMap[
"InclusiveBu"] =
nullptr;
1277 ofMap[
"DisplacedBu"] =
nullptr;
1278 ofMap[
"InclusiveBd"] =
nullptr;
1279 ofMap[
"DisplacedBd"] =
nullptr;
1280 ofMap[
"InclusiveBs"] =
nullptr;
1281 ofMap[
"DisplacedBs"] =
nullptr;
1282 ofMap[
"K0s"] =
nullptr;
1283 ofMap[
"Lambda0"] =
nullptr;
1284 ofMap[
"InclusiveB0"] =
nullptr;
1285 ofMap[
"DisplacedB0"] =
nullptr;
1286 ofMap[
"InclusiveLambdab"] =
nullptr;
1287 ofMap[
"DisplacedLambdab"] =
nullptr;
1288 ofMap[
"InclusiveBc"] =
nullptr;
1289 ofMap[
"DisplacedBc"] =
nullptr;
1290 ofMap[
"InclusiveX3872"] =
nullptr;
1291 ofMap[
"DisplacedX3872"] =
nullptr;
1292 map<string, ofstream*>::iterator iter = ofMap.begin();
1293 map<string, ofstream*>::iterator iend = ofMap.end();
1294 string name =
"list";
1295 while (iter != iend) {
1296 iter->second =
new ofstream(
name + iter->first);
1303 lumiSection =
ev.id().luminosityBlock();
1304 eventNumber =
ev.id().event();
1319 trigResultsToken.get(
ev, trigResults);
1324 bool flag_Dimuon25_Jpsi =
false;
1325 bool flag_Dimuon20_Jpsi_Barrel_Seagulls =
false;
1326 bool flag_Dimuon14_Phi_Barrel_Seagulls =
false;
1327 bool flag_Dimuon18_PsiPrime =
false;
1328 bool flag_Dimuon10_PsiPrime_Barrel_Seagulls =
false;
1329 bool flag_Dimuon12_Upsilon_eta1p5 =
false;
1330 bool flag_Dimuon12_Upsilon_y1p4 =
false;
1331 bool flag_DoubleMu4_JpsiTrk_Displaced =
false;
1335 int nObj =
names.size();
1336 for (iObj = 0; iObj < nObj; ++iObj) {
1339 CHK_TRIG(trigResults,
names, iObj, Dimuon20_Jpsi_Barrel_Seagulls)
1340 CHK_TRIG(trigResults,
names, iObj, Dimuon14_Phi_Barrel_Seagulls)
1342 CHK_TRIG(trigResults,
names, iObj, Dimuon10_PsiPrime_Barrel_Seagulls)
1345 CHK_TRIG(trigResults,
names, iObj, DoubleMu4_JpsiTrk_Displaced)
1370 oniaCandsToken.get(
ev, oniaCands);
1371 nqo = oniaCands->size();
1374 for (iqo = 0; iqo < nqo; ++iqo) {
1375 LogTrace(
"DataDump") <<
"*********** quarkonium " << iqo <<
"/" << nqo <<
" ***********";
1377 if (!oniaVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(
cand,
"primaryVertex")))
1379 if (!oniaDaughterSelect->accept(
cand))
1381 fillHisto(
"Full",
cand,
'c');
1382 if (phiBBasicSelect->accept(
cand)) {
1383 fillHisto(
"DBPhi",
cand,
'c');
1384 if (flag_Dimuon14_Phi_Barrel_Seagulls)
1385 fillHisto(
"TBPhi",
cand,
'c');
1386 if (flag_Dimuon14_Phi_Barrel_Seagulls)
1387 *ofMap[
"BarPhi"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1388 <<
cand.mass() << endl;
1390 if (jPsiIBasicSelect->accept(
cand)) {
1391 fillHisto(
"DIJPsi",
cand,
'c');
1392 if (flag_Dimuon25_Jpsi)
1393 fillHisto(
"TIJPsi",
cand,
'c');
1394 if (flag_Dimuon25_Jpsi)
1395 *ofMap[
"IncJPsi"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1396 <<
cand.mass() << endl;
1398 if (jPsiBBasicSelect->accept(
cand)) {
1399 fillHisto(
"DBJPsi",
cand,
'c');
1400 if (flag_Dimuon20_Jpsi_Barrel_Seagulls)
1401 fillHisto(
"TBJPsi",
cand,
'c');
1402 if (flag_Dimuon20_Jpsi_Barrel_Seagulls)
1403 *ofMap[
"BarJPsi"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1404 <<
cand.mass() << endl;
1406 if (psi2IBasicSelect->accept(
cand)) {
1407 fillHisto(
"DIPsi2",
cand,
'c');
1408 if (flag_Dimuon18_PsiPrime)
1409 fillHisto(
"TIPsi2",
cand,
'c');
1410 if (flag_Dimuon18_PsiPrime)
1411 *ofMap[
"IncPsi2"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1412 <<
cand.mass() << endl;
1414 if (psi2BBasicSelect->accept(
cand)) {
1415 fillHisto(
"DBPsi2",
cand,
'c');
1416 if (flag_Dimuon10_PsiPrime_Barrel_Seagulls)
1417 fillHisto(
"TBPsi2",
cand,
'c');
1418 if (flag_Dimuon10_PsiPrime_Barrel_Seagulls)
1419 *ofMap[
"BarPsi2"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1420 <<
cand.mass() << endl;
1422 if (upsBBasicSelect->accept(
cand)) {
1423 fillHisto(
"DBUps123",
cand,
'c');
1424 if (flag_Dimuon12_Upsilon_eta1p5 || flag_Dimuon12_Upsilon_y1p4)
1425 fillHisto(
"TBUps123",
cand,
'c');
1426 if (flag_Dimuon12_Upsilon_eta1p5 || flag_Dimuon12_Upsilon_y1p4)
1427 *ofMap[
"BarUpsilon123"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1428 <<
cand.mass() << endl;
1438 buCandsToken.get(
ev, buCands);
1439 nbu = buCands->size();
1442 for (ibu = 0; ibu < nbu; ++ibu) {
1443 LogTrace(
"DataDump") <<
"*********** Bu " << ibu <<
"/" << nbu <<
" ***********";
1446 LogTrace(
"DataDump") <<
"JPsi: " << jPsi;
1447 if (jPsi ==
nullptr)
1449 if (!npJPsiBasicSelect->accept(*jPsi))
1451 if (!npJPsiDaughterSelect->accept(*jPsi))
1454 if (kptr ==
nullptr)
1456 if (buIBasicSelect->accept(
cand) && buIJPsiBasicSelect->accept(*jPsi) &&
1458 buIVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1459 (kptr->
pt() > buIKPtMin)) {
1460 fillHisto(
"DIBu",
cand,
'f');
1461 fillHisto(
"DIBuJPsi", *jPsi,
'c');
1462 if (flag_Dimuon25_Jpsi) {
1463 fillHisto(
"TIBu",
cand,
'f');
1464 fillHisto(
"TIBuJPsi", *jPsi,
'c');
1465 *ofMap[
"InclusiveBu"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1466 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1469 if (buDBasicSelect->accept(
cand) && buDJPsiBasicSelect->accept(*jPsi) &&
1471 buDVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1472 (kptr->
pt() > buDKPtMin)) {
1473 fillHisto(
"DDBu",
cand,
'f');
1474 fillHisto(
"DDBuJPsi", *jPsi,
'c');
1475 if (flag_DoubleMu4_JpsiTrk_Displaced) {
1476 fillHisto(
"TDBu",
cand,
'f');
1477 fillHisto(
"TDBuJPsi", *jPsi,
'c');
1478 *ofMap[
"DisplacedBu"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1479 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1490 bdCandsToken.get(
ev, bdCands);
1491 nbd = bdCands->size();
1494 for (ibd = 0; ibd < nbd; ++ibd) {
1495 LogTrace(
"DataDump") <<
"*********** Bd " << ibd <<
"/" << nbd <<
" ***********";
1498 LogTrace(
"DataDump") <<
"JPsi: " << jPsi;
1499 if (jPsi ==
nullptr)
1501 if (!npJPsiBasicSelect->accept(*jPsi))
1503 if (!npJPsiDaughterSelect->accept(*jPsi))
1506 LogTrace(
"DataDump") <<
"Kx0: " << kx0;
1509 if (bdIBasicSelect->accept(
cand) && bdIJPsiBasicSelect->accept(*jPsi) && bdIKx0BasicSelect->accept(*kx0) &&
1511 bdIVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1512 fillHisto(
"DIBd",
cand,
'f');
1513 fillHisto(
"DIBdJPsi", *jPsi,
'c');
1514 fillHisto(
"DIBdKx0", *kx0,
'c');
1515 if (flag_Dimuon25_Jpsi) {
1516 fillHisto(
"TIBd",
cand,
'f');
1517 fillHisto(
"TIBdJPsi", *jPsi,
'c');
1518 fillHisto(
"TIBdKx0", *kx0,
'c');
1519 *ofMap[
"InclusiveBd"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1520 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1523 if (bdDBasicSelect->accept(
cand) && bdDJPsiBasicSelect->accept(*jPsi) && bdDKx0BasicSelect->accept(*kx0) &&
1525 bdDVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1526 fillHisto(
"DDBd",
cand,
'f');
1527 fillHisto(
"DDBdJPsi", *jPsi,
'c');
1528 fillHisto(
"DDBdKx0", *kx0,
'c');
1529 if (flag_DoubleMu4_JpsiTrk_Displaced) {
1530 fillHisto(
"TDBd",
cand,
'f');
1531 fillHisto(
"TDBdJPsi", *jPsi,
'c');
1532 fillHisto(
"TDBdKx0", *kx0,
'c');
1533 *ofMap[
"DisplacedBd"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1534 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1545 bsCandsToken.get(
ev, bsCands);
1546 nbs = bsCands->size();
1549 for (ibs = 0; ibs < nbs; ++ibs) {
1550 LogTrace(
"DataDump") <<
"*********** Bs " << ibs <<
"/" << nbs <<
" ***********";
1553 LogTrace(
"DataDump") <<
"JPsi: " << jPsi;
1554 if (jPsi ==
nullptr)
1556 if (!npJPsiBasicSelect->accept(*jPsi))
1558 if (!npJPsiDaughterSelect->accept(*jPsi))
1561 LogTrace(
"DataDump") <<
"Phi: " << phi;
1564 if (bsIBasicSelect->accept(
cand) && bsIJPsiBasicSelect->accept(*jPsi) && bsIPhiBasicSelect->accept(*phi) &&
1566 bsIVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1567 fillHisto(
"DIBs",
cand,
'f');
1568 fillHisto(
"DIBsJPsi", *jPsi,
'c');
1569 fillHisto(
"DIBsPhi", *phi,
'c');
1570 if (flag_Dimuon25_Jpsi) {
1571 fillHisto(
"TIBs",
cand,
'f');
1572 fillHisto(
"TIBsJPsi", *jPsi,
'c');
1573 fillHisto(
"TIBsPhi", *phi,
'c');
1574 *ofMap[
"InclusiveBs"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1575 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1578 if (bsDBasicSelect->accept(
cand) && bsDJPsiBasicSelect->accept(*jPsi) && bsDPhiBasicSelect->accept(*phi) &&
1580 bsDVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1581 fillHisto(
"DDBs",
cand,
'f');
1582 fillHisto(
"DDBsJPsi", *jPsi,
'c');
1583 fillHisto(
"DDBsPhi", *phi,
'c');
1584 if (flag_DoubleMu4_JpsiTrk_Displaced) {
1585 fillHisto(
"TDBs",
cand,
'f');
1586 fillHisto(
"TDBsJPsi", *jPsi,
'c');
1587 fillHisto(
"TDBsPhi", *phi,
'c');
1588 *ofMap[
"DisplacedBs"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1589 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1600 k0CandsToken.get(
ev, k0Cands);
1601 nk0 = k0Cands->size();
1604 for (ik0 = 0; ik0 < nk0; ++ik0) {
1605 LogTrace(
"DataDump") <<
"*********** K0 " << ik0 <<
"/" << nk0 <<
" ***********";
1607 fillHisto(
"DK0s",
cand,
'f');
1608 *ofMap[
"K0s"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1609 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1618 l0CandsToken.get(
ev, l0Cands);
1619 nl0 = l0Cands->size();
1622 for (il0 = 0; il0 < nl0; ++il0) {
1623 LogTrace(
"DataDump") <<
"*********** Lambda0 " << il0 <<
"/" << nl0 <<
" ***********";
1625 fillHisto(
"DLambda0",
cand,
'f');
1626 *ofMap[
"Lambda0"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1627 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1636 b0CandsToken.get(
ev, b0Cands);
1637 nb0 = b0Cands->size();
1644 for (ib0 = 0; ib0 < nb0; ++ib0) {
1645 LogTrace(
"DataDump") <<
"*********** B0 " << ib0 <<
"/" << nb0 <<
" ***********";
1648 LogTrace(
"DataDump") <<
"JPsi: " << jPsi;
1649 if (jPsi ==
nullptr)
1651 if (!npJPsiBasicSelect->accept(*jPsi))
1653 if (!npJPsiDaughterSelect->accept(*jPsi))
1656 LogTrace(
"DataDump") <<
"K0s: " << k0s;
1659 if (b0IBasicSelect->accept(
cand) && b0IJPsiBasicSelect->accept(*jPsi) && b0IK0sBasicSelect->accept(*k0s) &&
1661 b0IVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1662 fillHisto(
"DIB0",
cand,
'f');
1663 fillHisto(
"DIB0JPsi", *jPsi,
'c');
1664 fillHisto(
"DIB0K0s", *k0s,
'c');
1665 if (flag_Dimuon25_Jpsi) {
1666 fillHisto(
"TIB0",
cand,
'f');
1667 fillHisto(
"TIB0JPsi", *jPsi,
'c');
1668 fillHisto(
"TIB0K0s", *k0s,
'c');
1669 *ofMap[
"InclusiveB0"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1670 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1673 if (b0DBasicSelect->accept(
cand) && b0DJPsiBasicSelect->accept(*jPsi) && b0DK0sBasicSelect->accept(*k0s) &&
1675 b0DVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1676 fillHisto(
"DDB0",
cand,
'f');
1677 fillHisto(
"DDB0JPsi", *jPsi,
'c');
1678 fillHisto(
"DDB0K0s", *k0s,
'c');
1679 if (flag_DoubleMu4_JpsiTrk_Displaced) {
1680 fillHisto(
"TDB0",
cand,
'f');
1681 fillHisto(
"TDB0JPsi", *jPsi,
'c');
1682 fillHisto(
"TDB0K0s", *k0s,
'c');
1683 *ofMap[
"DisplacedB0"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1684 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1695 lbCandsToken.get(
ev, lbCands);
1696 nlb = lbCands->size();
1699 for (ilb = 0; ilb < nlb; ++ilb) {
1700 LogTrace(
"DataDump") <<
"*********** Lambdab " << ilb <<
"/" << nlb <<
" ***********";
1703 LogTrace(
"DataDump") <<
"JPsi: " << jPsi;
1704 if (jPsi ==
nullptr)
1706 if (!npJPsiBasicSelect->accept(*jPsi))
1708 if (!npJPsiDaughterSelect->accept(*jPsi))
1711 LogTrace(
"DataDump") <<
"Lambda0: " << l0;
1714 if (lbIBasicSelect->accept(
cand) && lbIJPsiBasicSelect->accept(*jPsi) && lbILambda0BasicSelect->accept(*l0) &&
1716 lbIVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1717 fillHisto(
"DILambdab",
cand,
'f');
1718 fillHisto(
"DILbJPsi", *jPsi,
'c');
1719 fillHisto(
"DILbL0", *l0,
'c');
1720 if (flag_Dimuon25_Jpsi) {
1721 fillHisto(
"TILambdab",
cand,
'f');
1722 fillHisto(
"TILbJPsi", *jPsi,
'c');
1723 fillHisto(
"TILbL0", *l0,
'c');
1724 *ofMap[
"InclusiveLambdab"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1725 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1728 if (lbDBasicSelect->accept(
cand) && lbDJPsiBasicSelect->accept(*jPsi) && lbDLambda0BasicSelect->accept(*l0) &&
1730 lbDVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex"))) {
1731 fillHisto(
"DDLambdab",
cand,
'f');
1732 fillHisto(
"DDLbJPsi", *jPsi,
'c');
1733 fillHisto(
"DDLbL0", *l0,
'c');
1734 if (flag_DoubleMu4_JpsiTrk_Displaced) {
1735 fillHisto(
"TDLambdab",
cand,
'f');
1736 fillHisto(
"TDLbJPsi", *jPsi,
'c');
1737 fillHisto(
"TDLbL0", *l0,
'c');
1738 *ofMap[
"DisplacedLambdab"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1739 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1750 bcCandsToken.get(
ev, bcCands);
1751 nbc = bcCands->size();
1754 for (ibc = 0; ibc < nbc; ++ibc) {
1755 LogTrace(
"DataDump") <<
"*********** Bc " << ibc <<
"/" << nbc <<
" ***********";
1758 LogTrace(
"DataDump") <<
"JPsi: " << jPsi;
1759 if (jPsi ==
nullptr)
1762 if (!npJPsiBasicSelect->accept(*jPsi))
1764 if (!npJPsiDaughterSelect->accept(*jPsi))
1767 if (pptr ==
nullptr)
1770 if (bcIBasicSelect->accept(
cand) && bcIJPsiBasicSelect->accept(*jPsi) &&
1772 bcIJPsiVertexSelect->accept(*jPsi, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1773 bcIVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1774 (pptr->
pt() > bcIPiPtMin)) {
1775 fillHisto(
"DIBc",
cand,
'f');
1776 fillHisto(
"DIBcJPsi", *jPsi,
'c');
1777 if (flag_Dimuon25_Jpsi) {
1778 fillHisto(
"TIBc",
cand,
'f');
1779 fillHisto(
"TIBcJPsi", *jPsi,
'c');
1780 *ofMap[
"InclusiveBc"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1781 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1784 if (bcDBasicSelect->accept(
cand) && bcDJPsiBasicSelect->accept(*jPsi) &&
1786 bcDVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1787 bcDVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1788 (pptr->
pt() > bcDPiPtMin)) {
1789 fillHisto(
"DDBc",
cand,
'f');
1790 fillHisto(
"DDBcJPsi", *jPsi,
'c');
1791 if (flag_DoubleMu4_JpsiTrk_Displaced) {
1792 fillHisto(
"TDBc",
cand,
'f');
1793 fillHisto(
"TDBcJPsi", *jPsi,
'c');
1794 *ofMap[
"DisplacedBc"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1795 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1806 x3872CandsToken.get(
ev, x3872Cands);
1807 nx3872 = x3872Cands->size();
1810 for (ix3872 = 0; ix3872 < nx3872; ++ix3872) {
1811 LogTrace(
"DataDump") <<
"*********** X3872 " << ix3872 <<
"/" << nx3872 <<
" ***********";
1814 LogTrace(
"DataDump") <<
"JPsi: " << jPsi;
1815 if (jPsi ==
nullptr)
1818 if (!npJPsiBasicSelect->accept(*jPsi))
1820 if (!npJPsiDaughterSelect->accept(*jPsi))
1824 if (ppt1 ==
nullptr)
1826 if (ppt2 ==
nullptr)
1828 if (x3872IBasicSelect->accept(
cand) && x3872IJPsiBasicSelect->accept(*jPsi) &&
1830 x3872IJPsiVertexSelect->accept(*jPsi, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1831 x3872IVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1832 (ppt1->
pt() > x3872IPiPtMin) && (ppt2->
pt() > x3872IPiPtMin)) {
1833 fillHisto(
"DIX3872",
cand,
'f');
1834 fillHisto(
"DIX3872JPsi", *jPsi,
'c');
1835 if (flag_Dimuon25_Jpsi) {
1836 fillHisto(
"TIX3872",
cand,
'f');
1837 fillHisto(
"TIX3872JPsi", *jPsi,
'c');
1838 *ofMap[
"InclusiveX3872"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1839 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1842 if (x3872DBasicSelect->accept(
cand) && x3872DJPsiBasicSelect->accept(*jPsi) &&
1844 x3872DVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1845 x3872DVertexSelect->accept(
cand, BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex")) &&
1846 (ppt1->
pt() > x3872DPiPtMin) && (ppt2->
pt() > x3872DPiPtMin)) {
1847 fillHisto(
"DDX3872",
cand,
'f');
1848 fillHisto(
"DDX3872JPsi", *jPsi,
'c');
1849 if (flag_DoubleMu4_JpsiTrk_Displaced) {
1850 fillHisto(
"TDX3872",
cand,
'f');
1851 fillHisto(
"TDX3872JPsi", *jPsi,
'c');
1852 *ofMap[
"DisplacedX3872"] <<
ev.id().run() <<
' ' <<
ev.id().luminosityBlock() <<
' ' <<
ev.id().event() <<
' '
1853 << (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1) << endl;
1868 float mass = (
cand.hasUserFloat(
"fitMass") ?
cand.userFloat(
"fitMass") : -1);
1869 fillHisto(
"mass" +
name,
cand.mass());
1872 recoTime = -999999.0;
1873 recoErrT = -999999.0;
1875 const reco::Vertex* pvtx = BPHUserData::getByRef<reco::Vertex>(
cand,
"primaryVertex");
1876 if (pvtx ==
nullptr) {
1878 if (jPsi ==
nullptr)
1880 pvtx = BPHUserData::getByRef<reco::Vertex>(*jPsi,
"primaryVertex");
1884 if (pvtx !=
nullptr) {
1887 svtx = BPHUserData::get<reco::Vertex>(
cand,
"fitVertex");
1888 if (svtx ==
nullptr)
1889 svtx = BPHUserData::get<reco::Vertex>(
cand,
"vertex");
1891 if (svtx !=
nullptr) {
1895 BPHUserData::get<Vector3DBase<float, GlobalTag>>(
cand,
"fitMomentum");
1896 if (fmom !=
nullptr) {
1907 recoErrT = ctauErrPV2;
1908 fillHisto(
"ctau" +
name, ctauPV2);
1916 map<string, TH1F*>::iterator iter = histoMap.find(
name);
1917 map<string, TH1F*>::iterator iend = histoMap.end();
1920 iter->second->Fill(x);
1925 histoMap[
name] = fs->make<TH1F>(
name.c_str(),
name.c_str(), nbin, hmin, hmax);