17 declareInterface<IMuonHitSummaryTool>(
this);
25 return StatusCode::SUCCESS;
45 if (
track.trackSummary() &&
track.trackSummary()->muonTrackSummary())
return summary(*
track.trackSummary()->muonTrackSummary());
55 if (
sum.muonTrackSummary())
return summary(*
sum.muonTrackSummary());
62 std::map<int, int> sectorLayerCounts;
65 std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit =
s.chamberHitSummary().begin();
66 std::vector<Trk::MuonTrackSummary::ChamberHitSummary>::const_iterator chit_end =
s.chamberHitSummary().end();
67 for (; chit != chit_end; ++chit) {
73 bool isEIPrec = isCsc || isMM || issTgc;
76 if ((isMdt && chit->nhits() > 0) || (isEIPrec && chit->netaHits() > 0)) {
79 sectorLayerCounts[sector] += chit->nhits();
81 sectorLayerCounts[sector] += chit->netaHits();
82 sum.sectors.insert(sector);
86 if (!isMdt && chit->nphiHits() > 0) {
112 if (chit->nphiHits() > 0) ++hitSummary.
nphiLayers;
113 if (chit->nphiHits() > 0 && chit->netaHits() > 0) ++hitSummary.
netaPhiLayers;
115 if (!isEIPrec && chit->etaProjection().nholes > 0 && chit->etaProjection().nhits == 0) ++hitSummary.
netaTriggerHoleLayers;
116 if (chit->phiProjection().nholes > 0 && chit->phiProjection().nhits == 0) ++hitSummary.
nphiHoleLayers;
124 for (; secIt != secIt_end; ++secIt) {
125 if (secIt->second > maxHits) {
126 maxHits = secIt->second;
127 mainSec = secIt->first;
130 sum.mainSector = mainSec;
140 sum.nprecisionLayers = 0;
141 sum.nprecisionGoodLayers = 0;
142 sum.nprecisionHoleLayers = 0;
144 sum.ntrigEtaLayers = 0;
145 sum.nphiHoleLayers = 0;
146 sum.ntrigEtaHoleLayers = 0;
148 std::map<MuonStationIndex::StIndex, Muon::IMuonHitSummaryTool::HitSummary>::const_iterator hsit =
sum.stationLayers.begin();
149 std::map<MuonStationIndex::StIndex, Muon::IMuonHitSummaryTool::HitSummary>::const_iterator hsit_end =
sum.stationLayers.end();
150 for (; hsit != hsit_end; ++hsit) {
156 ++
sum.nprecisionLayers;
158 ++
sum.nprecisionGoodLayers;
163 ++
sum.nprecisionHoleLayers;
165 sum.nphiLayers =
sum.phiLayers.size();
173 std::vector<const Trk::MeasurementBase*> rioVec;
174 std::vector<const Muon::MuonSegment*>::const_iterator sit = segments.begin();
175 std::vector<const Muon::MuonSegment*>::const_iterator sit_end = segments.end();
176 for (; sit != sit_end; ++sit)
177 rioVec.insert(rioVec.end(), (*sit)->containedMeasurements().begin(), (*sit)->containedMeasurements().end());
183 std::map<int, int> sectorLayerCounts;
185 std::map<MuonStationIndex::StIndex, std::map<MuonStationIndex::PhiIndex, std::pair<int, int> > > countLayersPerStation;
187 std::vector<const Trk::MeasurementBase*>::const_iterator
it = rioVec.begin();
188 std::vector<const Trk::MeasurementBase*>::const_iterator it_end = rioVec.end();
189 for (;
it != it_end; ++
it) {
198 if (isMdt || (isCsc && !measuresPhi)) {
200 if (isMdt) ++sectorLayerCounts[sector];
201 if (isCsc) ++sectorLayerCounts[sector];
202 sum.sectors.insert(sector);
206 if (!isMdt && measuresPhi) {
213 if (isMdt || (isCsc && !measuresPhi)) ++hitSummary.
nprecisionHits;
217 std::pair<int, int> etaPhiCount = countLayersPerStation[
index][pindex];
221 ++etaPhiCount.second;
229 for (; secIt != secIt_end; ++secIt) {
230 if (secIt->second > maxHits) {
231 maxHits = secIt->second;
232 mainSec = secIt->first;
235 sum.mainSector = mainSec;
237 std::map<MuonStationIndex::StIndex, std::map<MuonStationIndex::PhiIndex, std::pair<int, int> > >
::iterator sit =
238 countLayersPerStation.begin();
239 std::map<MuonStationIndex::StIndex, std::map<MuonStationIndex::PhiIndex, std::pair<int, int> > >
::iterator sit_end =
240 countLayersPerStation.end();
241 for (; sit != sit_end; ++sit) {
244 std::map<MuonStationIndex::PhiIndex, std::pair<int, int> >
::iterator pit = sit->second.begin();
245 std::map<MuonStationIndex::PhiIndex, std::pair<int, int> >
::iterator pit_end = sit->second.end();
246 for (; pit != pit_end; ++pit) {
247 if (pit->second.first != 0) ++hitSummary.
nphiLayers;
249 if (pit->second.second != 0 && pit->second.first != 0) ++hitSummary.
netaPhiLayers;