00001 #include "PhysicsTools/CandUtils/interface/makeCompositeCandidate.h" 00002 using namespace reco; 00003 using namespace std; 00004 00005 helpers::CompositeCandidateMaker makeCompositeCandidate( const Candidate & c1, const Candidate & c2 ) { 00006 helpers::CompositeCandidateMaker cmp( auto_ptr<CompositeCandidate>( new CompositeCandidate ) ); 00007 cmp.addDaughter( c1 ); 00008 cmp.addDaughter( c2 ); 00009 return cmp; 00010 } 00011 00012 helpers::CompositeCandidateMaker makeCompositeCandidate( const Candidate & c1, const Candidate & c2, 00013 const Candidate & c3 ) { 00014 helpers::CompositeCandidateMaker cmp( auto_ptr<CompositeCandidate>( new CompositeCandidate ) ); 00015 cmp.addDaughter( c1 ); 00016 cmp.addDaughter( c2 ); 00017 cmp.addDaughter( c3 ); 00018 return cmp; 00019 } 00020 00021 helpers::CompositeCandidateMaker makeCompositeCandidate( const Candidate & c1, const Candidate & c2, 00022 const Candidate & c3,const Candidate & c4 ) { 00023 helpers::CompositeCandidateMaker cmp( auto_ptr<CompositeCandidate>( new CompositeCandidate ) ); 00024 cmp.addDaughter( c1 ); 00025 cmp.addDaughter( c2 ); 00026 cmp.addDaughter( c3 ); 00027 cmp.addDaughter( c4 ); 00028 return cmp; 00029 } 00030 00031 helpers::CompositeCandidateMaker 00032 makeCompositeCandidateWithRefsToMaster( const reco::CandidateRef & c1, 00033 const reco::CandidateRef & c2 ) { 00034 helpers::CompositeCandidateMaker cmp( auto_ptr<CompositeCandidate>( new CompositeCandidate ) ); 00035 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c1 ) ) ); 00036 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c2 ) ) ); 00037 return cmp; 00038 } 00039 00040 helpers::CompositeCandidateMaker 00041 makeCompositeCandidateWithRefsToMaster( const reco::CandidateRef & c1, 00042 const reco::CandidateRef & c2, 00043 const reco::CandidateRef & c3 ) { 00044 helpers::CompositeCandidateMaker cmp( auto_ptr<CompositeCandidate>( new CompositeCandidate ) ); 00045 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c1 ) ) ); 00046 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c2 ) ) ); 00047 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c3 ) ) ); 00048 return cmp; 00049 } 00050 00051 helpers::CompositeCandidateMaker 00052 makeCompositeCandidateWithRefsToMaster( const reco::CandidateRef & c1, 00053 const reco::CandidateRef & c2, 00054 const reco::CandidateRef & c3, 00055 const reco::CandidateRef & c4 ) { 00056 helpers::CompositeCandidateMaker cmp( auto_ptr<CompositeCandidate>( new CompositeCandidate ) ); 00057 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c1 ) ) ); 00058 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c2 ) ) ); 00059 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c3 ) ) ); 00060 cmp.addDaughter( ShallowCloneCandidate( CandidateBaseRef( c4 ) ) ); 00061 return cmp; 00062 }