370 int npv = pVertices->size();
378 nrc = pfCands->size();
388 nrc = pcCands->size();
395 nrc = gpCands->size();
430 vector<const reco::Candidate*> muDaugs;
431 set<const pat::Muon*> muonSet;
432 typedef multimap<const reco::Candidate*, const pat::CompositeCandidate*> mu_cc_map;
437 int n = ccCands->size();
441 set<const pat::Muon*>::const_iterator iter;
442 set<const pat::Muon*>::const_iterator iend;
444 for (
i = 0;
i <
n; ++
i) {
447 int m =
cc.numberOfDaughters();
448 for (
j = 0;
j <
m; ++
j) {
451 iter = muonSet.
begin();
452 iend = muonSet.end();
453 bool add = (mp !=
nullptr) && (muonSet.find(mp) == iend);
454 while (
add && (iter != iend)) {
461 muCCMap.insert(pair<const reco::Candidate*, const pat::CompositeCandidate*>(
dp, &
cc));
464 iter = muonSet.begin();
465 iend = muonSet.end();
467 muDaugs.push_back(*iter++);
470 map<recoType, map<parType, double> >::const_iterator rIter =
parMap.begin();
471 map<recoType, map<parType, double> >::const_iterator rIend =
parMap.end();
485 if (onia !=
nullptr) {
486 while (rIter != rIend) {
487 const map<recoType, map<parType, double> >
::value_type& rEntry = *rIter++;
489 const map<parType, double>&
pMap = rEntry.second;
516 map<parType, double>::const_iterator pIter =
pMap.begin();
517 map<parType, double>::const_iterator pIend =
pMap.end();
518 while (pIter != pIend) {
521 double pv = pEntry.second;
555 int nFull =
lFull.size();
556 map<const BPHRecoCandidate*, const reco::Vertex*> oniaVtxMap;
558 typedef mu_cc_map::const_iterator mu_cc_iter;
559 for (iFull = 0; iFull < nFull; ++iFull) {
563 const std::vector<const reco::Candidate*>& daugs = ptr->
daughters();
567 pair<mu_cc_iter, mu_cc_iter> cc0 = muCCMap.equal_range(ptr->
originalReco(daugs[0]));
568 pair<mu_cc_iter, mu_cc_iter> cc1 = muCCMap.equal_range(ptr->
originalReco(daugs[1]));
569 mu_cc_iter iter0 = cc0.first;
570 mu_cc_iter iend0 = cc0.second;
571 mu_cc_iter iter1 = cc1.first;
572 mu_cc_iter iend1 = cc1.second;
573 while ((iter0 != iend0) && (pVtx ==
nullptr)) {
575 while (iter1 != iend1) {
576 if (ccp != iter1++->
second)
581 float dMin = 999999.;
583 for (ipv = 0; ipv < npv; ++ipv) {
586 float dist =
pow(pPos.x() - tPos.x(), 2) +
pow(pPos.y() - tPos.y(), 2) +
pow(pPos.z() - tPos.z(), 2);
600 if (pVtx ==
nullptr) {
610 float minDz = 999999.;
611 float extrapZ = (
state ? ttmd.
points().first.z() : -9e20);
613 for (ipv = 0; ipv < npv; ++ipv) {
624 oniaVtxMap[ptr] = pVtx;
634 bool jPsiFound = !
lJPsi.empty();
642 int nj =
lJPsi.size();
643 int no =
lFull.size();
644 for (ij = 0; ij < nj; ++ij) {
646 for (
io = 0;
io < no; ++
io) {
659 if (
recoBu && jPsiFound) {
670 if (rIter != rIend) {
671 const map<parType, double>&
pMap = rIter->second;
672 map<parType, double>::const_iterator pIter =
pMap.begin();
673 map<parType, double>::const_iterator pIend =
pMap.end();
674 while (pIter != pIend) {
677 double pv = pEntry.second;
723 vector<BPHPlusMinusConstCandPtr> lKx0;
737 set<BPHRecoConstCandPtr> sKx0;
739 if (kx0 !=
nullptr) {
741 if (rIter != rIend) {
742 const map<parType, double>&
pMap = rIter->second;
743 map<parType, double>::const_iterator pIter =
pMap.begin();
744 map<parType, double>::const_iterator pIend =
pMap.end();
745 while (pIter != pIend) {
748 double pv = pEntry.second;
775 sKx0.insert(lKx0.begin(), lKx0.end());
779 bool kx0Found = !lKx0.empty();
783 if (
recoBd && jPsiFound && kx0Found) {
786 if (rIter != rIend) {
787 const map<parType, double>&
pMap = rIter->second;
788 map<parType, double>::const_iterator pIter =
pMap.begin();
789 map<parType, double>::const_iterator pIend =
pMap.end();
790 while (pIter != pIend) {
793 double pv = pEntry.second;
838 int nBd =
lBd.size();
839 for (iBd = 0; iBd < nBd; ++iBd)
840 sKx0.insert(
lBd[iBd]->getComp(
"Kx0"));
842 set<BPHRecoConstCandPtr>::const_iterator kx0_iter = sKx0.begin();
843 set<BPHRecoConstCandPtr>::const_iterator kx0_iend = sKx0.end();
844 lSd.reserve(sKx0.size());
845 while (kx0_iter != kx0_iend)
846 lSd.push_back(*kx0_iter++);
850 vector<BPHPlusMinusConstCandPtr> lPhi;
864 set<BPHRecoConstCandPtr> sPhi;
866 if (
phi !=
nullptr) {
868 if (rIter != rIend) {
869 const map<parType, double>&
pMap = rIter->second;
870 map<parType, double>::const_iterator pIter =
pMap.begin();
871 map<parType, double>::const_iterator pIend =
pMap.end();
872 while (pIter != pIend) {
875 double pv = pEntry.second;
902 sPhi.insert(lPhi.begin(), lPhi.end());
906 bool phiFound = !lPhi.empty();
910 if (
recoBs && jPsiFound && phiFound) {
913 if (rIter != rIend) {
914 const map<parType, double>&
pMap = rIter->second;
915 map<parType, double>::const_iterator pIter =
pMap.begin();
916 map<parType, double>::const_iterator pIend =
pMap.end();
917 while (pIter != pIend) {
920 double pv = pEntry.second;
923 bs->setJPsiMassMin(
pv);
926 bs->setJPsiMassMax(
pv);
929 bs->setPhiMassMin(
pv);
932 bs->setPhiMassMax(
pv);
944 bs->setMassFitMin(
pv);
947 bs->setMassFitMax(
pv);
950 bs->setConstr(
pv > 0);
965 int nBs =
lBs.size();
966 for (iBs = 0; iBs < nBs; ++iBs)
967 sPhi.insert(
lBs[iBs]->getComp(
"Phi"));
969 set<BPHRecoConstCandPtr>::const_iterator phi_iter = sPhi.begin();
970 set<BPHRecoConstCandPtr>::const_iterator phi_iend = sPhi.end();
971 lSs.reserve(sPhi.size());
972 while (phi_iter != phi_iend)
973 lSs.push_back(*phi_iter++);
984 if (k0s !=
nullptr) {
986 if (rIter != rIend) {
987 const map<parType, double>&
pMap = rIter->second;
988 map<parType, double>::const_iterator pIter =
pMap.begin();
989 map<parType, double>::const_iterator pIend =
pMap.end();
990 while (pIter != pIend) {
993 double pv = pEntry.second;
1022 bool k0Found = !
lK0.empty();
1033 if (l0s !=
nullptr) {
1035 if (rIter != rIend) {
1036 const map<parType, double>&
pMap = rIter->second;
1037 map<parType, double>::const_iterator pIter =
pMap.begin();
1038 map<parType, double>::const_iterator pIend =
pMap.end();
1039 while (pIter != pIend) {
1042 double pv = pEntry.second;
1071 bool l0Found = !
lL0.empty();
1075 if (
recoB0 && jPsiFound && k0Found) {
1078 if (rIter != rIend) {
1079 const map<parType, double>&
pMap = rIter->second;
1080 map<parType, double>::const_iterator pIter =
pMap.begin();
1081 map<parType, double>::const_iterator pIend =
pMap.end();
1082 while (pIter != pIend) {
1085 double pv = pEntry.second;
1088 b0->setJPsiMassMin(
pv);
1091 b0->setJPsiMassMax(
pv);
1094 b0->setK0MassMin(
pv);
1097 b0->setK0MassMax(
pv);
1109 b0->setMassFitMin(
pv);
1112 b0->setMassFitMax(
pv);
1115 b0->setConstr(
pv > 0);
1127 const map<const BPHRecoCandidate*, const BPHRecoCandidate*>& b0Map =
b0->daughMap();
1128 daughMap.insert(b0Map.begin(), b0Map.end());
1137 if (rIter != rIend) {
1138 const map<parType, double>&
pMap = rIter->second;
1139 map<parType, double>::const_iterator pIter =
pMap.begin();
1140 map<parType, double>::const_iterator pIend =
pMap.end();
1141 while (pIter != pIend) {
1144 double pv = pEntry.second;
1186 const map<const BPHRecoCandidate*, const BPHRecoCandidate*>& ldMap = lb->
daughMap();
1187 daughMap.insert(ldMap.begin(), ldMap.end());
1194 if (
recoBc && jPsiFound) {
1203 if (bc !=
nullptr) {
1205 if (rIter != rIend) {
1206 const map<parType, double>&
pMap = rIter->second;
1207 map<parType, double>::const_iterator pIter =
pMap.begin();
1208 map<parType, double>::const_iterator pIend =
pMap.end();
1209 while (pIter != pIend) {
1212 double pv = pEntry.second;
1271 if (psi2S !=
nullptr) {
1273 if (rIter != rIend) {
1274 const map<parType, double>&
pMap = rIter->second;
1275 map<parType, double>::const_iterator pIter =
pMap.begin();
1276 map<parType, double>::const_iterator pIend =
pMap.end();
1277 while (pIter != pIend) {
1280 double pv = pEntry.second;
1339 if (x3872 !=
nullptr) {
1341 if (rIter != rIend) {
1342 const map<parType, double>&
pMap = rIter->second;
1343 map<parType, double>::const_iterator pIter =
pMap.begin();
1344 map<parType, double>::const_iterator pIend =
pMap.end();
1345 while (pIter != pIend) {
1348 double pv = pEntry.second;
1393 class ResTrkTrkCompare {
1396 vector<const reco::Track*> tl =
l->tracks();
1397 vector<const reco::Track*> tr =
r->tracks();
1398 if (tl.size() < tr.size())
1400 sort(tl.begin(), tl.end());
1401 sort(tr.begin(), tr.end());
1404 for (
i = 0;
i <
n; ++
i) {
1413 set<BPHRecoConstCandPtr, ResTrkTrkCompare> sjpPiPi(rttc);
1416 vector<BPHRecoConstCandPtr> ljpPiPi;
1417 ljpPiPi.insert(ljpPiPi.end(), sjpPiPi.begin(), sjpPiPi.end());
1418 bool jpPiPiFound = !ljpPiPi.empty();
1423 if (
recoBp && jpPiPiFound) {
1432 if (bp !=
nullptr) {
1435 BPHBuToPsi2SSelect()
1437 ~BPHBuToPsi2SSelect()
override =
default;
1444 bool mcJPsi =
false;
1447 if (rIter != rIend) {
1448 const map<parType, double>&
pMap = rIter->second;
1449 map<parType, double>::const_iterator pIter =
pMap.begin();
1450 map<parType, double>::const_iterator pIend =
pMap.end();
1451 while (pIter != pIend) {
1454 double pv = pEntry.second;
1507 const map<const BPHRecoCandidate*, const BPHRecoCandidate*>& bpMap = bp->
daughMap();
1508 daughMap.insert(bpMap.begin(), bpMap.end());
BPHTokenWrapper< std::vector< reco::VertexCompositeCandidate > > l0CandsToken
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
Analysis-level particle class.
static bool sameTrack(const reco::Candidate *lCand, const reco::Candidate *rCand, double minPDifference)
void setJPsiMassMax(double m)
void setEtaMax(double eta)
BPHTokenWrapper< std::vector< reco::Vertex > > pVertexToken
std::vector< BPHPlusMinusConstCandPtr > lJPsi
void setJPsiMassMin(double m)
set cuts
BPHTokenWrapper< std::vector< reco::VertexCompositePtrCandidate > > kSCandsToken
std::vector< BPHPlusMinusConstCandPtr > lK0
edm::Ref< std::vector< reco::Vertex > > vertex_ref
void setMassMax(oniaType type, double m)
std::map< const BPHRecoCandidate *, compcc_ref > ccRefMap
void setConstr(bool flag)
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
static const double jPsiMWidth
std::vector< BPHPlusMinusConstCandPtr > lFull
const Point & position() const
position
uint32_t cc[maxCellsPerHit]
void setJPsiMassMin(double m)
T const * product() const
void setKPtMin(double pt)
set cuts
std::vector< BPHRecoConstCandPtr > lBs
std::vector< BPHRecoConstCandPtr > lBp
bool get(const edm::Event &ev, edm::Handle< Obj > &obj)
BPHTokenWrapper< std::vector< BPHTrackReference::candidate > > pcCandsToken
void setKEtaMax(double eta)
void setKxMassMin(double m)
virtual std::vector< prod_ptr > build()
build candidates
static const double jPsiMass
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
BPHESTokenWrapper< MagneticField, IdealMagneticFieldRecord > magFieldToken
const pat::CompositeCandidate & composite() const override
get a composite by the simple sum of simple particles
void setLambda0MassMin(double m)
void setJPsiMassMax(double m)
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > daughMap
void setProbMin(oniaType type, double p)
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
std::map< std::string, parType > pMap
void setMassFitSelect(BPHMassFitSelect *mfs)
static BPHGenericCollection * createCollection(const edm::Handle< T > &collection, const std::string &list="cfhpmig")
std::vector< BPHRecoConstCandPtr > lSs
U second(std::pair< T, U > const &p)
double getConstrSigma(oniaType type) const
virtual const reco::Candidate * getDaug(const std::string &name) const
BPHTokenWrapper< std::vector< reco::VertexCompositeCandidate > > k0CandsToken
Container::value_type value_type
std::vector< BPHPlusMinusConstCandPtr > getList(oniaType type, BPHRecoSelect *dSel=nullptr, BPHMomentumSelect *mSel=nullptr, BPHVertexSelect *vSel=nullptr, BPHFitSelect *kSel=nullptr)
BPHTokenWrapper< pat::MuonCollection > patMuonToken
void setProbMin(double p)
void setEtaMax(double eta)
void setEtaMax(double eta)
BPHTokenWrapper< std::vector< reco::PFCandidate > > pfCandsToken
void setMassMax(double m)
void setJPsiMassMin(double m)
set cuts
BPHTokenWrapper< std::vector< reco::VertexCompositePtrCandidate > > lSCandsToken
math::XYZPoint Point
point in the space
BPHTokenWrapper< std::vector< pat::CompositeCandidate > > ccCandsToken
std::pair< GlobalPoint, GlobalPoint > points() const override
std::vector< BPHRecoConstCandPtr > lSd
void setMassFitMin(double m)
double getConstrMass(oniaType type) const
const T * userData(const std::string &key) const
Returns user-defined data. Returns NULL if the data is not present, or not of type T...
virtual const reco::Vertex & vertex(VertexFitter< 5 > *fitter=nullptr, const reco::BeamSpot *bs=nullptr, const GlobalPoint *priorPos=nullptr, const GlobalError *priorError=nullptr) const
get reconstructed vertex
void setPsi2SMassMax(double m)
double getMassFitMax() const
void setLambda0MassMax(double m)
BPHTokenWrapper< std::vector< pat::GenericParticle > > gpCandsToken
void setKEtaMax(double eta)
void setMassFitMax(double m)
void setPiEtaMax(double eta)
std::map< const BPHRecoCandidate *, vertex_ref > pvRefMap
std::vector< BPHPlusMinusConstCandPtr > lL0
std::vector< BPHRecoConstCandPtr > lBu
void setKxMassMax(double m)
std::vector< BPHRecoConstCandPtr > lLb
void setPiPtMin(double pt)
set cuts
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
const edm::EventSetup * get() const
void setJPsiMassMin(double m)
void setConstr(oniaType type, double mass, double sigma)
void setEtaMax(oniaType type, double eta)
void setPtMin(double pt)
set cuts
double getMassFitMin() const
std::map< recoType, std::map< parType, double > > parMap
void setMassMin(double m)
set cuts
std::vector< BPHRecoConstCandPtr > lPsi2S
virtual const std::vector< const reco::Candidate * > & daughters() const
const std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > & daughMap() const
get original daughters map
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > jPsiOMap
static constexpr float b0
std::vector< BPHRecoConstCandPtr > lB0
void setKPtMin(double pt)
set cuts
void setMassMin(oniaType type, double m)
std::vector< BPHRecoConstCandPtr > lBc
std::vector< BPHRecoConstCandPtr > lX3872
void setPiEtaMax(double eta)
const std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > & daughMap() const
get original daughters map
bool accept(const BPHKinematicFit &cand) const override
select particle
void setJPsiMassMin(double m)
std::vector< BPHRecoConstCandPtr > lBd
Analysis-level muon class.
bool get(const edm::EventSetup &es, edm::ESHandle< Obj > &obj)
void setJPsiMassMax(double m)
void setPsi2SMassMin(double m)
Power< A, B >::type pow(const A &a, const B &b)
void setPtMin(oniaType type, double pt)
set cuts
void setJPsiMassMax(double m)
void setJPsiMassMax(double m)
void setPtMin(double pt)
set cuts
const_iterator begin() const
first daughter const_iterator
void setPiPtMin(double pt)
set cuts