8 Njets_(iConfig.getParameter<
std::vector<unsigned>>(
"Njets")),
9 measureDefinition_(iConfig.getParameter<unsigned>(
"measureDefinition")),
10 beta_(iConfig.getParameter<double>(
"beta")),
11 R0_(iConfig.getParameter<double>(
"R0")),
12 Rcutoff_(iConfig.getParameter<double>(
"Rcutoff")),
13 axesDefinition_(iConfig.getParameter<unsigned>(
"axesDefinition")),
14 nPass_(iConfig.getParameter<
int>(
"nPass")),
15 akAxesR0_(iConfig.getParameter<double>(
"akAxesR0")) {
20 for (std::vector<unsigned>::const_iterator
n =
Njets_.begin();
n !=
Njets_.end(); ++
n) {
21 std::ostringstream tauN_str;
22 tauN_str <<
"tau" << *
n;
24 produces<edm::ValueMap<float>>(tauN_str.str());
28 fastjet::contrib::NormalizedMeasure normalizedMeasure(
beta_,
R0_);
29 fastjet::contrib::UnnormalizedMeasure unnormalizedMeasure(
beta_);
30 fastjet::contrib::OriginalGeometricMeasure geometricMeasure(
beta_);
31 fastjet::contrib::NormalizedCutoffMeasure normalizedCutoffMeasure(
beta_,
R0_,
Rcutoff_);
32 fastjet::contrib::UnnormalizedCutoffMeasure unnormalizedCutoffMeasure(
beta_,
Rcutoff_);
35 fastjet::contrib::MeasureDefinition
const* measureDef =
nullptr;
38 measureDef = &unnormalizedMeasure;
41 measureDef = &geometricMeasure;
44 measureDef = &normalizedCutoffMeasure;
47 measureDef = &unnormalizedCutoffMeasure;
52 measureDef = &normalizedMeasure;
57 fastjet::contrib::KT_Axes kt_axes;
58 fastjet::contrib::CA_Axes ca_axes;
59 fastjet::contrib::AntiKT_Axes antikt_axes(
akAxesR0_);
60 fastjet::contrib::WTA_KT_Axes wta_kt_axes;
61 fastjet::contrib::WTA_CA_Axes wta_ca_axes;
62 fastjet::contrib::OnePass_KT_Axes onepass_kt_axes;
63 fastjet::contrib::OnePass_CA_Axes onepass_ca_axes;
64 fastjet::contrib::OnePass_AntiKT_Axes onepass_antikt_axes(
akAxesR0_);
65 fastjet::contrib::OnePass_WTA_KT_Axes onepass_wta_kt_axes;
66 fastjet::contrib::OnePass_WTA_CA_Axes onepass_wta_ca_axes;
67 fastjet::contrib::MultiPass_Axes multipass_axes(
nPass_);
69 fastjet::contrib::AxesDefinition
const* axesDef =
nullptr;
79 axesDef = &antikt_axes;
82 axesDef = &wta_kt_axes;
85 axesDef = &wta_ca_axes;
88 axesDef = &onepass_kt_axes;
91 axesDef = &onepass_ca_axes;
94 axesDef = &onepass_antikt_axes;
97 axesDef = &onepass_wta_kt_axes;
100 axesDef = &onepass_wta_ca_axes;
103 axesDef = &multipass_axes;
119 for (std::vector<unsigned>::const_iterator
n =
Njets_.begin();
n !=
Njets_.end(); ++
n) {
120 std::ostringstream tauN_str;
121 tauN_str <<
"tau" << *
n;
124 std::vector<float> tauN;
125 tauN.reserve(
jets->size());
135 auto outT = std::make_unique<edm::ValueMap<float>>();
137 fillerT.insert(
jets, tauN.begin(), tauN.end());
145 std::vector<fastjet::PseudoJet> fjParticles;
146 for (
unsigned k = 0;
k <
object->numberOfDaughters(); ++
k) {
148 if (
dp.isNonnull() &&
dp.isAvailable()) {
150 if (
dp->numberOfDaughters() == 0) {
151 if (
object->isWeighted()) {
154 <<
"ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl;
155 float w = (*weightsHandle_)[
dp];
156 fjParticles.push_back(fastjet::PseudoJet(
dp->px() *
w,
dp->py() *
w,
dp->pz() *
w,
dp->energy() *
w));
158 fjParticles.push_back(fastjet::PseudoJet(
dp->px(),
dp->py(),
dp->pz(),
dp->energy()));
160 auto subjet = dynamic_cast<reco::Jet const*>(
dp.get());
161 for (
unsigned l = 0;
l < subjet->numberOfDaughters(); ++
l) {
162 if (subjet !=
nullptr) {
164 if (subjet->isWeighted()) {
167 <<
"ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl;
168 float w = (*weightsHandle_)[ddp];
169 fjParticles.push_back(fastjet::PseudoJet(ddp->px() *
w, ddp->py() *
w, ddp->pz() *
w, ddp->energy() *
w));
171 fjParticles.push_back(fastjet::PseudoJet(ddp->px(), ddp->py(), ddp->pz(), ddp->energy()));
174 <<
"BasicJet constituent required for N-jettiness computation is missing!";
180 edm::LogWarning(
"MissingJetConstituent") <<
"Jet constituent required for N-jettiness computation is missing!";