File indexing completed on 2024-04-06 12:15:34
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/BPHAnalyzerTokenWrapper.h"
0017 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoBuilder.h"
0018
0019
0020
0021
0022 using namespace std;
0023
0024
0025
0026
0027
0028
0029
0030
0031 BPHRecoCandidate::BPHRecoCandidate(const BPHEventSetupWrapper* es, int daugNum, int compNum)
0032 : BPHDecayMomentum(daugNum, compNum), BPHDecayVertex(es), BPHKinematicFit() {}
0033
0034 BPHRecoCandidate::BPHRecoCandidate(const BPHEventSetupWrapper* es, const BPHRecoBuilder::ComponentSet& compList)
0035 : BPHDecayMomentum(compList.daugMap, compList.compMap), BPHDecayVertex(this, es), BPHKinematicFit(this) {}
0036
0037
0038
0039
0040 vector<BPHRecoConstCandPtr> BPHRecoCandidate::build(const BPHRecoBuilder& builder, double mass, double msig) {
0041
0042
0043 vector<BPHRecoConstCandPtr> cList;
0044 fill<BPHRecoCandidate>(cList, builder, mass, msig);
0045 return cList;
0046 }
0047
0048
0049
0050 BPHRecoCandidate* BPHRecoCandidate::clone(int level) const {
0051 BPHRecoCandidate* ptr = new BPHRecoCandidate(getEventSetup());
0052 fill(ptr, level);
0053 return ptr;
0054 }
0055
0056
0057
0058 void BPHRecoCandidate::fill(BPHRecoCandidate* ptr, int level) const {
0059 ptr->setConstraint(constrMass(), constrSigma());
0060 const vector<string>& nDaug = daugNames();
0061 int id;
0062 int nd = nDaug.size();
0063 for (id = 0; id < nd; ++id) {
0064 const string& n = nDaug[id];
0065 const reco::Candidate* d = getDaug(n);
0066 ptr->add(n, originalReco(d), getTrackSearchList(d), d->mass(), getMassSigma(d));
0067 }
0068 const vector<string>& nComp = compNames();
0069 int ic;
0070 int nc = nComp.size();
0071 for (ic = 0; ic < nc; ++ic) {
0072 const string& n = nComp[ic];
0073 BPHRecoConstCandPtr c = getComp(n);
0074 if (level)
0075 ptr->add(n, BPHRecoConstCandPtr(c->clone(level - 1)));
0076 else
0077 ptr->add(n, c);
0078 double m = -1;
0079 double s = -1;
0080 if (getIndependentFit(n, m, s))
0081 ptr->setIndependentFit(n, true, m, s);
0082 }
0083 return;
0084 }