ATLAS Offline Software
JetTruthLabelingTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
13 
15  asg::AsgTool(name)
16 {}
17 
19 
20  ATH_MSG_INFO("Initializing " << name());
21 
24  if(m_truthLabelName == "R10TruthLabel_R21Consolidated") {
25  m_truthJetCollectionName="AntiKt10TruthTrimmedPtFrac5SmallR20Jets";
26  m_matchUngroomedParent = false;
27  m_dRTruthJet = 0.75;
28  m_useDRMatch = true;
29  m_dRTruthPart = 0.75;
30  m_useWZMassHigh = true;
31  m_mLowTop = 140.0;
32  m_mLowW = 50.0;
33  m_mHighW = 100.0;
34  m_mLowZ = 60.0;
35  m_mHighZ = 110.0;
37  }
39  else if(m_truthLabelName == "R10TruthLabel_R21Precision") {
40  m_truthJetCollectionName="AntiKt10TruthJets";
42  m_dRTruthJet = 0.75;
43  m_useDRMatch = false;
44  m_useWZMassHigh = true;
45  m_mLowTop = 140.0;
46  m_mLowW = 50.0;
47  m_mHighW = 100.0;
48  m_mLowZ = 60.0;
49  m_mHighZ = 110.0;
51  }
53  else if( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" or m_truthLabelName == "R10TruthLabel_R22v1" ) {
54  m_truthJetCollectionName="AntiKt10TruthJets";
56  m_dRTruthJet = 0.75;
57  m_useDRMatch = false;
58  m_useWZMassHigh = false;
59  m_mLowTop = 140.0;
60  m_mLowW = 50.0;
61  m_mLowZ = 50.0;
62  if ( m_truthLabelName == "R10TruthLabel_R22v1" ) {
64  m_truthGroomedJetCollectionName = "AntiKt10TruthSoftDropBeta100Zcut10Jets";
65  } else {
67  }
68  }
69 
70  print();
71 
73 
74  bool isSupportedLabel = false;
75  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R21Consolidated");
76  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R21Precision");
77  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R21Precision_2022v1");
78  isSupportedLabel = isSupportedLabel || (m_truthLabelName=="R10TruthLabel_R22v1");
79 
80  if(!isSupportedLabel) {
81  ATH_MSG_ERROR("TruthLabelName " << m_truthLabelName << " is not supported. Exiting...");
82  return StatusCode::FAILURE;
83  }
84 
91  m_split12_truthKey = m_truthJetCollectionName.key() + ".Split12";
92  m_split23_truthKey = m_truthJetCollectionName.key() + ".Split23";
93 
94  if(!m_isTruthJetCol){
101  m_truthSplit12_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit12";
102  m_truthSplit23_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetSplit23";
103  m_truthJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetMass";
104  m_truthJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthJetPt";
105  m_truthGroomedJetMass_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthGroomedJetMass";
106  m_truthGroomedJetPt_recoKey = m_jetContainerName + "." + m_truthLabelName + "_TruthGroomedJetPt";
107  }
108 
113  ATH_CHECK(m_truthJetCollectionName.initialize());
115 
116  ATH_CHECK(m_label_truthKey.initialize());
121  ATH_CHECK(m_NB_truthKey.initialize());
122 
123  ATH_CHECK(m_split12_truthKey.initialize(m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1"));
124  ATH_CHECK(m_split23_truthKey.initialize(m_truthLabelName == "R10TruthLabel_R21Precision" || m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1"));
125 
131  ATH_CHECK(m_NB_recoKey.initialize(!m_isTruthJetCol));
132  ATH_CHECK(m_truthSplit12_recoKey.initialize(!m_isTruthJetCol && (m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1") ));
133  ATH_CHECK(m_truthSplit23_recoKey.initialize(!m_isTruthJetCol && (m_truthLabelName == "R10TruthLabel_R21Precision" || m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1")));
136 
139 
140  return StatusCode::SUCCESS;
141 }
142 
144  ATH_MSG_INFO("Parameters for " << name());
145 
146  ATH_MSG_INFO("xAOD information:");
147  ATH_MSG_INFO("TruthLabelName: " << m_truthLabelName);
148  ATH_MSG_INFO("UseTRUTH3: " << ( m_useTRUTH3 ? "True" : "False"));
149 
150  if(m_useTRUTH3) {
151  ATH_MSG_INFO("TruthBosonContainerName: " << m_truthBosonContainerName);
152  ATH_MSG_INFO("TruthTopQuarkContainerName: " << m_truthTopQuarkContainerName);
153  }
154  else {
155  ATH_MSG_INFO("TruthParticleContainerName: " << m_truthParticleContainerName);
156  }
157 
158  ATH_MSG_INFO("TruthJetCollectionName: " << m_truthJetCollectionName.key());
159  ATH_MSG_INFO("dRTruthJet: " << std::to_string(m_dRTruthJet));
160 
161  if ( m_useDRMatch ) {
162  ATH_MSG_INFO("dRTruthPart: " << std::to_string(m_dRTruthPart));
163  }
164 
165  ATH_MSG_INFO("mLowTop: " << std::to_string(m_mLowTop));
166  ATH_MSG_INFO("mLowW: " << std::to_string(m_mLowW));
167  if(m_useWZMassHigh)
168  ATH_MSG_INFO("mHighW: " << std::to_string(m_mHighW));
169  ATH_MSG_INFO("mLowZ: " << std::to_string(m_mLowZ));
170  if(m_useWZMassHigh)
171  ATH_MSG_INFO("mHighZ: " << std::to_string(m_mHighZ));
172 
174  ATH_MSG_INFO("truthGroomedJetCollectionName: " << m_truthGroomedJetCollectionName.key());
175  }
176 }
177 
178 
180  (const JetTruthLabelingTool& tool, const EventContext& ctx)
181 {
182  auto maybeInit = [&] (auto& h,
184  {
185  if (!k.key().empty()) h.emplace (k, ctx);
186  };
187  maybeInit (labelHandle, tool.m_label_truthKey);
188  maybeInit (nbHandle, tool.m_NB_truthKey);
189  maybeInit (labelRecoHandle, tool.m_label_recoKey);
190  maybeInit (nbRecoHandle, tool.m_NB_recoKey);
191  maybeInit (dRWHandle, tool.m_dR_W_truthKey);
192  maybeInit (dRZHandle, tool.m_dR_Z_truthKey);
193  maybeInit (dRHHandle, tool.m_dR_H_truthKey);
194  maybeInit (dRTopHandle, tool.m_dR_Top_truthKey);
195  maybeInit (dRWRecoHandle, tool.m_dR_W_recoKey);
196  maybeInit (dRZRecoHandle, tool.m_dR_Z_recoKey);
197  maybeInit (dRHRecoHandle, tool.m_dR_H_recoKey);
198  maybeInit (dRTopRecoHandle, tool.m_dR_Top_recoKey);
199  maybeInit (split23Handle, tool.m_truthSplit23_recoKey);
200  maybeInit (split12Handle, tool.m_truthSplit12_recoKey);
201  maybeInit (truthMassHandle, tool.m_truthJetMass_recoKey);
202  maybeInit (truthPtHandle, tool.m_truthJetPt_recoKey);
203  maybeInit (truthGroomedMassHandle, tool.m_truthGroomedJetMass_recoKey);
204  maybeInit (truthGroomedPtHandle, tool.m_truthGroomedJetPt_recoKey);
205 }
206 
208  const xAOD::Jet &jet,
209  const std::vector<std::pair<TLorentzVector,int> >& tlv_truthParts,
210  const EventContext& ctx) const {
211 
213  bool matchW = false;
214  bool matchZ = false;
215  bool matchH = false;
216  bool matchTop = false;
217 
219  float dR_W = 9999;
220  float dR_Z = 9999;
221  float dR_H = 9999;
222  float dR_Top = 9999;
223 
224  for (auto tlv_truth : tlv_truthParts) {
225  float dR = tlv_truth.first.DeltaR(jet.p4());
226  if( dR < m_dRTruthPart ) {
227 
228  if ( std::abs(tlv_truth.second) == 23 && !matchZ ) {
229  dR_Z = dR;
230  matchZ = true;
231  }
232 
233  if ( std::abs(tlv_truth.second) == 24 && !matchW ) {
234  dR_W = dR;
235  matchW = true;
236  }
237 
238  if ( std::abs(tlv_truth.second) == 25 && !matchH ) {
239  dR_H = dR;
240  matchH = true;
241  }
242 
243  if ( std::abs(tlv_truth.second) == 6 && !matchTop ) {
244  dR_Top = dR;
245  matchTop = true;
246  }
247 
248  }
249  }
250 
252  (*dh.dRWHandle)(jet) = dR_W;
253  (*dh.dRZHandle)(jet) = dR_Z;
254  (*dh.dRHHandle)(jet) = dR_H;
255  (*dh.dRTopHandle)(jet) = dR_Top;
256 
257  return getLabel( dh, jet, matchH, matchW, matchZ, matchTop, ctx );
258 
259 }
260 
262  const xAOD::Jet &jet,
263  const EventContext& ctx ) const
264 {
266  bool matchW = false;
267  bool matchZ = false;
268  bool matchH = false;
269  bool matchTop = false;
270 
272  int nMatchW = getNGhostParticles( jet, "GhostWBosons" );
273 
274  if ( nMatchW ) {
275  matchW = true;
276  }
277 
279  int nMatchZ = getNGhostParticles( jet, "GhostZBosons" );
280 
281  if ( nMatchZ ) {
282  matchZ = true;
283  }
284 
286  int nMatchH = getNGhostParticles( jet, "GhostHBosons" );
287 
288  if ( nMatchH ) {
289  matchH = true;
290  }
291 
293  int nMatchTop = getNGhostParticles( jet, "GhostTQuarksFinal" );
294 
295  if ( nMatchTop ) {
296  matchTop = true;
297  }
298 
299  return getLabel( dh, jet, matchH, matchW, matchZ, matchTop, ctx );
300 
301 }
302 
304  const EventContext& ctx = Gaudi::Hive::currentContext();
305  DecorHandles dh (*this, ctx);
306 
308  if(m_isTruthJetCol) {
309  return labelTruthJets(dh, jets, ctx);
310  }
311 
313  else {
314  ATH_CHECK( labelTruthJets(dh, ctx) );
315  return labelRecoJets(dh, jets, ctx);
316  }
317 
318  return StatusCode::SUCCESS;
319 }
320 
322  const xAOD::JetContainer& jets,
323  const EventContext& ctx) const {
324 
326  SG::ReadHandle<xAOD::JetContainer> truthGroomedJets;
328  truthGroomedJets = SG::makeHandle(m_truthGroomedJetCollectionName, ctx);
329  }
330  const SG::AuxElement::Accessor<int> nbAcc (m_truthLabelName + "_NB");
331  static const SG::ConstAccessor< ElementLink< xAOD::JetContainer > > ParentAcc ("Parent");
332  for(const xAOD::Jet *jet : jets) {
333 
335  const xAOD::Jet* parent = nullptr;
336  if ( m_matchUngroomedParent ){
337  ElementLink<xAOD::JetContainer> element_link = ParentAcc (*jet);
338  if ( element_link.isValid() ) {
339  parent = *element_link;
340  }
341  else {
342  ATH_MSG_ERROR("Unable to get a link to the parent jet! Returning a NULL pointer.");
343  return StatusCode::FAILURE;
344  }
345  }
346 
348  float dRmin = 9999;
349  const xAOD::Jet* matchTruthJet = nullptr;
350  float dRminGroomed = 9999;
351  const xAOD::Jet* matchTruthGroomedJet = nullptr;
352 
353  // Ensure that the reco jet has at least one constituent
354  // (and thus a well-defined four-vector)
355  if(jet->numConstituents() > 0){
356  for ( const xAOD::Jet* truthJet : *truthJets ) {
357  float dR = jet->p4().DeltaR( truthJet->p4() );
359  if ( parent ) dR = parent->p4().DeltaR( truthJet->p4() );
361  if ( m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
362  if ( dR < dRmin ) {
363  dRmin = dR;
364  matchTruthJet = truthJet;
365  }
366  }
367  }
368  }
369 
371  float dR_truthJet_W = 9999;
372  float dR_truthJet_Z = 9999;
373  float dR_truthJet_Top = 9999;
374  float dR_truthJet_H = 9999;
375  int truthJetNB = -1;
376  float truthJetSplit12 = -9999;
377  float truthJetSplit23 = -9999;
378  float truthJetMass = -9999;
379  float truthJetPt = -9999;
380 
381  if ( matchTruthJet ) {
382  // WriteDecorHandles can also read
383  label = (*dh.labelHandle)(*matchTruthJet);
384  if ( m_useDRMatch ) {
385  if(dh.dRWHandle->isAvailable()) dR_truthJet_W = (*dh.dRWHandle)(*matchTruthJet);
386  if(dh.dRZHandle->isAvailable()) dR_truthJet_Z = (*dh.dRZHandle)(*matchTruthJet);
387  if(dh.dRHHandle->isAvailable()) dR_truthJet_H = (*dh.dRHHandle)(*matchTruthJet);
388  if(dh.dRTopHandle->isAvailable()) dR_truthJet_Top = (*dh.dRTopHandle)(*matchTruthJet);
389  }
390  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ) {
392  if(split23Handle.isAvailable()) truthJetSplit23 = split23Handle(*matchTruthJet);
393  }
394  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1" ) {
396  if(split23Handle.isAvailable()) truthJetSplit23 = split23Handle(*matchTruthJet);
398  if(split12Handle.isAvailable()) truthJetSplit12 = split12Handle(*matchTruthJet);
399  }
400  if(nbAcc.isAvailable(*matchTruthJet)) truthJetNB = nbAcc (*matchTruthJet);
401  truthJetMass = matchTruthJet->m();
402  truthJetPt = matchTruthJet->pt();
403  }
404 
405  // Save Groomed Truth Jet variables
406  float truthGroomedJetMass = -9999;
407  float truthGroomedJetPt = -9999;
409  if ( matchTruthJet ) {
410  for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
411  ElementLink<xAOD::JetContainer> element_link = ParentAcc (*truthGroomedJet);
412  if ( !element_link.isValid() ) { continue; }
413  if ( matchTruthJet == *element_link ) {
414  matchTruthGroomedJet = truthGroomedJet;
415  break;
416  }
417  }
418  }
419  // If no matched jet found or matched jet has no corresponding groomed jet, use dR matching
420  if ( !matchTruthGroomedJet ) {
421  for ( const xAOD::Jet* truthGroomedJet : *truthGroomedJets ) {
422  float dR = jet->p4().DeltaR( truthGroomedJet->p4() );
424  if ( m_dRTruthJet < 0 || dR < m_dRTruthJet ) {
425  if ( dR < dRminGroomed ) {
426  dRminGroomed = dR;
427  matchTruthGroomedJet = truthGroomedJet;
428  }
429  }
430  }
431  }
432  if ( matchTruthGroomedJet ) {
433  truthGroomedJetMass = matchTruthGroomedJet->m();
434  truthGroomedJetPt = matchTruthGroomedJet->pt();
435  }
436  }
437 
439  (*dh.labelRecoHandle)(*jet) = label;
440 
442  if ( m_useDRMatch ) {
443  (*dh.dRWRecoHandle)(*jet) = dR_truthJet_W;
444  (*dh.dRZRecoHandle)(*jet) = dR_truthJet_Z;
445  (*dh.dRHRecoHandle)(*jet) = dR_truthJet_H;
446  (*dh.dRTopRecoHandle)(*jet) = dR_truthJet_Top;
447  }
448  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ) {
449  (*dh.split23Handle)(*jet) = truthJetSplit23;
450  }
451 
452  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1" ) {
453  (*dh.split23Handle)(*jet) = truthJetSplit23;
454  (*dh.split12Handle)(*jet) = truthJetSplit12;
455  }
456 
457  (*dh.nbRecoHandle)(*jet) = truthJetNB;
458  (*dh.truthMassHandle)(*jet) = truthJetMass;
459  (*dh.truthPtHandle)(*jet) = truthJetPt;
460 
462  (*dh.truthGroomedMassHandle)(*jet) = truthGroomedJetMass;
463  (*dh.truthGroomedPtHandle)(*jet) = truthGroomedJetPt;
464  }
465  }
466 
467  return StatusCode::SUCCESS;
468 }
469 
471  const EventContext& ctx) const {
472 
475 
477  if ( !truthJets.isValid() ) {
478  ATH_MSG_ERROR("No truth jet container retrieved. Please make sure you are using a supported TruthLabelName.");
479  return StatusCode::FAILURE;
480  }
481 
482  return labelTruthJets(dh, *truthJets, ctx);
483 
484 }
485 
487  const xAOD::JetContainer &truthJets,
488  const EventContext& ctx) const
489 {
491  if ( !(truthJets.size()) ) return StatusCode::SUCCESS;
492 
494  if(dh.labelHandle->isAvailable()){
495  ATH_MSG_DEBUG("labelTruthJets: Truth jet collection already labelled with " << m_truthLabelName);
496  return StatusCode::SUCCESS;
497  }
498 
500  int channelNumber = -999;
501 
504  if(!eventInfo.isValid()){
505  ATH_MSG_ERROR("Failed to retrieve event information.");
506  return StatusCode::FAILURE;
507  }
508 
510  std::vector<std::pair<TLorentzVector,int> > tlv_truthParts;
511 
513  if ( m_useDRMatch ) {
514 
515  channelNumber = eventInfo->mcChannelNumber();
516 
517  if ( channelNumber < 0 ) {
518  ATH_MSG_ERROR("Channel number was not set correctly");
519  return StatusCode::FAILURE;
520  }
521 
523  bool isSherpa = getIsSherpa(channelNumber);
524 
525  if ( m_useTRUTH3 && isSherpa ) {
526  ATH_MSG_ERROR("Cannot apply truth labels to Sherpa 2.2.1 samples using TRUTH3 containers");
527  return StatusCode::FAILURE;
528  }
529 
531  if( m_useTRUTH3 ) {
534  if(!truthPartsBoson.isValid()){
535  ATH_MSG_ERROR("Unable to find " << m_truthBosonContainerName.key() << ". Please check the content of your input file.");
536  return StatusCode::FAILURE;
537  }
540  if(!truthPartsTop.isValid()){
541  ATH_MSG_ERROR("Unable to find " << m_truthTopQuarkContainerName.key() << ". Please check the content of your input file.");
542  return StatusCode::FAILURE;
543  }
545  getTLVs(tlv_truthParts, truthPartsBoson.cptr(), truthPartsTop.cptr(), isSherpa);
546  }
547 
549  else {
551  if(!truthParts.isValid()){
552  ATH_MSG_ERROR("Unable to find " << m_truthParticleContainerName << ". Please check the content of your input file.");
553  return StatusCode::FAILURE;
554  }
556  getTLVs(tlv_truthParts, truthParts.cptr(), truthParts.cptr(), isSherpa);
557  }
558  }
559 
562  for ( const xAOD::Jet *jet : truthJets ) {
563 
564  if ( m_useDRMatch ) {
565  ATH_MSG_DEBUG("Getting truth label using dR matching");
566  label = getTruthJetLabelDR(dh, *jet, tlv_truthParts, ctx);
567  }
568 
569  else {
570  ATH_MSG_DEBUG("Getting truth label using ghost-association");
571  label = getTruthJetLabelGA(dh, *jet, ctx);
572  }
573 
574  (*dh.labelHandle)(*jet) = label;
575  }
576 
577  return StatusCode::SUCCESS;
578 }
579 
580 void JetTruthLabelingTool::getTLVs( std::vector<std::pair<TLorentzVector,int> > &tlvs, const xAOD::TruthParticleContainer *truthBosons, const xAOD::TruthParticleContainer *truthTop, bool isSherpa ) const {
581 
582  tlvs.clear();
583 
585  if(isSherpa) {
586  int countStatus3 = 0;
587 
589  TLorentzVector p1(0,0,0,0);
590  TLorentzVector p2(0,0,0,0);
591 
593  TLorentzVector WZCand(0,0,0,0);
594 
596  bool isWPCand = false;
597  bool isWMCand = false;
598  bool isZCand = false;
599 
601  bool inMassWindow = false;
602 
603  for ( unsigned int ipart = 0; ipart < truthBosons->size(); ipart++ ){
604 
605  const xAOD::TruthParticle* part1 = truthBosons->at(ipart);
606 
608  if ( MC::isPhysical(part1) ) continue;
609 
611  if ( std::abs(part1->pdgId()) > 5 ) continue;
612 
613  countStatus3++;
615  if ( countStatus3 > 3 ) continue;
617  p1 = part1->p4();
618 
620  for ( unsigned int jpart = ipart+1; jpart < truthBosons->size(); jpart++ ) {
621 
622  const xAOD::TruthParticle* part2 = truthBosons->at(jpart);
623 
625  if ( MC::isPhysical(part2) ) continue;
626 
628  if ( std::abs(part2->pdgId()) > 5 ) continue;
629 
630  p2 = part2->p4();
631 
633  if ( part1->pdgId() + part2->pdgId() == 0 ) {
634  isZCand = true;
635  }
637  else if ( part1->pdgId() == 2 || part1->pdgId() == 4 || part2->pdgId() == 2 || part2->pdgId() == 4 ) {
638  isWPCand = true;
639  }
641  else {
642  isWMCand = true;
643  }
644 
646  break;
647 
648  }
649 
650  WZCand = p1 + p2;
651 
653  if ( 60000 < WZCand.M() && WZCand.M() < 140000. ) {
654  inMassWindow = true;
655  break;
656  }
657 
658  }
659 
660  if ( inMassWindow && (isWPCand || isWMCand || isZCand) ) {
661  std::pair<TLorentzVector,int> WZ;
662  if ( isZCand ) {
663  WZ = std::make_pair(WZCand,23);
664  }
665  if ( isWPCand ) {
666  WZ = std::make_pair(WZCand,24);
667  }
668  if ( isWMCand ) {
669  WZ = std::make_pair(WZCand,-24);
670  }
671  tlvs.push_back(WZ);
672  }
673 
674  }
675 
677  for ( const xAOD::TruthParticle* part : *truthBosons ) {
678  if ( !(selectTruthParticle(part,23) || selectTruthParticle(part,24) || selectTruthParticle(part,25)) ) continue;
680  tlvs.push_back(std::make_pair(part->p4(),part->pdgId()));
681  }
682 
684  for ( const xAOD::TruthParticle* part : *truthTop ) {
685  if ( !selectTruthParticle(part,6) ) continue;
687  tlvs.push_back(std::make_pair(part->p4(),part->pdgId()));
688  }
689 
690 }
691 
693  if ( std::abs(tp->pdgId()) != pdgId ) return false;
694  for ( unsigned int iChild = 0; iChild < tp->nChildren(); iChild++ ) {
695  const xAOD::TruthParticle *child = tp->child(iChild);
696  if ( !child ) continue;
697  if ( child->pdgId() == tp->pdgId() ) return false;
698  }
699  return true;
700 }
701 
703 
706 
707  float split12 = -999.0;
708 
709  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" || m_truthLabelName == "R10TruthLabel_R22v1") {
710  const float c0 = 55.25;
711  const float c1 = -2.34e-3;
712 
713  split12 = c0 * std::exp( c1 * pt );
714  }
715 
716  return split12;
717 
718 }
719 
721 
724 
725  float split23 = -999.0;
726 
727  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ||
728  m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" ||
729  m_truthLabelName == "R10TruthLabel_R22v1") {
730 
731  const float c0 = 3.3;
732  const float c1 = -6.98e-4;
733 
734  split23 = std::exp( c0 + c1 * pt );
735 
736  }
737 
738  return split23;
739 }
740 
741 int JetTruthLabelingTool::getNGhostParticles( const xAOD::Jet &jet, std::string collection ) const {
742 
743  int nMatchPart = 0;
744 
745  if( !jet.getAttribute<int>( collection+"Count", nMatchPart ) ){
746 
747  std::vector<const xAOD::TruthParticle*> ghostParts;
748  if( !jet.getAssociatedObjects<xAOD::TruthParticle>( collection, ghostParts ) ){
749  ATH_MSG_ERROR( collection + " cannot be retrieved! Truth label definition might be wrong" );
750  }
751  nMatchPart = ghostParts.size();
752  }
753 
754  return nMatchPart;
755 }
756 
758  const xAOD::Jet &jet,
759  bool matchH,
760  bool matchW,
761  bool matchZ,
762  bool matchTop,
763  const EventContext& ctx) const {
764 
765  // store GhostBHadronsFinal count
766  int nMatchB = getNGhostParticles( jet, "GhostBHadronsFinal" );
767  (*dh.nbHandle)(jet) = nMatchB;
768 
770  bool is_bb = false;
771  bool is_cc = false;
772  bool is_tautauEl = false;
773  bool is_tautauMu = false;
774  bool is_tautauHad = false;
775  bool isTop = false;
776  bool isW = false;
777  bool isZ = false;
778 
780  if ( m_truthLabelName == "R10TruthLabel_R21Consolidated" ) {
781  is_bb = ( nMatchB > 1 );
782  isTop = ( matchTop && nMatchB > 0 && jet.m() / 1000. > m_mLowTop );
783  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && jet.m() / 1000. < m_mHighW;
784  isZ = matchZ && jet.m() / 1000. > m_mLowZ && jet.m() / 1000. < m_mHighZ;
785  }
786 
788  if ( m_truthLabelName == "R10TruthLabel_R21Precision" ) {
790  is_bb = ( nMatchB > 1 );
791  isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
792  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && jet.m() / 1000. < m_mHighW;
793  isZ = matchZ && jet.m() / 1000. > m_mLowZ && jet.m() / 1000. < m_mHighZ;
794  }
795 
796  // Use R21Precision_2022v1 definition
797  if ( m_truthLabelName == "R10TruthLabel_R21Precision_2022v1" ) {
800  is_bb = ( nMatchB > 1 );
801  isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
802  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
803  isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
804  }
805 
806  // Use R10TruthLabel_R22v1 definition
807  if ( m_truthLabelName == "R10TruthLabel_R22v1" ) {
808  // get extended ghost associated truth label
809  int extended_GA_label = -1;
810  if (not jet.getAttribute("HadronGhostExtendedTruthLabelID", extended_GA_label)) {
811  ATH_MSG_ERROR( "HadronGhostExtendedTruthLabelID not available for " + m_truthJetCollectionName.key() );
812  }
813 
816  is_bb = ( extended_GA_label == 55 );
817  is_cc = ( extended_GA_label == 44 );
818  is_tautauEl = ( extended_GA_label == 151511 );
819  is_tautauMu = ( extended_GA_label == 151513 );
820  is_tautauHad = ( extended_GA_label == 1515 );
821  isTop = ( matchTop && matchW && nMatchB > 0 && jet.m() / 1000. > m_mLowTop && split23Handle(jet) / 1000. > getTopSplit23Cut( jet.pt() / 1000. ) );
822  isW = matchW && nMatchB == 0 && jet.m() / 1000. > m_mLowW && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
823  isZ = matchZ && jet.m() / 1000. > m_mLowZ && split12Handle(jet) / 1000. > getWZSplit12Cut( jet.pt() / 1000. );
824  }
825 
826 
828 
829  /* The default priority of labels is:
830  * 1) Hbb/cc/tautau
831  * 2) Contained top
832  * 3) Contained W
833  * 4) Contained Zbb/cc/qq
834  * 5) Uncontained top
835  * 6) Uncontained V
836  */
837 
839  if( !(matchTop || matchW || matchZ || matchH) ) {
841  }
842 
843  // Higgs
844  if ( matchH ) {
846  if ( is_bb ) return LargeRJetTruthLabel::Hbb;
848  if ( is_cc ) return LargeRJetTruthLabel::Hcc;
850  if ( is_tautauEl ) return LargeRJetTruthLabel::HtautauEl;
851  if ( is_tautauMu ) return LargeRJetTruthLabel::HtautauMu;
852  if ( is_tautauHad ) return LargeRJetTruthLabel::HtautauHad;
855  }
856 
858  if ( isTop ) return LargeRJetTruthLabel::tqqb;
859 
860  if ( isW ) {
862  if ( matchTop ) return LargeRJetTruthLabel::Wqq_From_t;
865  }
866 
867  if ( matchZ ) {
869  if ( is_bb ) return LargeRJetTruthLabel::Zbb;
871  if ( is_cc ) return LargeRJetTruthLabel::Zcc;
872  }
873  if ( isZ ) {
876  }
877 
879  if ( matchTop ) return LargeRJetTruthLabel::other_From_t;
880 
883 
884 }
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
JetTruthLabelingTool::m_evtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition: JetTruthLabelingTool.h:53
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
JetTruthLabelingTool::DecorHandles::dRTopHandle
FloatHandleOp_t dRTopHandle
Definition: JetTruthLabelingTool.h:90
JetTruthLabelingTool::DecorHandles::split12Handle
FloatHandleOp_t split12Handle
Definition: JetTruthLabelingTool.h:96
JetTruthLabelingTool::m_truthSplit12_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit12_recoKey
Definition: JetTruthLabelingTool.h:173
JetTruthLabelingTool::m_truthGroomedJetPt_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthGroomedJetPt_recoKey
Definition: JetTruthLabelingTool.h:178
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
JetTruthLabelingTool::DecorHandles::dRWRecoHandle
FloatHandleOp_t dRWRecoHandle
Definition: JetTruthLabelingTool.h:91
JetTruthLabelingTool::m_dR_Top_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Top_recoKey
Definition: JetTruthLabelingTool.h:171
CurrentContext.h
JetTruthLabelingTool::m_matchUngroomedParent
bool m_matchUngroomedParent
Use upper mass cut for W/Z labels.
Definition: JetTruthLabelingTool.h:66
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
JetTruthLabelingTool::m_truthParticleContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerName
Definition: JetTruthLabelingTool.h:57
JetTruthLabelingTool::DecorHandles::split23Handle
FloatHandleOp_t split23Handle
Definition: JetTruthLabelingTool.h:95
JetTruthLabelingTool::m_isTruthJetCol
Gaudi::Property< bool > m_isTruthJetCol
Definition: JetTruthLabelingTool.h:51
jet::JetTopology::WZ
@ WZ
Definition: UncertaintyEnum.h:211
extractSporadic.c1
c1
Definition: extractSporadic.py:134
JetTruthLabelingTool::m_mHighW
double m_mHighW
Lower mass cut for W label.
Definition: JetTruthLabelingTool.h:72
JetTruthLabelingTool::DecorHandles::dRHRecoHandle
FloatHandleOp_t dRHRecoHandle
Definition: JetTruthLabelingTool.h:93
asg
Definition: DataHandleTestTool.h:28
test_pyathena.pt
pt
Definition: test_pyathena.py:11
LargeRJetTruthLabel::other_From_t
@ other_From_t
Definition: LargeRJetLabelEnum.h:22
ParticleTest.tp
tp
Definition: ParticleTest.py:25
JetTruthLabelingTool::m_useTRUTH3
Gaudi::Property< bool > m_useTRUTH3
TRUTH1 or TRUTH3.
Definition: JetTruthLabelingTool.h:56
JetTruthLabelingTool::m_truthGroomedJetMass_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthGroomedJetMass_recoKey
Definition: JetTruthLabelingTool.h:177
JetTruthLabelingTool::selectTruthParticle
bool selectTruthParticle(const xAOD::TruthParticle *tp, int pdgId) const
Check if truth particle has correct DSID and isn't self decay.
Definition: JetTruthLabelingTool.cxx:692
JetTruthLabelingTool::m_dR_H_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_H_recoKey
Definition: JetTruthLabelingTool.h:170
JetTruthLabelingTool::m_truthTopQuarkContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthTopQuarkContainerName
Definition: JetTruthLabelingTool.h:59
JetTruthLabelingTool::labelTruthJets
StatusCode labelTruthJets(DecorHandles &dh, const EventContext &ctx) const
Label truth jet collection.
Definition: JetTruthLabelingTool.cxx:470
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:54
PyPoolBrowser.dh
dh
Definition: PyPoolBrowser.py:102
JetTruthLabelingTool::m_truthBosonContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthBosonContainerName
Definition: JetTruthLabelingTool.h:58
LargeRJetTruthLabel::Zqq
@ Zqq
Definition: LargeRJetLabelEnum.h:20
JetTruthLabelingTool::getNGhostParticles
int getNGhostParticles(const xAOD::Jet &jet, std::string collection) const
Get number of ghost associated particles.
Definition: JetTruthLabelingTool.cxx:741
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
JetTruthLabelingTool::m_mLowZ
double m_mLowZ
Upper mass cut for W label.
Definition: JetTruthLabelingTool.h:73
JetTruthLabelingTool::DecorHandles::labelRecoHandle
IntHandleOp_t labelRecoHandle
Definition: JetTruthLabelingTool.h:83
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
JetTruthLabelingTool::m_truthGroomedJetCollectionName
SG::ReadHandleKey< xAOD::JetContainer > m_truthGroomedJetCollectionName
Definition: JetTruthLabelingTool.h:63
LargeRJetTruthLabel::qcd
@ qcd
Definition: LargeRJetLabelEnum.h:25
JetTruthLabelingTool::DecorHandles::dRZHandle
FloatHandleOp_t dRZHandle
Definition: JetTruthLabelingTool.h:88
LargeRJetTruthLabel::Hbb
@ Hbb
Definition: LargeRJetLabelEnum.h:26
JetTruthLabelingTool::m_NB_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_truthKey
Definition: JetTruthLabelingTool.h:163
JetTruthLabelingTool::DecorHandles
Upper mass cut for Z label.
Definition: JetTruthLabelingTool.h:76
JetTruthLabelingTool::m_label_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_recoKey
Definition: JetTruthLabelingTool.h:167
PowhegPy8EG_H2a.pdgId
dictionary pdgId
Definition: PowhegPy8EG_H2a.py:128
LargeRJetTruthLabel::notruth
@ notruth
Definition: LargeRJetLabelEnum.h:24
JetTruthLabelingTool::DecorHandles::truthGroomedPtHandle
FloatHandleOp_t truthGroomedPtHandle
Definition: JetTruthLabelingTool.h:100
LargeRJetTruthLabel::HtautauMu
@ HtautauMu
Definition: LargeRJetLabelEnum.h:30
JetTruthLabelingTool::m_mLowW
double m_mLowW
Lower mass cut for top label.
Definition: JetTruthLabelingTool.h:71
JetTruthLabelingTool::DecorHandles::truthGroomedMassHandle
FloatHandleOp_t truthGroomedMassHandle
Definition: JetTruthLabelingTool.h:99
JetTruthLabelingTool::DecorHandles::DecorHandles
DecorHandles(const JetTruthLabelingTool &tool, const EventContext &ctx)
Definition: JetTruthLabelingTool.cxx:180
JetTruthLabelingTool::getTruthJetLabelDR
int getTruthJetLabelDR(DecorHandles &dh, const xAOD::Jet &jet, const std::vector< std::pair< TLorentzVector, int > > &tlv_truthParts, const EventContext &ctx) const
Get truth label using dR-matched particles.
Definition: JetTruthLabelingTool.cxx:207
xAOD::EventInfo_v1::mcChannelNumber
uint32_t mcChannelNumber() const
The MC generator's channel number.
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
hotSpotInTAG.c0
c0
Definition: hotSpotInTAG.py:192
MC::isPhysical
bool isPhysical(const T &p)
Definition: HepMCHelpers.h:32
part1
Definition: part1.py:1
JetTruthLabelingTool::m_dR_W_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_W_recoKey
Definition: JetTruthLabelingTool.h:168
JetTruthLabelingTool::getTopSplit23Cut
float getTopSplit23Cut(float pt) const
Get top label Split23 cut.
Definition: JetTruthLabelingTool.cxx:720
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
LargeRJetTruthLabel::Wqq
@ Wqq
Definition: LargeRJetLabelEnum.h:17
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
JetTruthLabelingTool
Definition: JetTruthLabelingTool.h:26
JetTruthLabelingTool::m_dR_Z_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Z_recoKey
Definition: JetTruthLabelingTool.h:169
LargeRJetTruthLabel::HtautauEl
@ HtautauEl
Definition: LargeRJetLabelEnum.h:29
JetTruthLabelingTool::m_dR_Top_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Top_truthKey
Definition: JetTruthLabelingTool.h:162
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JetTruthLabelingTool::getLabel
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.
Definition: JetTruthLabelingTool.cxx:757
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
extractSporadic.h
list h
Definition: extractSporadic.py:97
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:164
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
JetTruthLabelingTool::m_dR_H_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_H_truthKey
Definition: JetTruthLabelingTool.h:161
JetTruthLabelingTool::m_truthJetPt_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthJetPt_recoKey
Definition: JetTruthLabelingTool.h:176
JetTruthLabelingTool::m_mHighZ
double m_mHighZ
Lower mass cut for Z label.
Definition: JetTruthLabelingTool.h:74
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JetTruthLabelingTool.h
JetTruthLabelingTool::getIsSherpa
bool getIsSherpa(const int DSID) const
Check for Sherpa DSIDs.
Definition: JetTruthLabelingTool.h:142
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LargeRJetTruthLabel::Hcc
@ Hcc
Definition: LargeRJetLabelEnum.h:27
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
JetTruthLabelingTool::m_split23_truthKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split23_truthKey
Definition: JetTruthLabelingTool.h:165
JetTruthLabelingTool::getWZSplit12Cut
float getWZSplit12Cut(float pt) const
Get W/Z label Split12 cut.
Definition: JetTruthLabelingTool.cxx:702
LargeRJetTruthLabel::Zbb
@ Zbb
Definition: LargeRJetLabelEnum.h:18
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
WriteDecorHandle.h
Handle class for adding a decoration to an object.
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
LargeRJetTruthLabel::HtautauHad
@ HtautauHad
Definition: LargeRJetLabelEnum.h:31
part2
Definition: part2.py:1
JetTruthLabelingTool::m_useWZMassHigh
bool m_useWZMassHigh
Use dR to match partons to truth jet.
Definition: JetTruthLabelingTool.h:65
JetTruthLabelingTool::DecorHandles::dRHHandle
FloatHandleOp_t dRHHandle
Definition: JetTruthLabelingTool.h:89
JetTruthLabelingTool::DecorHandles::labelHandle
IntHandleOp_t labelHandle
Definition: JetTruthLabelingTool.h:81
LargeRJetTruthLabel::Wqq_From_t
@ Wqq_From_t
Definition: LargeRJetLabelEnum.h:21
JetTruthLabelingTool::DecorHandles::truthMassHandle
FloatHandleOp_t truthMassHandle
Definition: JetTruthLabelingTool.h:97
JetTruthLabelingTool::DecorHandles::nbHandle
IntHandleOp_t nbHandle
Definition: JetTruthLabelingTool.h:82
JetTruthLabelingTool::m_truthJetMass_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthJetMass_recoKey
Definition: JetTruthLabelingTool.h:175
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JetTruthLabelingTool::getTLVs
void getTLVs(std::vector< std::pair< TLorentzVector, int > > &tlvs, const xAOD::TruthParticleContainer *truthBosons, const xAOD::TruthParticleContainer *truthTop, bool isSherpa=false) const
Extract heavy particle 4-vectors from truth record.
Definition: JetTruthLabelingTool.cxx:580
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ReadHandle.h
Handle class for reading from StoreGate.
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
JetTruthLabelingTool::m_truthLabelName
Gaudi::Property< std::string > m_truthLabelName
Definition: JetTruthLabelingTool.h:49
JetTruthLabelingTool::m_mLowTop
double m_mLowTop
dR to match truth particles to truth jet
Definition: JetTruthLabelingTool.h:70
JetTruthLabelingTool::DecorHandles::truthPtHandle
FloatHandleOp_t truthPtHandle
Definition: JetTruthLabelingTool.h:98
JetTruthLabelingTool::DecorHandles::dRWHandle
FloatHandleOp_t dRWHandle
Definition: JetTruthLabelingTool.h:87
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
isW
bool isW(const T &p)
Definition: AtlasPID.h:167
JetTruthLabelingTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetTruthLabelingTool.cxx:18
JetTruthLabelingTool::JetTruthLabelingTool
JetTruthLabelingTool(const std::string &name="JetTruthLabelingTool")
default constructor - to be used in all derived classes
Definition: JetTruthLabelingTool.cxx:14
JetTruthLabelingTool::m_split12_truthKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_split12_truthKey
Definition: JetTruthLabelingTool.h:164
xAOD::Jet_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: Jet_v1.cxx:59
JetTruthLabelingTool::getTruthJetLabelGA
int getTruthJetLabelGA(DecorHandles &dh, const xAOD::Jet &jet, const EventContext &ctx) const
Get truth label using ghost-associated particles.
Definition: JetTruthLabelingTool.cxx:261
isTop
bool isTop(const T &p)
Definition: AtlasPID.h:126
h
LargeRJetTruthLabel::other_From_V
@ other_From_V
Definition: LargeRJetLabelEnum.h:23
JetTruthLabelingTool::DecorHandles::dRZRecoHandle
FloatHandleOp_t dRZRecoHandle
Definition: JetTruthLabelingTool.h:92
JetTruthLabelingTool::decorate
StatusCode decorate(const xAOD::JetContainer &jets) const override
decorate truth label to a jet collection
Definition: JetTruthLabelingTool.cxx:303
JetTruthLabelingTool::m_dR_Z_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_Z_truthKey
Definition: JetTruthLabelingTool.h:160
ReadDecorHandle.h
Handle class for reading a decoration on an object.
JetTruthLabelingTool::m_truthJetCollectionName
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetCollectionName
parameters for truth labeling
Definition: JetTruthLabelingTool.h:62
LargeRJetTruthLabel::other_From_H
@ other_From_H
Definition: LargeRJetLabelEnum.h:28
JetTruthLabelingTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetTruthLabelingTool.h:48
JetTruthLabelingTool::m_truthSplit23_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_truthSplit23_recoKey
Definition: JetTruthLabelingTool.h:174
JetTruthLabelingTool::m_dR_W_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dR_W_truthKey
Definition: JetTruthLabelingTool.h:159
LargeRJetTruthLabel::Zcc
@ Zcc
Definition: LargeRJetLabelEnum.h:19
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
JetTruthLabelingTool::print
void print() const override
Print configured parameters.
Definition: JetTruthLabelingTool.cxx:143
LargeRJetTruthLabel::tqqb
@ tqqb
Definition: LargeRJetLabelEnum.h:16
LargeRJetTruthLabel::enumToInt
int enumToInt(const TypeEnum type)
Definition: LargeRJetLabelEnum.h:34
JetTruthLabelingTool::DecorHandles::dRTopRecoHandle
FloatHandleOp_t dRTopRecoHandle
Definition: JetTruthLabelingTool.h:94
JetTruthLabelingTool::m_dRTruthPart
double m_dRTruthPart
dR to match truth jet to reco jet
Definition: JetTruthLabelingTool.h:69
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
JetTruthLabelingTool::m_useDRMatch
bool m_useDRMatch
Definition: JetTruthLabelingTool.h:64
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
SG::ReadDecorHandle::isAvailable
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
JetTruthLabelingTool::m_getTruthGroomedJetValues
bool m_getTruthGroomedJetValues
Use the ungroomed reco jet parent to match to truth jet.
Definition: JetTruthLabelingTool.h:67
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JetTruthLabelingTool::m_label_truthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_label_truthKey
Definition: JetTruthLabelingTool.h:158
JetTruthLabelingTool::m_NB_recoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_NB_recoKey
Definition: JetTruthLabelingTool.h:172
HepMCHelpers.h
JetTruthLabelingTool::labelRecoJets
StatusCode labelRecoJets(DecorHandles &dh, const xAOD::JetContainer &jets, const EventContext &ctx) const
Apply labels to all jets in a container.
Definition: JetTruthLabelingTool.cxx:321
fitman.k
k
Definition: fitman.py:528
JetTruthLabelingTool::DecorHandles::nbRecoHandle
IntHandleOp_t nbRecoHandle
Definition: JetTruthLabelingTool.h:84
JetTruthLabelingTool::m_dRTruthJet
double m_dRTruthJet
When truth jet matching to ungroomed truth, allow saving properties of groomed truth jets.
Definition: JetTruthLabelingTool.h:68