CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BPHDecayToResTrkBuilder.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 //-------------------------------
20 
21 //---------------
22 // C++ Headers --
23 //---------------
24 using namespace std;
25 
26 //-------------------
27 // Initializations --
28 //-------------------
29 
30 //----------------
31 // Constructors --
32 //----------------
34  const std::string& resName,
35  double resMass,
36  double resWidth,
37  const std::vector<BPHPlusMinusConstCandPtr>& resCollection,
38  const std::string& trkName,
39  double trkMass,
40  double trkSigma,
41  const BPHRecoBuilder::BPHGenericCollection* trkCollection)
42  : BPHDecayConstrainedBuilder(es, resName, resMass, resWidth, resCollection),
43  tName(trkName),
44  tMass(trkMass),
45  tSigma(trkSigma),
46  tCollection(trkCollection),
47  tknVeto(new BPHParticleNeutralVeto),
48  ptSel(new BPHParticlePtSelect(0.0)),
49  etaSel(new BPHParticleEtaSelect(100.0)) {}
50 
51 //--------------
52 // Destructor --
53 //--------------
55  delete tknVeto;
56  delete ptSel;
57  delete etaSel;
58 }
59 
60 //--------------
61 // Operations --
62 //--------------
63 vector<BPHRecoConstCandPtr> BPHDecayToResTrkBuilder::build() {
64  if (updated)
65  return recList;
66 
67  recList.clear();
68 
69  BPHRecoBuilder brb(*evSetup);
71  brb.add(rName, *rCollection);
73  if (resoSel->getMassMax() > 0.0)
74  brb.filter(rName, *resoSel);
75  brb.filter(tName, *tknVeto);
76  if (ptSel->getPtMin() >= 0.0)
77  brb.filter(tName, *ptSel);
78  if (etaSel->getEtaMax() >= 0.0)
79  brb.filter(tName, *etaSel);
80 
81  if (massSel->getMassMax() >= 0.0)
82  brb.filter(*massSel);
83  if (chi2Sel->getProbMin() >= 0.0)
84  brb.filter(*chi2Sel);
85  if (mFitSel->getMassMax() >= 0.0)
86  brb.filter(*mFitSel);
87 
89  updated = true;
90  return recList;
91 }
92 
95  updated = false;
96  ptSel->setPtMin(pt);
97  return;
98 }
99 
101  updated = false;
102  etaSel->setEtaMax(eta);
103  return;
104 }
void setMinPDiffererence(double pMin)
void setTrkPtMin(double pt)
set cuts
void setPtMin(double pt)
set pt min
std::vector< BPHRecoConstCandPtr > build()
build candidates
double getPtMin() const
get current pt min
static std::vector< BPHRecoConstCandPtr > build(const BPHRecoBuilder &builder, double mass=-1, double msig=-1)
const BPHRecoBuilder::BPHGenericCollection * tCollection
BPHParticleNeutralVeto * tknVeto
const std::vector< BPHPlusMinusConstCandPtr > * rCollection
void setEtaMax(double eta)
set eta max
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:66
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
double getMassMax() const
Definition: BPHMassCuts.h:59
BPHParticleEtaSelect * etaSel
void filter(const std::string &name, const BPHRecoSelect &sel) const
std::vector< BPHRecoConstCandPtr > recList
double getEtaMax() const
get current eta max
BPHParticlePtSelect * ptSel
BPHDecayToResTrkBuilder(const edm::EventSetup &es, const std::string &resName, double resMass, double resWidth, const std::vector< BPHPlusMinusConstCandPtr > &resCollection, const std::string &trkName, double trkMass, double trkSigma, const BPHRecoBuilder::BPHGenericCollection *trkCollection)
const edm::EventSetup * evSetup