CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
BPHDecayToChargedXXbarBuilder Class Reference

#include <BPHDecayToChargedXXbarBuilder.h>

Inheritance diagram for BPHDecayToChargedXXbarBuilder:
BPHDecayGenericBuilderBase BPHDecayGenericBuilder< BPHPlusMinusCandidate > BPHDecayGenericBuilderBase BPHDecayToV0SameMassBuilder BPHPhiToKKBuilder BPHK0sToPiPiBuilder

Classes

class  Particle
 

Public Member Functions

 BPHDecayToChargedXXbarBuilder (const BPHEventSetupWrapper &es, const std::string &dPosName, const std::string &dNegName, double daugMass, double daugSigma, const BPHRecoBuilder::BPHGenericCollection *posCollection, const BPHRecoBuilder::BPHGenericCollection *negCollection)
 
 BPHDecayToChargedXXbarBuilder (const BPHDecayToChargedXXbarBuilder &x)=delete
 
double getDzMax () const
 
double getEtaMax () const
 
double getPtMin () const
 get current cuts More...
 
BPHDecayToChargedXXbarBuilderoperator= (const BPHDecayToChargedXXbarBuilder &x)=delete
 
void setDzMax (double dz)
 
void setEtaMax (double eta)
 
void setPtMin (double pt)
 set cuts More...
 
 ~BPHDecayToChargedXXbarBuilder () override=default
 
- Public Member Functions inherited from BPHDecayGenericBuilderBase
 BPHDecayGenericBuilderBase ()
 
 BPHDecayGenericBuilderBase (const BPHEventSetupWrapper &es, BPHMassFitSelect *mfs=new BPHMassFitSelect(-2.0e+06, -1.0e+06))
 
 BPHDecayGenericBuilderBase (const BPHDecayGenericBuilderBase &x)=delete
 
double getMassFitMax () const
 
double getMassFitMin () const
 
double getMassMax () const
 
double getMassMin () const
 get current cuts More...
 
double getMinPDiff ()
 
double getProbMin () const
 
BPHDecayGenericBuilderBaseoperator= (const BPHDecayGenericBuilderBase &x)=delete
 
void setMassFitMax (double m)
 
void setMassFitMin (double m)
 
void setMassFitRange (double mMin, double mMax)
 
void setMassMax (double m)
 
void setMassMin (double m)
 set cuts More...
 
void setMassRange (double mMin, double mMax)
 
void setMinPDiff (double mpd)
 track min p difference More...
 
void setProbMin (double p)
 
virtual ~BPHDecayGenericBuilderBase ()
 
- Public Member Functions inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
 BPHDecayGenericBuilder (const BPHEventSetupWrapper &es, BPHMassFitSelect *mfs)
 
 BPHDecayGenericBuilder (const BPHDecayGenericBuilder &x)=delete
 
virtual std::vector< prod_ptrbuild ()
 build candidates More...
 
BPHDecayGenericBuilderoperator= (const BPHDecayGenericBuilder &x)=delete
 
 ~BPHDecayGenericBuilder () override=default
 

Protected Member Functions

void fillRecList () override
 build candidates More...
 
- Protected Member Functions inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
 BPHDecayGenericBuilder ()
 

Protected Attributes

double dMass
 
double dSigma
 
double dzMax
 
double etaMax
 
const BPHRecoBuilder::BPHGenericCollectionnCollection
 
std::string nName
 
const BPHRecoBuilder::BPHGenericCollectionpCollection
 
std::string pName
 
double ptMin
 
- Protected Attributes inherited from BPHDecayGenericBuilderBase
BPHChi2Selectchi2Sel
 
const BPHEventSetupWrapperevSetup
 
BPHMassSelectmassSel
 
BPHMassFitSelectmFitSel
 
double minPDiff
 
bool outdated
 
- Protected Attributes inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
std::vector< prod_ptrrecList
 

Private Member Functions

void addParticle (const BPHRecoBuilder::BPHGenericCollection *collection, int charge, std::vector< Particle *> &list)
 

Additional Inherited Members

- Public Types inherited from BPHDecayGenericBuilder< BPHPlusMinusCandidate >
typedef BPHPlusMinusCandidate ::const_pointer prod_ptr
 

Detailed Description

Description: Class to build a decay to an oppositely charged particle-antiparticle pair

Author
Paolo Ronchese INFN Padova

Definition at line 42 of file BPHDecayToChargedXXbarBuilder.h.

Constructor & Destructor Documentation

◆ BPHDecayToChargedXXbarBuilder() [1/2]

BPHDecayToChargedXXbarBuilder::BPHDecayToChargedXXbarBuilder ( const BPHEventSetupWrapper es,
const std::string &  dPosName,
const std::string &  dNegName,
double  daugMass,
double  daugSigma,
const BPHRecoBuilder::BPHGenericCollection posCollection,
const BPHRecoBuilder::BPHGenericCollection negCollection 
)

Constructor

◆ BPHDecayToChargedXXbarBuilder() [2/2]

BPHDecayToChargedXXbarBuilder::BPHDecayToChargedXXbarBuilder ( const BPHDecayToChargedXXbarBuilder x)
delete

◆ ~BPHDecayToChargedXXbarBuilder()

BPHDecayToChargedXXbarBuilder::~BPHDecayToChargedXXbarBuilder ( )
overridedefault

Destructor

Member Function Documentation

◆ addParticle()

void BPHDecayToChargedXXbarBuilder::addParticle ( const BPHRecoBuilder::BPHGenericCollection collection,
int  charge,
std::vector< Particle *> &  list 
)
private

Definition at line 148 of file BPHDecayToChargedXXbarBuilder.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, universalConfigTemplate::collection, dMass, etaMax, BPHTrackReference::getTrack(), mps_fire::i, dqmiodumpmetadata::n, ptMin, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, submitPVResolutionJobs::q, and mathSSE::sqrt().

Referenced by fillRecList().

150  {
151  int i;
152  int n = collection->size();
153  list.reserve(n);
154  for (i = 0; i < n; ++i) {
155  const reco::Candidate& cand = collection->get(i);
156  int q = cand.charge();
157  if ((charge > 0) && (q <= 0))
158  continue;
159  if ((charge < 0) && (q >= 0))
160  continue;
161  const reco::Candidate::LorentzVector p4 = cand.p4();
162  if (p4.pt() < ptMin)
163  continue;
164  if (p4.eta() > etaMax)
165  continue;
166  const reco::Track* tk = BPHTrackReference::getTrack(cand, "cfhp");
167  if (tk == nullptr)
168  continue;
169  double px = p4.px();
170  double py = p4.py();
171  double pz = p4.pz();
172  list.push_back(new Particle(&cand, tk, px, py, pz, sqrt((px * px) + (py * py) + (pz * pz) + (dMass * dMass))));
173  }
174  return;
175 }
T sqrt(T t)
Definition: SSEVec.h:19
static const reco::Track * getTrack(const reco::Candidate &rc, const char *modeList="cfhbpmnigset", char *modeFlag=nullptr)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36

◆ fillRecList()

void BPHDecayToChargedXXbarBuilder::fillRecList ( )
overrideprotectedvirtual

build candidates

Implements BPHDecayGenericBuilderBase.

Reimplemented in BPHDecayToV0SameMassBuilder.

Definition at line 82 of file BPHDecayToChargedXXbarBuilder.cc.

References BPHChi2Select::accept(), addParticle(), BPHDecayToChargedXXbarBuilder::Particle::cand, BPHDecayGenericBuilderBase::chi2Sel, BPHGenericPtr< T >::create(), dMass, dSigma, BPHDecayToChargedXXbarBuilder::Particle::en, BPHDecayGenericBuilderBase::evSetup, BPHDecayGenericBuilderBase::getMassMax(), BPHDecayGenericBuilderBase::getMassMin(), callgraph::m2, EgHLTOffHistBins_cfi::mass, vertexSelectForHeavyFlavorDQM_cfi::massMax, vertexSelectForHeavyFlavorDQM_cfi::massMin, nCollection, compareTotals::ne, nName, nt, pCollection, pName, DiDispStaMuonMonitor_cfi::pt, multPhiCorr_741_25nsDY_cfi::px, BPHDecayToChargedXXbarBuilder::Particle::px, multPhiCorr_741_25nsDY_cfi::py, BPHDecayToChargedXXbarBuilder::Particle::py, BPHDecayToChargedXXbarBuilder::Particle::pz, BPHDecayGenericBuilder< BPHPlusMinusCandidate >::recList, and BPHDecayToChargedXXbarBuilder::Particle::track.

Referenced by BPHDecayToV0SameMassBuilder::buildFromBPHGenericCollection().

82  {
83  // extract basic informations from input collections
84 
85  vector<Particle*> pList;
86  vector<Particle*> nList;
87 
88  addParticle(pCollection, +1, pList);
89  addParticle(nCollection, -1, nList);
90  int iPos;
91  int iNeg;
92  int nPos = pList.size();
93  int nNeg = nList.size();
94  double massMin = getMassMin();
95  double massMax = getMassMax();
96  double mSqMin = massMin * massMin * 0.9;
97  double mSqMax = massMax * massMax * 1.1;
98  if (mSqMin < 0.0)
99  mSqMin = 0.0;
100 
101  for (iPos = 0; iPos < nPos; ++iPos) {
102  Particle* pc = pList[iPos];
103  const reco::Track* pt = pc->track;
104  double px = pc->px;
105  double py = pc->py;
106  double pz = pc->pz;
107  double pe = pc->en;
108  for (iNeg = 0; iNeg < nNeg; ++iNeg) {
109  Particle* nc = nList[iNeg];
110  const reco::Track* nt = nc->track;
111  if (fabs(nt->dz() - pt->dz()) > 1.0)
112  continue;
113  double nx = nc->px;
114  double ny = nc->py;
115  double nz = nc->pz;
116  double ne = nc->en;
117  const float tx = px + nx;
118  const float ty = py + ny;
119  const float tz = pz + nz;
120  const float te = pe + ne;
121  const float m2 = (te * te) - ((tx * tx) + (ty * ty) + (tz * tz));
122  if (m2 < mSqMin)
123  continue;
124  if (m2 > mSqMax)
125  continue;
127  rc->add(pName, pc->cand, dMass, dSigma);
128  rc->add(nName, nc->cand, dMass, dSigma);
129  double mass = rc->composite().mass();
130  if (mass < massMin)
131  continue;
132  if (mass > massMax)
133  continue;
134  if (!chi2Sel->accept(*rc))
135  continue;
136  recList.push_back(rc);
137  }
138  }
139 
140  for (iPos = 0; iPos < nPos; ++iPos)
141  delete pList[iPos];
142  for (iNeg = 0; iNeg < nNeg; ++iNeg)
143  delete nList[iNeg];
144 
145  return;
146 }
bool accept(const BPHDecayVertex &cand) const override
select vertex
Definition: BPHChi2Select.h:48
const BPHEventSetupWrapper * evSetup
double getMassMin() const
get current cuts
BPHGenericPtr< BPHPlusMinusCandidate >::type BPHPlusMinusCandidatePtr
const BPHRecoBuilder::BPHGenericCollection * pCollection
int nt
Definition: AMPTWrapper.h:42
static type create(Args &&... args)
Definition: BPHGenericPtr.h:10
void addParticle(const BPHRecoBuilder::BPHGenericCollection *collection, int charge, std::vector< Particle *> &list)
const BPHRecoBuilder::BPHGenericCollection * nCollection

◆ getDzMax()

double BPHDecayToChargedXXbarBuilder::getDzMax ( ) const
inline

Definition at line 74 of file BPHDecayToChargedXXbarBuilder.h.

References dzMax.

◆ getEtaMax()

double BPHDecayToChargedXXbarBuilder::getEtaMax ( ) const
inline

Definition at line 73 of file BPHDecayToChargedXXbarBuilder.h.

References etaMax.

◆ getPtMin()

double BPHDecayToChargedXXbarBuilder::getPtMin ( ) const
inline

get current cuts

Definition at line 72 of file BPHDecayToChargedXXbarBuilder.h.

References ptMin.

◆ operator=()

BPHDecayToChargedXXbarBuilder& BPHDecayToChargedXXbarBuilder::operator= ( const BPHDecayToChargedXXbarBuilder x)
delete

◆ setDzMax()

void BPHDecayToChargedXXbarBuilder::setDzMax ( double  dz)

◆ setEtaMax()

void BPHDecayToChargedXXbarBuilder::setEtaMax ( double  eta)

◆ setPtMin()

void BPHDecayToChargedXXbarBuilder::setPtMin ( double  pt)

Member Data Documentation

◆ dMass

double BPHDecayToChargedXXbarBuilder::dMass
protected

Definition at line 87 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by addParticle(), and fillRecList().

◆ dSigma

double BPHDecayToChargedXXbarBuilder::dSigma
protected

Definition at line 88 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by fillRecList().

◆ dzMax

double BPHDecayToChargedXXbarBuilder::dzMax
protected

Definition at line 79 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by getDzMax(), and setDzMax().

◆ etaMax

double BPHDecayToChargedXXbarBuilder::etaMax
protected

◆ nCollection

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToChargedXXbarBuilder::nCollection
protected

Definition at line 91 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by fillRecList().

◆ nName

std::string BPHDecayToChargedXXbarBuilder::nName
protected

Definition at line 86 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by fillRecList().

◆ pCollection

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToChargedXXbarBuilder::pCollection
protected

Definition at line 90 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by fillRecList().

◆ pName

std::string BPHDecayToChargedXXbarBuilder::pName
protected

Definition at line 85 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by fillRecList().

◆ ptMin

double BPHDecayToChargedXXbarBuilder::ptMin
protected