CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BPHBdToKxMuMuBuilder.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 //-------------------------------
23 
24 //---------------
25 // C++ Headers --
26 //---------------
27 using namespace std;
28 
29 //-------------------
30 // Initializations --
31 //-------------------
32 
33 //----------------
34 // Constructors --
35 //----------------
37  const std::vector<BPHPlusMinusConstCandPtr>& oniaCollection,
38  const std::vector<BPHPlusMinusConstCandPtr>& kx0Collection)
39  : oniaName("Onia"), kx0Name("Kx0"), evSetup(&es), jCollection(&oniaCollection), kCollection(&kx0Collection) {
40  oniaSel = new BPHMassSelect(1.00, 12.00);
41  mkx0Sel = new BPHMassSelect(0.80, 1.00);
42  massSel = new BPHMassSelect(3.50, 8.00);
43  chi2Sel = new BPHChi2Select(0.02);
44  mFitSel = new BPHMassFitSelect(4.00, 7.00);
45  massConstr = true;
46  minPDiff = 1.0e-4;
47  updated = false;
48 }
49 
50 //--------------
51 // Destructor --
52 //--------------
54  delete oniaSel;
55  delete mkx0Sel;
56  delete massSel;
57  delete chi2Sel;
58  delete mFitSel;
59 }
60 
61 //--------------
62 // Operations --
63 //--------------
64 vector<BPHRecoConstCandPtr> BPHBdToKxMuMuBuilder::build() {
65  if (updated)
66  return bdList;
67 
68  bdList.clear();
69 
70  BPHRecoBuilder bBd(*evSetup);
72  bBd.add(oniaName, *jCollection);
73  bBd.add(kx0Name, *kCollection);
74  bBd.filter(oniaName, *oniaSel);
75  bBd.filter(kx0Name, *mkx0Sel);
76 
77  bBd.filter(*massSel);
78  if (chi2Sel != nullptr)
79  bBd.filter(*chi2Sel);
80  if (massConstr)
81  bBd.filter(*mFitSel);
82 
84  //
85  // Apply kinematic constraint on the onia mass.
86  // The operation is already performed when apply the mass selection,
87  // so it's not repeated. The following code is left as example
88  // for similar operations
89  //
90  // int iBd;
91  // int nBd = ( massConstr ? bdList.size() : 0 );
92  // for ( iBd = 0; iBd < nBd; ++iBd ) {
93  // BPHRecoCandidate* cptr = bdList[iBd].get();
94  // BPHRecoConstCandPtr onia = cptr->getComp( oniaName );
95  // double oMass = onia->constrMass();
96  // if ( oMass < 0 ) continue;
97  // double sigma = onia->constrSigma();
98  // cptr->kinematicTree( oniaName, oMass, sigma );
99  // }
100  updated = true;
101 
102  return bdList;
103 }
104 
107  updated = false;
108  oniaSel->setMassMin(m);
109  return;
110 }
111 
113  updated = false;
114  oniaSel->setMassMax(m);
115  return;
116 }
117 
119  updated = false;
120  mkx0Sel->setMassMin(m);
121  return;
122 }
123 
125  updated = false;
126  mkx0Sel->setMassMax(m);
127  return;
128 }
129 
131  updated = false;
132  massSel->setMassMin(m);
133  return;
134 }
135 
137  updated = false;
138  massSel->setMassMax(m);
139  return;
140 }
141 
143  updated = false;
144  delete chi2Sel;
145  chi2Sel = (p < 0.0 ? nullptr : new BPHChi2Select(p));
146  return;
147 }
148 
150  updated = false;
151  mFitSel->setMassMin(m);
152  return;
153 }
154 
156  updated = false;
157  mFitSel->setMassMax(m);
158  return;
159 }
160 
162  updated = false;
163  massConstr = flag;
164  return;
165 }
166 
169 
171 
173 
175 
177 
179 
180 double BPHBdToKxMuMuBuilder::getProbMin() const { return (chi2Sel == nullptr ? -1.0 : chi2Sel->getProbMin()); }
181 
183 
185 
void setMinPDiffererence(double pMin)
void setMassMax(double m)
Definition: BPHMassCuts.h:52
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
double getOniaMassMax() const
std::vector< BPHRecoConstCandPtr > bdList
const std::vector< BPHPlusMinusConstCandPtr > * kCollection
static const std::string kCollection
Definition: FWTableView.cc:190
std::vector< BPHRecoConstCandPtr > build()
build Bs candidates
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
BPHBdToKxMuMuBuilder(const edm::EventSetup &es, const std::vector< BPHPlusMinusConstCandPtr > &oniaCollection, const std::vector< BPHPlusMinusConstCandPtr > &kx0Collection)
double getOniaMassMin() const
get current cuts
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:66
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:48
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
double getMassMax() const
Definition: BPHMassCuts.h:59
void setOniaMassMin(double m)
set cuts
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:58
void filter(const std::string &name, const BPHRecoSelect &sel) const
const edm::EventSetup * evSetup
BPHMassFitSelect * mFitSel