CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< BPHPlusMinusConstCandPtr
build ()
 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::BPHGenericCollection
nCollection
 
std::string nName
 
const
BPHRecoBuilder::BPHGenericCollection
pCollection
 
std::string pName
 
double ptMin
 
std::vector
< BPHPlusMinusConstCandPtr
recList
 

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::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::BPHDecayToChargedXXbarBuilder ( const BPHDecayToChargedXXbarBuilder x)
delete
BPHDecayToChargedXXbarBuilder::~BPHDecayToChargedXXbarBuilder ( )
override

Destructor

Definition at line 60 of file BPHDecayToChargedXXbarBuilder.cc.

60 {}

Member Function Documentation

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

Definition at line 156 of file BPHDecayToChargedXXbarBuilder.cc.

References reco::Candidate::charge(), dMass, etaMax, BPHRecoBuilder::BPHGenericCollection::get(), BPHTrackReference::getTrack(), mps_fire::i, dqmiodumpmetadata::n, reco::Candidate::p4(), ptMin, submitPVResolutionJobs::q, BPHRecoBuilder::BPHGenericCollection::size(), 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)
virtual const reco::Candidate & get(int i) const =0
virtual int charge() const =0
electric charge
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
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, reco::TrackBase::dz(), BPHDecayToChargedXXbarBuilder::Particle::en, BPHDecayGenericBuilder::evSetup, BPHDecayGenericBuilder::getMassMax(), BPHDecayGenericBuilder::getMassMin(), callgraph::m2, ResonanceBuilder::mass, nCollection, compareTotals::ne, nName, nt, pCollection, pName, DiDispStaMuonMonitor_cfi::pt, BPHDecayToChargedXXbarBuilder::Particle::px, BPHDecayToChargedXXbarBuilder::Particle::py, BPHDecayToChargedXXbarBuilder::Particle::pz, recList, BPHDecayToChargedXXbarBuilder::Particle::track, and BPHDecayGenericBuilder::updated.

Referenced by BPHDecayToV0SameMassBuilder::buildFromBPHGenericCollection(), and BPHWriteSpecificDecay::fill().

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
void addParticle(const BPHRecoBuilder::BPHGenericCollection *collection, int charge, std::vector< Particle * > &list)
tuple m2
Definition: callgraph.py:57
BPHGenericPtr< BPHPlusMinusCandidate >::type BPHPlusMinusCandidatePtr
const BPHRecoBuilder::BPHGenericCollection * pCollection
double getMassMin() const
get current cuts
int nt
Definition: AMPTWrapper.h:42
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
static type create(Args &&...args)
Definition: BPHGenericPtr.h:10
const BPHRecoBuilder::BPHGenericCollection * nCollection
const edm::EventSetup * evSetup
double BPHDecayToChargedXXbarBuilder::getDzMax ( ) const
inline

Definition at line 75 of file BPHDecayToChargedXXbarBuilder.h.

References dzMax.

double BPHDecayToChargedXXbarBuilder::getEtaMax ( ) const
double BPHDecayToChargedXXbarBuilder::getPtMin ( ) const

get current cuts

BPHDecayToChargedXXbarBuilder& BPHDecayToChargedXXbarBuilder::operator= ( const BPHDecayToChargedXXbarBuilder x)
delete
void BPHDecayToChargedXXbarBuilder::setDzMax ( double  dz)
void BPHDecayToChargedXXbarBuilder::setEtaMax ( double  eta)
void BPHDecayToChargedXXbarBuilder::setPtMin ( double  pt)

Member Data Documentation

double BPHDecayToChargedXXbarBuilder::dMass
private

Definition at line 80 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by addParticle(), and build().

double BPHDecayToChargedXXbarBuilder::dSigma
private

Definition at line 81 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

double BPHDecayToChargedXXbarBuilder::dzMax
private

Definition at line 88 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by getDzMax(), and setDzMax().

double BPHDecayToChargedXXbarBuilder::etaMax
private

Definition at line 87 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by addParticle(), and setEtaMax().

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToChargedXXbarBuilder::nCollection
private

Definition at line 84 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

std::string BPHDecayToChargedXXbarBuilder::nName
private

Definition at line 79 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

const BPHRecoBuilder::BPHGenericCollection* BPHDecayToChargedXXbarBuilder::pCollection
private

Definition at line 83 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

std::string BPHDecayToChargedXXbarBuilder::pName
private

Definition at line 78 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().

double BPHDecayToChargedXXbarBuilder::ptMin
private

Definition at line 86 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by addParticle(), and setPtMin().

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

Definition at line 90 of file BPHDecayToChargedXXbarBuilder.h.

Referenced by build().