13 produces<reco::BasicJetCollection>();
26 writeCompoundJets<reco::CaloJet>(
iEvent, iSetup);
29 writeCompoundJets<reco::PFJet>(
iEvent, iSetup);
32 writeCompoundJets<reco::GenJet>(
iEvent, iSetup);
35 writeCompoundJets<reco::BasicJet>(
iEvent, iSetup);
38 throw cms::Exception(
"InvalidInput") <<
"invalid jet type in CompoundJetProducer\n";
47 auto jetCollection = std::make_unique<reco::BasicJetCollection>();
49 auto subjetCollection = std::make_unique<std::vector<T>>();
54 std::vector<std::vector<int>>
indices;
56 std::vector<math::XYZTLorentzVector> p4_hardJets;
58 std::vector<double> area_hardJets;
64 for (; it != iEnd; ++it) {
65 int jetIndex = it - iBegin;
66 fastjet::PseudoJet localJet = it->hardJet();
69 area_hardJets.push_back(it->hardJetArea());
72 std::vector<CompoundPseudoSubJet>::const_iterator itSubJetBegin = it->subjets().begin(), itSubJet = itSubJetBegin,
73 itSubJetEnd = it->subjets().end();
74 for (; itSubJet != itSubJetEnd; ++itSubJet) {
75 fastjet::PseudoJet subjet = itSubJet->subjet();
80 std::vector<reco::CandidatePtr> subjetConstituents;
83 std::vector<int>
const& subjetFastjetConstituentIndices = itSubJet->constituents();
84 std::vector<int>::const_iterator fastSubIt = subjetFastjetConstituentIndices.begin(),
85 transConstEnd = subjetFastjetConstituentIndices.end();
86 for (; fastSubIt != transConstEnd; ++fastSubIt) {
88 if (*fastSubIt < static_cast<int>(
inputs_.size()))
89 subjetConstituents.push_back(
inputs_[*fastSubIt]);
93 indices[jetIndex].push_back(subjetCollection->size());
98 jet.setJetArea(itSubJet->subjetArea());
99 subjetCollection->push_back(
jet);
106 std::vector<math::XYZTLorentzVector>::const_iterator ip4 = p4_hardJets.begin(), ip4Begin = p4_hardJets.begin(),
107 ip4End = p4_hardJets.end();
109 for (; ip4 != ip4End; ++ip4) {
110 int p4_index = ip4 - ip4Begin;
111 std::vector<int>& ind =
indices[p4_index];
112 std::vector<reco::CandidatePtr> i_hardJetConstituents;
114 for (std::vector<int>::const_iterator isub = ind.begin(); isub != ind.end(); ++isub) {
116 i_hardJetConstituents.push_back(candPtr);
120 toput.
setJetArea(area_hardJets[ip4 - ip4Begin]);