6 distMax_( iConfig.getParameter<double>(
"distMax") ),
7 jetToken_(consumes<edm::
View<pat::
Jet> >( iConfig.getParameter<edm::
InputTag>(
"jetSrc") )),
8 algoLabels_( iConfig.getParameter< std::vector<std::
string> > (
"algoLabels") ),
9 algoTags_ (iConfig.getParameter<std::vector<edm::
InputTag> > (
"algoTags" )),
10 fixDaughters_(iConfig.getParameter<bool>(
"fixDaughters"))
18 produces<std::vector<pat::Jet> > ();
32 std::auto_ptr< std::vector<pat::Jet> > outputs(
new std::vector<pat::Jet> );
35 std::vector< edm::Handle< edm::View<pat::Jet> > > algoHandles;
51 for (
auto const & ijet : *jetHandle ) {
53 outputs->push_back( ijet );
56 unsigned int index = 0;
57 for (
auto const & ialgoHandle : algoHandles ) {
58 std::vector< edm::Ptr<pat::Jet> > nextSubjets;
61 for (
auto const & jjet : *ialgoHandle ) {
64 for (
size_t ida = 0; ida < jjet.numberOfDaughters(); ++ida ) {
74 outputs->back().addSubjets( nextSubjets,
algoLabels_[index] );
80 std::vector<reco::CandidatePtr> daughtersInSubjets;
81 std::vector<reco::CandidatePtr> daughtersNew;
82 const std::vector<reco::CandidatePtr> & jdaus = outputs->back().daughterPtrVector();
85 const std::vector<reco::CandidatePtr> & sjdaus = subjet->daughterPtrVector();
88 bool skipSubjet =
false;
91 if (
std::find(jdaus.begin(), jdaus.end(), rekeyed) == jdaus.end()) {
96 if (skipSubjet)
continue;
98 daughtersInSubjets.insert(daughtersInSubjets.end(), sjdaus.begin(), sjdaus.end());
111 if (
std::find(daughtersInSubjets.begin(), daughtersInSubjets.end(), rekeyed) == daughtersInSubjets.end()) {
112 daughtersNew.push_back( rekeyed );
119 outputs->back().clearDaughters();
120 for (
const auto & dau : daughtersNew) outputs->back().addDaughter(dau);
T getParameter(std::string const &) const
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
#define DEFINE_FWK_MODULE(type)
std::vector< edm::EDGetTokenT< edm::View< pat::Jet > > > algoTokens_
JetSubstructurePacker(const edm::ParameterSet &)
edm::EDGetTokenT< edm::Association< reco::PFCandidateCollection > > pc2pf_
double deltaR(const T1 &t1, const T2 &t2)
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::EDGetTokenT< edm::View< pat::Jet > > jetToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produce(edm::Event &, const edm::EventSetup &) override
std::vector< edm::InputTag > algoTags_
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
std::vector< std::string > algoLabels_