File indexing completed on 2021-02-14 12:49:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoCandidate.h"
0012
0013
0014
0015
0016 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoBuilder.h"
0017
0018
0019
0020
0021 using namespace std;
0022
0023
0024
0025
0026
0027
0028
0029
0030 BPHRecoCandidate::BPHRecoCandidate(const edm::EventSetup* es) : BPHDecayVertex(es) {}
0031
0032 BPHRecoCandidate::BPHRecoCandidate(const edm::EventSetup* es, const BPHRecoBuilder::ComponentSet& compList)
0033 : BPHDecayMomentum(compList.daugMap, compList.compMap), BPHDecayVertex(this, es), BPHKinematicFit(this) {}
0034
0035
0036
0037
0038 BPHRecoCandidate::~BPHRecoCandidate() {}
0039
0040
0041
0042
0043 vector<BPHRecoConstCandPtr> BPHRecoCandidate::build(const BPHRecoBuilder& builder, double mass, double msig) {
0044
0045
0046 vector<BPHRecoConstCandPtr> cList;
0047 fill<BPHRecoCandidate>(cList, builder, mass, msig);
0048 return cList;
0049 }
0050
0051
0052
0053 BPHRecoCandidate* BPHRecoCandidate::clone(int level) const {
0054 BPHRecoCandidate* ptr = new BPHRecoCandidate(getEventSetup());
0055 fill(ptr, level);
0056 return ptr;
0057 }
0058
0059
0060
0061 void BPHRecoCandidate::fill(BPHRecoCandidate* ptr, int level) const {
0062 ptr->setConstraint(constrMass(), constrSigma());
0063 const std::vector<std::string>& nDaug = daugNames();
0064 int id;
0065 int nd = nDaug.size();
0066 for (id = 0; id < nd; ++id) {
0067 const string& n = nDaug[id];
0068 const reco::Candidate* d = getDaug(n);
0069 ptr->add(n, originalReco(d), getTrackSearchList(d), d->mass(), getMassSigma(d));
0070 }
0071 const std::vector<std::string>& nComp = compNames();
0072 int ic;
0073 int nc = nComp.size();
0074 for (ic = 0; ic < nc; ++ic) {
0075 const string& n = nComp[ic];
0076 BPHRecoConstCandPtr c = getComp(n);
0077 if (level)
0078 ptr->add(n, BPHRecoConstCandPtr(c->clone(level - 1)));
0079 else
0080 ptr->add(n, c);
0081 if (getIndependentFit(n))
0082 ptr->setIndependentFit(n);
0083 }
0084 return;
0085 }