MuonTrackSummary.cxx 4.67 KB
Newer Older
1
2
3
4
5
6
7
/*
  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/

#include "TrkTrackSummary/MuonTrackSummary.h"

#include "GaudiKernel/MsgStream.h"
8
#include <iostream>
9

10
11
12
13
Trk::MuonTrackSummary::MuonTrackSummary()
  : m_nscatterers(0)
  , m_npseudoMeasurements(0)
{}
14

15
Trk::MuonTrackSummary::~MuonTrackSummary() {}
16

17
18
19
unsigned int
Trk::MuonTrackSummary::netaHits() const
{
20
21

  unsigned int count = 0;
22
23
24
25
26
27
  std::vector<ChamberHitSummary>::const_iterator it =
    m_chamberHitSummary.begin();
  std::vector<ChamberHitSummary>::const_iterator it_end =
    m_chamberHitSummary.end();
  for (; it != it_end; ++it)
    count += it->netaHits();
28
29
30
  return count;
}

31
32
33
unsigned int
Trk::MuonTrackSummary::nphiHits() const
{
34
  unsigned int count = 0;
35
36
37
38
39
40
  std::vector<ChamberHitSummary>::const_iterator it =
    m_chamberHitSummary.begin();
  std::vector<ChamberHitSummary>::const_iterator it_end =
    m_chamberHitSummary.end();
  for (; it != it_end; ++it)
    count += it->nphiHits();
41
42
43
  return count;
}

44
45
46
unsigned int
Trk::MuonTrackSummary::nholes() const
{
47
  unsigned int count = 0;
48
49
50
51
52
53
  std::vector<ChamberHitSummary>::const_iterator it =
    m_chamberHitSummary.begin();
  std::vector<ChamberHitSummary>::const_iterator it_end =
    m_chamberHitSummary.end();
  for (; it != it_end; ++it)
    count += it->nholes();
54
55
56
  return count;
}

57
58
59
unsigned int
Trk::MuonTrackSummary::noutliers() const
{
60
  unsigned int count = 0;
61
62
63
64
65
66
  std::vector<ChamberHitSummary>::const_iterator it =
    m_chamberHitSummary.begin();
  std::vector<ChamberHitSummary>::const_iterator it_end =
    m_chamberHitSummary.end();
  for (; it != it_end; ++it)
    count += it->noutliers();
67
68
69
  return count;
}

70
71
72
unsigned int
Trk::MuonTrackSummary::ncloseHits() const
{
73
  unsigned int count = 0;
74
75
76
77
78
79
  std::vector<ChamberHitSummary>::const_iterator it =
    m_chamberHitSummary.begin();
  std::vector<ChamberHitSummary>::const_iterator it_end =
    m_chamberHitSummary.end();
  for (; it != it_end; ++it)
    count += it->ncloseHits();
80
81
82
  return count;
}

83
84
std::ostream&
Trk::operator<<(std::ostream& out, const MuonTrackSummary& trackSum)
85
{
86
87
88
89
90
91
92
  out << "MuonTrackSummary: npseudo " << trackSum.npseudoMeasurements()
      << " nscat " << trackSum.nscatterers() << " number of chambers "
      << trackSum.chamberHitSummary().size() << std::endl;
  std::vector<MuonTrackSummary::ChamberHitSummary>::const_iterator it =
    trackSum.chamberHitSummary().begin();
  std::vector<MuonTrackSummary::ChamberHitSummary>::const_iterator it_end =
    trackSum.chamberHitSummary().end();
93

94
  for (; it != it_end; ++it) {
95
    const MuonTrackSummary::ChamberHitSummary& chSum = *it;
96
97
98
99
100
101
102
103
104
105
106
107
    const MuonTrackSummary::ChamberHitSummary::Projection& etaP =
      chSum.etaProjection();
    const MuonTrackSummary::ChamberHitSummary::Projection& phiP =
      chSum.phiProjection();
    out << " Chamber " << chSum.chamberId() << " isMdt " << chSum.isMdt()
        << std::endl
        << " First projection: Hits " << etaP.nhits << " holes " << etaP.nholes
        << " outlier " << etaP.noutliers << " deltas " << etaP.ndeltas
        << " close Hits " << etaP.ncloseHits << std::endl
        << " Second projection: Hits " << phiP.nhits << " holes " << phiP.nholes
        << " outlier " << phiP.noutliers << " deltas " << phiP.ndeltas
        << " close Hits " << phiP.ncloseHits << std::endl;
108
109
110
111
  }
  return out;
}

112
113
MsgStream&
Trk::operator<<(MsgStream& out, const MuonTrackSummary& trackSum)
114
{
115
116
117
118
119
120
121
122
123
124
  out << "MuonTrackSummary: Hits: eta " << trackSum.netaHits() << " phi "
      << trackSum.nphiHits() << " holes " << trackSum.nholes() << " outliers "
      << trackSum.noutliers() << " close hits " << trackSum.ncloseHits()
      << endmsg;
  if (out.level() <= MSG::VERBOSE) {
    std::vector<MuonTrackSummary::ChamberHitSummary>::const_iterator it =
      trackSum.chamberHitSummary().begin();
    std::vector<MuonTrackSummary::ChamberHitSummary>::const_iterator it_end =
      trackSum.chamberHitSummary().end();
    for (; it != it_end; ++it) {
125
      const MuonTrackSummary::ChamberHitSummary& chSum = *it;
126
127
128
129
130
131
132
133
134
135
136
137
      const MuonTrackSummary::ChamberHitSummary::Projection& etaP =
        chSum.etaProjection();
      const MuonTrackSummary::ChamberHitSummary::Projection& phiP =
        chSum.phiProjection();
      out << " Chamber " << chSum.chamberId() << " isMdt " << chSum.isMdt()
          << std::endl
          << " First projection: Hits " << etaP.nhits << " holes "
          << etaP.nholes << " outlier " << etaP.noutliers << " deltas "
          << etaP.ndeltas << " close Hits " << etaP.ncloseHits << std::endl
          << " Second projection: Hits " << phiP.nhits << " holes "
          << phiP.nholes << " outlier " << phiP.noutliers << " deltas "
          << phiP.ndeltas << " close Hits " << phiP.ncloseHits << std::endl;
138
139
140
141
    }
  }
  return out;
}