CMS 3D CMS Logo

BPHDecayToResTrkBuilderBase.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 //-------------------------------
21 
22 //---------------
23 // C++ Headers --
24 //---------------
25 using namespace std;
26 
27 //-------------------
28 // Initializations --
29 //-------------------
30 
31 //----------------
32 // Constructors --
33 //----------------
35  const string& resName,
36  double resMass,
37  double resWidth,
38  const string& trkName,
39  double trkMass,
40  double trkSigma,
41  const BPHRecoBuilder::BPHGenericCollection* trkCollection)
42  : BPHDecayGenericBuilderBase(es, nullptr),
43  BPHDecayConstrainedBuilderBase(resName, resMass, resWidth),
44  tName(trkName),
45  tMass(trkMass),
46  tSigma(trkSigma),
47  tCollection(trkCollection),
48  tknVeto(new BPHParticleNeutralVeto),
49  ptSel(new BPHParticlePtSelect(0.0)),
50  etaSel(new BPHParticleEtaSelect(100.0)) {}
51 
53  double trkMass,
54  double trkSigma,
55  const BPHRecoBuilder::BPHGenericCollection* trkCollection)
56  : tName(trkName),
57  tMass(trkMass),
58  tSigma(trkSigma),
59  tCollection(trkCollection),
60  tknVeto(new BPHParticleNeutralVeto),
61  ptSel(new BPHParticlePtSelect(0.0)),
62  etaSel(new BPHParticleEtaSelect(100.0)) {}
63 
64 //--------------
65 // Destructor --
66 //--------------
68  delete tknVeto;
69  delete ptSel;
70  delete etaSel;
71 }
72 
73 //--------------
74 // Operations --
75 //--------------
76 
79  outdated = true;
80  ptSel->setPtMin(pt);
81  return;
82 }
83 
85  outdated = true;
87  return;
88 }
89 
93  addResCollection(brb);
94  int i;
95  int n = tCollection->size();
96  tCollectSel1.clear();
97  tCollectSel1.reserve(n);
98  for (i = 0; i < n; ++i) {
100  if (cand.charge() != 0)
101  tCollectSel1.push_back(&cand);
102  }
103  vector<const reco::Candidate*>* dv = &tCollectSel1;
104  vector<const reco::Candidate*>* sv = &tCollectSel2;
105  if (ptSel->getPtMin() >= 0.0) {
106  swap(sv, dv);
107  filter(sv, dv, ptSel);
108  }
109  if (etaSel->getEtaMax() >= 0.0) {
110  swap(sv, dv);
111  filter(sv, dv, etaSel);
112  }
114 
115  if (massSel->getMassMax() >= 0.0)
116  brb.filter(*massSel);
117  if (chi2Sel->getProbMin() >= 0.0)
118  brb.filter(*chi2Sel);
119  if (mFitSel->getMassMax() >= 0.0)
120  brb.filter(*mFitSel);
121 
122  setup(parameters);
123 
124  return;
125 }
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:66
virtual void addResCollection(BPHRecoBuilder &brb)=0
void setMinPDiffererence(double pMin)
double getPtMin() const
get current pt min
BPHDecayToResTrkBuilderBase(const BPHEventSetupWrapper &es, const std::string &resName, double resMass, double resWidth, const std::string &trkName, double trkMass, double trkSigma, const BPHRecoBuilder::BPHGenericCollection *trkCollection)
void fill(BPHRecoBuilder &brb, void *parameters) override
build candidates
void setPtMin(double pt)
set pt min
static BPHGenericCollection * createCollection(const edm::Handle< T > &collection, const std::string &list="cfhpmig")
const std::string & searchList() const
void filter(const std::string &name, const BPHRecoSelect &sel) const
virtual const reco::Candidate & get(int i) const =0
void setEtaMax(double eta)
set eta max
double getMassMax() const
Definition: BPHMassCuts.h:59
const BPHRecoBuilder::BPHGenericCollection * tCollection
static void filter(const std::vector< const reco::Candidate *> *s, std::vector< const reco::Candidate *> *d, BPHRecoSelect *f)
void add(const std::string &name, const BPHGenericCollection *collection, double mass=-1.0, double msig=-1.0)
std::vector< const reco::Candidate * > tCollectSel2
virtual void setup(void *parameters)=0
void swap(std::vector< const reco::Candidate *> *&l, std::vector< const reco::Candidate *> *&r)
common object to interface with edm collections
std::vector< const reco::Candidate * > tCollectSel1
double getEtaMax() const
get current eta max