ATLAS Offline Software
Loading...
Searching...
No Matches
JetTruthLabelingTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
13
15 asg::AsgTool(name)
16{}
17
19JetTruthLabelingTool::parseLabel(const std::string& name) {
20
21 if (name == "R10TruthLabel_R21Precision_2022v1")
23
24 if (name == "R10TruthLabel_R22v1")
26
27 if (name == "R10WZTruthLabel_R22v1")
29
30 if (name == "R4TruthLabel")
32
33 if (name == "R4TruthDressedWZLabel")
35
36 if (name == "R4InTimeTruthLabel")
38
40}
41
42
44
45 ATH_MSG_INFO("Initializing " << name());
46
48
51 ATH_MSG_ERROR("TruthLabelName " << m_truthLabelName << " is not supported. Exiting...");
52 return StatusCode::FAILURE;
53 }
54
56 m_useGhostJetMatch = false;
57 m_recoGhostFrac = 0.75;
58
59 switch(m_truthLabelConfig) {
63 m_truthJetCollectionKey="AntiKt10TruthJets";
65 m_dRTruthJet = 0.75;
68 m_truthGroomedJetCollectionKey="AntiKt10TruthSoftDropBeta100Zcut10Jets";
69 } else {
71 }
72 break;
75 m_truthJetCollectionKey="AntiKt10TruthDressedWZJets";
77 m_dRTruthJet = 0.75;
78 m_mLowTop = 140.0;
79 m_mLowW = 50.0;
80 m_mLowZ = 50.0;
82 m_truthGroomedJetCollectionKey="AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets";
83 break;
84
89 switch (m_truthLabelConfig) {
91 m_truthJetCollectionKey = "AntiKt4TruthJets";
92 break;
94 m_truthJetCollectionKey = "AntiKt4TruthDressedWZJets";
95 break;
97 m_truthJetCollectionKey = "InTimeAntiKt4TruthJets";
98 break;
99 default: // Cannot hit anything else
100 break;
101 }
103 m_dRTruthJet = 0.3;
105 m_useGhostJetMatch = true;
106 m_doLargeRLabels = false;
107 break;
108 default:
109 ATH_MSG_ERROR(" Unhandled TruthLabelName " << m_truthLabelName << "! Exiting...");
110 return StatusCode::FAILURE;
111 }
112
114 m_useGhostJetMatch = false;
115 }
116
117 print();
118
121 m_split12_truthKey = m_truthJetCollectionKey.key() + ".Split12";
122 m_split23_truthKey = m_truthJetCollectionKey.key() + ".Split23";
123
124 if(!m_isTruthJetCol){
127 m_truthSplit12_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit12";
128 m_truthSplit23_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit23";
129
131 m_matchedTruthJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetMass";
132 m_matchedTruthJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetPt";
133 m_matchedTruthJetEta_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetEta";
134 m_matchedTruthJetPhi_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetPhi";
135 m_matchedTruthJetDR_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetDR";
136 m_matchedTruthJetGF_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthJetGF";
137
138 m_matchedTruthGroomedJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthGroomedJetMass";
139 m_matchedTruthGroomedJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_MatchedTruthGroomedJetPt";
140 }
141
142 ATH_CHECK(m_evtInfoKey.initialize());
145
146 ATH_CHECK(m_label_truthKey.initialize());
147 ATH_CHECK(m_NB_truthKey.initialize());
148
151
156
164
167
168 return StatusCode::SUCCESS;
169}
170
172 ATH_MSG_INFO("Parameters for " << name());
173
174 ATH_MSG_INFO("xAOD information:");
175 ATH_MSG_INFO("TruthLabelName: " << m_truthLabelName);
176 ATH_MSG_INFO("TruthJetCollectionName: " << m_truthJetCollectionKey.key());
177 ATH_MSG_INFO("dRTruthJet: " << std::to_string(m_dRTruthJet));
178
180 ATH_MSG_INFO("truthGroomedJetCollectionName: " << m_truthGroomedJetCollectionKey.key());
181 }
182}
183
184
186 (const JetTruthLabelingTool& tool, const EventContext& ctx)
187{
188 auto maybeInit = [&] (auto& h,
190 {
191 if (!k.key().empty()) h.emplace (k, ctx);
192 };
193 maybeInit (labelHandle, tool.m_label_truthKey);
194 maybeInit (nbHandle, tool.m_NB_truthKey);
195 maybeInit (labelRecoHandle, tool.m_label_recoKey);
196 maybeInit (nbRecoHandle, tool.m_NB_recoKey);
197 maybeInit (split23Handle, tool.m_truthSplit23_recoKey);
198 maybeInit (split12Handle, tool.m_truthSplit12_recoKey);
199
200 maybeInit (matchedTruthJetHandle, tool.m_matchedTruthJet_recoKey);
201 maybeInit (matchedTruthJetMassHandle, tool.m_matchedTruthJetMass_recoKey);
202 maybeInit (matchedTruthJetPtHandle, tool.m_matchedTruthJetPt_recoKey);
203 maybeInit (matchedTruthJetEtaHandle, tool.m_matchedTruthJetEta_recoKey);
204 maybeInit (matchedTruthJetPhiHandle, tool.m_matchedTruthJetPhi_recoKey);
205 maybeInit (matchedTruthJetDRHandle, tool.m_matchedTruthJetDR_recoKey);
206 maybeInit (matchedTruthJetGFHandle, tool.m_matchedTruthJetGF_recoKey);
207
208 maybeInit (matchedTruthGroomedMassHandle, tool.m_matchedTruthGroomedJetMass_recoKey);
209 maybeInit (matchedTruthGroomedPtHandle, tool.m_matchedTruthGroomedJetPt_recoKey);
210}
211
213 const xAOD::Jet &jet,
214 const EventContext& ctx ) const
215{
217 bool matchW = false;
218 bool matchZ = false;
219 bool matchH = false;
220 bool matchTop = false;
221
223 int nMatchW = getNGhostParticles( jet, "GhostWBosons" );
224
225 if ( nMatchW ) {
226 matchW = true;
227 }
228
230 int nMatchZ = getNGhostParticles( jet, "GhostZBosons" );
231
232 if ( nMatchZ ) {
233 matchZ = true;
234 }
235
237 int nMatchH = getNGhostParticles( jet, "GhostHBosons" );
238
239 if ( nMatchH ) {
240 matchH = true;
241 }
242
244 int nMatchTop = getNGhostParticles( jet, "GhostTQuarksFinal" );
245
246 if ( nMatchTop ) {
247 matchTop = true;
248 }
249
250 return getLabel( dh, jet, matchH, matchW, matchZ, matchTop, ctx );
251
252}
253
255 const EventContext& ctx = Gaudi::Hive::currentContext();
256 DecorHandles dh (*this, ctx);
257
259 if(m_isTruthJetCol) {
260 return labelTruthJets(dh, jets, ctx);
261 }
262
263 else if (!m_isTruthJetCol && !m_doLargeRLabels) {
264 return labelRecoJets(dh, jets, ctx);
265 }
266
268 else {
269 ATH_CHECK( labelTruthJets(dh, ctx) );
270 return labelRecoJets(dh, jets, ctx);
271 }
272
273 return StatusCode::SUCCESS;
274}
275
277 const xAOD::JetContainer& jets,
278 const EventContext& ctx) const {
279
281 SG::ReadHandle<xAOD::JetContainer> truthGroomedJets;
283 truthGroomedJets = SG::makeHandle(m_truthGroomedJetCollectionKey, ctx);
284 }
285 const SG::AuxElement::Accessor<int> nbAcc (m_truthLabelName + "_NB");
286 static const SG::ConstAccessor< ElementLink< xAOD::JetContainer > > ParentAcc ("Parent");
287 for(const xAOD::Jet *jet : jets) {
288
290 const xAOD::Jet* parent = nullptr;
292 ElementLink<xAOD::JetContainer> element_link = ParentAcc (*jet);
293 if ( element_link.isValid() ) {
294 parent = *element_link;
295 }
296 else {
297 ATH_MSG_ERROR("Unable to get a link to the parent jet! Returning a NULL pointer.");
298 return StatusCode::FAILURE;
299 }
300 }
302 float dRmin = 9999;
303 float ghostFracNominal = 9999;
304 const xAOD::Jet* matchTruthJet = nullptr;
305 float dRminGroomed = 9999;
306 const xAOD::Jet* matchTruthGroomedJet = nullptr;
307
308 // Ensure that the reco jet has at least one constituent
309 // (and thus a well-defined four-vector)
310 if(jet->numConstituents() > 0){
311 for ( const xAOD::Jet* truthJet : *truthJets ) {
312 // Calculate DR and GF values. Both are used regardless of the matching option.
313 // DR
314 float dR = jet->p4().DeltaR(truthJet->p4());
316 if (parent) dR = parent->p4().DeltaR(truthJet->p4());
317 if (m_useGhostJetMatch) {
318 // GF
319 static const SG::ConstAccessor<float> accGhostTruthPt("GhostTruthPt");
320 float ghostTruthPt = accGhostTruthPt(*jet);
321 float ghostPtFraction = (ghostTruthPt / (truthJet->pt()));
322 // GA matching. Upper bound applied for completeness, but realistically not needed.
323 if ((ghostPtFraction >= m_recoGhostFrac) && (ghostPtFraction <= (2 - m_recoGhostFrac))) {
324 if (std::abs(1 - ghostPtFraction) < std::abs(1 - ghostFracNominal)) {
325 matchTruthJet = truthJet;
326 ghostFracNominal = ghostPtFraction;
327 }
328 }
329 }
330 else {
331 // If m_dRTruthJet < 0, the closest truth jet is used as matched jet. Otherwise, only match if dR < m_dRTruthJet
332 if (m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
333 if (dR < dRmin) {
334 dRmin = dR;
335 matchTruthJet = truthJet;
336 }
337 }
338 }
339
340 }
341 }
342
343
345 int truthJetNB = -1;
346 float truthJetSplit12 = -9999;
347 float truthJetSplit23 = -9999;
348
349 // Defaults to null EL
351 float truthJetMass = -9999;
352 float truthJetPt = -9999;
353 float truthJetEta = -9999;
354 float truthJetPhi = -9999;
355 float deltaR = -2;
356 float ghostFrac = -2;
357
358 if ( matchTruthJet ) {
359 // Can't use the WriteDecorHandle to read --- the decoration may have
360 // been added and locked by a previous algorithm.
361 // Not saving Truth jet decorations for small R
362 if (m_doLargeRLabels) {
363 SG::ConstAccessor<int> labelAcc(dh.labelHandle->auxid());
364 label = labelAcc(*matchTruthJet);
367 if (split23Handle.isAvailable()) truthJetSplit23 = split23Handle(*matchTruthJet);
369 if (split12Handle.isAvailable()) truthJetSplit12 = split12Handle(*matchTruthJet);
370 }
371 if (nbAcc.isAvailable(*matchTruthJet)) truthJetNB = nbAcc(*matchTruthJet);
372 }
373 truthJetEL = ElementLink<xAOD::JetContainer>(*truthJets,matchTruthJet->index(),ctx);
374 truthJetMass = matchTruthJet->m();
375 truthJetPt = matchTruthJet->pt();
376 truthJetEta = matchTruthJet->eta();
377 truthJetPhi = matchTruthJet->phi();
378 ghostFrac = ghostFracNominal;
379 deltaR = dRmin;
380 }
381
382 // Save Groomed Truth Jet variables
383 float truthGroomedJetMass = -9999;
384 float truthGroomedJetPt = -9999;
386 if ( matchTruthJet ) {
387 for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
388 ElementLink<xAOD::JetContainer> element_link = ParentAcc (*truthGroomedJet);
389 if ( !element_link.isValid() ) { continue; }
390 if ( matchTruthJet == *element_link ) {
391 matchTruthGroomedJet = truthGroomedJet;
392 break;
393 }
394 }
395 }
396 // If no matched jet found or matched jet has no corresponding groomed jet, use dR matching
397 if ( !matchTruthGroomedJet && parent != nullptr) {
398 for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
399 float dR = parent->p4().DeltaR(truthGroomedJet->p4());
401 if ( m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
402 if ( dR < dRminGroomed ) {
403 dRminGroomed = dR;
404 matchTruthGroomedJet = truthGroomedJet;
405 }
406 }
407 }
408 }
409 if ( matchTruthGroomedJet ) {
410 truthGroomedJetMass = matchTruthGroomedJet->m();
411 truthGroomedJetPt = matchTruthGroomedJet->pt();
412 }
413 }
414
416 if (m_doLargeRLabels) {
417 (*dh.labelRecoHandle)(*jet) = label;
420 (*dh.split23Handle)(*jet) = truthJetSplit23;
421 (*dh.split12Handle)(*jet) = truthJetSplit12;
422 }
423
424 (*dh.nbRecoHandle)(*jet) = truthJetNB;
425 }
426
427 (*dh.matchedTruthJetHandle)(*jet) = truthJetEL;
428 (*dh.matchedTruthJetMassHandle)(*jet) = truthJetMass;
429 (*dh.matchedTruthJetPtHandle)(*jet) = truthJetPt;
430 (*dh.matchedTruthJetEtaHandle)(*jet) = truthJetEta;
431 (*dh.matchedTruthJetPhiHandle)(*jet) = truthJetPhi;
433 (*dh.matchedTruthJetGFHandle)(*jet) = ghostFrac;
434
436 (*dh.matchedTruthGroomedMassHandle)(*jet) = truthGroomedJetMass;
437 (*dh.matchedTruthGroomedPtHandle)(*jet) = truthGroomedJetPt;
438 }
439 }
440
441 return StatusCode::SUCCESS;
442}
443
445 const EventContext& ctx) const {
446
449
451 if ( !truthJets.isValid() ) {
452 ATH_MSG_ERROR("No truth jet container retrieved. Please make sure you are using a supported TruthLabelName.");
453 return StatusCode::FAILURE;
454 }
455
456 return labelTruthJets(dh, *truthJets, ctx);
457
458}
459
461 const xAOD::JetContainer &truthJets,
462 const EventContext& ctx) const
463{
465 if ( !(truthJets.size()) ) return StatusCode::SUCCESS;
466
468 if(dh.labelHandle->isAvailable()){
469 // Beware: if we get here, the configuration is probably not MT-compatible.
470 ATH_MSG_DEBUG("labelTruthJets: Truth jet collection already labelled with " << m_truthLabelName);
471 return StatusCode::SUCCESS;
472 }
473
476 if(!eventInfo.isValid()){
477 ATH_MSG_ERROR("Failed to retrieve event information.");
478 return StatusCode::FAILURE;
479 }
480
481 if(m_doLargeRLabels) {
484 for ( const xAOD::Jet *jet : truthJets ) {
485 ATH_MSG_DEBUG("Getting truth label using ghost-association");
486 label = getTruthJetLabelGA(dh, *jet, ctx);
487 (*dh.labelHandle)(*jet) = label;
488 }
489 }
490
491 return StatusCode::SUCCESS;
492}
493
495
498
499 float split12 = -999.0;
500
502 const float c0 = 55.25;
503 const float c1 = -2.34e-3;
504
505 split12 = c0 * std::exp( c1 * pt );
506 }
507
508 return split12;
509
510}
511
513
516
517 float split23 = -999.0;
518
522
523 const float c0 = 3.3;
524 const float c1 = -6.98e-4;
525
526 split23 = std::exp( c0 + c1 * pt );
527
528 }
529
530 return split23;
531}
532
533int JetTruthLabelingTool::getNGhostParticles( const xAOD::Jet &jet, const std::string & collection ) const {
534
535 int nMatchPart = 0;
536
537 if( !jet.getAttribute<int>( collection+"Count", nMatchPart ) ){
538
539 std::vector<const xAOD::TruthParticle*> ghostParts;
540 if( !jet.getAssociatedObjects<xAOD::TruthParticle>( collection, ghostParts ) ){
541 ATH_MSG_ERROR( collection + " cannot be retrieved! Truth label definition might be wrong" );
542 }
543 nMatchPart = ghostParts.size();
544 }
545
546 return nMatchPart;
547}
548
550 const xAOD::Jet &jet,
551 bool matchH,
552 bool matchW,
553 bool matchZ,
554 bool matchTop,
555 const EventContext& ctx) const {
556
557 // store GhostBHadronsFinal count
558 int nMatchB = getNGhostParticles( jet, "GhostBHadronsFinal" );
559 (*dh.nbHandle)(jet) = nMatchB;
560
562 bool is_bb = false;
563 bool is_cc = false;
564 bool is_tautauEl = false;
565 bool is_tautauMu = false;
566 bool is_tautauHad = false;
567 bool isTop = false;
568 bool isW = false;
569 bool isZ = false;
570
571 // Use R21Precision_2022v1 definition
575 is_bb = ( nMatchB > 1 );
576 isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
577 isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
578 isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
579 }
580
581 // Use R10TruthLabel_R22v1 definition
583 // get extended ghost associated truth label
584 int extended_GA_label = -1;
585 if (not jet.getAttribute("HadronGhostExtendedTruthLabelID", extended_GA_label)) {
586 ATH_MSG_ERROR( "HadronGhostExtendedTruthLabelID not available for " + m_truthJetCollectionKey.key() );
587 }
588
591 is_bb = ( extended_GA_label == 55 );
592 is_cc = ( extended_GA_label == 44 );
593 is_tautauEl = ( extended_GA_label == 151511 );
594 is_tautauMu = ( extended_GA_label == 151513 );
595 is_tautauHad = ( extended_GA_label == 1515 );
596 isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
597 isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
598 isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
599 }
600
601
603
604 /* The default priority of labels is:
605 * 1) Hbb/cc/tautau
606 * 2) Contained top
607 * 3) Contained W
608 * 4) Contained Zbb/cc/qq/tautau
609 * 5) Uncontained top
610 * 6) Uncontained V
611 */
612
614 if( !(matchTop || matchW || matchZ || matchH) ) {
616 }
617
618 // Higgs
619 if ( matchH ) {
621 if ( is_bb ) return LargeRJetTruthLabel::Hbb;
623 if ( is_cc ) return LargeRJetTruthLabel::Hcc;
625 if ( is_tautauEl ) return LargeRJetTruthLabel::HtautauEl;
626 if ( is_tautauMu ) return LargeRJetTruthLabel::HtautauMu;
627 if ( is_tautauHad ) return LargeRJetTruthLabel::HtautauHad;
630 }
631
633 if ( isTop ) return LargeRJetTruthLabel::tqqb;
634
635 if ( isW ) {
637 if ( matchTop ) return LargeRJetTruthLabel::Wqq_From_t;
640 }
641
642 if ( matchZ ) {
644 if ( is_bb ) return LargeRJetTruthLabel::Zbb;
646 if ( is_cc ) return LargeRJetTruthLabel::Zcc;
648 if ( is_tautauEl ) return LargeRJetTruthLabel::ZtautauEl;
649 if ( is_tautauMu ) return LargeRJetTruthLabel::ZtautauMu;
650 if ( is_tautauHad ) return LargeRJetTruthLabel::ZtautauHad;
651 }
652 if ( isZ ) {
655 }
656
658 if ( matchTop ) return LargeRJetTruthLabel::other_From_t;
659
662
663}
Scalar deltaR(const MatrixBase< Derived > &vec) const
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
bool isW(const T &p)
Definition AtlasPID.h:382
bool isZ(const T &p)
Definition AtlasPID.h:379
bool isTop(const T &p)
Definition AtlasPID.h:185
Helper class to provide constant type-safe access to aux data.
ATLAS-specific HepMC functions.
Header file for AthHistogramAlgorithm.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< std::string > m_jetContainerName
Gaudi::Property< std::string > m_truthLabelName
Gaudi::Property< bool > m_forceDeltaRMatch
bool m_getTruthGroomedJetValues
Use the ungroomed reco jet parent to match to truth jet.
double m_mLowZ
Lower mass cut for W label.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetDR_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_truthKey
StatusCode labelRecoJets(DecorHandles &dh, const xAOD::JetContainer &jets, const EventContext &ctx) const
Apply labels to all jets in a container.
float getTopSplit23Cut(float pt) const
Get top label Split23 cut.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetPt_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_recoKey
StatusCode labelTruthJets(DecorHandles &dh, const EventContext &ctx) const
Label truth jet collection.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetEta_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetPhi_recoKey
double m_mLowTop
Ghost pT fraction to match truth jet to reco jet.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::ReadHandleKey< xAOD::JetContainer > m_truthGroomedJetCollectionKey
void print() const override
Print configured parameters.
int getTruthJetLabelGA(DecorHandles &dh, const xAOD::Jet &jet, const EventContext &ctx) const
Get truth label using ghost-associated particles.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetMass_recoKey
double m_recoGhostFrac
dR to match truth jet to reco jet
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJet_recoKey
Gaudi::Property< bool > m_isTruthJetCol
TruthLabelConfiguration m_truthLabelConfig
bool m_doLargeRLabels
Lower mass cut for Z label.
int getLabel(DecorHandles &dh, const xAOD::Jet &jet, bool matchH, bool matchW, bool matchZ, bool matchTop, const EventContext &ctx) const
Get label based on matching and containment criteria.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit23_recoKey
float getWZSplit12Cut(float pt) const
Get W/Z label Split12 cut.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split23_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthJetGF_recoKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split12_truthKey
int getNGhostParticles(const xAOD::Jet &jet, const std::string &collection) const
Get number of ghost associated particles.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit12_recoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthGroomedJetMass_recoKey
bool m_matchUngroomedParent
Use ghost association to match reco to truth jets, dR otherwise.
TruthLabelConfiguration parseLabel(const std::string &label)
JetTruthLabelingTool(const std::string &name="JetTruthLabelingTool")
default constructor - to be used in all derived classes
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_truthKey
StatusCode decorate(const xAOD::JetContainer &jets) const override
decorate truth label to a jet collection
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetCollectionKey
parameters for truth labeling
double m_mLowW
Lower mass cut for top label.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedTruthGroomedJetPt_recoKey
double m_dRTruthJet
When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets.
Helper class to provide constant type-safe access to aux data.
Handle class for reading a decoration on an object.
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double m() const
The invariant mass of the particle.
Definition Jet_v1.cxx:59
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49
std::string label(const std::string &format, int i)
Definition label.h:19
int enumToInt(const TypeEnum type)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Jet_v1 Jet
Definition of the current "jet version".
TruthParticle_v1 TruthParticle
Typedef to implementation.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Track internally if the W,Z,Top labels should be done (for large-R).
DecorHandles(const JetTruthLabelingTool &tool, const EventContext &ctx)