CMS 3D CMS Logo

BPHBsToJPsiPhiBuilder.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>& phiCollection ):
40  jPsiName( "JPsi" ),
41  phiName( "Phi" ),
42  evSetup( &es ),
43  jCollection( &jpsiCollection ),
44  pCollection( & phiCollection ) {
45  jpsiSel = new BPHMassSelect ( 2.80, 3.40 );
46  mphiSel = new BPHMassSelect ( 1.005, 1.035 );
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 mphiSel;
64  delete massSel;
65  delete chi2Sel;
66  delete mFitSel;
67 }
68 
69 //--------------
70 // Operations --
71 //--------------
72 vector<BPHRecoConstCandPtr> BPHBsToJPsiPhiBuilder::build() {
73 
74  if ( updated ) return bsList;
75 
76  BPHRecoBuilder bBs( *evSetup );
78  bBs.add( jPsiName, *jCollection );
79  bBs.add( phiName, *pCollection );
80  bBs.filter( jPsiName, *jpsiSel );
81  bBs.filter( phiName, *mphiSel );
82 
83  bBs.filter( *massSel );
84  bBs.filter( *chi2Sel );
85  if ( massConstr ) bBs.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 iBs;
95 // int nBs = ( massConstr ? bsList.size() : 0 );
96 // for ( iBs = 0; iBs < nBs; ++iBs ) {
97 // BPHRecoCandidate* cptr( const_cast<BPHRecoCandidate*>(
98 // bsList[iBs].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 bsList;
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  mphiSel->setMassMin( m );
129  return;
130 }
131 
132 
134  updated = false;
135  mphiSel->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 mphiSel->getMassMin();
194 }
195 
196 
198  return mphiSel->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
static const double jPsiMWidth
static const double jPsiMass
const edm::EventSetup * evSetup
void setProbMin(double p)
set prob min
Definition: BPHChi2Select.h:55
double getJPsiMassMin() const
get current cuts
BPHMassFitSelect * mFitSel
std::vector< BPHRecoConstCandPtr > bsList
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
BPHBsToJPsiPhiBuilder(const edm::EventSetup &es, const std::vector< BPHPlusMinusConstCandPtr > &jpsiCollection, const std::vector< BPHPlusMinusConstCandPtr > &phiCollection)
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:58
const std::vector< BPHPlusMinusConstCandPtr > * pCollection
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
void setJPsiMassMin(double m)
set cuts
void filter(const std::string &name, const BPHRecoSelect &sel) const
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
std::vector< BPHRecoConstCandPtr > build()
build Bs candidates