Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:56

0001 #include <memory>
0002 
0003 #include "CommonTools/CandUtils/interface/makeNamedCompositeCandidate.h"
0004 using namespace reco;
0005 using namespace std;
0006 
0007 helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidate(const Candidate& c1,
0008                                                                   std::string s1,
0009                                                                   const Candidate& c2,
0010                                                                   std::string s2) {
0011   helpers::NamedCompositeCandidateMaker cmp(std::make_unique<NamedCompositeCandidate>());
0012   cmp.addDaughter(c1, s1);
0013   cmp.addDaughter(c2, s2);
0014   return cmp;
0015 }
0016 
0017 helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidate(
0018     const Candidate& c1, std::string s1, const Candidate& c2, std::string s2, const Candidate& c3, std::string s3) {
0019   helpers::NamedCompositeCandidateMaker cmp(std::make_unique<NamedCompositeCandidate>());
0020   cmp.addDaughter(c1, s1);
0021   cmp.addDaughter(c2, s2);
0022   cmp.addDaughter(c3, s3);
0023   return cmp;
0024 }
0025 
0026 helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidate(const Candidate& c1,
0027                                                                   std::string s1,
0028                                                                   const Candidate& c2,
0029                                                                   std::string s2,
0030                                                                   const Candidate& c3,
0031                                                                   std::string s3,
0032                                                                   const Candidate& c4,
0033                                                                   std::string s4) {
0034   helpers::NamedCompositeCandidateMaker cmp(std::make_unique<NamedCompositeCandidate>());
0035   cmp.addDaughter(c1, s1);
0036   cmp.addDaughter(c2, s2);
0037   cmp.addDaughter(c3, s3);
0038   cmp.addDaughter(c4, s4);
0039   return cmp;
0040 }
0041 
0042 helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
0043                                                                                   std::string s1,
0044                                                                                   const reco::CandidateRef& c2,
0045                                                                                   std::string s2) {
0046   helpers::NamedCompositeCandidateMaker cmp(std::make_unique<NamedCompositeCandidate>());
0047   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)), s1);
0048   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)), s2);
0049   return cmp;
0050 }
0051 
0052 helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
0053                                                                                   std::string s1,
0054                                                                                   const reco::CandidateRef& c2,
0055                                                                                   std::string s2,
0056                                                                                   const reco::CandidateRef& c3,
0057                                                                                   std::string s3) {
0058   helpers::NamedCompositeCandidateMaker cmp(std::make_unique<NamedCompositeCandidate>());
0059   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)), s1);
0060   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)), s2);
0061   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c3)), s3);
0062   return cmp;
0063 }
0064 
0065 helpers::NamedCompositeCandidateMaker makeNamedCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
0066                                                                                   std::string s1,
0067                                                                                   const reco::CandidateRef& c2,
0068                                                                                   std::string s2,
0069                                                                                   const reco::CandidateRef& c3,
0070                                                                                   std::string s3,
0071                                                                                   const reco::CandidateRef& c4,
0072                                                                                   std::string s4) {
0073   helpers::NamedCompositeCandidateMaker cmp(std::make_unique<NamedCompositeCandidate>());
0074   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)), s1);
0075   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)), s2);
0076   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c3)), s3);
0077   cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c4)), s4);
0078   return cmp;
0079 }