2 #include "fastjet/PseudoJet.hh" 3 #include "fastjet/ClusterSequence.hh" 7 src_(iConfig.getParameter<
edm::InputTag>(
"src")),
9 Njets_(iConfig.getParameter<
std::vector<unsigned> >(
"Njets")),
10 beta_(iConfig.getParameter<double>(
"beta"))
12 for ( std::vector<unsigned>::const_iterator
n =
Njets_.begin();
n !=
Njets_.end(); ++
n )
14 std::ostringstream ecfN_str;
15 ecfN_str <<
"ecf" << *
n;
17 produces<edm::ValueMap<float> >(ecfN_str.str().c_str());
18 routine_.push_back(std::auto_ptr<fastjet::contrib::EnergyCorrelator> (
new fastjet::contrib::EnergyCorrelator( *n,
beta_, fastjet::contrib::EnergyCorrelator::pt_R ) ));
28 for ( std::vector<unsigned>::const_iterator
n =
Njets_.begin();
n !=
Njets_.end(); ++
n )
31 std::vector<float> ecfN;
32 ecfN.reserve(jets->size());
43 auto outT = std::make_unique<edm::ValueMap<float>>();
45 fillerT.insert(jets, ecfN.begin(), ecfN.end());
55 std::vector<fastjet::PseudoJet> FJparticles;
56 for (
unsigned k = 0;
k <
object->numberOfDaughters(); ++
k)
60 FJparticles.push_back( fastjet::PseudoJet( dp->px(), dp->py(), dp->pz(), dp->energy() ) );
62 edm::LogWarning(
"MissingJetConstituent") <<
"Jet constituent required for ECF computation is missing!";
64 fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, 999);
65 fastjet::ClusterSequence thisClustering_basic(FJparticles, jetDef);
66 std::vector<fastjet::PseudoJet> out_jets_basic = thisClustering_basic.inclusive_jets(0);
67 if(out_jets_basic.size()!=1)
return -1;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ECFAdder(const edm::ParameterSet &iConfig)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
float getECF(unsigned index, const edm::Ptr< reco::Jet > &object) const
std::vector< std::string > variables_
std::vector< std::auto_ptr< fastjet::contrib::EnergyCorrelator > > routine_
edm::EDGetTokenT< edm::View< reco::Jet > > src_token_
std::vector< unsigned > Njets_
bool isNonnull() const
Checks for non-null.
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator