ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetTrackSummaryHelperTool Class Referencefinal

#include <InDetTrackSummaryHelperTool.h>

Inheritance diagram for InDet::InDetTrackSummaryHelperTool:
Collaboration diagram for InDet::InDetTrackSummaryHelperTool:

Public Member Functions

 InDetTrackSummaryHelperTool (const std::string &, const std::string &, const IInterface *)
 constructor
virtual ~InDetTrackSummaryHelperTool ()=default
 destructor
virtual StatusCode initialize () override
 standard AlgTool methods: initialise retrieves Tools, finalize does nothing
virtual StatusCode finalize () override
virtual void analyse (const EventContext &ctx, const Trk::Track &track, const Trk::RIO_OnTrack *rot, const Trk::TrackStateOnSurface *tsos, std::vector< int > &information, std::bitset< Trk::numberOfDetectorTypes > &hitPattern) const override final
virtual void analyse (const EventContext &ctx, const Trk::Track &track, const Trk::CompetingRIOsOnTrack *crot, const Trk::TrackStateOnSurface *tsos, std::vector< int > &information, std::bitset< Trk::numberOfDetectorTypes > &hitPattern) const override final
virtual void addDetailedTrackSummary (const EventContext &ctx, const Trk::Track &, Trk::TrackSummary &) const override final
virtual void searchForHoles (const Trk::Track &track, std::vector< int > &information, const Trk::ParticleHypothesis partHyp=Trk::pion) const override final
 Input : track, partHyp Output: Changes in information This method first calls the method getListOfHits to isolate the relevant hits on the track before calling the method performHoleSearchStepWise which then performs the actual hole search.

Private Attributes

const PixelIDm_pixelId { nullptr }
 ID pixel helper.
const SCT_IDm_sctId { nullptr }
 ID SCT helper.
const TRT_IDm_trtId { nullptr }
 ID TRT helper.
ToolHandle< Trk::ITrackHoleSearchToolm_holeSearchTool
ToolHandle< ITRT_StrawStatusSummaryToolm_TRTStrawSummaryTool
BooleanProperty m_usePixel { this, "usePixel", true }
BooleanProperty m_useSCT { this, "useSCT", true }
BooleanProperty m_useTRT { this, "useTRT", true }

Detailed Description

Definition at line 39 of file InDetTrackSummaryHelperTool.h.

Constructor & Destructor Documentation

◆ InDetTrackSummaryHelperTool()

InDet::InDetTrackSummaryHelperTool::InDetTrackSummaryHelperTool ( const std::string & t,
const std::string & n,
const IInterface * p )

constructor

Definition at line 25 of file InDetTrackSummaryHelperTool.cxx.

29 : base_class(t, n, p)
30{}

◆ ~InDetTrackSummaryHelperTool()

virtual InDet::InDetTrackSummaryHelperTool::~InDetTrackSummaryHelperTool ( )
virtualdefault

destructor

Member Function Documentation

◆ addDetailedTrackSummary()

void InDet::InDetTrackSummaryHelperTool::addDetailedTrackSummary ( const EventContext & ctx,
const Trk::Track & ,
Trk::TrackSummary &  ) const
finaloverridevirtual

Definition at line 238 of file InDetTrackSummaryHelperTool.cxx.

242{
243}

◆ analyse() [1/2]

void InDet::InDetTrackSummaryHelperTool::analyse ( const EventContext & ctx,
const Trk::Track & track,
const Trk::CompetingRIOsOnTrack * crot,
const Trk::TrackStateOnSurface * tsos,
std::vector< int > & information,
std::bitset< Trk::numberOfDetectorTypes > & hitPattern ) const
finaloverridevirtual

Definition at line 208 of file InDetTrackSummaryHelperTool.cxx.

215{
216 // re-produce prior behaviour (i.e. just take most probable ROT)
217 analyse(ctx,
218 track,
219 &crot->rioOnTrack(crot->indexOfMaxAssignProb()),
220 tsos,
221 information,
222 hitPattern);
223}
virtual void analyse(const EventContext &ctx, const Trk::Track &track, const Trk::RIO_OnTrack *rot, const Trk::TrackStateOnSurface *tsos, std::vector< int > &information, std::bitset< Trk::numberOfDetectorTypes > &hitPattern) const override final
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.

◆ analyse() [2/2]

void InDet::InDetTrackSummaryHelperTool::analyse ( const EventContext & ctx,
const Trk::Track & track,
const Trk::RIO_OnTrack * rot,
const Trk::TrackStateOnSurface * tsos,
std::vector< int > & information,
std::bitset< Trk::numberOfDetectorTypes > & hitPattern ) const
finaloverridevirtual

Definition at line 67 of file InDetTrackSummaryHelperTool.cxx.

74{
75 const Identifier& id = rot->identify();
76 bool isOutlier = tsos->type(Trk::TrackStateOnSurface::Outlier);
77 bool ispatterntrack = (track.info().trackFitter() == Trk::TrackInfo::Unknown);
78
79 if (m_usePixel and m_pixelId->is_pixel(id)
80 and (not isOutlier or ispatterntrack)) {
81 // ME: outliers on pattern tracks may be
82 // reintegrated by fitter, so count them as hits
83
84 information[Trk::numberOfPixelHits]++;
85 if (m_pixelId->layer_disk(id) == 0 and m_pixelId->is_barrel(id))
87 if (m_pixelId->layer_disk(id) == 1 and m_pixelId->is_barrel(id))
89
90 // check to see if there's an ambiguity with the ganged cluster.
91 const PixelClusterOnTrack* pix = nullptr;
93 pix = static_cast<const PixelClusterOnTrack*>(rot);
94 }
95 if (not pix) {
96 ATH_MSG_ERROR("Could not cast pixel RoT to PixelClusterOnTrack!");
97 } else {
98 if (pix->isBroadCluster())
99 information[Trk::numberOfPixelSpoiltHits]++;
100 if (pix->hasClusterAmbiguity()) {
101 information[Trk::numberOfGangedPixels]++;
102 if (pix->isFake())
103 information[Trk::numberOfGangedFlaggedFakes]++;
104 }
105
106 if ((m_pixelId->is_barrel(id))) {
107 int offset = m_pixelId->layer_disk(id);
108 if (not hitPattern.test(offset))
109 information[Trk::numberOfContribPixelLayers]++;
110 hitPattern.set(offset); // assumes numbered consecutively
111 } else {
112 int offset = static_cast<int>(Trk::pixelEndCap0); // get int value of first pixel endcap disc
113 offset += m_pixelId->layer_disk(id);
114 if (not hitPattern.test(offset))
115 information[Trk::numberOfContribPixelLayers]++;
116 hitPattern.set(offset); // assumes numbered consecutively
117 }
118 }
119
120 } else if (m_useSCT and m_sctId->is_sct(id)
121 and (not isOutlier or ispatterntrack)) {
122 // ME: outliers on pattern tracks may be
123 // reintegrated by fitter, so count them as hits
124
125 information[Trk::numberOfSCTHits]++;
126
127 const InDet::SCT_ClusterOnTrack* sctclus = nullptr;
129 sctclus = static_cast<const InDet::SCT_ClusterOnTrack*>(rot);
130 }
131 if (not sctclus) {
132 ATH_MSG_ERROR("Could not cast SCT RoT to SCT_ClusterOnTrack!");
133 } else {
134 if (sctclus->isBroadCluster())
135 information[Trk::numberOfSCTSpoiltHits]++;
136 }
137
138 if ((m_sctId->is_barrel(id))) {
139 int offset = static_cast<int>(Trk::sctBarrel0);
140 hitPattern.set(offset + m_sctId->layer_disk(id)); // assumes numbered consecutively
141 } else {
142 int offset = static_cast<int>(Trk::sctEndCap0); // get int value of first sct endcap disc
143 hitPattern.set(offset + m_sctId->layer_disk(id)); // assumes numbered consecutively
144 }
145
146 } else if (m_useTRT and m_trtId->is_trt(id)) {
147 bool isArgonStraw = false;
148 bool isKryptonStraw = false;
149 if (not m_TRTStrawSummaryTool.empty()) {
150 int statusHT = m_TRTStrawSummaryTool->getStatusHT(id, ctx);
151 if (statusHT == TRTCond::StrawStatus::Argon or
152 statusHT == TRTCond::StrawStatus::Dead or
154 isArgonStraw = true;
155 }
156 if (statusHT == TRTCond::StrawStatus::Krypton or
158 isKryptonStraw = true;
159 }
160 }
161 if (not isArgonStraw and not isKryptonStraw) {
162 information[Trk::numberOfTRTXenonHits]++;
163 }
164
165 if (isOutlier and not ispatterntrack) {
166 // ME: outliers on pattern tracks may be
167 // reintegrated by fitter, so count them as hits
168 information[Trk::numberOfTRTOutliers]++;
169
170 const InDet::TRT_DriftCircleOnTrack* trtDriftCircle = nullptr;
172 trtDriftCircle = static_cast<const InDet::TRT_DriftCircleOnTrack*>(rot);
173 }
174 if (not trtDriftCircle) {
175 ATH_MSG_ERROR("Could not cast TRT RoT to TRT_DriftCircleOnTracknot ");
176 } else {
177 if (trtDriftCircle->highLevel() and not isArgonStraw and
178 not isKryptonStraw)
180 }
181 } else {
182 information[Trk::numberOfTRTHits]++;
183 double error2 = rot->localCovariance()(0, 0);
184 if (error2 > 1)
185 information[Trk::numberOfTRTTubeHits]++;
186
187 const InDet::TRT_DriftCircleOnTrack* trtDriftCircle = nullptr;
189 trtDriftCircle = static_cast<const InDet::TRT_DriftCircleOnTrack*>(rot);
190 }
191 if (not trtDriftCircle) {
192 ATH_MSG_ERROR("Could not cast TRT RoT to TRT_DriftCircleOnTracknot ");
193 } else {
194 if (trtDriftCircle->highLevel()) {
195 if (not isArgonStraw and not isKryptonStraw)
197 assert(Trk::numberOfTRTHighThresholdHitsTotal < information.size());
199 }
200 }
201 }
202
203 }
204
205}
#define ATH_MSG_ERROR(x)
ToolHandle< ITRT_StrawStatusSummaryTool > m_TRTStrawSummaryTool
const PixelID * m_pixelId
ID pixel helper.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Identifier identify() const
return the identifier -extends MeasurementBase
virtual bool rioType(RIO_OnTrackType::Type type) const =0
Method checking the Rio On Track type.
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ pixelEndCap0
three pixel discs (on each side)
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector
@ numberOfGangedPixels
number of Ganged Pixels flagged as fakes
@ numberOfPixelHits
number of pixel layers on track with absence of hits
@ numberOfTRTHighThresholdOutliers
number of dead TRT straws crossed
@ numberOfNextToInnermostPixelLayerHits
these are the pixel hits, including the b-layer
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
@ numberOfGangedFlaggedFakes
number of dead pixel sensors crossed
@ numberOfTRTTubeHits
number of TRT hits on track in straws with xenon
@ numberOfTRTHighThresholdHitsTotal
number of TRT hits used for dE/dx computation

◆ finalize()

StatusCode InDet::InDetTrackSummaryHelperTool::finalize ( )
overridevirtual

Definition at line 246 of file InDetTrackSummaryHelperTool.cxx.

247{
248 return StatusCode::SUCCESS;
249}

◆ initialize()

StatusCode InDet::InDetTrackSummaryHelperTool::initialize ( )
overridevirtual

standard AlgTool methods: initialise retrieves Tools, finalize does nothing

Definition at line 35 of file InDetTrackSummaryHelperTool.cxx.

36{
37 if (m_usePixel) {
38 if (detStore()->retrieve(m_pixelId, "PixelID").isFailure()) {
39 ATH_MSG_ERROR("Could not get PixelID helper !");
40 return StatusCode::FAILURE;
41 }
42 }
43
44 if (m_useSCT) {
45 if (detStore()->retrieve(m_sctId, "SCT_ID").isFailure()) {
46 ATH_MSG_ERROR("Could not get SCT_ID helper !");
47 return StatusCode::FAILURE;
48 }
49 }
50
51 if (m_useTRT) {
52 if (detStore()->retrieve(m_trtId, "TRT_ID").isFailure()) {
53 ATH_MSG_ERROR("Could not get TRT_ID helper !");
54 return StatusCode::FAILURE;
55 }
56 }
57
58 ATH_CHECK(m_holeSearchTool.retrieve(DisableTool{m_holeSearchTool.empty()}));
60 DisableTool{not m_useTRT or m_TRTStrawSummaryTool.empty()}));
61
62 return StatusCode::SUCCESS;
63}
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandle< Trk::ITrackHoleSearchTool > m_holeSearchTool
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ searchForHoles()

void InDet::InDetTrackSummaryHelperTool::searchForHoles ( const Trk::Track & track,
std::vector< int > & information,
const Trk::ParticleHypothesis partHyp = Trk::pion ) const
finaloverridevirtual

Input : track, partHyp Output: Changes in information This method first calls the method getListOfHits to isolate the relevant hits on the track before calling the method performHoleSearchStepWise which then performs the actual hole search.

Additionally the Layers of the Pixel Detector which contribute measurements to the track are counted If problems occur, the information counters for Holes and PixelLayers are reset to -1 flagging them as not set.

Definition at line 226 of file InDetTrackSummaryHelperTool.cxx.

230{
231 ATH_MSG_DEBUG("Do hole search within HELPER, PLEASE FIX THIS AFTER 16.0.X");
232 m_holeSearchTool->countHoles(track, information, partHyp);
233}
#define ATH_MSG_DEBUG(x)

Member Data Documentation

◆ m_holeSearchTool

ToolHandle<Trk::ITrackHoleSearchTool> InDet::InDetTrackSummaryHelperTool::m_holeSearchTool
private
Initial value:
{
this,
"HoleSearch",
"InDet::InDetTrackHoleSearchTool"
}

Definition at line 112 of file InDetTrackSummaryHelperTool.h.

112 {
113 this,
114 "HoleSearch",
115 "InDet::InDetTrackHoleSearchTool"
116 };

◆ m_pixelId

const PixelID* InDet::InDetTrackSummaryHelperTool::m_pixelId { nullptr }
private

ID pixel helper.

Definition at line 104 of file InDetTrackSummaryHelperTool.h.

104{ nullptr };

◆ m_sctId

const SCT_ID* InDet::InDetTrackSummaryHelperTool::m_sctId { nullptr }
private

ID SCT helper.

Definition at line 107 of file InDetTrackSummaryHelperTool.h.

107{ nullptr };

◆ m_trtId

const TRT_ID* InDet::InDetTrackSummaryHelperTool::m_trtId { nullptr }
private

ID TRT helper.

Definition at line 110 of file InDetTrackSummaryHelperTool.h.

110{ nullptr };

◆ m_TRTStrawSummaryTool

ToolHandle<ITRT_StrawStatusSummaryTool> InDet::InDetTrackSummaryHelperTool::m_TRTStrawSummaryTool
private
Initial value:
{
this,
"TRTStrawSummarySvc",
"TRT_StrawStatusSummaryTool",
"The ConditionsSummaryTool"
}

Definition at line 118 of file InDetTrackSummaryHelperTool.h.

118 {
119 this,
120 "TRTStrawSummarySvc",
121 "TRT_StrawStatusSummaryTool",
122 "The ConditionsSummaryTool"
123 };

◆ m_usePixel

BooleanProperty InDet::InDetTrackSummaryHelperTool::m_usePixel { this, "usePixel", true }
private

Definition at line 125 of file InDetTrackSummaryHelperTool.h.

125{ this, "usePixel", true };

◆ m_useSCT

BooleanProperty InDet::InDetTrackSummaryHelperTool::m_useSCT { this, "useSCT", true }
private

Definition at line 126 of file InDetTrackSummaryHelperTool.h.

126{ this, "useSCT", true };

◆ m_useTRT

BooleanProperty InDet::InDetTrackSummaryHelperTool::m_useTRT { this, "useTRT", true }
private

Definition at line 127 of file InDetTrackSummaryHelperTool.h.

127{ this, "useTRT", true };

The documentation for this class was generated from the following files: