17 #include "fastjet/PseudoJet.hh"
18 #include "fastjet/ClusterSequence.hh"
19 #include "fastjet/JetDefinition.hh"
20 #include "fastjet/contrib/SoftDrop.hh"
21 #include "fastjet/tools/Filter.hh"
22 #include "fastjet/contrib/Nsubjettiness.hh"
66 return StatusCode::SUCCESS;
73 if (!
jets.isValid()) {
74 ATH_MSG_ERROR(
"No jet collection with name " << m_jetKey.key() <<
" found in StoreGate!");
75 return StatusCode::FAILURE;
77 unsigned int nJets(
jets->size());
78 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
81 if (!m_selectionString.empty()) {
82 std::vector<int>
entries = m_parser->evaluateAsVector();
86 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
87 return StatusCode::FAILURE;
90 for (
unsigned int i=0;
i<nJets; ++
i)
if (
entries[
i]==1) jetToCheck.push_back((*
jets)[
i]);
93 for (
unsigned int i=0;
i<nJets; ++
i) jetToCheck.push_back((*
jets)[
i]);
97 WDH dec_Qw (m_dec_Qw, ctx);
98 WDH dec_Tau1 (m_dec_Tau1, ctx);
99 WDH dec_Tau2 (m_dec_Tau2, ctx);
100 WDH dec_Tau3 (m_dec_Tau3, ctx);
101 WDH dec_Tau4 (m_dec_Tau4, ctx);
102 WDH dec_Tau21 (m_dec_Tau21, ctx);
103 WDH dec_Tau32 (m_dec_Tau32, ctx);
104 WDH dec_Split12 (m_dec_Split12, ctx);
105 WDH dec_Split23 (m_dec_Split23, ctx);
106 WDH dec_Split34 (m_dec_Split34, ctx);
107 WDH dec_ECF1 (m_dec_ECF1, ctx);
108 WDH dec_ECF2 (m_dec_ECF2, ctx);
109 WDH dec_ECF3 (m_dec_ECF3, ctx);
110 WDH dec_ECF4 (m_dec_ECF4, ctx);
111 WDH dec_C2 (m_dec_C2, ctx);
112 WDH dec_D2 (m_dec_D2, ctx);
113 WDH dec_pT (m_dec_pT, ctx);
114 WDH dec_m (m_dec_m, ctx);
115 WDH dec_NConstits (m_dec_NConstits, ctx);
116 WDH dec_eta (m_dec_eta, ctx);
117 WDH dec_phi (m_dec_phi, ctx);
118 WDH dec_timing (m_dec_timing, ctx);
120 std::vector<const xAOD::IParticle*> mergedGhostConstits;
121 std::vector<const xAOD::IParticle*> ghosts;
122 std::vector<fastjet::PseudoJet> constituents;
127 mergedGhostConstits.clear();
128 for (std::string ghostName: m_ghostNames) {
130 ATH_CHECK(
jet->getAssociatedObjects(ghostName, ghosts));
131 mergedGhostConstits.insert(mergedGhostConstits.end(), ghosts.begin(), ghosts.end());
135 constituents.clear();
138 for (
auto constit : mergedGhostConstits){
139 if (constit==
nullptr) {
144 if (constit->e()<0) {
ATH_MSG_INFO(
"################## Negative energy cluster");
continue;}
145 constituents.push_back( fastjet::PseudoJet(constit->p4()) );
150 double eConstit = caloConstit->
e()* caloConstit->e();
151 time += caloConstit->time()* eConstit;
158 dec_timing(*
jet) = 0;
164 int nConstits = constituents.size();
167 fastjet::PseudoJet groomed_jet;
171 fastjet::PseudoJet recluster_jet = cs.inclusive_jets(0.0).front();
174 if (m_grooming==
"Trimming"){
175 groomed_jet = m_trimmer->result(recluster_jet);
176 }
else if (m_grooming==
"SoftDrop"){
177 groomed_jet = m_softdropper->result(recluster_jet);
179 ATH_MSG_DEBUG(
" No grooming requested or wrong one, will not apply grooming");
180 groomed_jet = recluster_jet;
184 nConstits = groomed_jet.constituents().size();
191 dec_Tau1(*
jet) = -999;
192 dec_Tau2(*
jet) = -999;
193 dec_Tau3(*
jet) = -999;
194 dec_Tau4(*
jet) = -999;
196 dec_Tau21(*
jet) = -999;
197 dec_Tau32(*
jet) = -999;
199 dec_Split12(*
jet) = -999;
200 dec_Split23(*
jet) = -999;
201 dec_Split34(*
jet) = -999;
203 dec_ECF1(*
jet) = -999;
204 dec_ECF2(*
jet) = -999;
205 dec_ECF3(*
jet) = -999;
206 dec_ECF4(*
jet) = -999;
213 dec_NConstits(*
jet) = 0;
214 dec_eta(*
jet) = -999;
215 dec_phi(*
jet) = -999;
217 return StatusCode::SUCCESS;
221 dec_pT(*
jet) = groomed_jet.pt();
222 dec_m(*
jet) = groomed_jet.m();
223 dec_NConstits(*
jet) = nConstits;
224 dec_eta(*
jet) = groomed_jet.eta();
225 dec_phi(*
jet) = groomed_jet.phi() -
M_PI;
229 dec_Qw(*
jet) =
qw.result(groomed_jet);
232 fastjet::contrib::WTA_KT_Axes wta_kt_axes;
233 fastjet::contrib::NormalizedCutoffMeasure normalized_measure(1.0, 1.0, 1000000);
238 float tau1_wta = Tau1_wta.
result(groomed_jet);
239 float tau2_wta = Tau2_wta.
result(groomed_jet);
240 float tau3_wta = Tau3_wta.
result(groomed_jet);
241 float tau4_wta = Tau4_wta.
result(groomed_jet);
242 float tau21_wta = -999;
243 float tau32_wta = -999;
245 if( tau1_wta > 1
e-8 ) {
246 tau21_wta = tau2_wta / tau1_wta;
248 if( tau2_wta > 1
e-8 ) {
249 tau32_wta = tau3_wta / tau2_wta;
252 dec_Tau1(*
jet) = tau1_wta;
253 dec_Tau2(*
jet) = tau2_wta;
254 dec_Tau3(*
jet) = tau3_wta;
255 dec_Tau4(*
jet) = tau4_wta;
256 dec_Tau21(*
jet) = tau21_wta;
257 dec_Tau32(*
jet) = tau32_wta;
263 float split12 = Split12.
result(groomed_jet);
264 float split23 = Split23.
result(groomed_jet);
265 float split34 = Split34.
result(groomed_jet);
267 dec_Split12(*
jet) = split12;
268 dec_Split23(*
jet) = split23;
269 dec_Split34(*
jet) = split34;
276 float ecf1 = ECF1.
result(groomed_jet);
277 float ecf2 = ECF2.
result(groomed_jet);
278 float ecf3 = ECF3.
result(groomed_jet);
279 float ecf4 = ECF4.
result(groomed_jet);
284 c2 = ecf3 * ecf1 /
pow( ecf2, 2.0 );
285 d2 = ecf3 *
pow( ecf1, 3.0 ) /
pow( ecf2, 3.0 );
288 dec_ECF1(*
jet) = ecf1;
289 dec_ECF2(*
jet) = ecf2;
290 dec_ECF3(*
jet) = ecf3;
291 dec_ECF4(*
jet) = ecf4;
297 return StatusCode::SUCCESS;