332 int npv = pVertices->size();
340 nrc = pfCands->size();
350 nrc = pcCands->size();
357 nrc = gpCands->size();
392 vector<const reco::Candidate*> muDaugs;
393 set<const pat::Muon*> muonSet;
394 typedef multimap<const reco::Candidate*, const pat::CompositeCandidate*> mu_cc_map;
399 int n = ccCands->size();
403 set<const pat::Muon*>::const_iterator iter;
404 set<const pat::Muon*>::const_iterator iend;
406 for (i = 0; i <
n; ++
i) {
410 for (j = 0; j <
m; ++
j) {
413 iter = muonSet.
begin();
414 iend = muonSet.end();
415 bool add = (mp !=
nullptr) && (muonSet.find(mp) == iend);
416 while (add && (iter != iend)) {
423 muCCMap.insert(pair<const reco::Candidate*, const pat::CompositeCandidate*>(dp, &cc));
426 iter = muonSet.begin();
427 iend = muonSet.end();
429 muDaugs.push_back(*iter++);
432 map<recoType, map<parType, double>>::const_iterator rIter =
parMap.begin();
433 map<recoType, map<parType, double>>::const_iterator rIend =
parMap.end();
447 if (onia !=
nullptr) {
448 while (rIter != rIend) {
449 const map<recoType, map<parType, double>>
::value_type& rEntry = *rIter++;
451 const map<parType, double>&
pMap = rEntry.second;
478 map<parType, double>::const_iterator pIter = pMap.begin();
479 map<parType, double>::const_iterator pIend = pMap.end();
480 while (pIter != pIend) {
483 double pv = pEntry.second;
517 int nFull =
lFull.size();
518 map<const BPHRecoCandidate*, const reco::Vertex*> oniaVtxMap;
520 typedef mu_cc_map::const_iterator mu_cc_iter;
521 for (iFull = 0; iFull < nFull; ++iFull) {
525 const std::vector<const reco::Candidate*>& daugs = ptr->
daughters();
529 pair<mu_cc_iter, mu_cc_iter> cc0 = muCCMap.equal_range(ptr->
originalReco(daugs[0]));
530 pair<mu_cc_iter, mu_cc_iter> cc1 = muCCMap.equal_range(ptr->
originalReco(daugs[1]));
531 mu_cc_iter iter0 = cc0.first;
532 mu_cc_iter iend0 = cc0.second;
533 mu_cc_iter iter1 = cc1.first;
534 mu_cc_iter iend1 = cc1.second;
535 while ((iter0 != iend0) && (pVtx ==
nullptr)) {
537 while (iter1 != iend1) {
538 if (ccp != iter1++->
second)
543 float dMin = 999999.;
545 for (ipv = 0; ipv < npv; ++ipv) {
548 float dist =
pow(pPos.x() - tPos.x(), 2) +
pow(pPos.y() - tPos.y(), 2) +
pow(pPos.z() - tPos.z(), 2);
562 if (pVtx ==
nullptr) {
572 float minDz = 999999.;
573 float extrapZ = (state ? ttmd.
points().first.z() : -9e20);
575 for (ipv = 0; ipv < npv; ++ipv) {
577 float deltaZ = fabs(extrapZ - tVtx.
position().z());
578 if (deltaZ < minDz) {
586 oniaVtxMap[ptr] = pVtx;
596 int nJPsi =
lJPsi.size();
606 int nj =
lJPsi.size();
607 int no =
lFull.size();
608 for (ij = 0; ij < nj; ++ij) {
610 for (io = 0; io < no; ++io) {
634 if (rIter != rIend) {
635 const map<parType, double>& pMap = rIter->second;
636 map<parType, double>::const_iterator pIter = pMap.begin();
637 map<parType, double>::const_iterator pIend = pMap.end();
638 while (pIter != pIend) {
641 double pv = pEntry.second;
687 vector<BPHPlusMinusConstCandPtr> lKx0;
701 if (kx0 !=
nullptr) {
703 if (rIter != rIend) {
704 const map<parType, double>& pMap = rIter->second;
705 map<parType, double>::const_iterator pIter = pMap.begin();
706 map<parType, double>::const_iterator pIend = pMap.end();
707 while (pIter != pIend) {
710 double pv = pEntry.second;
739 int nKx0 = lKx0.size();
746 if (rIter != rIend) {
747 const map<parType, double>& pMap = rIter->second;
748 map<parType, double>::const_iterator pIter = pMap.begin();
749 map<parType, double>::const_iterator pIend = pMap.end();
750 while (pIter != pIend) {
753 double pv = pEntry.second;
797 set<BPHRecoConstCandPtr> sKx0;
799 int nBd =
lBd.size();
800 for (iBd = 0; iBd < nBd; ++iBd)
801 sKx0.insert(
lBd[iBd]->getComp(
"Kx0"));
802 set<BPHRecoConstCandPtr>::const_iterator iter = sKx0.begin();
803 set<BPHRecoConstCandPtr>::const_iterator iend = sKx0.end();
805 lSd.push_back(*iter++);
810 vector<BPHPlusMinusConstCandPtr> lPhi;
824 if (phi !=
nullptr) {
826 if (rIter != rIend) {
827 const map<parType, double>& pMap = rIter->second;
828 map<parType, double>::const_iterator pIter = pMap.begin();
829 map<parType, double>::const_iterator pIend = pMap.end();
830 while (pIter != pIend) {
833 double pv = pEntry.second;
862 int nPhi = lPhi.size();
869 if (rIter != rIend) {
870 const map<parType, double>& pMap = rIter->second;
871 map<parType, double>::const_iterator pIter = pMap.begin();
872 map<parType, double>::const_iterator pIend = pMap.end();
873 while (pIter != pIend) {
876 double pv = pEntry.second;
920 set<BPHRecoConstCandPtr> sPhi;
922 int nBs =
lBs.size();
923 for (iBs = 0; iBs < nBs; ++iBs)
924 sPhi.insert(
lBs[iBs]->getComp(
"Phi"));
925 set<BPHRecoConstCandPtr>::const_iterator iter = sPhi.begin();
926 set<BPHRecoConstCandPtr>::const_iterator iend = sPhi.end();
928 lSs.push_back(*iter++);
940 if (k0s !=
nullptr) {
942 if (rIter != rIend) {
943 const map<parType, double>& pMap = rIter->second;
944 map<parType, double>::const_iterator pIter = pMap.begin();
945 map<parType, double>::const_iterator pIend = pMap.end();
946 while (pIter != pIend) {
949 double pv = pEntry.second;
978 int nK0 =
lK0.size();
989 if (l0s !=
nullptr) {
991 if (rIter != rIend) {
992 const map<parType, double>& pMap = rIter->second;
993 map<parType, double>::const_iterator pIter = pMap.begin();
994 map<parType, double>::const_iterator pIend = pMap.end();
995 while (pIter != pIend) {
998 double pv = pEntry.second;
1027 int nL0 =
lL0.size();
1034 if (rIter != rIend) {
1035 const map<parType, double>& pMap = rIter->second;
1036 map<parType, double>::const_iterator pIter = pMap.begin();
1037 map<parType, double>::const_iterator pIend = pMap.end();
1038 while (pIter != pIend) {
1041 double pv = pEntry.second;
1083 const map<const BPHRecoCandidate*, const BPHRecoCandidate*>& b0Map = b0->
daughMap();
1084 daughMap.insert(b0Map.begin(), b0Map.end());
1093 if (rIter != rIend) {
1094 const map<parType, double>& pMap = rIter->second;
1095 map<parType, double>::const_iterator pIter = pMap.begin();
1096 map<parType, double>::const_iterator pIend = pMap.end();
1097 while (pIter != pIend) {
1100 double pv = pEntry.second;
1142 const map<const BPHRecoCandidate*, const BPHRecoCandidate*>& ldMap = lb->
daughMap();
1143 daughMap.insert(ldMap.begin(), ldMap.end());
1159 if (bc !=
nullptr) {
1161 if (rIter != rIend) {
1162 const map<parType, double>& pMap = rIter->second;
1163 map<parType, double>::const_iterator pIter = pMap.begin();
1164 map<parType, double>::const_iterator pIend = pMap.end();
1165 while (pIter != pIend) {
1168 double pv = pEntry.second;
1227 if (x3872 !=
nullptr) {
1229 if (rIter != rIend) {
1230 const map<parType, double>& pMap = rIter->second;
1231 map<parType, double>::const_iterator pIter = pMap.begin();
1232 map<parType, double>::const_iterator pIend = pMap.end();
1233 while (pIter != pIend) {
1236 double pv = pEntry.second;
BPHTokenWrapper< std::vector< reco::VertexCompositeCandidate > > l0CandsToken
Analysis-level particle class.
static bool sameTrack(const reco::Candidate *lCand, const reco::Candidate *rCand, double minPDifference)
void setJPsiMassMax(double m)
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
void setEtaMax(double eta)
void setMassMin(double m)
BPHTokenWrapper< std::vector< reco::Vertex > > pVertexToken
void setMassMax(double m)
std::vector< BPHRecoConstCandPtr > build()
build candidates
std::vector< BPHPlusMinusConstCandPtr > lJPsi
void setJPsiMassMin(double m)
set cuts
void setJPsiMassMin(double m)
set cuts
BPHTokenWrapper< std::vector< reco::VertexCompositePtrCandidate > > kSCandsToken
std::vector< BPHPlusMinusConstCandPtr > lK0
std::vector< BPHPlusMinusConstCandPtr > build()
build candidates
edm::Ref< std::vector< reco::Vertex > > vertex_ref
void setMassMax(oniaType type, double m)
std::map< const BPHRecoCandidate *, compcc_ref > ccRefMap
void setK0MassMax(double m)
void setPiEtaMax(double eta)
std::vector< BPHPlusMinusConstCandPtr > lFull
double getConstrMass(oniaType type) const
void setMassFitMin(double m)
void setJPsiMassMin(double m)
void setKPtMin(double pt)
set cuts
void setPiPtMin(double pt)
set cuts
std::vector< BPHRecoConstCandPtr > lBs
bool get(const edm::Event &ev, edm::Handle< Obj > &obj)
BPHTokenWrapper< std::vector< BPHTrackReference::candidate > > pcCandsToken
void setKEtaMax(double eta)
void setKxMassMin(double m)
void setJPsiMassMax(double m)
void setPhiMassMax(double m)
const Point & position() const
position
virtual const std::vector< const reco::Candidate * > & daughters() const
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
static BPHGenericCollection * createCollection(const edm::Handle< T > &collection, const std::string &list="cfhpmig")
void setMassFitMax(double m)
std::vector< BPHRecoConstCandPtr > lSs
std::vector< BPHRecoConstCandPtr > build()
build candidates
U second(std::pair< T, U > const &p)
deep_tau::DeepTauBase::BasicDiscriminator bd
void setJPsiMassMax(double m)
BPHTokenWrapper< std::vector< reco::VertexCompositeCandidate > > k0CandsToken
Container::value_type value_type
std::vector< BPHPlusMinusConstCandPtr > build()
build Phi candidates
void setEtaMax(double eta)
std::vector< BPHPlusMinusConstCandPtr > getList(oniaType type, BPHRecoSelect *dSel=nullptr, BPHMomentumSelect *mSel=nullptr, BPHVertexSelect *vSel=nullptr, BPHFitSelect *kSel=nullptr)
double getConstrSigma(oniaType type) const
BPHTokenWrapper< pat::MuonCollection > patMuonToken
void setEtaMax(double eta)
BPHTokenWrapper< std::vector< reco::PFCandidate > > pfCandsToken
void setMassMax(double m)
void setProbMin(double p)
void setJPsiMassMin(double m)
set cuts
BPHTokenWrapper< std::vector< reco::VertexCompositePtrCandidate > > lSCandsToken
void setMassMin(double m)
set cuts
math::XYZPoint Point
point in the space
void setConstr(bool flag)
BPHTokenWrapper< std::vector< pat::CompositeCandidate > > ccCandsToken
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...
std::pair< GlobalPoint, GlobalPoint > points() const override
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
std::vector< BPHRecoConstCandPtr > lSd
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
void setMassFitMin(double m)
void setMassFitMax(double m)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
void setLambda0MassMax(double m)
const std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > & daughMap() const
get original daughters map
void setJPsiMassMax(double m)
BPHTokenWrapper< std::vector< pat::GenericParticle > > gpCandsToken
T const * product() const
void setK0MassMin(double m)
void setJPsiMassMin(double m)
set cuts
size_type numberOfDaughters() const override
number of daughters
void setPiEtaMax(double eta)
std::map< const BPHRecoCandidate *, vertex_ref > pvRefMap
std::vector< BPHPlusMinusConstCandPtr > lL0
std::vector< BPHRecoConstCandPtr > build()
build X3872 candidates
std::vector< BPHRecoConstCandPtr > lBu
void setKxMassMax(double m)
std::vector< BPHRecoConstCandPtr > lLb
std::vector< BPHPlusMinusConstCandPtr > build()
build resonance candidates
void setJPsiMassMin(double m)
void setConstr(oniaType type, double mass, double sigma)
void setEtaMax(oniaType type, double eta)
void setPtMin(double pt)
set cuts
std::map< recoType, std::map< parType, double > > parMap
void setPhiMassMin(double m)
const_iterator begin() const
first daughter const_iterator
std::vector< BPHRecoConstCandPtr > build()
build candidates
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > jPsiOMap
static constexpr float b0
void setJPsiMassMin(double m)
set cuts
std::vector< BPHRecoConstCandPtr > lB0
virtual const reco::Candidate * getDaug(const std::string &name) const
void setMassMin(oniaType type, double m)
std::vector< BPHRecoConstCandPtr > lBc
std::vector< BPHRecoConstCandPtr > lX3872
void setConstr(bool flag)
std::vector< BPHPlusMinusConstCandPtr > build()
build candidates
std::vector< BPHRecoConstCandPtr > lBd
Analysis-level muon class.
void setJPsiMassMax(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 setProbMin(double p)
void setPtMin(double pt)
set cuts
void setPiPtMin(double pt)
set cuts