CMS 3D CMS Logo

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

#include <BPHDecayToChargedXXbarBuilder.h>

Inheritance diagram for BPHDecayToChargedXXbarBuilder:
BPHDecayGenericBuilder BPHPhiToKKBuilder

Classes

class  Particle
 

Public Member Functions

 BPHDecayToChargedXXbarBuilder (const edm::EventSetup &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
 
std::vector< BPHPlusMinusConstCandPtrbuild ()
 build Phi candidates More...
 
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
 
- Public Member Functions inherited from BPHDecayGenericBuilder
 BPHDecayGenericBuilder (const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
 
 BPHDecayGenericBuilder (const BPHDecayGenericBuilder &x)=delete
 
double getMassFitMax () const
 
double getMassFitMin () const
 
double getMassMax () const
 
double getMassMin () const
 get current cuts More...
 
double getMinPDiff ()
 
double getProbMin () const
 
BPHDecayGenericBuilderoperator= (const BPHDecayGenericBuilder &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 ~BPHDecayGenericBuilder ()
 

Private Member Functions

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

Private Attributes

double dMass
 
double dSigma
 
double dzMax
 
double etaMax
 
const BPHRecoBuilder::BPHGenericCollectionnCollection
 
std::string nName
 
const BPHRecoBuilder::BPHGenericCollectionpCollection
 
std::string pName
 
double ptMin
 
std::vector< BPHPlusMinusConstCandPtrrecList
 

Additional Inherited Members

- Protected Attributes inherited from BPHDecayGenericBuilder
BPHChi2Selectchi2Sel
 
const edm::EventSetupevSetup
 
BPHMassSelectmassSel
 
BPHMassFitSelectmFitSel
 
double minPDiff
 
bool updated
 

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 edm::EventSetup es,
const std::string &  dPosName,
const std::string &  dNegName,
double  daugMass,
double  daugSigma,
const BPHRecoBuilder::BPHGenericCollection posCollection,
const BPHRecoBuilder::BPHGenericCollection negCollection 
)

Constructor

Definition at line 39 of file BPHDecayToChargedXXbarBuilder.cc.

47  pName(dPosName),
48  nName(dNegName),
49  dMass(daugMass),
50  dSigma(daugSigma),
51  pCollection(posCollection),
52  nCollection(negCollection),
53  ptMin(-1.0),
54  etaMax(10.0),
55  dzMax(1.0) {}
BPHDecayGenericBuilder(const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
const BPHRecoBuilder::BPHGenericCollection * pCollection
const BPHRecoBuilder::BPHGenericCollection * nCollection

◆ BPHDecayToChargedXXbarBuilder() [2/2]

BPHDecayToChargedXXbarBuilder::BPHDecayToChargedXXbarBuilder ( const BPHDecayToChargedXXbarBuilder x)
delete

◆ ~BPHDecayToChargedXXbarBuilder()

BPHDecayToChargedXXbarBuilder::~BPHDecayToChargedXXbarBuilder ( )
override

Destructor

Definition at line 60 of file BPHDecayToChargedXXbarBuilder.cc.

60 {}

Member Function Documentation

◆ addParticle()

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

Definition at line 156 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 build().

158  {
159  int i;
160  int n = collection->size();
161  list.reserve(n);
162  for (i = 0; i < n; ++i) {
163  const reco::Candidate& cand = collection->get(i);
164  int q = cand.charge();
165  if ((charge > 0) && (q <= 0))
166  continue;
167  if ((charge < 0) && (q >= 0))
168  continue;
169  const reco::Candidate::LorentzVector p4 = cand.p4();
170  if (p4.pt() < ptMin)
171  continue;
172  if (p4.eta() > etaMax)
173  continue;
174  const reco::Track* tk = BPHTrackReference::getTrack(cand, "cfhp");
175  if (tk == nullptr)
176  continue;
177  double px = p4.px();
178  double py = p4.py();
179  double pz = p4.pz();
180  list.push_back(new Particle(&cand, tk, px, py, pz, sqrt((px * px) + (py * py) + (pz * pz) + (dMass * dMass))));
181  }
182  return;
183 }
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

◆ build()

vector< BPHPlusMinusConstCandPtr > BPHDecayToChargedXXbarBuilder::build ( )

build Phi candidates

Operations

Definition at line 65 of file BPHDecayToChargedXXbarBuilder.cc.

References BPHChi2Select::accept(), addParticle(), BPHDecayToChargedXXbarBuilder::Particle::cand, BPHDecayGenericBuilder::chi2Sel, BPHGenericPtr< T >::create(), dMass, dSigma, BPHDecayToChargedXXbarBuilder::Particle::en, BPHDecayGenericBuilder::evSetup, BPHDecayGenericBuilder::getMassMax(), BPHDecayGenericBuilder::getMassMin(), callgraph::m2, EgHLTOffHistBins_cfi::mass, recoSelectForWrite_cfi::massMax, recoSelectForWrite_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, recList, BPHDecayToChargedXXbarBuilder::Particle::track, and BPHDecayGenericBuilder::updated.

65  {
66  if (updated)
67  return recList;
68 
69  recList.clear();
70 
71  // extract basic informations from input collections
72 
73  vector<Particle*> pList;
74  vector<Particle*> nList;
75 
76  addParticle(pCollection, +1, pList);
77  addParticle(nCollection, -1, nList);
78  int iPos;
79  int iNeg;
80  int nPos = pList.size();
81  int nNeg = nList.size();
82  double massMin = getMassMin();
83  double massMax = getMassMax();
84  double mSqMin = massMin * massMin * 0.9;
85  double mSqMax = massMax * massMax * 1.1;
86  if (mSqMin < 0.0)
87  mSqMin = 0.0;
88 
89  for (iPos = 0; iPos < nPos; ++iPos) {
90  Particle* pc = pList[iPos];
91  const reco::Track* pt = pc->track;
92  double px = pc->px;
93  double py = pc->py;
94  double pz = pc->pz;
95  double pe = pc->en;
96  for (iNeg = 0; iNeg < nNeg; ++iNeg) {
97  Particle* nc = nList[iNeg];
98  const reco::Track* nt = nc->track;
99  if (fabs(nt->dz() - pt->dz()) > 1.0)
100  continue;
101  double nx = nc->px;
102  double ny = nc->py;
103  double nz = nc->pz;
104  double ne = nc->en;
105  const float tx = px + nx;
106  const float ty = py + ny;
107  const float tz = pz + nz;
108  const float te = pe + ne;
109  const float m2 = (te * te) - ((tx * tx) + (ty * ty) + (tz * tz));
110  if (m2 < mSqMin)
111  continue;
112  if (m2 > mSqMax)
113  continue;
115  rc->add(pName, pc->cand, dMass, dSigma);
116  rc->add(nName, nc->cand, dMass, dSigma);
117  double mass = rc->composite().mass();
118  if (mass < massMin)
119  continue;
120  if (mass > massMax)
121  continue;
122  if (!chi2Sel->accept(*rc))
123  continue;
124  recList.push_back(rc);
125  }
126  }
127 
128  for (iPos = 0; iPos < nPos; ++iPos)
129  delete pList[iPos];
130  for (iNeg = 0; iNeg < nNeg; ++iNeg)
131  delete nList[iNeg];
132 
133  updated = true;
134  return recList;
135 }
std::vector< BPHPlusMinusConstCandPtr > recList
bool accept(const BPHDecayVertex &cand) const override
select vertex
Definition: BPHChi2Select.h:48
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
const edm::EventSetup * evSetup

◆ getDzMax()

double BPHDecayToChargedXXbarBuilder::getDzMax ( ) const
inline

Definition at line 75 of file BPHDecayToChargedXXbarBuilder.h.

References dzMax.

◆ getEtaMax()

double BPHDecayToChargedXXbarBuilder::getEtaMax ( ) const

◆ getPtMin()

double BPHDecayToChargedXXbarBuilder::getPtMin ( ) const

get current cuts

◆ 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
private

Definition at line 80 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by addParticle(), and build().

◆ dSigma

double BPHDecayToChargedXXbarBuilder::dSigma
private

Definition at line 81 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

◆ dzMax

double BPHDecayToChargedXXbarBuilder::dzMax
private

Definition at line 88 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by getDzMax(), and setDzMax().

◆ etaMax

double BPHDecayToChargedXXbarBuilder::etaMax
private

Definition at line 87 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by addParticle(), and setEtaMax().

◆ nCollection

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToChargedXXbarBuilder::nCollection
private

Definition at line 84 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

◆ nName

std::string BPHDecayToChargedXXbarBuilder::nName
private

Definition at line 79 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

◆ pCollection

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToChargedXXbarBuilder::pCollection
private

Definition at line 83 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

◆ pName

std::string BPHDecayToChargedXXbarBuilder::pName
private

Definition at line 78 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

◆ ptMin

double BPHDecayToChargedXXbarBuilder::ptMin
private

Definition at line 86 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by addParticle(), and setPtMin().

◆ recList

std::vector<BPHPlusMinusConstCandPtr> BPHDecayToChargedXXbarBuilder::recList
private

Definition at line 90 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().