CMS 3D CMS Logo

BPHBuToJPsiKBuilder.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 //-------------------------------
26 
27 //---------------
28 // C++ Headers --
29 //---------------
30 using namespace std;
31 
32 //-------------------
33 // Initializations --
34 //-------------------
35 
36 
37 //----------------
38 // Constructors --
39 //----------------
41  const std::vector<BPHPlusMinusConstCandPtr>& jpsiCollection,
42  const BPHRecoBuilder::BPHGenericCollection* kaonCollection ):
43  jPsiName( "JPsi" ),
44  kaonName( "Kaon" ),
45  evSetup( &es ),
46  jCollection( &jpsiCollection ),
47  kCollection( kaonCollection ) {
48  jpsiSel = new BPHMassSelect ( 2.80, 3.40 );
50  ptSel = new BPHParticlePtSelect ( 0.7 );
51  etaSel = new BPHParticleEtaSelect( 10.0 );
52  massSel = new BPHMassSelect ( 3.50, 8.00 );
53  chi2Sel = new BPHChi2Select ( 0.02 );
57  5.00, 6.00 );
58  massConstr = true;
59  minPDiff = 1.0e-4;
60  updated = false;
61 }
62 
63 //--------------
64 // Destructor --
65 //--------------
67  delete jpsiSel;
68  delete knVeto;
69  delete ptSel;
70  delete etaSel;
71  delete massSel;
72  delete chi2Sel;
73  delete mFitSel;
74 }
75 
76 //--------------
77 // Operations --
78 //--------------
79 vector<BPHRecoConstCandPtr> BPHBuToJPsiKBuilder::build() {
80 
81  if ( updated ) return buList;
82 
83  BPHRecoBuilder bBu( *evSetup );
85  bBu.add( jPsiName, *jCollection );
88  bBu.filter( jPsiName, *jpsiSel );
89  bBu.filter( kaonName, * knVeto );
90  bBu.filter( kaonName, * ptSel );
91  bBu.filter( kaonName, * etaSel );
92 
93  bBu.filter( *massSel );
94  bBu.filter( *chi2Sel );
95  if ( massConstr ) bBu.filter( *mFitSel );
96 
98 //
99 // Apply kinematic constraint on the JPsi mass.
100 // The operation is already performed when apply the mass selection,
101 // so it's not repeated. The following code is left as example
102 // for similar operations
103 //
104 // int iBu;
105 // int nBu = ( massConstr ? buList.size() : 0 );
106 // for ( iBu = 0; iBu < nBu; ++iBu ) {
107 // BPHRecoCandidate* cptr( const_cast<BPHRecoCandidate*>(
108 // buList[iBu].get() ) );
109 // BPHRecoConstCandPtr jpsi = cptr->getComp( jPsiName );
110 // double jMass = jpsi->constrMass();
111 // if ( jMass < 0 ) continue;
112 // double sigma = jpsi->constrSigma();
113 // cptr->kinematicTree( jPsiName, jMass, sigma );
114 // }
115  updated = true;
116  return buList;
117 
118 }
119 
122  updated = false;
123  jpsiSel->setMassMin( m );
124  return;
125 }
126 
127 
129  updated = false;
130  jpsiSel->setMassMax( m );
131  return;
132 }
133 
134 
136  updated = false;
137  ptSel->setPtMin( pt );
138  return;
139 }
140 
141 
143  updated = false;
144  etaSel->setEtaMax( eta );
145  return;
146 }
147 
148 
150  updated = false;
151  massSel->setMassMin( m );
152  return;
153 }
154 
155 
157  updated = false;
158  massSel->setMassMax( m );
159  return;
160 }
161 
162 
164  updated = false;
165  chi2Sel->setProbMin( p );
166  return;
167 }
168 
169 
171  updated = false;
172  mFitSel->setMassMin( m );
173  return;
174 }
175 
176 
178  updated = false;
179  mFitSel->setMassMax( m );
180  return;
181 }
182 
183 
185  updated = false;
186  massConstr = flag;
187  return;
188 }
189 
192  return jpsiSel->getMassMin();
193 }
194 
195 
197  return jpsiSel->getMassMax();
198 }
199 
200 
202  return ptSel->getPtMin();
203 }
204 
205 
207  return etaSel->getEtaMax();
208 }
209 
210 
212  return massSel->getMassMin();
213 }
214 
215 
217  return massSel->getMassMax();
218 }
219 
220 
222  return chi2Sel->getProbMin();
223 }
224 
225 
227  return mFitSel->getMassMin();
228 }
229 
230 
232  return mFitSel->getMassMax();
233 }
234 
235 
237  return massConstr;
238 }
239 
BPHParticlePtSelect * ptSel
std::vector< BPHRecoConstCandPtr > build()
build Bu candidates
void setMinPDiffererence(double pMin)
void setMassMax(double m)
Definition: BPHMassCuts.h:51
static const double kaonMass
double getJPsiMassMax() const
BPHParticleNeutralVeto * knVeto
static const double jPsiMWidth
double getMassMin() const
BPHMassFitSelect * mFitSel
void setJPsiMassMin(double m)
set cuts
void setKPtMin(double pt)
set cuts
void setMassFitMax(double m)
void setKEtaMax(double eta)
static const double jPsiMass
double getMassFitMax() const
BPHParticleEtaSelect * etaSel
void setPtMin(double pt)
set pt min
BPHBuToJPsiKBuilder(const edm::EventSetup &es, const std::vector< BPHPlusMinusConstCandPtr > &jpsiCollection, const BPHRecoBuilder::BPHGenericCollection *kaonCollection)
const BPHRecoBuilder::BPHGenericCollection * kCollection
double getKPtMin() const
get current cuts
double getPtMin() const
get current pt min
void setProbMin(double p)
set prob min
Definition: BPHChi2Select.h:55
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
static const std::string kCollection
Definition: FWTableView.cc:198
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
void setMassFitMin(double m)
void setEtaMax(double eta)
set eta max
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:58
double getJPsiMassMin() const
get current cuts
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 getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:54
double getMassFitMin() const
static const double kaonMSigma
double getMassMax() const
void filter(const std::string &name, const BPHRecoSelect &sel) const
double getEtaMax() const
get current eta max
double getProbMin() const
const edm::EventSetup * evSetup
BPHMassSelect * jpsiSel
double getKEtaMax() const
void setJPsiMassMax(double m)
std::vector< BPHRecoConstCandPtr > buList