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 // Constructors --
38 //----------------
40  const std::vector<BPHPlusMinusConstCandPtr>& jpsiCollection,
41  const BPHRecoBuilder::BPHGenericCollection* kaonCollection)
42  : jPsiName("JPsi"), kaonName("Kaon"), evSetup(&es), jCollection(&jpsiCollection), kCollection(kaonCollection) {
43  jpsiSel = new BPHMassSelect(2.80, 3.40);
45  ptSel = new BPHParticlePtSelect(0.7);
46  etaSel = new BPHParticleEtaSelect(10.0);
47  massSel = new BPHMassSelect(3.50, 8.00);
48  chi2Sel = new BPHChi2Select(0.02);
50  massConstr = true;
51  minPDiff = 1.0e-4;
52  updated = false;
53 }
54 
55 //--------------
56 // Destructor --
57 //--------------
59  delete jpsiSel;
60  delete knVeto;
61  delete ptSel;
62  delete etaSel;
63  delete massSel;
64  delete chi2Sel;
65  delete mFitSel;
66 }
67 
68 //--------------
69 // Operations --
70 //--------------
71 vector<BPHRecoConstCandPtr> BPHBuToJPsiKBuilder::build() {
72  if (updated)
73  return buList;
74 
75  BPHRecoBuilder bBu(*evSetup);
77  bBu.add(jPsiName, *jCollection);
79  bBu.filter(jPsiName, *jpsiSel);
80  bBu.filter(kaonName, *knVeto);
81  bBu.filter(kaonName, *ptSel);
82  bBu.filter(kaonName, *etaSel);
83 
84  bBu.filter(*massSel);
85  bBu.filter(*chi2Sel);
86  if (massConstr)
87  bBu.filter(*mFitSel);
88 
90  //
91  // Apply kinematic constraint on the JPsi mass.
92  // The operation is already performed when apply the mass selection,
93  // so it's not repeated. The following code is left as example
94  // for similar operations
95  //
96  // int iBu;
97  // int nBu = ( massConstr ? buList.size() : 0 );
98  // for ( iBu = 0; iBu < nBu; ++iBu ) {
99  // BPHRecoCandidate* cptr( const_cast<BPHRecoCandidate*>(
100  // buList[iBu].get() ) );
101  // BPHRecoConstCandPtr jpsi = cptr->getComp( jPsiName );
102  // double jMass = jpsi->constrMass();
103  // if ( jMass < 0 ) continue;
104  // double sigma = jpsi->constrSigma();
105  // cptr->kinematicTree( jPsiName, jMass, sigma );
106  // }
107  updated = true;
108  return buList;
109 }
110 
113  updated = false;
114  jpsiSel->setMassMin(m);
115  return;
116 }
117 
119  updated = false;
120  jpsiSel->setMassMax(m);
121  return;
122 }
123 
125  updated = false;
126  ptSel->setPtMin(pt);
127  return;
128 }
129 
131  updated = false;
132  etaSel->setEtaMax(eta);
133  return;
134 }
135 
137  updated = false;
138  massSel->setMassMin(m);
139  return;
140 }
141 
143  updated = false;
144  massSel->setMassMax(m);
145  return;
146 }
147 
149  updated = false;
150  chi2Sel->setProbMin(p);
151  return;
152 }
153 
155  updated = false;
156  mFitSel->setMassMin(m);
157  return;
158 }
159 
161  updated = false;
162  mFitSel->setMassMax(m);
163  return;
164 }
165 
167  updated = false;
168  massConstr = flag;
169  return;
170 }
171 
174 
176 
177 double BPHBuToJPsiKBuilder::getKPtMin() const { return ptSel->getPtMin(); }
178 
179 double BPHBuToJPsiKBuilder::getKEtaMax() const { return etaSel->getEtaMax(); }
180 
182 
184 
186 
188 
190 
BPHParticlePtSelect * ptSel
std::vector< BPHRecoConstCandPtr > build()
build Bu candidates
void setMinPDiffererence(double pMin)
void setMassMax(double m)
Definition: BPHMassCuts.h:48
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:54
const std::vector< BPHPlusMinusConstCandPtr > * jCollection
static const std::string kCollection
Definition: FWTableView.cc:189
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:60
double getJPsiMassMin() const
get current cuts
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 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