ATLAS Offline Software
MuonSimuTrack.cxx
Go to the documentation of this file.
1 /* // -*- C++ -*- */
2 
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
8 #include <math.h>
9 #include <iostream>
10 #include <iomanip>
11 
13 
15 RPCtrigDataObject(number,"SimulatedMuonTrack")
16 {
17  this->m_event_number = data.event_number;
18  this->m_vertex_number = data.vertex_number;
19  this->m_track_number = data.track_number;
20 
21  this->m_Px = data.Px;
22  this->m_Py = data.Py;
23  this->m_Pz = data.Pz;
24  this->m_Energy = data.Energy;
25 }
26 
29 {
30  this->m_event_number = muon.event_number();
31  this->m_vertex_number = muon.vertex_number();
32  this->m_track_number = muon.track_number();
33 
34  this->m_Px = muon.Px();
35  this->m_Py = muon.Py();
36  this->m_Pz = muon.Pz();
37  this->m_Energy = muon.Energy();
38 }
39 
41 {
42  static_cast<RPCtrigDataObject&>(*this) =
43  static_cast<const RPCtrigDataObject&>(muon);
44  this->m_event_number = muon.event_number();
45  this->m_vertex_number = muon.vertex_number();
46  this->m_track_number = muon.track_number();
47 
48  this->m_Px = muon.Px();
49  this->m_Py = muon.Py();
50  this->m_Pz = muon.Pz();
51  this->m_Energy = muon.Energy();
52 
53  return *this;
54 }
55 
56 float MuonSimuTrack::Pt(void) const
57 {
58  return sqrt(m_Px * m_Px + m_Py * m_Py);
59 }
60 
62 {
63  return atan(this->Pt()/fabsf(this->m_Pz));
64 }
65 
67 {
68  float eta = -log(tan(this->generation_theta()/2.));
69  return (this->m_Pz > 0.)? eta : -eta;
70 }
71 
73 {
74  return atan2(this->m_Py,this->m_Px);
75 }
76 
77 void MuonSimuTrack::Print(std::ostream& stream,bool detail) const
78 {
79  unsigned int upper = 17;
80  unsigned int lower = 19;
81 
82  for(int i=0;i<61;++i) stream << (char) upper;
83  stream << std::endl;
84 
85  stream << " Muon track number " << track_number() <<
86  " from vertex n. " << vertex_number() <<
87  ", belonging to event " << event_number() <<
88  ":" << std::endl;
89  stream << " generation eta = " << std::setw(6) << generation_eta() <<
90  " generation phi = " << std::setw(6) << generation_phi() <<
91  std::endl;
92 
93  if (detail)
94  {
95  stream << " Px = " << std::setw(7) << Px() <<
96  ", Py = " << std::setw(7) << Py() <<
97  ", Pz = " << std::setw(7) << Pz() <<
98  ", Energy = " << std::setw(7) << Energy() << std::endl;
99  }
100 
101  for(int i=0;i<61;++i) stream << (char) lower;
102  stream << std::endl;
103 }
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
MuonSimuTrack::Pz
float Pz(void) const
Definition: MuonSimuTrack.h:86
MuonSimuTrack::m_Px
float m_Px
Definition: MuonSimuTrack.h:62
MuonSimuTrack::m_event_number
int m_event_number
Definition: MuonSimuTrack.h:58
MuonSimuTrack.h
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
MuonSimuTrack::m_Energy
float m_Energy
Definition: MuonSimuTrack.h:65
MuonSimuTrack::Print
void Print(std::ostream &, bool) const
Definition: MuonSimuTrack.cxx:77
SimuTrackData::track_number
int track_number
Definition: MuonSimuTrack.h:46
detail
Definition: extract_histogram_tag.cxx:14
upper
int upper(int c)
Definition: LArBadChannelParser.cxx:49
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
SimuTrackData
Definition: MuonSimuTrack.h:43
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
MuonSimuTrack::Py
float Py(void) const
Definition: MuonSimuTrack.h:85
MuonSimuTrack::operator=
MuonSimuTrack operator=(const MuonSimuTrack &)
Definition: MuonSimuTrack.cxx:40
MuonSimuTrack::generation_eta
float generation_eta(void) const
Definition: MuonSimuTrack.cxx:66
lumiFormat.i
int i
Definition: lumiFormat.py:85
SimuTrackData::event_number
int event_number
Definition: MuonSimuTrack.h:44
MuonSimuTrack::m_track_number
int m_track_number
Definition: MuonSimuTrack.h:60
MuonSimuTrack::m_Py
float m_Py
Definition: MuonSimuTrack.h:63
MuonSimuTrack::track_number
int track_number(void) const
Definition: MuonSimuTrack.h:77
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
MuonSimuTrack::Energy
float Energy(void) const
Definition: MuonSimuTrack.h:87
SimuTrackData::Pz
float Pz
Definition: MuonSimuTrack.h:50
MuonSimuTrack::Pt
float Pt(void) const
Definition: MuonSimuTrack.cxx:56
MuonSimuTrack::generation_phi
float generation_phi(void) const
Definition: MuonSimuTrack.cxx:72
python.selection.number
number
Definition: selection.py:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
RPCtrigDataObject
Definition: RPCtrigDataObject.h:15
MuonSimuTrack::generation_theta
float generation_theta(void) const
Definition: MuonSimuTrack.cxx:61
MuonSimuTrack::Px
float Px(void) const
Definition: MuonSimuTrack.h:84
SimuTrackData::vertex_number
int vertex_number
Definition: MuonSimuTrack.h:45
MuonSimuTrack::MuonSimuTrack
MuonSimuTrack(int, const SimuTrackData &)
Definition: MuonSimuTrack.cxx:14
MuonSimuTrack::m_Pz
float m_Pz
Definition: MuonSimuTrack.h:64
SimuTrackData::Energy
float Energy
Definition: MuonSimuTrack.h:51
MuonSimuTrack::m_vertex_number
int m_vertex_number
Definition: MuonSimuTrack.h:59
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SimuTrackData::Px
float Px
Definition: MuonSimuTrack.h:48
MuonSimuTrack::event_number
int event_number(void) const
Definition: MuonSimuTrack.h:75
SimuTrackData::Py
float Py
Definition: MuonSimuTrack.h:49
MuonSimuTrack::vertex_number
int vertex_number(void) const
Definition: MuonSimuTrack.h:76
MuonSimuTrack
Definition: MuonSimuTrack.h:56