32 auto outputs = std::make_unique<std::vector<pat::Jet>>();
35 std::vector< edm::Handle< edm::View<pat::Jet> > > algoHandles;
51 for (
auto const & ijet : *jetHandle ) {
55 unsigned int index = 0;
57 for (
auto const & ialgoHandle : algoHandles ) {
58 std::vector< edm::Ptr<pat::Jet> > nextSubjets;
60 for (
auto const & jjet : *ialgoHandle ) {
62 for (
auto const & userfloatstr : jjet.userFloatNames() ) {
63 outputs->back().addUserFloat( userfloatstr, jjet.userFloat(userfloatstr) );
65 for (
auto const & userintstr : jjet.userIntNames() ) {
66 outputs->back().addUserInt( userintstr, jjet.userInt(userintstr) );
68 for (
auto const & usercandstr : jjet.userCandNames() ) {
69 outputs->back().addUserCand( usercandstr, jjet.userCand(usercandstr) );
71 for (
size_t ida = 0; ida < jjet.numberOfDaughters(); ++ida ) {
85 std::vector<reco::CandidatePtr> daughtersInSubjets;
86 std::vector<reco::CandidatePtr> daughtersNew;
87 const std::vector<reco::CandidatePtr> & jdausPF =
outputs->back().daughterPtrVector();
88 std::vector<reco::CandidatePtr> jdaus;
89 jdaus.reserve( jdausPF.size() );
91 for (
auto const & jdau : jdausPF ) {
96 const std::vector<reco::CandidatePtr> & sjdaus = subjet->daughterPtrVector();
98 bool skipSubjet =
false;
100 if (
std::find(jdaus.begin(), jdaus.end(), dau) == jdaus.end()) {
105 if (skipSubjet)
continue;
107 daughtersInSubjets.insert(daughtersInSubjets.end(), sjdaus.begin(), sjdaus.end());
111 if (
std::find(daughtersInSubjets.begin(), daughtersInSubjets.end(), dau) == daughtersInSubjets.end()) {
112 daughtersNew.push_back( dau );
115 outputs->back().clearDaughters();
116 for (
const auto & dau : daughtersNew)
outputs->back().addDaughter(dau);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< edm::EDGetTokenT< edm::View< pat::Jet > > > algoTokens_
edm::EDGetTokenT< edm::Association< reco::PFCandidateCollection > > pc2pf_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< edm::InputTag > algoTags_
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
std::vector< std::string > algoLabels_