|
ATLAS Offline Software
|
Helper tool to extract simple counts from a Trk::Track, Trk::TrackSummary or Trk::MuonTrackSummary.
More...
#include <MuonHitSummaryTool.h>
|
| MuonHitSummaryTool (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~MuonHitSummaryTool ()=default |
|
StatusCode | initialize () |
|
virtual CompactSummary | summary (const Trk::Track &track) const |
| Calculate compact summary. More...
|
|
virtual CompactSummary | summary (const Trk::TrackSummary &summary) const |
| Calculate compact summary. More...
|
|
virtual CompactSummary | summary (const Trk::MuonTrackSummary &summary) const |
| Calculate compact summary. More...
|
|
virtual CompactSummary | summary (const Muon::MuonSegment &segment) const |
| Calculate compact summary. More...
|
|
virtual CompactSummary | summary (const std::vector< const Muon::MuonSegment * > &segments) const |
| Calculate compact summary. More...
|
|
virtual CompactSummary | summary (const std::vector< const Trk::MeasurementBase * > &measurements) const |
| Calculate compact summary. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Helper tool to extract simple counts from a Trk::Track, Trk::TrackSummary or Trk::MuonTrackSummary.
Definition at line 24 of file MuonHitSummaryTool.h.
◆ StoreGateSvc_t
◆ MuonHitSummaryTool()
Muon::MuonHitSummaryTool::MuonHitSummaryTool |
( |
const std::string & |
ty, |
|
|
const std::string & |
na, |
|
|
const IInterface * |
pa |
|
) |
| |
◆ ~MuonHitSummaryTool()
virtual Muon::MuonHitSummaryTool::~MuonHitSummaryTool |
( |
| ) |
|
|
virtualdefault |
◆ calculateSummaryCounts()
Definition at line 139 of file MuonHitSummaryTool.cxx.
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();
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ getMuonTrackSummary()
◆ initialize()
StatusCode Muon::MuonHitSummaryTool::initialize |
( |
| ) |
|
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
const InterfaceID & Muon::IMuonHitSummaryTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ summary() [1/6]
◆ summary() [2/6]
Calculate compact summary.
- Parameters
-
segments | input vector of MuonSegments |
- Returns
- CompactSummary
Implements Muon::IMuonHitSummaryTool.
Definition at line 172 of file MuonHitSummaryTool.cxx.
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());
◆ summary() [3/6]
Calculate compact summary.
- Parameters
-
measurements | input vector of MeasurementBase |
- Returns
- CompactSummary
Implements Muon::IMuonHitSummaryTool.
Definition at line 181 of file MuonHitSummaryTool.cxx.
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) {
212 HitSummary& hitSummary =
sum.stationLayers[
index];
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) {
242 HitSummary& hitSummary =
sum.stationLayers[sit->first];
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;
◆ summary() [4/6]
Calculate compact summary.
Can fail if summary does not have a MuonTrackSummary.
- Parameters
-
summary | MuonTrackSummary of input track |
- Returns
- CompactSummary
Implements Muon::IMuonHitSummaryTool.
Definition at line 59 of file MuonHitSummaryTool.cxx.
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) {
92 HitSummary& hitSummary =
sum.stationLayers[
index];
96 hitSummary.nprecisionHits += chit->nhits();
97 hitSummary.nprecisionHoles += chit->nholes();
98 hitSummary.nprecisionOutliers += chit->noutliers();
99 hitSummary.nprecisionCloseHits += chit->ncloseHits();
100 hitSummary.nprecisionGoodHits += chit->ngoodHits();
101 hitSummary.noutBoundsHits += chit->noutBoundsHits();
104 hitSummary.nprecisionHits += chit->netaHits();
105 hitSummary.nprecisionGoodHits += chit->netaHits();
106 hitSummary.nprecisionHoles += chit->etaProjection().nholes;
107 hitSummary.nprecisionOutliers += chit->etaProjection().noutliers;
108 hitSummary.nprecisionCloseHits += chit->etaProjection().ncloseHits;
110 if (chit->netaHits() > 0) ++hitSummary.netaTriggerLayers;
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;
◆ summary() [5/6]
◆ summary() [6/6]
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_edmHelperSvc
Initial value:{
this,
"edmHelper",
"Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface",
}
Definition at line 77 of file MuonHitSummaryTool.h.
◆ m_evtStore
◆ m_idHelperSvc
Initial value:{
this,
"MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
}
Definition at line 72 of file MuonHitSummaryTool.h.
◆ m_printer
Initial value:{
this,
"Printer",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
}
Definition at line 84 of file MuonHitSummaryTool.h.
◆ m_summaryHelperTool
Initial value:{
this,
"MuonTrackSummaryHelperTool",
"Muon::MuonTrackSummaryHelperTool/MuonTrackSummaryHelperTool",
}
Definition at line 89 of file MuonHitSummaryTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
PhiIndex
enum to classify the different phi layers in the muon spectrometer
virtual void setOwner(IDataHandleHolder *o)=0
Detailed track summary for the muon system Give access to hit counts per chamber.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
A summary of the information contained by a track.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
StIndex
enum to classify the different station layers in the muon spectrometer
const MuonTrackSummary * muonTrackSummary() const
returns a pointer to the MuonTrackSummary if available
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)