CMS 3D CMS Logo

BPHDecayToV0SameMassBuilder.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author Paolo Ronchese INFN Padova
5  *
6  */
7 
8 //-----------------------
9 // This Class' Header --
10 //-----------------------
12 
13 //-------------------------------
14 // Collaborating Class Headers --
15 //-------------------------------
20 
21 //---------------
22 // C++ Headers --
23 //---------------
24 #include <cmath>
25 using namespace std;
26 
27 //-------------------
28 // Initializations --
29 //-------------------
30 
31 //----------------
32 // Constructors --
33 //----------------
35  const string& posName,
36  const string& negName,
37  double daugMass,
38  double daugSigma,
39  const BPHRecoBuilder::BPHGenericCollection* posCollection,
40  const BPHRecoBuilder::BPHGenericCollection* negCollection)
42  BPHDecayToV0Builder(es, posName, negName, posCollection, negCollection),
43  BPHDecayToChargedXXbarBuilder(es, posName, negName, daugMass, daugSigma, posCollection, negCollection),
44  pMass(daugMass),
45  pSigma(daugSigma) {}
46 
48  const string& posName,
49  const string& negName,
50  double daugMass,
51  double daugSigma,
52  const vector<reco::VertexCompositeCandidate>* v0Collection,
53  const string& searchList)
55  BPHDecayToV0Builder(es, posName, negName, v0Collection, searchList),
56  BPHDecayToChargedXXbarBuilder(es, posName, negName, daugMass, daugSigma, nullptr, nullptr),
57  pMass(daugMass),
58  pSigma(daugSigma) {}
59 
61  const string& posName,
62  const string& negName,
63  double daugMass,
64  double daugSigma,
65  const vector<reco::VertexCompositePtrCandidate>* vpCollection,
66  const string& searchList)
68  BPHDecayToV0Builder(es, posName, negName, vpCollection, searchList),
69  BPHDecayToChargedXXbarBuilder(es, posName, negName, daugMass, daugSigma, nullptr, nullptr),
70  pMass(daugMass),
71  pSigma(daugSigma) {}
72 
73 //--------------
74 // Operations --
75 //--------------
78  return;
79 }
80 
82  const reco::Candidate* c2,
83  const void* v0,
84  v0Type type) {
85  if (c1->p4().pt() < ptMin)
86  return nullptr;
87  if (c2->p4().pt() < ptMin)
88  return nullptr;
89  if (fabs(c1->p4().eta()) > etaMax)
90  return nullptr;
91  if (fabs(c2->p4().eta()) > etaMax)
92  return nullptr;
94  if (c1->charge() > 0) {
95  cand->add(p1Name, c1, pMass, pSigma);
96  cand->add(p2Name, c2, pMass, pSigma);
97  } else {
98  cand->add(p1Name, c2, pMass, pSigma);
99  cand->add(p2Name, c1, pMass, pSigma);
100  }
101  return cand;
102 }
void fillRecList() override
build candidates
void buildFromBPHGenericCollection() override
build candidates and link to V0
const BPHEventSetupWrapper * evSetup
BPHGenericPtr< BPHPlusMinusCandidate >::type BPHPlusMinusCandidatePtr
BPHPlusMinusCandidatePtr buildCandidate(const reco::Candidate *c1, const reco::Candidate *c2, const void *v0, v0Type type) override
BPHDecayToV0SameMassBuilder(const BPHEventSetupWrapper &es, const std::string &posName, const std::string &negName, double daugMass, double daugSigma, const BPHRecoBuilder::BPHGenericCollection *posCollection, const BPHRecoBuilder::BPHGenericCollection *negCollection)
static type create(Args &&... args)
Definition: BPHGenericPtr.h:10
common object to interface with edm collections
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector