10 Njets_(iConfig.getParameter<
std::
vector<unsigned>>(
"Njets")),
11 measureDefinition_(iConfig.getParameter<unsigned>(
"measureDefinition")),
12 beta_(iConfig.getParameter<double>(
"beta")),
13 R0_(iConfig.getParameter<double>(
"R0")),
14 Rcutoff_(iConfig.getParameter<double>(
"Rcutoff")),
15 axesDefinition_(iConfig.getParameter<unsigned>(
"axesDefinition")),
16 nPass_(iConfig.getParameter<
int>(
"nPass")),
17 akAxesR0_(iConfig.getParameter<double>(
"akAxesR0")) {
22 for (std::vector<unsigned>::const_iterator
n =
Njets_.begin();
n !=
Njets_.end(); ++
n) {
23 std::ostringstream tauN_str;
24 tauN_str <<
"tau" << *
n;
26 produces<edm::ValueMap<float>>(tauN_str.str());
30 fastjet::contrib::NormalizedMeasure normalizedMeasure(
beta_,
R0_);
31 fastjet::contrib::UnnormalizedMeasure unnormalizedMeasure(
beta_);
32 fastjet::contrib::OriginalGeometricMeasure geometricMeasure(
beta_);
33 fastjet::contrib::NormalizedCutoffMeasure normalizedCutoffMeasure(
beta_,
R0_,
Rcutoff_);
34 fastjet::contrib::UnnormalizedCutoffMeasure unnormalizedCutoffMeasure(
beta_,
Rcutoff_);
37 fastjet::contrib::MeasureDefinition
const* measureDef =
nullptr;
40 measureDef = &unnormalizedMeasure;
43 measureDef = &geometricMeasure;
46 measureDef = &normalizedCutoffMeasure;
49 measureDef = &unnormalizedCutoffMeasure;
54 measureDef = &normalizedMeasure;
59 fastjet::contrib::KT_Axes kt_axes;
60 fastjet::contrib::CA_Axes ca_axes;
61 fastjet::contrib::AntiKT_Axes antikt_axes(
akAxesR0_);
62 fastjet::contrib::WTA_KT_Axes wta_kt_axes;
63 fastjet::contrib::WTA_CA_Axes wta_ca_axes;
64 fastjet::contrib::OnePass_KT_Axes onepass_kt_axes;
65 fastjet::contrib::OnePass_CA_Axes onepass_ca_axes;
66 fastjet::contrib::OnePass_AntiKT_Axes onepass_antikt_axes(
akAxesR0_);
67 fastjet::contrib::OnePass_WTA_KT_Axes onepass_wta_kt_axes;
68 fastjet::contrib::OnePass_WTA_CA_Axes onepass_wta_ca_axes;
69 fastjet::contrib::MultiPass_Axes multipass_axes(
nPass_);
71 fastjet::contrib::AxesDefinition
const* axesDef =
nullptr;
81 axesDef = &antikt_axes;
84 axesDef = &wta_kt_axes;
87 axesDef = &wta_ca_axes;
90 axesDef = &onepass_kt_axes;
93 axesDef = &onepass_ca_axes;
96 axesDef = &onepass_antikt_axes;
99 axesDef = &onepass_wta_kt_axes;
102 axesDef = &onepass_wta_ca_axes;
105 axesDef = &multipass_axes;
109 routine_ = std::make_unique<fastjet::contrib::Njettiness>(*axesDef, *measureDef);
121 for (std::vector<unsigned>::const_iterator
n =
Njets_.begin();
n !=
Njets_.end(); ++
n) {
122 std::ostringstream tauN_str;
123 tauN_str <<
"tau" << *
n;
126 std::vector<float> tauN;
127 tauN.reserve(
jets->size());
137 auto outT = std::make_unique<edm::ValueMap<float>>();
139 fillerT.insert(
jets, tauN.begin(), tauN.end());
147 std::vector<fastjet::PseudoJet> fjParticles;
148 for (
unsigned k = 0;
k <
object->numberOfDaughters(); ++
k) {
150 if (
dp.isNonnull() &&
dp.isAvailable()) {
152 if (
dp->numberOfDaughters() == 0) {
153 if (
object->isWeighted()) {
156 <<
"ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl;
157 float w = (*weightsHandle_)[
dp];
158 fjParticles.push_back(fastjet::PseudoJet(
dp->px() *
w,
dp->py() *
w,
dp->pz() *
w,
dp->energy() *
w));
160 fjParticles.push_back(fastjet::PseudoJet(
dp->px(),
dp->py(),
dp->pz(),
dp->energy()));
162 auto subjet = dynamic_cast<reco::Jet const*>(
dp.get());
163 for (
unsigned l = 0;
l < subjet->numberOfDaughters(); ++
l) {
164 if (subjet !=
nullptr) {
166 if (subjet->isWeighted()) {
169 <<
"ECFAdder: No weights (e.g. PUPPI) given for weighted jet collection" << std::endl;
170 float w = (*weightsHandle_)[ddp];
171 fjParticles.push_back(fastjet::PseudoJet(ddp->px() *
w, ddp->py() *
w, ddp->pz() *
w, ddp->energy() *
w));
173 fjParticles.push_back(fastjet::PseudoJet(ddp->px(), ddp->py(), ddp->pz(), ddp->energy()));
176 <<
"BasicJet constituent required for N-jettiness computation is missing!";
182 edm::LogWarning(
"MissingJetConstituent") <<
"Jet constituent required for N-jettiness computation is missing!";