Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
BuildTruthTaus.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Local include(s)
9 
10 // Core include(s):
11 #include "AthLinks/ElementLink.h"
12 #include "AthContainers/Accessor.h"
13 
14 // EDM include(s):
15 #include "xAODTruth/TruthVertex.h"
17 
19 
20 // Tool include(s)
22 
23 using namespace TauAnalysisTools;
24 
25 //=================================PUBLIC-PART==================================
26 //______________________________________________________________________________
27 BuildTruthTaus::BuildTruthTaus( const std::string& name )
28  : AsgMetadataTool(name)
29  , m_tMCTruthClassifier("MCTruthClassifier", this)
30 {
31 }
32 
33 //______________________________________________________________________________
35 {
36  if (!m_truthMatchingMode) {
37  ATH_MSG_INFO( "Initializing BuildTruthTaus, will generate " << m_truthTauOutputContainer.key() << " from " << m_truthParticleContainer.key() << " container" );
38  }
39  else {
40  ATH_MSG_INFO( "Initializing BuildTruthTaus in truth matching mode, using input container " << m_truthTauInputContainer.key() );
41  }
42 
43  // input containers
49 
50  // in truth matching mode, truth electron/muon/jet containers are optional but expected
51  if (m_truthMatchingMode) {
53  ATH_MSG_WARNING("Truth electron container is not available, won't perform matching to truth electrons");
54  }
56  ATH_MSG_WARNING("Truth muon container is not available, won't perform matching to truth muons");
57  }
58  if (m_truthJetContainer.empty()) {
59  ATH_MSG_WARNING("Truth jet container is not available, won't perform matching to truth jets");
60  }
61  }
62 
63  // output container
65 
66  // The following properties are only available in athena
67 #ifndef XAOD_ANALYSIS
68  ATH_CHECK(m_tMCTruthClassifier.setProperty("ParticleCaloExtensionTool", ""));
69  ATH_CHECK(m_tMCTruthClassifier.setProperty("TruthInConeTool", ""));
70 #endif
71 
74 
75  // drop at earliest occasion
77 
78  return StatusCode::SUCCESS;
79 }
80 
81 
83 {
85 }
86 
87 
89 {
90  return retrieveTruthTaus (dynamic_cast<TruthTausEvent&> (truthTausEvent));
91 }
92 
93 
94 StatusCode BuildTruthTaus::retrieveTruthTaus(TruthTausEvent& truthTausEvent) const
95 {
96  const EventContext& ctx = Gaudi::Hive::currentContext();
97 
98  // truth matching mode
99  if (m_truthMatchingMode) {
102  if (!truthElectronsHandle.isValid()) {
103  ATH_MSG_ERROR ("Could not retrieve " << truthElectronsHandle.key());
104  return StatusCode::FAILURE;
105  }
106  truthTausEvent.m_xTruthElectronContainerConst = truthElectronsHandle.cptr();
107  }
108 
109  if (!m_truthMuonContainer.empty()) {
111  if (!truthMuonsHandle.isValid()) {
112  ATH_MSG_ERROR ("Could not retrieve " << truthMuonsHandle.key());
113  return StatusCode::FAILURE;
114  }
115  truthTausEvent.m_xTruthMuonContainerConst = truthMuonsHandle.cptr();
116  }
117 
118  if (!m_truthJetContainer.empty()) {
120  if (!truthJetsHandle.isValid()) {
121  ATH_MSG_ERROR ("Could not retrieve " << truthJetsHandle.key());
122  return StatusCode::FAILURE;
123  }
124  truthTausEvent.m_xTruthJetContainerConst = truthJetsHandle.cptr();
125  }
126 
128  if (!truthTausHandle.isValid()) {
129  ATH_MSG_ERROR ("Could not retrieve " << truthTausHandle.key());
130  return StatusCode::FAILURE;
131  }
132  truthTausEvent.m_xTruthTauContainerConst = truthTausHandle.cptr();
133  }
134  // truth tau building mode
135  else {
137  if (!truthParticlesHandle.isValid()) {
138  ATH_MSG_ERROR ("Could not retrieve " << truthParticlesHandle.key());
139  return StatusCode::FAILURE;
140  }
141  truthTausEvent.m_xTruthParticleContainer = truthParticlesHandle.cptr();
142 
143  auto truthTausOutput = std::make_unique<xAOD::TruthParticleContainer>();
144  auto truthTausOutputAux = std::make_unique<xAOD::TruthParticleAuxContainer>();
145  truthTausOutput->setStore(truthTausOutputAux.get());
146  truthTausEvent.m_xTruthTauContainer = truthTausOutput.get();
147 
148  ATH_CHECK( buildTruthTausFromTruthParticles(truthTausEvent) );
149 
150  auto writeHandle = SG::makeHandle(m_truthTauOutputContainer, ctx);
151  ATH_CHECK(writeHandle.record(std::move(truthTausOutput), std::move(truthTausOutputAux)));
152  }
153 
154  return StatusCode::SUCCESS;
155 }
156 
157 //=================================PRIVATE-PART=================================
158 //______________________________________________________________________________
159 //______________________________________________________________________________
161 BuildTruthTaus::buildTruthTausFromTruthParticles(TruthTausEvent& truthTausEvent) const
162 {
163  static const SG::Accessor<char> dressedPhotonAcc ("dressedPhoton");
164 
165  bool copyDressedPhotons = false;
166 
167  for (auto xTruthParticle : *truthTausEvent.m_xTruthParticleContainer)
168  {
169  if ( xTruthParticle->isTau() )
170  {
171  auto xTruthTau = std::make_unique<xAOD::TruthParticle>();
172  xTruthTau->makePrivateStore( *xTruthParticle );
173 
174  if ( examineTruthTau(*xTruthTau).isFailure() )
175  {
176  continue;
177  }
178 
179  // The dressedPhoton decoration will likely be unlocked and thus will
180  // not be copied by the above. Copy it explicitly in that case.
181  // See ATLASRECTS-8008.
182  // First time through the loop we check to see if the decoration
183  // needs to be copied and remember for subsequent iterations
184  // (during which the destination decoration will have already
185  // been created).
186  if (truthTausEvent.m_xTruthTauContainer->empty() &&
187  dressedPhotonAcc.isAvailable ( *xTruthParticle ) &&
188  !dressedPhotonAcc.isAvailable ( *xTruthTau ))
189  {
190  copyDressedPhotons = true;
191  }
192  if (copyDressedPhotons)
193  {
194  dressedPhotonAcc( *xTruthTau ) = dressedPhotonAcc( *xTruthParticle );
195  }
196 
197  // Run classification
198  auto pClassification = m_tMCTruthClassifier->particleTruthClassifier(xTruthTau.get());
199  static const SG::Accessor<unsigned int> decClassifierParticleType("classifierParticleType");
200  static const SG::Accessor<unsigned int> decClassifierParticleOrigin("classifierParticleOrigin");
201  decClassifierParticleType(*xTruthTau) = pClassification.first;
202  decClassifierParticleOrigin(*xTruthTau) = pClassification.second;
203 
204  // create link to the original TruthParticle
205  ElementLink < xAOD::TruthParticleContainer > lTruthParticleLink(xTruthParticle, *truthTausEvent.m_xTruthParticleContainer);
206  static const SG::Accessor<ElementLink< xAOD::TruthParticleContainer > > accOriginalTruthParticle("originalTruthParticle");
207  accOriginalTruthParticle(*xTruthTau) = lTruthParticleLink;
208 
209  truthTausEvent.m_xTruthTauContainer->push_back(std::move(xTruthTau));
210  }
211  }
212  return StatusCode::SUCCESS;
213 }
214 
215 //______________________________________________________________________________
217 {
218  // skip this tau if it has no decay vertex, should not happen
219  if ( !xTruthParticle.hasDecayVtx() )
220  return StatusCode::FAILURE;
221 
222  ATH_MSG_VERBOSE("looking for charged daughters of a truth tau");
223 
224  TauTruthInfo truthInfo;
225 
226  const xAOD::TruthVertex* xDecayVertex = xTruthParticle.decayVtx();
227  if (xDecayVertex == nullptr)
228  return StatusCode::FAILURE;
229  for ( size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->nOutgoingParticles(); ++iOutgoingParticle )
230  {
231  const xAOD::TruthParticle* xTruthDaughter = xDecayVertex->outgoingParticle(iOutgoingParticle);
232  if (xTruthDaughter == nullptr)
233  {
234  ATH_MSG_ERROR("Truth daughter of tau decay was not found in "<< m_truthParticleContainer.key() <<" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
235  return StatusCode::FAILURE;
236  }
237 
238  // if tau decays into tau this is not a proper tau decay
239  if ( xTruthDaughter->isTau() )
240  {
241  ATH_MSG_VERBOSE("Tau decays into a tau itself -> skip this decay");
242  return StatusCode::FAILURE;
243  }
244  }
245 
246  examineTruthTauDecay(xTruthParticle, truthInfo).ignore();
247 
248  if (truthInfo.m_bIsHadronicTau)
249  ATH_MSG_VERBOSE(truthInfo.m_iNChargedDaughters << " prong hadronic truth tau was found with uniqueID "<<HepMC::uniqueID(xTruthParticle));
250  else
251  ATH_MSG_VERBOSE(truthInfo.m_iNChargedDaughters << " prong leptonic truth tau was found with uniqueID "<<HepMC::uniqueID(xTruthParticle));
252  if ( truthInfo.m_iNChargedDaughters%2 == 0 )
253  {
254  ATH_MSG_WARNING("found tau with even multiplicity: " << truthInfo.m_iNChargedDaughters);
255  printDecay(xTruthParticle);
256  }
257 
258  static const SG::Decorator<double> decPtVis("pt_vis");
259  static const SG::Decorator<double> decEtaVis("eta_vis");
260  static const SG::Decorator<double> decPhiVis("phi_vis");
261  static const SG::Decorator<double> decMVis("m_vis");
262 
263  static const SG::Decorator<size_t> decNumCharged("numCharged");
264  static const SG::Decorator<size_t> decNumChargedPion("numChargedPion");
265  static const SG::Decorator<size_t> decNumNeutral("numNeutral");
266  static const SG::Decorator<size_t> decNumNeutralPion("numNeutralPion");
267 
268  decPtVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Pt();
269  decEtaVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Eta();
270  decPhiVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.Phi();
271  decMVis(xTruthParticle) = truthInfo.m_vTruthVisTLV.M();
272 
273  decNumCharged(xTruthParticle) = truthInfo.m_iNChargedDaughters;
274  decNumChargedPion(xTruthParticle) = truthInfo.m_iNChargedPions;
275  decNumNeutral(xTruthParticle) = truthInfo.m_iNNeutralPions+truthInfo.m_iNNeutralOthers;
276  decNumNeutralPion(xTruthParticle) = truthInfo.m_iNNeutralPions;
277 
278  static const SG::Decorator<char> decIsHadronicTau("IsHadronicTau");
279  decIsHadronicTau(xTruthParticle) = (char)truthInfo.m_bIsHadronicTau;
280 
282  {
283  TLorentzVector vTruthInvisTLV = xTruthParticle.p4() - truthInfo.m_vTruthVisTLV;
284  static const SG::Decorator<double> decPtInvis("pt_invis");
285  static const SG::Decorator<double> decEtaInvis("eta_invis");
286  static const SG::Decorator<double> decPhiInvis("phi_invis");
287  static const SG::Decorator<double> decMInvis("m_invis");
288  decPtInvis(xTruthParticle) = vTruthInvisTLV.Pt();
289  decEtaInvis(xTruthParticle) = vTruthInvisTLV.Eta();
290  decPhiInvis(xTruthParticle) = vTruthInvisTLV.Phi();
291  decMInvis(xTruthParticle) = vTruthInvisTLV.M();
292  }
293 
295  {
296  static const SG::Decorator<double> decPtVisCharged("pt_vis_charged");
297  static const SG::Decorator<double> decEtaVisCharged("eta_vis_charged");
298  static const SG::Decorator<double> decPhiVisCharged("phi_vis_charged");
299  static const SG::Decorator<double> decMVisCharged("m_vis_charged");
300  decPtVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Pt();
301  decEtaVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Eta();
302  decPhiVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.Phi();
303  decMVisCharged(xTruthParticle) = truthInfo.m_vTruthVisTLVCharged.M();
304  }
305 
307  {
308  static const SG::Decorator<double> decPtVisNeutral("pt_vis_neutral");
309  static const SG::Decorator<double> decEtaVisNeutral("eta_vis_neutral");
310  static const SG::Decorator<double> decPhiVisNeutral("phi_vis_neutral");
311  static const SG::Decorator<double> decMVisNeutral("m_vis_neutral");
312  decPtVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Pt();
313  decEtaVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Eta();
314  decPhiVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.Phi();
315  decMVisNeutral(xTruthParticle) = truthInfo.m_vTruthVisTLVNeutral.M();
316  }
317 
319  {
320  static const SG::Decorator<std::vector<int> > decDecayModeVector("DecayModeVector");
321  decDecayModeVector(xTruthParticle) = truthInfo.m_vDecayMode;
322  }
323 
324  if ( m_bWriteVertices )
325  {
326  // tau decay vertex
327  static const SG::Decorator<float> decDecayVertexX("decay_vertex_x");
328  static const SG::Decorator<float> decDecayVertexY("decay_vertex_y");
329  static const SG::Decorator<float> decDecayVertexZ("decay_vertex_z");
330 
331  decDecayVertexX(xTruthParticle) = truthInfo.m_vDecayVertex.X();
332  decDecayVertexY(xTruthParticle) = truthInfo.m_vDecayVertex.Y();
333  decDecayVertexZ(xTruthParticle) = truthInfo.m_vDecayVertex.Z();
334 
335  // tau production vertex
336  static const SG::Decorator<float> decProdVertexX("prod_vertex_x");
337  static const SG::Decorator<float> decProdVertexY("prod_vertex_y");
338  static const SG::Decorator<float> decProdVertexZ("prod_vertex_z");
339 
340  decProdVertexX(xTruthParticle) = truthInfo.m_vProdVertex.X();
341  decProdVertexY(xTruthParticle) = truthInfo.m_vProdVertex.Y();
342  decProdVertexZ(xTruthParticle) = truthInfo.m_vProdVertex.Z();
343  }
344 
345  return StatusCode::SUCCESS;
346 }
347 
348 //______________________________________________________________________________
350  TauTruthInfo& truthInfo) const
351 {
352  // get vertex and check if it exists
353  const xAOD::TruthVertex* xDecayVertex = xTruthParticle.decayVtx();
354  if (!xDecayVertex)
355  return StatusCode::SUCCESS;
356 
357  truthInfo.m_vDecayVertex.SetXYZ(xDecayVertex->x(),xDecayVertex->y(),xDecayVertex->z());
358 
359  if (xTruthParticle.hasProdVtx() ) {
360  const xAOD::TruthVertex* xProdVertex = xTruthParticle.prodVtx();
361  truthInfo.m_vProdVertex.SetXYZ(xProdVertex->x(),xProdVertex->y(),xProdVertex->z());
362  } else {
363  truthInfo.m_vProdVertex.SetXYZ(-1234,-1234,-1234);
364  }
365 
366  for ( size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->nOutgoingParticles(); ++iOutgoingParticle )
367  {
368  const xAOD::TruthParticle* xTruthDaughter = xDecayVertex->outgoingParticle(iOutgoingParticle);
369  if (xTruthDaughter == nullptr)
370  {
371  ATH_MSG_ERROR("Truth daughter of tau decay was not found in "<< m_truthParticleContainer.key() <<" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
372  return StatusCode::FAILURE;
373  }
374 
375  int iAbsPdgId = xTruthDaughter->absPdgId();
376  int iPdgId = xTruthDaughter->pdgId();
377 
378  // look at decay of unstable particles
379  if (MC::isDecayed(xTruthDaughter) || !MC::isPhysical(xTruthDaughter))
380  {
381  if ( iAbsPdgId != 111 && iAbsPdgId != 311 && iAbsPdgId != 310 && iAbsPdgId != 130 )
382  {
383  examineTruthTauDecay(*xTruthDaughter, truthInfo).ignore();
384  continue;
385  }
386  }
387 
388  // only process stable particles
389  if (!MC::isStable(xTruthDaughter) && !MC::isDecayed(xTruthDaughter))
390  continue;
391 
392  // add pdgID to vector for decay mode classification
393  truthInfo.m_vDecayMode.push_back(iPdgId);
394 
395  // if tau decays leptonically, indicated by an electron/muon neutrino then
396  // it is not a hadronic decay
397  if ( xTruthDaughter->isHadron() )
398  truthInfo.m_bIsHadronicTau = true;
399 
400  // ignore neutrinos for further progress
401  if ( xTruthDaughter->isNeutrino() )
402  {
403  ATH_MSG_VERBOSE("found neutrino decay particle with PdgId "<<iPdgId);
404  continue;
405  }
406 
407  // add momentum of non-neutrino particle to visible momentum
408  truthInfo.m_vTruthVisTLV += xTruthDaughter->p4();
410  if ( xTruthDaughter->isCharged() )
411  truthInfo.m_vTruthVisTLVCharged += xTruthDaughter->p4();
413  if ( xTruthDaughter->isNeutral() )
414  truthInfo.m_vTruthVisTLVNeutral += xTruthDaughter->p4();
415 
416  // only count charged decay particles
417  if ( xTruthDaughter->isCharged() )
418  {
419  ATH_MSG_VERBOSE("found charged decay particle with PdgId "<<iPdgId);
420  truthInfo.m_iNChargedDaughters++;
421  // count charged pions
422  if (iAbsPdgId==211) truthInfo.m_iNChargedPions++;
423  else truthInfo.m_iNChargedOthers++;
424  }
425  else
426  {
427  ATH_MSG_VERBOSE("found neutral decay particle with PdgId "<<iPdgId);
428  // count neutral pions
429  if (iAbsPdgId==111) truthInfo.m_iNNeutralPions++;
430  else truthInfo.m_iNNeutralOthers++;
431  }
432  }
433  return StatusCode::SUCCESS;
434 }
435 
436 void BuildTruthTaus::printDecay(const xAOD::TruthParticle& xTruthParticle, int depth) const
437 {
438  // loop over all decay particles, print their kinematic and other properties
439 
440  const xAOD::TruthVertex* xDecayVertex = xTruthParticle.decayVtx();
441  if (xDecayVertex == nullptr)
442  return;
443 
444  for ( size_t iOutgoingParticle = 0; iOutgoingParticle < xDecayVertex->nOutgoingParticles(); ++iOutgoingParticle )
445  {
446  const xAOD::TruthParticle* xTruthDaughter = xDecayVertex->outgoingParticle(iOutgoingParticle);
447  if (xTruthDaughter == nullptr)
448  {
449  ATH_MSG_WARNING("Truth daughter of tau decay was not found in "<< m_truthParticleContainer.key() <<" container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.");
450  return;
451  }
452  ATH_MSG_WARNING("depth "<<depth
453  <<" e "<<xTruthDaughter->e()
454  <<" eta "<<xTruthDaughter->p4().Eta()
455  <<" phi "<<xTruthDaughter->p4().Phi()
456  <<" pdgid "<<xTruthDaughter->pdgId()
457  <<" status "<<xTruthDaughter->status()
458  <<" uniqueID "<<HepMC::uniqueID(xTruthDaughter));
459  printDecay(*xTruthDaughter, depth+1);
460  }
461 }
TauAnalysisTools::BuildTruthTaus::examineTruthTau
StatusCode examineTruthTau(const xAOD::TruthParticle &xTruthParticle) const
Definition: BuildTruthTaus.cxx:216
asg::AnaToolHandle::initialize
StatusCode initialize()
initialize the tool
TauAnalysisTools::BuildTruthTaus::m_bWriteInvisibleFourMomentum
Gaudi::Property< bool > m_bWriteInvisibleFourMomentum
Definition: BuildTruthTaus.h:114
WriteHandle.h
Handle class for recording to StoreGate.
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_iNChargedOthers
size_t m_iNChargedOthers
Definition: BuildTruthTaus.h:79
TauAnalysisTools
Definition: TruthCollectionMakerTau.h:16
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_vTruthVisTLV
TLorentzVector m_vTruthVisTLV
Definition: BuildTruthTaus.h:87
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
xAOD::TruthParticle_v1::absPdgId
int absPdgId() const
Absolute PDG ID code (often useful)
TauAnalysisTools::BuildTruthTaus::m_tMCTruthClassifier
asg::AnaToolHandle< IMCTruthClassifier > m_tMCTruthClassifier
Definition: BuildTruthTaus.h:131
TauAnalysisTools::BuildTruthTaus::m_truthElectronContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthElectronContainer
Definition: BuildTruthTaus.h:123
TauAnalysisTools::BuildTruthTaus::m_bWriteVertices
Gaudi::Property< bool > m_bWriteVertices
Definition: BuildTruthTaus.h:118
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TauAnalysisTools::BuildTruthTaus::TauTruthInfo
Definition: BuildTruthTaus.h:76
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_vDecayVertex
TVector3 m_vDecayVertex
Definition: BuildTruthTaus.h:92
TauAnalysisTools::BuildTruthTaus::printDecay
void printDecay(const xAOD::TruthParticle &xTruthParticle, int depth=0) const
Definition: BuildTruthTaus.cxx:436
SG::Accessor< char >
TauAnalysisTools::IBuildTruthTaus::ITruthTausEvent
Declare the interface that the class provides.
Definition: IBuildTruthTaus.h:35
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_iNNeutralPions
size_t m_iNNeutralPions
Definition: BuildTruthTaus.h:78
SG::ReadHandle< xAOD::TruthParticleContainer >
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_bIsHadronicTau
bool m_bIsHadronicTau
Definition: BuildTruthTaus.h:84
initialize
void initialize()
Definition: run_EoverP.cxx:894
TauAnalysisTools::BuildTruthTaus::retrieveTruthTaus
virtual StatusCode retrieveTruthTaus() override
Definition: BuildTruthTaus.cxx:82
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_vDecayMode
std::vector< int > m_vDecayMode
Definition: BuildTruthTaus.h:82
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_vTruthVisTLVCharged
TLorentzVector m_vTruthVisTLVCharged
Definition: BuildTruthTaus.h:88
TauAnalysisTools::BuildTruthTaus::m_truthTauOutputContainer
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_truthTauOutputContainer
Definition: BuildTruthTaus.h:127
TauAnalysisTools::BuildTruthTaus::m_truthMatchingMode
bool m_truthMatchingMode
Definition: BuildTruthTaus.h:129
TauAnalysisTools::BuildTruthTaus::m_bWriteDecayModeVector
Gaudi::Property< bool > m_bWriteDecayModeVector
Definition: BuildTruthTaus.h:117
MCTruthClassifier.h
TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleChargedFourMomentum
Gaudi::Property< bool > m_bWriteVisibleChargedFourMomentum
Definition: BuildTruthTaus.h:115
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
ASG_MAKE_ANA_TOOL
#define ASG_MAKE_ANA_TOOL(handle, type)
create the tool in the given tool handle
Definition: AnaToolHandle.h:690
asg::AnaToolHandle::setProperty
StatusCode setProperty(const std::string &property, const T2 &value)
set the given property of the tool.
xAOD::TruthVertex_v1::y
float y() const
Vertex y displacement.
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
MC::isPhysical
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
Definition: HepMCHelpers.h:51
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_vProdVertex
TVector3 m_vProdVertex
Definition: BuildTruthTaus.h:93
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::TruthParticle_v1::e
virtual double e() const override final
The total energy of the particle.
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TauAnalysisTools::BuildTruthTaus::m_bTruthTauAvailable
bool m_bTruthTauAvailable
Definition: BuildTruthTaus.h:109
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::TruthParticle_v1::isTau
bool isTau() const
Whether the particle is a tau (or antitau)
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
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_iNChargedPions
size_t m_iNChargedPions
Definition: BuildTruthTaus.h:77
TauAnalysisTools::BuildTruthTaus::buildTruthTausFromTruthParticles
StatusCode buildTruthTausFromTruthParticles(TruthTausEvent &truthTausEvent) const
Definition: BuildTruthTaus.cxx:161
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::TruthParticle_v1::isCharged
bool isCharged() const
Whether the particle is electrically charged.
BuildTruthTaus.h
TruthVertex.h
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
TauAnalysisTools::BuildTruthTaus::m_truthTausEvent
TruthTausEvent m_truthTausEvent
Definition: BuildTruthTaus.h:106
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MagicNumbers.h
ReadHandle.h
Handle class for reading from StoreGate.
TauAnalysisTools::BuildTruthTaus::m_truthTauInputContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthTauInputContainer
Definition: BuildTruthTaus.h:121
Accessor.h
Helper class to provide type-safe access to aux data.
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_vTruthVisTLVNeutral
TLorentzVector m_vTruthVisTLVNeutral
Definition: BuildTruthTaus.h:89
EventInfo.h
MCTruthClassifier
Definition: MCTruthClassifier.h:56
xAOD::TruthVertex_v1::x
float x() const
Vertex x displacement.
TauAnalysisTools::BuildTruthTaus::m_truthJetContainer
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetContainer
Definition: BuildTruthTaus.h:125
xAOD::TruthParticle_v1::status
int status() const
Status code.
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
IMCTruthClassifier::particleTruthClassifier
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const =0
TauAnalysisTools::BuildTruthTaus::m_truthMuonContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthMuonContainer
Definition: BuildTruthTaus.h:124
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MC::isDecayed
bool isDecayed(const T &p)
Identify if the particle decayed.
Definition: HepMCHelpers.h:42
xAOD::TruthVertex_v1::z
float z() const
Vertex longitudinal distance along the beam line form the origin.
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
TauAnalysisTools::BuildTruthTaus::m_bWriteVisibleNeutralFourMomentum
Gaudi::Property< bool > m_bWriteVisibleNeutralFourMomentum
Definition: BuildTruthTaus.h:116
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_iNNeutralOthers
size_t m_iNNeutralOthers
Definition: BuildTruthTaus.h:80
xAOD::TruthParticle_v1::isNeutrino
bool isNeutrino() const
Whether the particle is a neutrino (or antineutrino)
TauAnalysisTools::BuildTruthTaus::TauTruthInfo::m_iNChargedDaughters
size_t m_iNChargedDaughters
Definition: BuildTruthTaus.h:81
TauAnalysisTools::BuildTruthTaus::m_truthParticleContainer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainer
Definition: BuildTruthTaus.h:122
xAOD::TruthParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TruthParticle_v1.cxx:196
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
TauAnalysisTools::BuildTruthTaus::examineTruthTauDecay
StatusCode examineTruthTauDecay(const xAOD::TruthParticle &xTruthParticle, TauTruthInfo &truthInfo) const
Definition: BuildTruthTaus.cxx:349
xAOD::TruthParticle_v1::isNeutral
bool isNeutral() const
Whether the particle is electrically neutral.
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:119
xAOD::TruthParticle_v1::isHadron
bool isHadron() const
Whether the particle is a hadron.