237 int npv = pVertices->size();
245 nrc = pfCands->size();
255 nrc = pcCands->size();
262 nrc = gpCands->size();
273 vector<const reco::Candidate*> muDaugs;
274 set<const pat::Muon*> muonSet;
275 typedef multimap<const reco::Candidate*, const pat::CompositeCandidate*> mu_cc_map;
280 int n = ccCands->size();
284 set<const pat::Muon*>::const_iterator iter;
285 set<const pat::Muon*>::const_iterator iend;
287 for (i = 0; i <
n; ++
i) {
291 for (j = 0; j <
m; ++
j) {
294 iter = muonSet.
begin();
295 iend = muonSet.end();
296 bool add = (mp !=
nullptr) && (muonSet.find(mp) == iend);
297 while (add && (iter != iend)) {
304 muCCMap.insert(pair<const reco::Candidate*, const pat::CompositeCandidate*>(dp, &cc));
307 iter = muonSet.begin();
308 iend = muonSet.end();
310 muDaugs.push_back(*iter++);
313 map<recoType, map<parType, double> >::const_iterator rIter =
parMap.begin();
314 map<recoType, map<parType, double> >::const_iterator rIend =
parMap.end();
328 if (onia !=
nullptr) {
329 while (rIter != rIend) {
330 const map<recoType, map<parType, double> >
::value_type& rEntry = *rIter++;
332 const map<parType, double>&
pMap = rEntry.second;
359 map<parType, double>::const_iterator pIter = pMap.begin();
360 map<parType, double>::const_iterator pIend = pMap.end();
361 while (pIter != pIend) {
364 double pv = pEntry.second;
398 int nFull =
lFull.size();
399 map<const BPHRecoCandidate*, const reco::Vertex*> oniaVtxMap;
401 typedef mu_cc_map::const_iterator mu_cc_iter;
402 for (iFull = 0; iFull < nFull; ++iFull) {
406 const std::vector<const reco::Candidate*>& daugs = ptr->
daughters();
410 pair<mu_cc_iter, mu_cc_iter> cc0 = muCCMap.equal_range(ptr->
originalReco(daugs[0]));
411 pair<mu_cc_iter, mu_cc_iter> cc1 = muCCMap.equal_range(ptr->
originalReco(daugs[1]));
412 mu_cc_iter iter0 = cc0.first;
413 mu_cc_iter iend0 = cc0.second;
414 mu_cc_iter iter1 = cc1.first;
415 mu_cc_iter iend1 = cc1.second;
416 while ((iter0 != iend0) && (pVtx ==
nullptr)) {
418 while (iter1 != iend1) {
419 if (ccp != iter1++->
second)
424 float dMin = 999999.;
426 for (ipv = 0; ipv < npv; ++ipv) {
429 float dist =
pow(pPos.x() - tPos.x(), 2) +
pow(pPos.y() - tPos.y(), 2) +
pow(pPos.z() - tPos.z(), 2);
443 if (pVtx ==
nullptr) {
453 float minDz = 999999.;
454 float extrapZ = (state ? ttmd.
points().first.z() : -9e20);
456 for (ipv = 0; ipv < npv; ++ipv) {
458 float deltaZ = fabs(extrapZ - tVtx.
position().z());
459 if (deltaZ < minDz) {
467 oniaVtxMap[ptr] = pVtx;
477 int nJPsi =
lJPsi.size();
487 int nj =
lJPsi.size();
488 int no =
lFull.size();
489 for (ij = 0; ij < nj; ++ij) {
491 for (io = 0; io < no; ++io) {
515 if (rIter != rIend) {
516 const map<parType, double>& pMap = rIter->second;
517 map<parType, double>::const_iterator pIter = pMap.begin();
518 map<parType, double>::const_iterator pIend = pMap.end();
519 while (pIter != pIend) {
522 double pv = pEntry.second;
568 vector<BPHPlusMinusConstCandPtr> lKx0;
582 if (kx0 !=
nullptr) {
584 if (rIter != rIend) {
585 const map<parType, double>& pMap = rIter->second;
586 map<parType, double>::const_iterator pIter = pMap.begin();
587 map<parType, double>::const_iterator pIend = pMap.end();
588 while (pIter != pIend) {
591 double pv = pEntry.second;
626 int nKx0 = lKx0.size();
633 if (rIter != rIend) {
634 const map<parType, double>& pMap = rIter->second;
635 map<parType, double>::const_iterator pIter = pMap.begin();
636 map<parType, double>::const_iterator pIend = pMap.end();
637 while (pIter != pIend) {
640 double pv = pEntry.second;
684 set<BPHRecoConstCandPtr> sKx0;
686 int nBd =
lBd.size();
687 for (iBd = 0; iBd < nBd; ++iBd)
688 sKx0.insert(
lBd[iBd]->getComp(
"Kx0"));
689 set<BPHRecoConstCandPtr>::const_iterator iter = sKx0.begin();
690 set<BPHRecoConstCandPtr>::const_iterator iend = sKx0.end();
692 lSd.push_back(*iter++);
697 vector<BPHPlusMinusConstCandPtr> lPhi;
711 if (phi !=
nullptr) {
713 if (rIter != rIend) {
714 const map<parType, double>& pMap = rIter->second;
715 map<parType, double>::const_iterator pIter = pMap.begin();
716 map<parType, double>::const_iterator pIend = pMap.end();
717 while (pIter != pIend) {
720 double pv = pEntry.second;
755 int nPhi = lPhi.size();
762 if (rIter != rIend) {
763 const map<parType, double>& pMap = rIter->second;
764 map<parType, double>::const_iterator pIter = pMap.begin();
765 map<parType, double>::const_iterator pIend = pMap.end();
766 while (pIter != pIend) {
769 double pv = pEntry.second;
813 set<BPHRecoConstCandPtr> sPhi;
815 int nBs =
lBs.size();
816 for (iBs = 0; iBs < nBs; ++iBs)
817 sPhi.insert(
lBs[iBs]->getComp(
"Phi"));
818 set<BPHRecoConstCandPtr>::const_iterator iter = sPhi.begin();
819 set<BPHRecoConstCandPtr>::const_iterator iend = sPhi.end();
821 lSs.push_back(*iter++);
Analysis-level particle class.
void setEtaMax(double eta)
double getConstrSigma() const
static bool sameTrack(const reco::Candidate *lCand, const reco::Candidate *rCand, double minPDifference)
std::vector< BPHRecoConstCandPtr > build()
build Bu candidates
void setProbMin(double p)
void setJPsiMassMax(double m)
void setMassMax(double m)
BPHTokenWrapper< std::vector< reco::Vertex > > pVertexToken
std::vector< BPHPlusMinusConstCandPtr > lJPsi
void setProbMin(double p)
std::pair< GlobalPoint, GlobalPoint > points() const override
void setJPsiMassMin(double m)
set cuts
edm::Ref< std::vector< reco::Vertex > > vertex_ref
void setMassMax(oniaType type, double m)
std::map< const BPHRecoCandidate *, compcc_ref > ccRefMap
std::vector< BPHPlusMinusConstCandPtr > lFull
double getConstrMass(oniaType type) const
void setMassFitMin(double m)
void setPtMin(double pt)
set cuts
void setJPsiMassMin(double m)
set cuts
void setMassMin(double m)
void setKPtMin(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 setMassFitMax(double m)
void setKEtaMax(double eta)
void setKxMassMin(double m)
void setMassMin(double m)
void setProbMin(double p)
void setPhiMassMax(double m)
void setPtMin(double pt)
set cuts
double getConstrMass() const
void setMassMin(double m)
const Point & position() const
position
virtual const std::vector< const reco::Candidate * > & daughters() const
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")
std::vector< BPHPlusMinusConstCandPtr > build()
build Phi candidates
std::vector< BPHRecoConstCandPtr > lSs
U second(std::pair< T, U > const &p)
const pat::CompositeCandidate & composite() const override
get a composite by the simple sum of simple particles
void setConstr(bool flag)
Container::value_type value_type
void setProbMin(double p)
double getConstrSigma(oniaType type) const
BPHTokenWrapper< pat::MuonCollection > patMuonToken
void setEtaMax(double eta)
BPHTokenWrapper< std::vector< reco::PFCandidate > > pfCandsToken
void setConstr(bool flag)
math::XYZPoint Point
point in the space
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...
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
void setProbMin(double p)
void setMassFitMin(double m)
std::vector< BPHRecoConstCandPtr > lSd
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
void setMassMin(double m)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
void setMassMax(double m)
void setJPsiMassMax(double m)
BPHTokenWrapper< std::vector< pat::GenericParticle > > gpCandsToken
double getConstrSigma() const
void setJPsiMassMin(double m)
set cuts
std::map< const BPHRecoCandidate *, vertex_ref > pvRefMap
void setMassFitMax(double m)
std::vector< BPHRecoConstCandPtr > lBu
void setKxMassMax(double m)
std::vector< BPHPlusMinusConstCandPtr > build()
build resonance candidates
void setConstr(double mass, double sigma)
void setConstr(bool flag)
void setConstr(oniaType type, double mass, double sigma)
void setEtaMax(oniaType type, double eta)
std::map< recoType, std::map< parType, double > > parMap
std::vector< BPHPlusMinusConstCandPtr > getList(oniaType type, BPHRecoSelect *dSel=0, BPHMomentumSelect *mSel=0, BPHVertexSelect *vSel=0, BPHFitSelect *kSel=0)
void setPhiMassMin(double m)
const_iterator begin() const
first daughter const_iterator
void setMassMax(double m)
void setMassMin(double m)
size_type numberOfDaughters() const override
number of daughters
void setMassMax(double m)
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > jPsiOMap
std::vector< BPHRecoConstCandPtr > build()
build Bs candidates
void setMassMax(double m)
virtual const reco::Candidate * getDaug(const std::string &name) const
void setMassMin(oniaType type, double m)
void setMassFitMax(double m)
void setMassFitMin(double m)
std::vector< BPHRecoConstCandPtr > lBd
Analysis-level muon class.
Power< A, B >::type pow(const A &a, const B &b)
void setPtMin(oniaType type, double pt)
set cuts
std::vector< BPHRecoConstCandPtr > build()
build Bs candidates
void setConstr(double mass, double sigma)
void setJPsiMassMax(double m)
double getConstrMass() const
virtual const reco::Vertex & vertex() const
get reconstructed vertex
std::vector< BPHPlusMinusConstCandPtr > build()
build Phi candidates