Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#include <memory>

#include "CommonTools/CandUtils/interface/makeCompositeCandidate.h"
using namespace reco;
using namespace std;

helpers::CompositeCandidateMaker makeCompositeCandidate(const Candidate& c1, const Candidate& c2) {
  helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
  cmp.addDaughter(c1);
  cmp.addDaughter(c2);
  return cmp;
}

helpers::CompositeCandidateMaker makeCompositeCandidate(const Candidate& c1, const Candidate& c2, const Candidate& c3) {
  helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
  cmp.addDaughter(c1);
  cmp.addDaughter(c2);
  cmp.addDaughter(c3);
  return cmp;
}

helpers::CompositeCandidateMaker makeCompositeCandidate(const Candidate& c1,
                                                        const Candidate& c2,
                                                        const Candidate& c3,
                                                        const Candidate& c4) {
  helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
  cmp.addDaughter(c1);
  cmp.addDaughter(c2);
  cmp.addDaughter(c3);
  cmp.addDaughter(c4);
  return cmp;
}

helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
                                                                        const reco::CandidateRef& c2) {
  helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)));
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)));
  return cmp;
}

helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
                                                                        const reco::CandidateRef& c2,
                                                                        const reco::CandidateRef& c3) {
  helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)));
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)));
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c3)));
  return cmp;
}

helpers::CompositeCandidateMaker makeCompositeCandidateWithRefsToMaster(const reco::CandidateRef& c1,
                                                                        const reco::CandidateRef& c2,
                                                                        const reco::CandidateRef& c3,
                                                                        const reco::CandidateRef& c4) {
  helpers::CompositeCandidateMaker cmp(std::make_unique<CompositeCandidate>());
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c1)));
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c2)));
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c3)));
  cmp.addDaughter(ShallowCloneCandidate(CandidateBaseRef(c4)));
  return cmp;
}

helpers::CompositePtrCandidateMaker makeCompositePtrCandidate(const CandidatePtr& c1, const CandidatePtr& c2) {
  helpers::CompositePtrCandidateMaker cmp(std::make_unique<CompositePtrCandidate>());
  cmp.addDaughter(c1);
  cmp.addDaughter(c2);
  return cmp;
}

helpers::CompositePtrCandidateMaker makeCompositePtrCandidate(const CandidatePtr& c1,
                                                              const CandidatePtr& c2,
                                                              const CandidatePtr& c3) {
  helpers::CompositePtrCandidateMaker cmp(std::make_unique<CompositePtrCandidate>());
  cmp.addDaughter(c1);
  cmp.addDaughter(c2);
  cmp.addDaughter(c3);
  return cmp;
}

helpers::CompositePtrCandidateMaker makeCompositePtrCandidate(const CandidatePtr& c1,
                                                              const CandidatePtr& c2,
                                                              const CandidatePtr& c3,
                                                              const CandidatePtr& c4) {
  helpers::CompositePtrCandidateMaker cmp(std::make_unique<CompositePtrCandidate>());
  cmp.addDaughter(c1);
  cmp.addDaughter(c2);
  cmp.addDaughter(c3);
  cmp.addDaughter(c4);
  return cmp;
}