ATLAS Offline Software
Classes | Namespaces | Functions
ParticleLevelEvent.h File Reference
#include <string>
#include <unordered_map>
#include <iostream>
#include "xAODEventInfo/EventInfo.h"
#include "xAODJet/JetContainer.h"
#include "xAODTruth/TruthParticleContainer.h"
#include "xAODMissingET/MissingET.h"
#include "TopEvent/Event.h"
Include dependency graph for ParticleLevelEvent.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  top::ParticleLevelEvent
 

Namespaces

 top
 TopConfig A simple configuration that is NOT a singleton.
 

Functions

std::ostream & operator<< (std::ostream &os, const top::ParticleLevelEvent &plEvent)
 Ostream overload operator. More...
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const top::ParticleLevelEvent plEvent 
)

Ostream overload operator.

Definition at line 7 of file ParticleLevelEvent.cxx.

7  {
8  if (plEvent.m_electrons) {
9  os << "Number of electrons: " << plEvent.m_electrons->size() << "\n";
10  for (const auto *elPtr : *plEvent.m_electrons) {
11  if (elPtr) {
12  os << " " << *elPtr << "\n";
13  }
14  }
15  } else {
16  os << "ParticleLevelEvent: Cannot find electron truth collection. Did you set the truth collection correctly?\n";
17  }
18 
19  if (plEvent.m_muons) {
20  os << "Number of muons: " << plEvent.m_muons->size() << "\n";
21  for (const auto *muPtr : *plEvent.m_muons) {
22  if (muPtr) {
23  os << " " << *muPtr << "\n";
24  }
25  }
26  } else {
27  os << "ParticleLevelEvent: Cannot find muon truth collection. Did you set the truth collection correctly?\n";
28  }
29 
30  if (plEvent.m_softmuons) {
31  os << "Number of soft muons: " << plEvent.m_softmuons->size() << "\n";
32  for (const auto *muPtr : *plEvent.m_softmuons) {
33  if (muPtr) {
34  os << " " << *muPtr << "\n";
35  }
36  }
37  } else {
38  os << "ParticleLevelEvent: Cannot find muon truth collection. Did you set the truth collection correctly?\n";
39  }
40 
41  if (plEvent.m_jets) {
42  os << "Number of jets: " << plEvent.m_jets->size() << "\n";
43  for (const auto *jetPtr : *plEvent.m_jets) {
44  if (jetPtr) {
45  os << " " << *jetPtr << "\n";
46  }
47  }
48  } else {
49  os << "ParticleLevelEvent: Cannot find jet truth collection. Did you set the truth collection correctly?\n";
50  }
51 
52  if (plEvent.m_largeRJets) {
53  os << "Number of large R jets: " << plEvent.m_largeRJets->size() << "\n";
54  for (const auto *largeRjetPtr : *plEvent.m_largeRJets) {
55  if (largeRjetPtr) {
56  os << " " << *largeRjetPtr << "\n";
57  }
58  }
59  } else {
60  os <<
61  "ParticleLevelEvent: Cannot find large R jets truth collection. Did you set the truth collection correctly?\n";
62  }
63 
64  if (plEvent.m_taus) {
65  os << "Number of taus: " << plEvent.m_taus->size() << "\n";
66  for (const auto *tauPtr : *plEvent.m_taus) {
67  if (tauPtr) {
68  os << " " << *tauPtr << "\n";
69  }
70  }
71  } else {
72  os << "ParticleLevelEvent: Cannot find tau truth collection. Did you set the truth collection correctly?\n";
73  }
74 
75  if (plEvent.m_photons) {
76  os << "Number of photons: " << plEvent.m_photons->size() << "\n";
77  for (const auto *phPtr : *plEvent.m_photons) {
78  if (phPtr) {
79  os << " " << *phPtr << "\n";
80  }
81  }
82  } else {
83  os << "ParticleLevelEvent: Cannot find photon truth collection. Did you set the truth collection correctly?\n";
84  }
85 
86  if (plEvent.m_met) {
87  os << *plEvent.m_met;
88  } else {
89  os <<
90  "ParticleLevelEvent: Cannot find MET (neutrino) truth collection. Did you set the truth collection correctly?\n";
91  }
92 
93  return os;
94 }
top::ParticleLevelEvent::m_muons
const xAOD::TruthParticleContainer * m_muons
Pointer to truth level muons.
Definition: ParticleLevelEvent.h:45
top::ParticleLevelEvent::m_jets
const xAOD::JetContainer * m_jets
Pointer to truth level jets.
Definition: ParticleLevelEvent.h:54
top::ParticleLevelEvent::m_taus
const xAOD::TruthParticleContainer * m_taus
Pointer to truth level photons.
Definition: ParticleLevelEvent.h:66
top::ParticleLevelEvent::m_largeRJets
const xAOD::JetContainer * m_largeRJets
Pointer to the truth level large R jets.
Definition: ParticleLevelEvent.h:63
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
top::ParticleLevelEvent::m_electrons
const xAOD::TruthParticleContainer * m_electrons
Pointer to truth level electrons.
Definition: ParticleLevelEvent.h:42
top::ParticleLevelEvent::m_photons
const xAOD::TruthParticleContainer * m_photons
Pointer to truth level photons.
Definition: ParticleLevelEvent.h:51
top::ParticleLevelEvent::m_softmuons
const xAOD::TruthParticleContainer * m_softmuons
Pointer to truth level soft-muons.
Definition: ParticleLevelEvent.h:48
top::ParticleLevelEvent::m_met
const xAOD::MissingET * m_met
Definition: ParticleLevelEvent.h:69
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.