ATLAS Offline Software
Event.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #include "TopEvent/Event.h"
6 #include "TopEvent/EventTools.h"
7 
11 #include "xAODMuon/MuonContainer.h"
12 #include "xAODJet/JetContainer.h"
17 #include "xAODTruth/TruthVertex.h"
18 #include "xAODCore/ShallowCopy.h"
19 
20 #include <iomanip>
21 
22 std::ostream & operator << (std::ostream& os, const TLorentzVector& v) {
23  os << "TLorentzVector" <<
24  " pt=" << v.Pt() <<
25  " eta " << v.Eta() <<
26  " phi " << v.Phi() <<
27  " m " << v.M();
28 
29  return os;
30 }
31 
32 std::ostream& operator << (std::ostream& os, const top::Event& event) {
33 // os << *event.m_info << "\n";
34 
35  os << "Electrons: " << event.m_electrons.size() << "\n";
36  for (const auto* const elPtr : event.m_electrons) {
37  os << " " << *elPtr << "\n";
38  }
39  os << "FwdElectrons: " << event.m_fwdElectrons.size() << "\n";
40  for (const auto* const elPtr : event.m_fwdElectrons) {
41  os << " " << *elPtr << "\n";
42  }
43  os << "Muons: " << event.m_muons.size() << "\n";
44  for (const auto* const muPtr : event.m_muons) {
45  os << " " << *muPtr << "\n";
46  }
47  os << "Soft Muons: " << event.m_softmuons.size() << "\n";
48  for (const auto* const muPtr : event.m_softmuons) {
49  os << " " << *muPtr << "\n";
50  }
51  os << "Jets: " << event.m_jets.size() << "\n";
52  for (const auto* const jetPtr : event.m_jets) {
53  os << " " << *jetPtr << "\n";
54  }
55  os << "Fail-JVT jets: " << event.m_failJvt_jets.size() << "\n";
56  for (const auto* const jetPtr : event.m_failJvt_jets) {
57  os << " " << *jetPtr << "\n";
58  }
59  os << "Fail-FJVT jets: " << event.m_failFJvt_jets.size() << "\n";
60  for (const auto* const jetPtr : event.m_failFJvt_jets) {
61  os << " " << *jetPtr << "\n";
62  }
63  os << "Large jets: " << event.m_largeJets.size() << "\n";
64  for (const auto* const jetPtr : event.m_largeJets) {
65  os << " " << *jetPtr << "\n";
66  }
67  os << "Track jets: " << event.m_trackJets.size() << "\n";
68  for (const auto* const jetPtr : event.m_trackJets) {
69  os << " " << *jetPtr << "\n";
70  }
71  os << "Tracks: " << event.m_tracks.size() << "\n";
72  for (const auto* const trackPtr : event.m_tracks) {
73  os << " " << *trackPtr << "\n";
74  }
75  os << "Taus: " << event.m_tauJets.size() << "\n";
76  for (const auto* const tauPtr : event.m_tauJets) {
77  os << " " << *tauPtr << "\n";
78  }
79  os << "MET: " << *event.m_met << "\n";
80 
81  return os;
82 }
83 
84 /*
85  std::ostream& operator<<(std::ostream& os, const xAOD::EventInfo& ei) {
86  os << "EventInfo" <<
87  " isSimulation " << std::boolalpha << ei.eventType(xAOD::EventInfo::IS_SIMULATION) <<
88  " runNumber " << ei.runNumber() <<
89  " eventNumber " << ei.eventNumber() <<
90  " <mu> " << ei.averageInteractionsPerCrossing();
91 
92  if (ei.eventType(xAOD::EventInfo::IS_SIMULATION)) {
93  os << " mcChannelNumber " << ei.mcChannelNumber() <<
94  " mcEventWeight " << ei.mcEventWeight();
95  }
96 
97  return os;
98  }*/
99 
100 std::ostream& operator << (std::ostream& os, const xAOD::Electron& el) {
101  os << "Electron" <<
102  " author " << el.author() <<
103  " pt " << el.pt() <<
104  " eta " << el.eta() <<
105  " phi " << el.phi() <<
106  " m " << el.m() <<
107  " charge " << el.charge();
108 
109  return os;
110 }
111 
112 std::ostream& operator << (std::ostream& os, const xAOD::Muon& mu) {
113  os << "Muon" <<
114  " author " << mu.author() <<
115  " pt " << mu.pt() <<
116  " eta " << mu.eta() <<
117  " phi " << mu.phi() <<
118  " m " << mu.m() <<
119  " charge " << mu.charge();
120 
121  return os;
122 }
123 
124 std::ostream& operator << (std::ostream& os, const xAOD::Jet& jet) {
125  os << "Jet" <<
126  " pt " << jet.pt() <<
127  " eta " << jet.eta() <<
128  " phi " << jet.phi() <<
129  " m " << jet.m();
130 
131  return os;
132 }
133 
134 std::ostream& operator << (std::ostream& os, const xAOD::TauJet& tau) {
135  os << "TauJet" <<
136  " pt " << tau.pt() <<
137  " eta " << tau.eta() <<
138  " phi " << tau.phi() <<
139  " m " << tau.m() <<
140  " charge " << tau.charge();
141 
142  return os;
143 }
144 
145 std::ostream& operator << (std::ostream& os, const xAOD::TrackParticle& track) {
146  os << "Track" <<
147  " pt " << track.pt() <<
148  " eta " << track.eta() <<
149  " phi " << track.phi() <<
150  " m " << track.m();
151 
152  return os;
153 }
154 
155 
156 std::ostream& operator << (std::ostream& os, const xAOD::TruthParticle& truth) {
157  const unsigned int w = 10;
158 
159  os << "TruthParticle" <<
160  " pdg " << std::setw(w) << truth.pdgId() <<
161  " status " << std::setw(w) << truth.status() <<
162  " pt " << std::setw(w) << truth.pt() <<
163  " eta " << std::setw(w) << truth.eta() <<
164  " phi " << std::setw(w) << truth.phi() <<
165  " e " << std::setw(w) << truth.e() <<
166  " m " << std::setw(w) << truth.p4().M();
167 
168  return os;
169 }
170 
171 std::ostream& operator << (std::ostream& os, const xAOD::MissingET& met) {
172  os << "MET" <<
173  " et " << met.met() <<
174  " phi " << met.phi() << "\n";
175 
176  return os;
177 }
ShallowCopy.h
xAOD::TauJet_v3::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
TruthParticleContainer.h
xAOD::TauJet_v3::m
virtual double m() const
The invariant mass of the particle.
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
xAOD::TauJet_v3::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
xAOD::TauJet_v3::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
met
Definition: IMETSignificance.h:24
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
xAOD::TruthParticle_v1::e
virtual double e() const override final
The total energy of the particle.
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
ElectronContainer.h
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
TauJetContainer.h
Event.h
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TruthVertex.h
xAOD::TruthParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TruthParticle_v1.cxx:174
xAOD::Electron_v1
Definition: Electron_v1.h:34
EventInfo.h
MuonContainer.h
python.PyAthena.v
v
Definition: PyAthena.py:157
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::TruthParticle_v1::status
int status() const
Status code.
ElectronContainerFwd.h
JetContainer.h
xAOD::TruthParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
Definition: TruthParticle_v1.cxx:181
xAOD::TauJet_v3::charge
float charge() const
xAOD::TruthParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TruthParticle_v1.cxx:166
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::TruthParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TruthParticle_v1.cxx:196
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
operator<<
std::ostream & operator<<(std::ostream &os, const TLorentzVector &v)
Definition: Event.cxx:22
MissingETContainer.h
TrackParticleContainer.h