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 //----------------
35 // Constructors --
36 //----------------
38  const std::vector<BPHPlusMinusConstCandPtr>& jpsiCollection,
39  const std::vector<BPHPlusMinusConstCandPtr>& kx0Collection ):
40  jPsiName( "JPsi" ),
41  kx0Name( "Kx0" ),
42  evSetup( &es ),
43  jCollection( &jpsiCollection ),
44  kCollection( & kx0Collection ) {
45  jpsiSel = new BPHMassSelect ( 2.80, 3.40 );
46  mkx0Sel = new BPHMassSelect ( 0.80, 1.00 );
47  massSel = new BPHMassSelect ( 3.50, 8.00 );
48  chi2Sel = new BPHChi2Select ( 0.02 );
52  5.00, 6.00 );
53  massConstr = true;
54  minPDiff = 1.0e-4;
55  updated = false;
56 }
57 
58 //--------------
59 // Destructor --
60 //--------------
62  delete jpsiSel;
63  delete mkx0Sel;
64  delete massSel;
65  delete chi2Sel;
66  delete mFitSel;
67 }
68 
69 //--------------
70 // Operations --
71 //--------------
72 vector<BPHRecoConstCandPtr> BPHBdToJPsiKxBuilder::build() {
73 
74  if ( updated ) return bdList;
75 
76  BPHRecoBuilder bBd( *evSetup );
78  bBd.add( jPsiName, *jCollection );
79  bBd.add( kx0Name, *kCollection );
80  bBd.filter( jPsiName, *jpsiSel );
81  bBd.filter( kx0Name, *mkx0Sel );
82 
83  bBd.filter( *massSel );
84  bBd.filter( *chi2Sel );
85  if ( massConstr ) bBd.filter( *mFitSel );
86 
88 //
89 // Apply kinematic constraint on the JPsi mass.
90 // The operation is already performed when apply the mass selection,
91 // so it's not repeated. The following code is left as example
92 // for similar operations
93 //
94 // int iBd;
95 // int nBd = ( massConstr ? bdList.size() : 0 );
96 // for ( iBd = 0; iBd < nBd; ++iBd ) {
97 // BPHRecoCandidate* cptr( const_cast<BPHRecoCandidate*>(
98 // bdList[iBd].get() ) );
99 // BPHRecoConstCandPtr jpsi = cptr->getComp( jPsiName );
100 // double jMass = jpsi->constrMass();
101 // if ( jMass < 0 ) continue;
102 // double sigma = jpsi->constrSigma();
103 // cptr->kinematicTree( jPsiName, jMass, sigma );
104 // }
105  updated = true;
106 
107  return bdList;
108 
109 }
110 
113  updated = false;
114  jpsiSel->setMassMin( m );
115  return;
116 }
117 
118 
120  updated = false;
121  jpsiSel->setMassMax( m );
122  return;
123 }
124 
125 
127  updated = false;
128  mkx0Sel->setMassMin( m );
129  return;
130 }
131 
132 
134  updated = false;
135  mkx0Sel->setMassMax( m );
136  return;
137 }
138 
139 
141  updated = false;
142  massSel->setMassMin( m );
143  return;
144 }
145 
146 
148  updated = false;
149  massSel->setMassMax( m );
150  return;
151 }
152 
153 
155  updated = false;
156  chi2Sel->setProbMin( p );
157  return;
158 }
159 
160 
162  updated = false;
163  mFitSel->setMassMin( m );
164  return;
165 }
166 
167 
169  updated = false;
170  mFitSel->setMassMax( m );
171  return;
172 }
173 
174 
176  updated = false;
177  massConstr = flag;
178  return;
179 }
180 
183  return jpsiSel->getMassMin();
184 }
185 
186 
188  return jpsiSel->getMassMax();
189 }
190 
191 
193  return mkx0Sel->getMassMin();
194 }
195 
196 
198  return mkx0Sel->getMassMax();
199 }
200 
201 
203  return massSel->getMassMin();
204 }
205 
206 
208  return massSel->getMassMax();
209 }
210 
211 
213  return chi2Sel->getProbMin();
214 }
215 
216 
218  return mFitSel->getMassMin();
219 }
220 
221 
223  return mFitSel->getMassMax();
224 }
225 
226 
228  return massConstr;
229 }
230 
void setMinPDiffererence(double pMin)
void setMassMax(double m)
Definition: BPHMassCuts.h:51
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:55
static const std::string kCollection
Definition: FWTableView.cc:198
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:58
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:50
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