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 BPHDecayToChargedXXbarBuilder &x)=delete
 
 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)
 
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 BPHDecayGenericBuilder &x)=delete
 
 BPHDecayGenericBuilder (const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
 
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) {}

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

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;
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 }

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

Referenced by build().

◆ build()

vector< BPHPlusMinusConstCandPtr > BPHDecayToChargedXXbarBuilder::build ( )

build Phi candidates

Operations

Definition at line 65 of file BPHDecayToChargedXXbarBuilder.cc.

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 }

References BPHChi2Select::accept(), addParticle(), BPHDecayToChargedXXbarBuilder::Particle::cand, BPHDecayGenericBuilder::chi2Sel, BPHGenericPtr< T >::create(), dMass, dSigma, BPHDecayToChargedXXbarBuilder::Particle::en, BPHDecayGenericBuilder::evSetup, BPHDecayGenericBuilder::getMassMax(), BPHDecayGenericBuilder::getMassMin(), EgHLTOffHistBins_cfi::mass, ZMuMuCategoriesSequences_cff::massMax, ZMuMuCategoriesSequences_cff::massMin, nCollection, 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.

◆ getDzMax()

double BPHDecayToChargedXXbarBuilder::getDzMax ( ) const
inline

Definition at line 75 of file BPHDecayToChargedXXbarBuilder.h.

75 { return dzMax; }

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)

Definition at line 150 of file BPHDecayToChargedXXbarBuilder.cc.

150  {
151  updated = false;
152  dzMax = dz;
153  return;
154 }

References PVValHelper::dz, dzMax, and BPHDecayGenericBuilder::updated.

◆ setEtaMax()

void BPHDecayToChargedXXbarBuilder::setEtaMax ( double  eta)

Definition at line 144 of file BPHDecayToChargedXXbarBuilder.cc.

144  {
145  updated = false;
146  etaMax = eta;
147  return;
148 }

References PVValHelper::eta, etaMax, and BPHDecayGenericBuilder::updated.

Referenced by BPHPhiToKKBuilder::BPHPhiToKKBuilder().

◆ setPtMin()

void BPHDecayToChargedXXbarBuilder::setPtMin ( double  pt)

set cuts

Definition at line 138 of file BPHDecayToChargedXXbarBuilder.cc.

138  {
139  updated = false;
140  ptMin = pt;
141  return;
142 }

References DiDispStaMuonMonitor_cfi::pt, ptMin, and BPHDecayGenericBuilder::updated.

Referenced by BPHPhiToKKBuilder::BPHPhiToKKBuilder().

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().

BPHDecayToChargedXXbarBuilder::pName
std::string pName
Definition: BPHDecayToChargedXXbarBuilder.h:78
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
BPHDecayGenericBuilder::getMassMax
double getMassMax() const
Definition: BPHDecayGenericBuilder.h:63
nt
int nt
Definition: AMPTWrapper.h:42
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
BPHPlusMinusCandidatePtr
BPHGenericPtr< BPHPlusMinusCandidate >::type BPHPlusMinusCandidatePtr
Definition: BPHPlusMinusCandidatePtr.h:7
BPHDecayToChargedXXbarBuilder::addParticle
void addParticle(const BPHRecoBuilder::BPHGenericCollection *collection, int charge, std::vector< Particle * > &list)
Definition: BPHDecayToChargedXXbarBuilder.cc:156
ZMuMuCategoriesSequences_cff.massMin
massMin
Definition: ZMuMuCategoriesSequences_cff.py:136
BPHDecayToChargedXXbarBuilder::etaMax
double etaMax
Definition: BPHDecayToChargedXXbarBuilder.h:87
BPHDecayToChargedXXbarBuilder::dSigma
double dSigma
Definition: BPHDecayToChargedXXbarBuilder.h:81
BPHTrackReference::getTrack
static const reco::Track * getTrack(const reco::Candidate &rc, const char *modeList="cfhbpmnigset", char *modeFlag=nullptr)
Definition: BPHTrackReference.h:60
BPHDecayToChargedXXbarBuilder::nName
std::string nName
Definition: BPHDecayToChargedXXbarBuilder.h:79
BPHDecayGenericBuilder::updated
bool updated
Definition: BPHDecayGenericBuilder.h:80
BPHDecayToChargedXXbarBuilder::pCollection
const BPHRecoBuilder::BPHGenericCollection * pCollection
Definition: BPHDecayToChargedXXbarBuilder.h:83
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
BPHDecayToChargedXXbarBuilder::dzMax
double dzMax
Definition: BPHDecayToChargedXXbarBuilder.h:88
reco::Track
Definition: Track.h:27
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
BPHDecayGenericBuilder::evSetup
const edm::EventSetup * evSetup
Definition: BPHDecayGenericBuilder.h:73
BPHDecayGenericBuilder::chi2Sel
BPHChi2Select * chi2Sel
Definition: BPHDecayGenericBuilder.h:76
cand
Definition: decayParser.h:32
BPHDecayToChargedXXbarBuilder::ptMin
double ptMin
Definition: BPHDecayToChargedXXbarBuilder.h:86
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
p4
double p4[4]
Definition: TauolaWrapper.h:92
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
ZMuMuCategoriesSequences_cff.massMax
massMax
Definition: ZMuMuCategoriesSequences_cff.py:137
reco::Candidate
Definition: Candidate.h:27
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
BPHDecayToChargedXXbarBuilder::nCollection
const BPHRecoBuilder::BPHGenericCollection * nCollection
Definition: BPHDecayToChargedXXbarBuilder.h:84
PVValHelper::dz
Definition: PVValidationHelpers.h:50
BPHDecayGenericBuilder::BPHDecayGenericBuilder
BPHDecayGenericBuilder(const edm::EventSetup &es, BPHMassFitSelect *mfs=nullptr)
Definition: BPHDecayGenericBuilder.cc:29
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
Particle
Definition: Particle.py:1
BPHDecayToChargedXXbarBuilder::dMass
double dMass
Definition: BPHDecayToChargedXXbarBuilder.h:80
BPHDecayToChargedXXbarBuilder::recList
std::vector< BPHPlusMinusConstCandPtr > recList
Definition: BPHDecayToChargedXXbarBuilder.h:90
BPHChi2Select::accept
bool accept(const BPHDecayVertex &cand) const override
select vertex
Definition: BPHChi2Select.h:48
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
BPHGenericPtr::create
static type create(Args &&... args)
Definition: BPHGenericPtr.h:10
BPHDecayGenericBuilder::getMassMin
double getMassMin() const
get current cuts
Definition: BPHDecayGenericBuilder.h:62