CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
BPHX3872ToJPsiPiPiBuilder Class Reference

#include <BPHX3872ToJPsiPiPiBuilder.h>

Public Member Functions

 BPHX3872ToJPsiPiPiBuilder (const edm::EventSetup &es, const std::vector< BPHPlusMinusConstCandPtr > &jpsiCollection, const BPHRecoBuilder::BPHGenericCollection *posCollection, const BPHRecoBuilder::BPHGenericCollection *negCollection)
 
 BPHX3872ToJPsiPiPiBuilder (const BPHX3872ToJPsiPiPiBuilder &x)=delete
 
std::vector< BPHRecoConstCandPtrbuild ()
 build X3872 candidates More...
 
bool getConstr () const
 
double getJPsiMassMax () const
 
double getJPsiMassMin () const
 get current cuts More...
 
double getMassFitMax () const
 
double getMassFitMin () const
 
double getMassMax () const
 
double getMassMin () const
 
double getPiEtaMax () const
 
double getPiPtMin () const
 get current cuts More...
 
double getProbMin () const
 
BPHX3872ToJPsiPiPiBuilderoperator= (const BPHX3872ToJPsiPiPiBuilder &x)=delete
 
void setConstr (bool flag)
 
void setJPsiMassMax (double m)
 
void setJPsiMassMin (double m)
 set cuts More...
 
void setMassFitMax (double m)
 
void setMassFitMin (double m)
 
void setMassMax (double m)
 
void setMassMin (double m)
 
void setPiEtaMax (double eta)
 
void setPiPtMin (double pt)
 set cuts More...
 
void setProbMin (double p)
 
virtual ~BPHX3872ToJPsiPiPiBuilder ()
 

Private Attributes

BPHChi2Selectchi2Sel
 
double etaMax
 
const edm::EventSetupevSetup
 
const std::vector
< BPHPlusMinusConstCandPtr > * 
jCollection
 
std::string jPsiName
 
BPHMassSelectjpsiSel
 
bool massConstr
 
BPHMassSelectmassSel
 
BPHMassFitSelectmFitSel
 
float minPDiff
 
const
BPHRecoBuilder::BPHGenericCollection
nCollection
 
const
BPHRecoBuilder::BPHGenericCollection
pCollection
 
std::string pionNegName
 
std::string pionPosName
 
double ptMin
 
bool updated
 
std::vector< BPHRecoConstCandPtrx3872List
 

Detailed Description

Description: Class to build X3872 to JPsi pi+ pi- candidates

Author
Paolo Ronchese INFN Padova

Definition at line 42 of file BPHX3872ToJPsiPiPiBuilder.h.

Constructor & Destructor Documentation

BPHX3872ToJPsiPiPiBuilder::BPHX3872ToJPsiPiPiBuilder ( const edm::EventSetup es,
const std::vector< BPHPlusMinusConstCandPtr > &  jpsiCollection,
const BPHRecoBuilder::BPHGenericCollection posCollection,
const BPHRecoBuilder::BPHGenericCollection negCollection 
)

Constructor

Definition at line 36 of file BPHX3872ToJPsiPiPiBuilder.cc.

References chi2Sel, etaMax, BPHParticleMasses::jPsiMass, BPHParticleMasses::jPsiMWidth, jPsiName, jpsiSel, massConstr, massSel, mFitSel, minPDiff, ptMin, and updated.

40  : jPsiName("JPsi"),
41  pionPosName("PionPos"),
42  pionNegName("PionNeg"),
43  evSetup(&es),
44  jCollection(&jpsiCollection),
45  pCollection(posCollection),
46  nCollection(negCollection) {
47  jpsiSel = new BPHMassSelect(2.80, 3.40);
48  ptMin = 1.0;
49  etaMax = 10.0;
50  massSel = new BPHMassSelect(3.00, 4.50);
51  chi2Sel = new BPHChi2Select(0.02);
53  massConstr = true;
54  minPDiff = 1.0e-4;
55  updated = false;
56 }
const edm::EventSetup * evSetup
static const double jPsiMWidth
const BPHRecoBuilder::BPHGenericCollection * pCollection
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
static const double jPsiMass
const BPHRecoBuilder::BPHGenericCollection * nCollection
BPHX3872ToJPsiPiPiBuilder::BPHX3872ToJPsiPiPiBuilder ( const BPHX3872ToJPsiPiPiBuilder x)
delete
BPHX3872ToJPsiPiPiBuilder::~BPHX3872ToJPsiPiPiBuilder ( )
virtual

Destructor

Definition at line 61 of file BPHX3872ToJPsiPiPiBuilder.cc.

References chi2Sel, jpsiSel, massSel, and mFitSel.

61  {
62  delete jpsiSel;
63  delete massSel;
64  delete chi2Sel;
65  delete mFitSel;
66 }

Member Function Documentation

vector< BPHRecoConstCandPtr > BPHX3872ToJPsiPiPiBuilder::build ( )

build X3872 candidates

Operations

Definition at line 71 of file BPHX3872ToJPsiPiPiBuilder.cc.

References BPHMassSelect::accept(), BPHChi2Select::accept(), BPHMassFitSelect::accept(), BPHRecoCandidate::add(), c, reco::Candidate::charge(), chi2Sel, reco::TrackBase::dz(), etaMax, evSetup, BPHRecoBuilder::BPHGenericCollection::get(), getMassMax(), BPHTrackReference::getTrack(), jCollection, BPHParticleMasses::jPsiMass, jPsiName, jpsiSel, ResonanceBuilder::mass, massSel, mFitSel, nCollection, nt, AlCaHLTBitMon_ParallelJobs::p, fireworks::p2, reco::Candidate::p4(), Particle::Particle(), pCollection, BPHParticleMasses::pionMass, BPHParticleMasses::pionMSigma, pionNegName, pionPosName, createTree::pp, DiDispStaMuonMonitor_cfi::pt, ptMin, BPHRecoBuilder::BPHGenericCollection::size(), mathSSE::sqrt(), HLT_FULL_cff::track, updated, x, x3872List, y, and z.

Referenced by BPHWriteSpecificDecay::fill().

71  {
72  if (updated)
73  return x3872List;
74 
75  x3872List.clear();
76 
77  // extract basic informations from input collections
78 
79  class Particle {
80  public:
81  Particle(const reco::Candidate* c, const reco::Track* tk, double x, double y, double z, double p)
82  : cand(c), track(tk), px(x), py(y), pz(z), ePion(p) {}
83  const reco::Candidate* cand;
84  const reco::Track* track;
85  double px;
86  double py;
87  double pz;
88  double ePion;
89  };
90 
91  vector<Particle> pList;
92  vector<Particle> nList;
93 
94  int nPos = pCollection->size();
95  int nNeg = nCollection->size();
96 
97  pList.reserve(nPos);
98  nList.reserve(nNeg);
99 
100  // filter input collections
101 
102  int iPos;
103  int iNeg;
104 
105  for (iPos = 0; iPos < nPos; ++iPos) {
106  const reco::Candidate& cand = pCollection->get(iPos);
107  if (cand.charge() != +1)
108  continue;
109  const reco::Candidate::LorentzVector p4 = cand.p4();
110  if (p4.pt() < ptMin)
111  continue;
112  if (p4.eta() > etaMax)
113  continue;
114  const reco::Track* tk = BPHTrackReference::getTrack(cand, "cfhp");
115  if (tk == nullptr)
116  continue;
117  double px = p4.px();
118  double py = p4.py();
119  double pz = p4.pz();
120  double p2 = (px * px) + (py * py) + (pz * pz);
121  pList.push_back(
122  Particle(&cand, tk, px, py, pz, sqrt(p2 + (BPHParticleMasses::pionMass * BPHParticleMasses::pionMass))));
123  }
124 
125  for (iNeg = 0; iNeg < nNeg; ++iNeg) {
126  const reco::Candidate& cand = nCollection->get(iNeg);
127  if (cand.charge() != -1)
128  continue;
129  const reco::Candidate::LorentzVector p4 = cand.p4();
130  if (p4.pt() < ptMin)
131  continue;
132  if (p4.eta() > etaMax)
133  continue;
134  const reco::Track* tk = BPHTrackReference::getTrack(cand, "cfhp");
135  if (tk == nullptr)
136  continue;
137  double px = p4.px();
138  double py = p4.py();
139  double pz = p4.pz();
140  double p2 = (px * px) + (py * py) + (pz * pz);
141  nList.push_back(
142  Particle(&cand, tk, px, py, pz, sqrt(p2 + (BPHParticleMasses::pionMass * BPHParticleMasses::pionMass))));
143  }
144 
145  // filter basic candidates
146 
147  nPos = pList.size();
148  nNeg = nList.size();
149 
150  double mMax = getMassMax() - (0.8 * BPHParticleMasses::jPsiMass);
151 
152  struct PionPair {
153  const reco::Candidate* posPion;
154  const reco::Candidate* negPion;
155  };
156  vector<const PionPair*> pionPairs;
157  pionPairs.reserve(nPos * nNeg);
158 
159  for (iPos = 0; iPos < nPos; ++iPos) {
160  Particle& pc = pList[iPos];
161  const reco::Track* pt = pc.track;
162  double px = pc.px;
163  double py = pc.py;
164  double pz = pc.pz;
165  double pe = pc.ePion;
166  for (iNeg = 0; iNeg < nNeg; ++iNeg) {
167  Particle& nc = nList[iNeg];
168  const reco::Track* nt = nc.track;
169  if (fabs(nt->dz() - pt->dz()) > 1.0)
170  continue;
171  double nx = nc.px;
172  double ny = nc.py;
173  double nz = nc.pz;
174  double ne = nc.ePion;
175  const float tx = px + nx;
176  const float ty = py + ny;
177  const float tz = pz + nz;
178  const float te = pe + ne;
179  float mass = (te * te) - ((tx * tx) + (ty * ty) + (tz * tz));
180  if (mass > mMax)
181  continue;
182  PionPair* pp = new PionPair;
183  pp->posPion = pc.cand;
184  pp->negPion = nc.cand;
185  pionPairs.push_back(pp);
186  }
187  }
188 
189  vector<BPHPlusMinusConstCandPtr> jPsi;
190  int nJPsi = jCollection->size();
191  int iJPsi;
192  jPsi.reserve(nJPsi);
193  for (iJPsi = 0; iJPsi < nJPsi; ++iJPsi) {
194  const BPHPlusMinusConstCandPtr& jpCand = jCollection->at(iJPsi);
195  if (jpsiSel->accept(*jpCand))
196  jPsi.push_back(jpCand);
197  }
198  nJPsi = jPsi.size();
199 
200  int nPair = pionPairs.size();
201  int iPair;
202  for (iPair = 0; iPair < nPair; ++iPair) {
203  const PionPair* pp = pionPairs[iPair];
204  for (iJPsi = 0; iJPsi < nJPsi; ++iJPsi) {
206  BPHRecoCandidatePtr xPtr(x3872);
207  x3872->add(jPsiName, jPsi[iJPsi]);
210  if (!massSel->accept(*x3872))
211  continue;
212  if ((chi2Sel != nullptr) && !chi2Sel->accept(*x3872))
213  continue;
214  if (!mFitSel->accept(*x3872))
215  continue;
216  x3872List.push_back(xPtr);
217  }
218  delete pp;
219  }
220 
221  updated = true;
222  return x3872List;
223 }
const edm::EventSetup & c
BPHGenericPtr< BPHRecoCandidate >::type BPHRecoCandidatePtr
const edm::EventSetup * evSetup
tuple pp
Definition: createTree.py:17
const TString p2
Definition: fwPaths.cc:13
bool accept(const BPHDecayVertex &cand) const override
select vertex
Definition: BPHChi2Select.h:48
const BPHRecoBuilder::BPHGenericCollection * pCollection
Particle(ParticlePDG *pdg=nullptr)
Definition: Particle.cc:13
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
static const double jPsiMass
const BPHRecoBuilder::BPHGenericCollection * nCollection
bool accept(const BPHDecayMomentum &cand) const override
select particle
Definition: BPHMassSelect.h:48
BPHGenericPtr< const BPHPlusMinusCandidate >::type BPHPlusMinusConstCandPtr
static const double pionMSigma
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
virtual void add(const std::string &name, const reco::Candidate *daug, double mass=-1.0, double sigma=-1.0)
int nt
Definition: AMPTWrapper.h:42
static const double pionMass
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
std::vector< BPHRecoConstCandPtr > x3872List
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
bool accept(const BPHKinematicFit &cand) const override
select particle
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
bool BPHX3872ToJPsiPiPiBuilder::getConstr ( ) const

Definition at line 306 of file BPHX3872ToJPsiPiPiBuilder.cc.

References massConstr.

double BPHX3872ToJPsiPiPiBuilder::getJPsiMassMax ( ) const

Definition at line 290 of file BPHX3872ToJPsiPiPiBuilder.cc.

References BPHMassCuts::getMassMax(), and jpsiSel.

290 { return jpsiSel->getMassMax(); }
double getMassMax() const
Definition: BPHMassCuts.h:59
double BPHX3872ToJPsiPiPiBuilder::getJPsiMassMin ( ) const

get current cuts

Definition at line 288 of file BPHX3872ToJPsiPiPiBuilder.cc.

References BPHMassCuts::getMassMin(), and jpsiSel.

288 { return jpsiSel->getMassMin(); }
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:58
double BPHX3872ToJPsiPiPiBuilder::getMassFitMax ( ) const

Definition at line 304 of file BPHX3872ToJPsiPiPiBuilder.cc.

References BPHMassCuts::getMassMax(), and mFitSel.

304 { return mFitSel->getMassMax(); }
double getMassMax() const
Definition: BPHMassCuts.h:59
double BPHX3872ToJPsiPiPiBuilder::getMassFitMin ( ) const

Definition at line 302 of file BPHX3872ToJPsiPiPiBuilder.cc.

References BPHMassCuts::getMassMin(), and mFitSel.

302 { return mFitSel->getMassMin(); }
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:58
double BPHX3872ToJPsiPiPiBuilder::getMassMax ( ) const

Definition at line 298 of file BPHX3872ToJPsiPiPiBuilder.cc.

References BPHMassCuts::getMassMax(), and massSel.

Referenced by build().

298 { return massSel->getMassMax(); }
double getMassMax() const
Definition: BPHMassCuts.h:59
double BPHX3872ToJPsiPiPiBuilder::getMassMin ( ) const

Definition at line 296 of file BPHX3872ToJPsiPiPiBuilder.cc.

References BPHMassCuts::getMassMin(), and massSel.

296 { return massSel->getMassMin(); }
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:58
double BPHX3872ToJPsiPiPiBuilder::getPiEtaMax ( ) const

Definition at line 294 of file BPHX3872ToJPsiPiPiBuilder.cc.

References etaMax.

double BPHX3872ToJPsiPiPiBuilder::getPiPtMin ( ) const

get current cuts

Definition at line 292 of file BPHX3872ToJPsiPiPiBuilder.cc.

References ptMin.

double BPHX3872ToJPsiPiPiBuilder::getProbMin ( ) const

Definition at line 300 of file BPHX3872ToJPsiPiPiBuilder.cc.

References chi2Sel, and BPHChi2Select::getProbMin().

300 { return (chi2Sel == nullptr ? -1.0 : chi2Sel->getProbMin()); }
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:66
BPHX3872ToJPsiPiPiBuilder& BPHX3872ToJPsiPiPiBuilder::operator= ( const BPHX3872ToJPsiPiPiBuilder x)
delete
void BPHX3872ToJPsiPiPiBuilder::setConstr ( bool  flag)

Definition at line 281 of file BPHX3872ToJPsiPiPiBuilder.cc.

References massConstr, and updated.

Referenced by BPHWriteSpecificDecay::fill().

281  {
282  updated = false;
283  massConstr = flag;
284  return;
285 }
void BPHX3872ToJPsiPiPiBuilder::setJPsiMassMax ( double  m)
void BPHX3872ToJPsiPiPiBuilder::setJPsiMassMin ( double  m)

set cuts

Definition at line 226 of file BPHX3872ToJPsiPiPiBuilder.cc.

References jpsiSel, BPHMassCuts::setMassMin(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

226  {
227  updated = false;
228  jpsiSel->setMassMin(m);
229  return;
230 }
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:48
void BPHX3872ToJPsiPiPiBuilder::setMassFitMax ( double  m)
void BPHX3872ToJPsiPiPiBuilder::setMassFitMin ( double  m)

Definition at line 269 of file BPHX3872ToJPsiPiPiBuilder.cc.

References mFitSel, BPHMassCuts::setMassMin(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

269  {
270  updated = false;
271  mFitSel->setMassMin(m);
272  return;
273 }
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:48
void BPHX3872ToJPsiPiPiBuilder::setMassMax ( double  m)
void BPHX3872ToJPsiPiPiBuilder::setMassMin ( double  m)

Definition at line 250 of file BPHX3872ToJPsiPiPiBuilder.cc.

References massSel, BPHMassCuts::setMassMin(), and updated.

Referenced by BPHWriteSpecificDecay::fill().

250  {
251  updated = false;
252  massSel->setMassMin(m);
253  return;
254 }
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:48
void BPHX3872ToJPsiPiPiBuilder::setPiEtaMax ( double  eta)

Definition at line 244 of file BPHX3872ToJPsiPiPiBuilder.cc.

References PVValHelper::eta, etaMax, and updated.

Referenced by BPHWriteSpecificDecay::fill().

void BPHX3872ToJPsiPiPiBuilder::setPiPtMin ( double  pt)

set cuts

Definition at line 238 of file BPHX3872ToJPsiPiPiBuilder.cc.

References DiDispStaMuonMonitor_cfi::pt, ptMin, and updated.

Referenced by BPHWriteSpecificDecay::fill().

void BPHX3872ToJPsiPiPiBuilder::setProbMin ( double  p)

Definition at line 262 of file BPHX3872ToJPsiPiPiBuilder.cc.

References chi2Sel, and updated.

Referenced by BPHWriteSpecificDecay::fill().

262  {
263  updated = false;
264  delete chi2Sel;
265  chi2Sel = (p < 0.0 ? nullptr : new BPHChi2Select(p));
266  return;
267 }

Member Data Documentation

BPHChi2Select* BPHX3872ToJPsiPiPiBuilder::chi2Sel
private
double BPHX3872ToJPsiPiPiBuilder::etaMax
private
const edm::EventSetup* BPHX3872ToJPsiPiPiBuilder::evSetup
private

Definition at line 93 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by build().

const std::vector<BPHPlusMinusConstCandPtr>* BPHX3872ToJPsiPiPiBuilder::jCollection
private

Definition at line 94 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by build().

std::string BPHX3872ToJPsiPiPiBuilder::jPsiName
private

Definition at line 89 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by BPHX3872ToJPsiPiPiBuilder(), and build().

BPHMassSelect* BPHX3872ToJPsiPiPiBuilder::jpsiSel
private
bool BPHX3872ToJPsiPiPiBuilder::massConstr
private

Definition at line 106 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by BPHX3872ToJPsiPiPiBuilder(), getConstr(), and setConstr().

BPHMassSelect* BPHX3872ToJPsiPiPiBuilder::massSel
private
BPHMassFitSelect* BPHX3872ToJPsiPiPiBuilder::mFitSel
private
float BPHX3872ToJPsiPiPiBuilder::minPDiff
private

Definition at line 107 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by BPHX3872ToJPsiPiPiBuilder().

const BPHRecoBuilder::BPHGenericCollection* BPHX3872ToJPsiPiPiBuilder::nCollection
private

Definition at line 96 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by build().

const BPHRecoBuilder::BPHGenericCollection* BPHX3872ToJPsiPiPiBuilder::pCollection
private

Definition at line 95 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by build().

std::string BPHX3872ToJPsiPiPiBuilder::pionNegName
private

Definition at line 91 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by build().

std::string BPHX3872ToJPsiPiPiBuilder::pionPosName
private

Definition at line 90 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by build().

double BPHX3872ToJPsiPiPiBuilder::ptMin
private
bool BPHX3872ToJPsiPiPiBuilder::updated
private
std::vector<BPHRecoConstCandPtr> BPHX3872ToJPsiPiPiBuilder::x3872List
private

Definition at line 110 of file BPHX3872ToJPsiPiPiBuilder.h.

Referenced by build().