CMS 3D CMS Logo

BPHBdToJPsiKxBuilder.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>& jpsiCollection,
38  const std::vector<BPHPlusMinusConstCandPtr>& kx0Collection)
39  : jPsiName("JPsi"), kx0Name("Kx0"), evSetup(&es), jCollection(&jpsiCollection), kCollection(&kx0Collection) {
40  jpsiSel = new BPHMassSelect(2.80, 3.40);
41  mkx0Sel = new BPHMassSelect(0.80, 1.00);
42  massSel = new BPHMassSelect(3.50, 8.00);
43  chi2Sel = new BPHChi2Select(0.02);
45  massConstr = true;
46  minPDiff = 1.0e-4;
47  updated = false;
48 }
49 
50 //--------------
51 // Destructor --
52 //--------------
54  delete jpsiSel;
55  delete mkx0Sel;
56  delete massSel;
57  delete chi2Sel;
58  delete mFitSel;
59 }
60 
61 //--------------
62 // Operations --
63 //--------------
64 vector<BPHRecoConstCandPtr> BPHBdToJPsiKxBuilder::build() {
65  if (updated)
66  return bdList;
67 
68  BPHRecoBuilder bBd(*evSetup);
70  bBd.add(jPsiName, *jCollection);
71  bBd.add(kx0Name, *kCollection);
72  bBd.filter(jPsiName, *jpsiSel);
73  bBd.filter(kx0Name, *mkx0Sel);
74 
75  bBd.filter(*massSel);
76  bBd.filter(*chi2Sel);
77  if (massConstr)
78  bBd.filter(*mFitSel);
79 
81  //
82  // Apply kinematic constraint on the JPsi mass.
83  // The operation is already performed when apply the mass selection,
84  // so it's not repeated. The following code is left as example
85  // for similar operations
86  //
87  // int iBd;
88  // int nBd = ( massConstr ? bdList.size() : 0 );
89  // for ( iBd = 0; iBd < nBd; ++iBd ) {
90  // BPHRecoCandidate* cptr( const_cast<BPHRecoCandidate*>(
91  // bdList[iBd].get() ) );
92  // BPHRecoConstCandPtr jpsi = cptr->getComp( jPsiName );
93  // double jMass = jpsi->constrMass();
94  // if ( jMass < 0 ) continue;
95  // double sigma = jpsi->constrSigma();
96  // cptr->kinematicTree( jPsiName, jMass, sigma );
97  // }
98  updated = true;
99 
100  return bdList;
101 }
102 
105  updated = false;
106  jpsiSel->setMassMin(m);
107  return;
108 }
109 
111  updated = false;
112  jpsiSel->setMassMax(m);
113  return;
114 }
115 
117  updated = false;
118  mkx0Sel->setMassMin(m);
119  return;
120 }
121 
123  updated = false;
124  mkx0Sel->setMassMax(m);
125  return;
126 }
127 
129  updated = false;
130  massSel->setMassMin(m);
131  return;
132 }
133 
135  updated = false;
136  massSel->setMassMax(m);
137  return;
138 }
139 
141  updated = false;
142  chi2Sel->setProbMin(p);
143  return;
144 }
145 
147  updated = false;
148  mFitSel->setMassMin(m);
149  return;
150 }
151 
153  updated = false;
154  mFitSel->setMassMax(m);
155  return;
156 }
157 
159  updated = false;
160  massConstr = flag;
161  return;
162 }
163 
166 
168 
170 
172 
174 
176 
178 
180 
182 
void setMinPDiffererence(double pMin)
void setMassMax(double m)
Definition: BPHMassCuts.h:48
double getJPsiMassMin() const
get current cuts
void setJPsiMassMin(double m)
set cuts
static const double jPsiMWidth
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
static const double jPsiMass
const edm::EventSetup * evSetup
void setProbMin(double p)
set prob min
Definition: BPHChi2Select.h:54
static const std::string kCollection
Definition: FWTableView.cc:189
std::vector< BPHRecoConstCandPtr > bdList
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:60
BPHBdToJPsiKxBuilder(const edm::EventSetup &es, const std::vector< BPHPlusMinusConstCandPtr > &jpsiCollection, const std::vector< BPHPlusMinusConstCandPtr > &kx0Collection)
void setMassMin(double m)
set mass cuts
Definition: BPHMassCuts.h:44
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
double getMassMax() const
Definition: BPHMassCuts.h:55
double getJPsiMassMax() const
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:54
void filter(const std::string &name, const BPHRecoSelect &sel) const
BPHMassFitSelect * mFitSel
const std::vector< BPHPlusMinusConstCandPtr > * kCollection
std::vector< BPHRecoConstCandPtr > build()
build Bs candidates