ATLAS Offline Software
Loading...
Searching...
No Matches
IMuonSegmentHitSummaryTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUON_IMUONSEGMENTHITSUMMARYTOOL_H
6#define MUON_IMUONSEGMENTHITSUMMARYTOOL_H
7
8#include "GaudiKernel/IAlgTool.h"
9#include "Identifier/Identifier.h"
10
11namespace Muon {
12 class MuonSegment;
13
15 class IMuonSegmentHitSummaryTool : virtual public IAlgTool {
16 public:
17 // struct to allow us to count the number of trigger hits per gas gap in both projections
19 EtaPhiHitCount() = default;
20 uint8_t nphiHits{0};
21 uint8_t netaHits{0};
22 uint8_t operator()() const {return nphiHits + netaHits; }
23 bool hasEtaAndPhi() const {return nphiHits > 0 && netaHits > 0; }
24 };
25
26 using HitCountsPerLayer = std::map<Identifier, EtaPhiHitCount>; // map with hits per gas gap
27
29 MdtLayerIntersect() = default;
30 uint8_t nhits{0};
31 uint8_t nholes{0};
32 double distFromTubeEnd{0.};
33 double tubeLength{0.};
34 };
35 using MdtLayerIntersectMap = std::map<int, MdtLayerIntersect>;
36
37 struct HitCounts {
38 HitCounts() = default;
39 uint8_t nmdtHighADCHits{0}; // number of mdt hits with an ADC count above cut
40 uint8_t nmdtHitsMl1{0}; // number of mdt hits in the first multilayer
41 uint8_t nmdtHitsMl2{0}; // number of mdt hits in the second multilayer
42 uint8_t nmdtHoles{0}; // number of mdt holes
43 uint8_t nmdtHolesInChamber{0}; // number of mdt holes within the chamber bounds
44 uint8_t nmdtEnclosedHoles{0}; // number of mdt holes enclosed within hits
45 EtaPhiHitCount ncscHits{}; // Number of CSC hits
46 EtaPhiHitCount nstgcHits{}; // Number of sTGC hits
47
48 uint8_t nmmEtaHits{0};
49 uint8_t nmmStereoHits{0};
50
51 uint8_t nphiTrigHitLayers{0}; // number of trigger hit layers with phi hits
52 uint8_t netaTrigHitLayers{0}; // number of trigger hit layers with eta hits
53 uint8_t npairedTrigHitLayers{0}; // number of trigger layers with hits in both projections
54 uint8_t nexpectedTrigHitLayers{0}; // number of expected trigger layers
55 bool closeToChamberEdge{false};
56 double segmentQuality{0}; // segment quality number
57 int adcMax{-999}; // maximum ADC on segment
58
60 uint8_t nmdtHits() const { return nmdtHitsMl1 + nmdtHitsMl2; }
62 uint8_t nmmHits() const {return nmmEtaHits + nmmStereoHits; }
64 uint8_t nnswHits() const {return nmmHits() + nstgcHits();}
65 double goodADCFraction() const { return (double)nmdtHighADCHits / (double)nmdtHits(); }
66
67 // count number of hits and holes per layer
69
70 // hit counts per layer
72
74 std::string print() const;
75 };
76
77 static const InterfaceID& interfaceID() {
78 static const InterfaceID IID_IMuonSegmentHitSummaryTool("Muon::IMuonSegmentHitSummaryTool", 1, 0);
79 return IID_IMuonSegmentHitSummaryTool;
80 }
81
85 virtual HitCounts getHitCounts(const MuonSegment& seg) const = 0;
86 };
87
89 std::ostringstream sout;
90 sout << "HitCounts: ";
91 if (nmdtHits()) sout << " MDT ml1 " << std::setw(3) <<(int) nmdtHitsMl1 << " ml2 " << std::setw(3) <<(int) nmdtHitsMl2;
92 if (nmdtHoles )
93 sout << " holes " << std::setw(3) << nmdtHoles << " in chamber " << std::setw(3) << nmdtHolesInChamber << " enclosed "
94 << std::setw(3) << nmdtEnclosedHoles << " quality " << segmentQuality;
95 if (ncscHits()) sout << " CSC eta " << std::setw(3) << (int) ncscHits.netaHits << " phi " << std::setw(3) << (int) ncscHits.nphiHits;
96 if (nmmHits()) sout << " Micromega eta " << std::setw(3) << (int) nmmEtaHits << " stereo " << std::setw(3) << (int) nmmStereoHits;
97 if (nstgcHits()) sout << " sTGC eta " << std::setw(3) << (int) nstgcHits.netaHits << " phi " << std::setw(3) << (int) nstgcHits.netaHits;
98
99 if (netaTrigHitLayers != 0) sout << " Trig eta " << std::setw(3) << (int)netaTrigHitLayers;
100 if (nphiTrigHitLayers != 0) sout << " Trig phi " << std::setw(3) << (int)nphiTrigHitLayers;
101 if (npairedTrigHitLayers != 0) sout << " Trig pairs " << std::setw(3) << (int)npairedTrigHitLayers;
102 if (closeToChamberEdge) sout << " on edge";
103 return sout.str();
104 }
105
106} // namespace Muon
107
108#endif // IMuonSegmentHitSummaryTool
Interface for tools providing segment hit summary information.
std::map< Identifier, EtaPhiHitCount > HitCountsPerLayer
virtual HitCounts getHitCounts(const MuonSegment &seg) const =0
get hits counts for a segment
static const InterfaceID & interfaceID()
std::map< int, MdtLayerIntersect > MdtLayerIntersectMap
This is the common class for 3D segments used in the muon spectrometer.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
uint8_t nmmStereoHits
Number of eta micromega hits.
std::string print() const
dump content to a string
uint8_t nmdtHits() const
Returns the number of hits in both MDT layers.
uint8_t nnswHits() const
Returns the number of hits in the NSW.
uint8_t nmmHits() const
Returns the number of hits in the micromegas.
uint8_t nphiTrigHitLayers
Number of eta stereo hits.