ATLAS Offline Software
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 
11 namespace 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
18  struct EtaPhiHitCount {
19  EtaPhiHitCount() = default;
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;
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 
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 
88  inline std::string IMuonSegmentHitSummaryTool::HitCounts::print() const {
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
Muon::IMuonSegmentHitSummaryTool::HitCounts::HitCounts
HitCounts()=default
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Muon::IMuonSegmentHitSummaryTool::MdtLayerIntersect::MdtLayerIntersect
MdtLayerIntersect()=default
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmmStereoHits
uint8_t nmmStereoHits
Number of eta micromega hits.
Definition: IMuonSegmentHitSummaryTool.h:49
Muon::IMuonSegmentHitSummaryTool::MdtLayerIntersectMap
std::map< int, MdtLayerIntersect > MdtLayerIntersectMap
Definition: IMuonSegmentHitSummaryTool.h:35
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmdtHitsMl1
uint8_t nmdtHitsMl1
Definition: IMuonSegmentHitSummaryTool.h:40
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmdtHighADCHits
uint8_t nmdtHighADCHits
Definition: IMuonSegmentHitSummaryTool.h:39
Muon::IMuonSegmentHitSummaryTool::EtaPhiHitCount::hasEtaAndPhi
bool hasEtaAndPhi() const
Definition: IMuonSegmentHitSummaryTool.h:23
Muon::IMuonSegmentHitSummaryTool::HitCounts::adcMax
int adcMax
Definition: IMuonSegmentHitSummaryTool.h:57
Muon::IMuonSegmentHitSummaryTool::MdtLayerIntersect
Definition: IMuonSegmentHitSummaryTool.h:28
Muon::IMuonSegmentHitSummaryTool::EtaPhiHitCount
Definition: IMuonSegmentHitSummaryTool.h:18
Muon::IMuonSegmentHitSummaryTool::MdtLayerIntersect::tubeLength
double tubeLength
Definition: IMuonSegmentHitSummaryTool.h:33
Muon::IMuonSegmentHitSummaryTool::HitCounts::npairedTrigHitLayers
uint8_t npairedTrigHitLayers
Definition: IMuonSegmentHitSummaryTool.h:53
Muon::IMuonSegmentHitSummaryTool::HitCounts::mdtHitHolePerLayerCounts
MdtLayerIntersectMap mdtHitHolePerLayerCounts
Definition: IMuonSegmentHitSummaryTool.h:68
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::IMuonSegmentHitSummaryTool::HitCounts::print
std::string print() const
dump content to a string
Definition: IMuonSegmentHitSummaryTool.h:88
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
Muon::IMuonSegmentHitSummaryTool::HitCounts::nnswHits
uint8_t nnswHits() const
Returns the number of hits in the NSW.
Definition: IMuonSegmentHitSummaryTool.h:64
Muon::IMuonSegmentHitSummaryTool::HitCounts::netaTrigHitLayers
uint8_t netaTrigHitLayers
Definition: IMuonSegmentHitSummaryTool.h:52
Muon::IMuonSegmentHitSummaryTool::getHitCounts
virtual HitCounts getHitCounts(const MuonSegment &seg) const =0
get hits counts for a segment
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmdtHits
uint8_t nmdtHits() const
Returns the number of hits in both MDT layers.
Definition: IMuonSegmentHitSummaryTool.h:60
Muon::IMuonSegmentHitSummaryTool
Interface for tools providing segment hit summary information.
Definition: IMuonSegmentHitSummaryTool.h:15
Muon::IMuonSegmentHitSummaryTool::HitCounts::nexpectedTrigHitLayers
uint8_t nexpectedTrigHitLayers
Definition: IMuonSegmentHitSummaryTool.h:54
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmdtHolesInChamber
uint8_t nmdtHolesInChamber
Definition: IMuonSegmentHitSummaryTool.h:43
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmmHits
uint8_t nmmHits() const
Returns the number of hits in the micromegas.
Definition: IMuonSegmentHitSummaryTool.h:62
Muon::IMuonSegmentHitSummaryTool::HitCounts::closeToChamberEdge
bool closeToChamberEdge
Definition: IMuonSegmentHitSummaryTool.h:55
Muon::IMuonSegmentHitSummaryTool::EtaPhiHitCount::EtaPhiHitCount
EtaPhiHitCount()=default
Muon::IMuonSegmentHitSummaryTool::interfaceID
static const InterfaceID & interfaceID()
Definition: IMuonSegmentHitSummaryTool.h:77
Muon::IMuonSegmentHitSummaryTool::HitCountsPerLayer
std::map< Identifier, EtaPhiHitCount > HitCountsPerLayer
Definition: IMuonSegmentHitSummaryTool.h:26
Muon::IMuonSegmentHitSummaryTool::MdtLayerIntersect::nholes
uint8_t nholes
Definition: IMuonSegmentHitSummaryTool.h:31
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
Muon::IMuonSegmentHitSummaryTool::MdtLayerIntersect::nhits
uint8_t nhits
Definition: IMuonSegmentHitSummaryTool.h:30
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmdtEnclosedHoles
uint8_t nmdtEnclosedHoles
Definition: IMuonSegmentHitSummaryTool.h:44
Muon::IMuonSegmentHitSummaryTool::EtaPhiHitCount::operator()
uint8_t operator()() const
Definition: IMuonSegmentHitSummaryTool.h:22
Muon::IMuonSegmentHitSummaryTool::HitCounts::nphiTrigHitLayers
uint8_t nphiTrigHitLayers
Number of eta stereo hits.
Definition: IMuonSegmentHitSummaryTool.h:51
Muon::IMuonSegmentHitSummaryTool::HitCounts::nstgcHits
EtaPhiHitCount nstgcHits
Definition: IMuonSegmentHitSummaryTool.h:46
Muon::IMuonSegmentHitSummaryTool::MdtLayerIntersect::distFromTubeEnd
double distFromTubeEnd
Definition: IMuonSegmentHitSummaryTool.h:32
Muon::IMuonSegmentHitSummaryTool::HitCounts
Definition: IMuonSegmentHitSummaryTool.h:37
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmdtHoles
uint8_t nmdtHoles
Definition: IMuonSegmentHitSummaryTool.h:42
Muon::IMuonSegmentHitSummaryTool::HitCounts::ncscHits
EtaPhiHitCount ncscHits
Definition: IMuonSegmentHitSummaryTool.h:45
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmmEtaHits
uint8_t nmmEtaHits
Definition: IMuonSegmentHitSummaryTool.h:48
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
Muon::IMuonSegmentHitSummaryTool::HitCounts::hitCountsPerLayer
HitCountsPerLayer hitCountsPerLayer
Definition: IMuonSegmentHitSummaryTool.h:71
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
Muon::IMuonSegmentHitSummaryTool::HitCounts::segmentQuality
double segmentQuality
Definition: IMuonSegmentHitSummaryTool.h:56
Muon::IMuonSegmentHitSummaryTool::EtaPhiHitCount::netaHits
uint8_t netaHits
Definition: IMuonSegmentHitSummaryTool.h:21
Muon::IMuonSegmentHitSummaryTool::HitCounts::goodADCFraction
double goodADCFraction() const
Definition: IMuonSegmentHitSummaryTool.h:65
Muon::IMuonSegmentHitSummaryTool::EtaPhiHitCount::nphiHits
uint8_t nphiHits
Definition: IMuonSegmentHitSummaryTool.h:20
Muon::IMuonSegmentHitSummaryTool::HitCounts::nmdtHitsMl2
uint8_t nmdtHitsMl2
Definition: IMuonSegmentHitSummaryTool.h:41