CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BPHMassSymSelect.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHMassSymSelect_h
2 #define HeavyFlavorAnalysis_SpecificDecay_BPHMassSymSelect_h
3 
13 //----------------------
14 // Base Class Headers --
15 //----------------------
17 
18 //------------------------------------
19 // Collaborating Class Declarations --
20 //------------------------------------
23 
24 //---------------
25 // C++ Headers --
26 //---------------
27 #include <string>
28 
29 // ---------------------
30 // -- Class Interface --
31 // ---------------------
32 
34 public:
38  : nPos(np), nNeg(nn), mSel(ms) {}
39 
40  // deleted copy constructor and assignment operator
41  BPHMassSymSelect(const BPHMassSymSelect& x) = delete;
42  BPHMassSymSelect& operator=(const BPHMassSymSelect& x) = delete;
43 
46  ~BPHMassSymSelect() override {}
47 
50  bool accept(const BPHDecayMomentum& cand) const override {
52  if (mSel->accept(cand))
53  return true;
54 
55  const reco::Candidate* pp = cand.getDaug(nPos);
56  const reco::Candidate* np = cand.getDaug(nNeg);
57 
58  reco::Candidate* pc = cand.originalReco(pp)->clone();
59  reco::Candidate* nc = cand.originalReco(np)->clone();
60 
61  pc->setMass(np->p4().mass());
62  nc->setMass(pp->p4().mass());
63  const reco::Candidate::LorentzVector s4 = pc->p4() + nc->p4();
64  double mass = s4.mass();
65 
66  delete pc;
67  delete nc;
68  return ((mass >= mSel->getMassMin()) && (mass <= mSel->getMassMax()));
69  }
70 
71 private:
75 };
76 
77 #endif
tuple pp
Definition: createTree.py:17
BPHMassSymSelect(const std::string &np, const std::string &nn, const BPHMassSelect *ms)
bool accept(const BPHDecayMomentum &cand) const override
select particle
bool accept(const BPHDecayMomentum &cand) const override
select particle
Definition: BPHMassSelect.h:48
int np
Definition: AMPTWrapper.h:43
~BPHMassSymSelect() override
virtual const reco::Candidate * originalReco(const reco::Candidate *daug) const
get the original particle from the clone
virtual Candidate * clone() const =0
returns a clone of the Candidate object
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:58
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
int32_t *__restrict__ nn
virtual const reco::Candidate * getDaug(const std::string &name) const
virtual void setMass(double m)=0
set particle mass
BPHMassSymSelect & operator=(const BPHMassSymSelect &x)=delete
const BPHMassSelect * mSel
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector