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;
281 int n = ccCands->size();
283 muDaugs.reserve( n );
285 set<const pat::Muon*>::const_iterator iter;
286 set<const pat::Muon*>::const_iterator iend;
288 for ( i = 0; i <
n; ++
i ) {
292 for ( j = 0; j <
m; ++j ) {
295 iter = muonSet.
begin();
296 iend = muonSet.end();
297 bool add = ( mp != 0 ) && ( muonSet.find( mp ) == iend );
298 while ( add && ( iter != iend ) ) {
301 if ( add ) muonSet.insert( mp );
303 muCCMap.insert( pair<
const reco::Candidate*,
307 iter = muonSet.begin();
308 iend = muonSet.end();
309 while ( iter != iend ) muDaugs.push_back( *iter++ );
312 map< recoType, map<parType,double> >::const_iterator rIter =
parMap.begin();
313 map< recoType, map<parType,double> >::const_iterator rIend =
parMap.end();
329 while ( rIter != rIend ) {
330 const map< recoType, map<parType,double> >
::value_type& rEntry = *rIter++;
332 const map<parType,double>&
pMap = rEntry.second;
344 map<parType,double>::const_iterator pIter = pMap.begin();
345 map<parType,double>::const_iterator pIend = pMap.end();
346 while ( pIter != pIend ) {
349 double pv = pEntry.second;
371 int nFull =
lFull.size();
372 map<const BPHRecoCandidate*,const reco::Vertex*> oniaVtxMap;
374 typedef mu_cc_map::const_iterator mu_cc_iter;
375 for ( iFull = 0; iFull < nFull; ++iFull ) {
380 const std::vector<const reco::Candidate*>& daugs = ptr->
daughters();
384 pair<mu_cc_iter,mu_cc_iter> cc0 = muCCMap.equal_range(
386 pair<mu_cc_iter,mu_cc_iter> cc1 = muCCMap.equal_range(
388 mu_cc_iter iter0 = cc0.first;
389 mu_cc_iter iend0 = cc0.second;
390 mu_cc_iter iter1 = cc1.first;
391 mu_cc_iter iend1 = cc1.second;
392 while ( ( iter0 != iend0 ) && ( pVtx == 0 ) ) {
394 while ( iter1 != iend1 ) {
395 if ( ccp != iter1++->
second )
continue;
399 float dMin = 999999.;
401 for ( ipv = 0; ipv < npv; ++ipv ) {
404 float dist =
pow( pPos.x() - tPos.x(), 2 ) +
405 pow( pPos.y() - tPos.y(), 2 ) +
406 pow( pPos.z() - tPos.z(), 2 );
432 float minDz = 999999.;
433 float extrapZ = ( state ? ttmd.
points().first.z() : -9e20 );
435 for ( ipv = 0; ipv < npv; ++ipv ) {
437 float deltaZ = fabs( extrapZ - tVtx.
position().z() ) ;
438 if ( deltaZ < minDz ) {
446 oniaVtxMap[ptr] = pVtx;
456 int nJPsi =
lJPsi.size();
459 if ( !nJPsi )
return;
464 int nj =
lJPsi.size();
465 int no =
lFull.size();
466 for ( ij = 0; ij < nj; ++ij ) {
468 for ( io = 0; io < no; ++io ) {
496 if ( rIter != rIend ) {
497 const map<parType,double>& pMap = rIter->second;
498 map<parType,double>::const_iterator pIter = pMap.begin();
499 map<parType,double>::const_iterator pIend = pMap.end();
500 while ( pIter != pIend ) {
503 double pv = pEntry.second;
526 vector<BPHPlusMinusConstCandPtr> lKx0;
544 if ( rIter != rIend ) {
545 const map<parType,double>& pMap = rIter->second;
546 map<parType,double>::const_iterator pIter = pMap.begin();
547 map<parType,double>::const_iterator pIend = pMap.end();
548 while ( pIter != pIend ) {
551 double pv = pEntry.second;
569 int nKx0 = lKx0.size();
577 if ( rIter != rIend ) {
578 const map<parType,double>& pMap = rIter->second;
579 map<parType,double>::const_iterator pIter = pMap.begin();
580 map<parType,double>::const_iterator pIend = pMap.end();
581 while ( pIter != pIend ) {
584 double pv = pEntry.second;
605 set<BPHRecoConstCandPtr> sKx0;
607 int nBd =
lBd.size();
608 for ( iBd = 0; iBd < nBd; ++iBd ) sKx0.insert(
lBd[iBd]->getComp(
"Kx0" ) );
609 set<BPHRecoConstCandPtr>::const_iterator iter = sKx0.begin();
610 set<BPHRecoConstCandPtr>::const_iterator iend = sKx0.end();
611 while ( iter != iend )
lSd.push_back( *iter++ );
617 vector<BPHPlusMinusConstCandPtr> lPhi;
635 if ( rIter != rIend ) {
636 const map<parType,double>& pMap = rIter->second;
637 map<parType,double>::const_iterator pIter = pMap.begin();
638 map<parType,double>::const_iterator pIend = pMap.end();
639 while ( pIter != pIend ) {
642 double pv = pEntry.second;
660 int nPhi = lPhi.size();
668 if ( rIter != rIend ) {
669 const map<parType,double>& pMap = rIter->second;
670 map<parType,double>::const_iterator pIter = pMap.begin();
671 map<parType,double>::const_iterator pIend = pMap.end();
672 while ( pIter != pIend ) {
675 double pv = pEntry.second;
696 set<BPHRecoConstCandPtr> sPhi;
698 int nBs =
lBs.size();
699 for ( iBs = 0; iBs < nBs; ++iBs ) sPhi.insert(
lBs[iBs]->getComp(
"Phi" ) );
700 set<BPHRecoConstCandPtr>::const_iterator iter = sPhi.begin();
701 set<BPHRecoConstCandPtr>::const_iterator iend = sPhi.end();
702 while ( iter != iend )
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)
std::vector< BPHPlusMinusConstCandPtr > lJPsi
void setProbMin(double p)
BPHTokenWrapper< std::vector< reco::PFCandidate > > pfCandsToken
std::pair< GlobalPoint, GlobalPoint > points() const override
void setJPsiMassMin(double m)
set cuts
void setMassMax(oniaType type, double m)
virtual const pat::CompositeCandidate & composite() const
get a composite by the simple sum of simple particles
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)
void setMassFitMax(double m)
void setKEtaMax(double eta)
void setKxMassMin(double m)
void setMassMin(double m)
std::map< const BPHRecoCandidate *, compcc_ref > ccRefMap
void setProbMin(double p)
void setPhiMassMax(double m)
void setPtMin(double pt)
set cuts
double getConstrMass() const
BPHTokenWrapper< std::vector< pat::CompositeCandidate > > ccCandsToken
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)
void setConstr(bool flag)
Container::value_type value_type
void setProbMin(double p)
BPHTokenWrapper< pat::MuonCollection > patMuonToken
double getConstrSigma(oniaType type) const
BPHTokenWrapper< std::vector< reco::Vertex > > pVertexToken
void setEtaMax(double eta)
void setConstr(bool flag)
math::XYZPoint Point
point in the space
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) ...
BPHTokenWrapper< std::vector< pat::GenericParticle > > gpCandsToken
void setProbMin(double p)
edm::Ref< std::vector< reco::Vertex > > vertex_ref
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)
std::map< recoType, std::map< parType, double > > parMap
double getConstrSigma() const
void setJPsiMassMin(double m)
set cuts
void setMassFitMax(double m)
std::vector< BPHRecoConstCandPtr > lBu
void setKxMassMax(double m)
BPHTokenWrapper< std::vector< BPHTrackReference::candidate > > pcCandsToken
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::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)
std::map< const BPHRecoCandidate *, vertex_ref > pvRefMap
size_type numberOfDaughters() const override
number of daughters
void setMassMax(double m)
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.
std::map< const BPHRecoCandidate *, const BPHRecoCandidate * > jPsiOMap
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