File indexing completed on 2024-04-06 12:01:03
0001 #include <memory>
0002
0003 #include "CommonTools/CandUtils/interface/makeCompositeCandidate.h"
0004 using namespace reco;
0005 using namespace std;
0006
0007 helpers::CompositeCandidateMaker makeCompositeCandidate(const Candidate& c1, const Candidate& c2) {
0008 helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
0009 cmp.addDaughter(c1);
0010 cmp.addDaughter(c2);
0011 return cmp;
0012 }
0013
0014 helpers::CompositeCandidateMaker makeCompositeCandidate(const Candidate& c1, const Candidate& c2, const Candidate& c3) {
0015 helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
0016 cmp.addDaughter(c1);
0017 cmp.addDaughter(c2);
0018 cmp.addDaughter(c3);
0019 return cmp;
0020 }
0021
0022 helpers::CompositeCandidateMaker makeCompositeCandidate(const Candidate& c1,
0023 const Candidate& c2,
0024 const Candidate& c3,
0025 const Candidate& c4) {
0026 helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
0027 cmp.addDaughter(c1);
0028 cmp.addDaughter(c2);
0029 cmp.addDaughter(c3);
0030 cmp.addDaughter(c4);
0031 return cmp;
0032 }
0033
0034 helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
0035 const reco::CandidateRef& c2) {
0036 helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
0037 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)));
0038 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)));
0039 return cmp;
0040 }
0041
0042 helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
0043 const reco::CandidateRef& c2,
0044 const reco::CandidateRef& c3) {
0045 helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
0046 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)));
0047 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)));
0048 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c3)));
0049 return cmp;
0050 }
0051
0052 helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
0053 const reco::CandidateRef& c2,
0054 const reco::CandidateRef& c3,
0055 const reco::CandidateRef& c4) {
0056 helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
0057 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)));
0058 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)));
0059 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c3)));
0060 cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c4)));
0061 return cmp;
0062 }
0063
0064 helpers::CompositePtrCandidateMaker makeCompositePtrCandidate(const CandidatePtr& c1, const CandidatePtr& c2) {
0065 helpers::CompositePtrCandidateMaker cmp(std::make_unique<CompositePtrCandidate>());
0066 cmp.addDaughter(c1);
0067 cmp.addDaughter(c2);
0068 return cmp;
0069 }
0070
0071 helpers::CompositePtrCandidateMaker makeCompositePtrCandidate(const CandidatePtr& c1,
0072 const CandidatePtr& c2,
0073 const CandidatePtr& c3) {
0074 helpers::CompositePtrCandidateMaker cmp(std::make_unique<CompositePtrCandidate>());
0075 cmp.addDaughter(c1);
0076 cmp.addDaughter(c2);
0077 cmp.addDaughter(c3);
0078 return cmp;
0079 }
0080
0081 helpers::CompositePtrCandidateMaker makeCompositePtrCandidate(const CandidatePtr& c1,
0082 const CandidatePtr& c2,
0083 const CandidatePtr& c3,
0084 const CandidatePtr& c4) {
0085 helpers::CompositePtrCandidateMaker cmp(std::make_unique<CompositePtrCandidate>());
0086 cmp.addDaughter(c1);
0087 cmp.addDaughter(c2);
0088 cmp.addDaughter(c3);
0089 cmp.addDaughter(c4);
0090 return cmp;
0091 }