go back through the chamber, nallhitsinroad - nhitsontrack = ncloseHits for both projection1 and projection2 pass chamber summary to function calculateRoadHits(currentChamberSummary)
calculate road hits for last chamber on track (otherwise it would have been skipped)
115 {
116 if (
summary.m_muonTrackSummary) {
117 ATH_MSG_DEBUG(
"TrackSummary already has detailed muon track summary, not adding a new one");
118 return;
119 }
120 const EventContext& ctx = Gaudi::Hive::currentContext();
121 SG::ReadCondHandle<MuonGM::MuonDetectorManager> DetectorManagerHandle{
m_DetectorManagerKey, ctx};
122 const MuonGM::MuonDetectorManager* MuonDetMgr{*DetectorManagerHandle};
123 if (MuonDetMgr == nullptr) {
124 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
125 return;
126 }
127
130
132 if (!states ||
states->empty()) {
return; }
133
134 Trk::MuonTrackSummary* muonTrackSummary = new Trk::MuonTrackSummary();
135 Trk::MuonTrackSummary& trackSummary = *muonTrackSummary;
136
137 Trk::MuonTrackSummary::ChamberHitSummary* currentChamberSummary = nullptr;
139
140
143 for (; tsit != tsit_end; ++tsit) {
145
148 continue;
149 }
150
152 if (!pars) {
153 ATH_MSG_WARNING(
" Hole state without track parameters, cannot identify hole ");
154 continue;
155 }
156 if (
pars->associatedSurface().associatedDetectorElement()) {
157 Identifier
id =
pars->associatedSurface().associatedDetectorElement()->identify();
159 if (issTgc) {
160
161 Identifier idh =
pars->associatedSurface().associatedDetectorElementIdentifier();
163 }
166
170
171
172 if (!currentChamberSummary || currentChamberSummary->
m_chId != chId) {
179 }
180
181
182 if (currentChamberSummary && !currentChamberSummary->
isMdt()) {
updateHoleContent(*currentChamberSummary); }
183
187 currentChamberPars =
pars;
188 }
189 if (!issTgc) {
190 Trk::MuonTrackSummary::ChamberHitSummary::Projection&
proj =
191 isFirst ? currentChamberSummary->
m_first : currentChamberSummary->
m_second;
193 } else {
194
197 Trk::MuonTrackSummary::ChamberHitSummary::Projection&
proj = currentChamberSummary->
m_second;
199 } else {
201 Trk::MuonTrackSummary::ChamberHitSummary::Projection&
proj = currentChamberSummary->
m_first;
203 }
204 }
205 }
206 continue;
207 }
208
209
210 const Trk::MeasurementBase* meas = (*tsit)->measurementOnTrack();
211 if (!meas) { continue; }
212
213 const Trk::PseudoMeasurementOnTrack* pseudo = dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(meas);
214 if (pseudo) {
216 continue;
217 }
218
219 if (!pars) {
221 continue;
222 }
223
227 continue;
228 }
229 bool inBounds = true;
230
232 std::set<Identifier> layIds;
233 std::set<Identifier> goodLayIds;
234
235
236 const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(meas);
237 if (rot) {
240
241
242 double tol1 = 100.;
243 double tol2 = 2 * tol1;
245
246
247 const Trk::StraightLineSurface* slSurf =
dynamic_cast<const Trk::StraightLineSurface*
>(&meas->
associatedSurface());
248
249 const MMClusterOnTrack* mmClusterOnTrack = dynamic_cast<const MMClusterOnTrack*>(meas);
250
251 if (slSurf) {
252
254 } else if (mmClusterOnTrack) {
255
256 inBounds = mmClusterOnTrack->detectorElement()->insideActiveBounds(id, locPos, tol1, tol2);
257 } else {
259 }
260
262 layIds.insert(layId);
263 const MdtDriftCircleOnTrack* mdtdc = dynamic_cast<const MdtDriftCircleOnTrack*>(rot);
264 if (mdtdc) {
265 MuonDriftCircleErrorStrategy errStrat = mdtdc->
errorStrategy();
268 goodLayIds.insert(layId);
269 }
271 const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(rot);
274 goodLayIds.insert(layId);
276
277 goodLayIds.insert(layId);
279
280 goodLayIds.insert(layId);
281 }
282 } else {
283 const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(meas);
284 if (crot) {
286
287
289
290
291 std::vector<const Muon::MuonClusterOnTrack*>::const_iterator cl_it = crot->
containedROTs().begin();
292 std::vector<const Muon::MuonClusterOnTrack*>::const_iterator cl_it_end = crot->
containedROTs().end();
293 for (; cl_it != cl_it_end; ++cl_it) {
294
295 Identifier layId =
m_idHelperSvc->layerId((*cl_it)->identify());
296 layIds.insert(layId);
298 const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(rot);
299 if (cscClus) {
302 goodLayIds.insert(layId);
303 }
304 }
305 }
306 } else {
307 continue;
308 }
309 }
311
317
319 if (!currentChamberSummary || currentChamberSummary->
m_chId != chId) {
323 }
324
325
326 if (currentChamberSummary && !currentChamberSummary->
isMdt()) {
updateHoleContent(*currentChamberSummary); }
327
331 currentChamberPars =
pars;
332 }
333
334 Trk::MuonTrackSummary::ChamberHitSummary::Projection&
proj =
335 isFirst ? currentChamberSummary->
m_first : currentChamberSummary->
m_second;
336
338
339 if (isMdt && pars) {
343 if (rTrack > rDrift && rTrack < innerRadius) {
345 continue;
346 }
347 }
349
350 } else {
351 proj.nhits += layIds.size();
352 proj.ngoodHits += goodLayIds.size();
353 }
354 if (!inBounds && isMdt)
proj.noutBounds++;
355
356 }
357
363 }
364
365
366 if (currentChamberSummary && !currentChamberSummary->
isMdt()) {
updateHoleContent(*currentChamberSummary); }
367
368 summary.m_muonTrackSummary.reset(muonTrackSummary);
369}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
DataModel_detail::const_iterator< DataVector > const_iterator
bool is_valid() const
Check if id is in a valid state.
const MuonDriftCircleErrorStrategy & errorStrategy() const
Get information about the creation strategy used by Muon::MdtDriftCircleOnTrackCreator when making th...
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
CscClusterStatus status() const
Returns Csc position measurement status flag.
@ StationError
A term is added to account for misaligned.
@ FixedError
A fixed error is given to this hit (user defined via jobProperties)
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
std::vector< ChamberHitSummary > m_chamberHitSummary
unsigned int m_nscatterers
unsigned int m_npseudoMeasurements
Identifier identify() const
return the identifier -extends MeasurementBase
virtual const SurfaceBounds & bounds() const override final
This method returns the bounds of the Surface by reference.
virtual bool insideLoc2(const Amg::Vector2D &locpo, double tol2=0.) const =0
Extend the interface to for single inside Loc 1 / Loc2 tests.
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
@ Hole
A hole on the track - this is defined in the following way.
Eigen::Matrix< double, 2, 1 > Vector2D
@ CscStatusUnspoiled
Clean cluster with precision fit.
@ CscStatusSplitUnspoiled
Clean cluster with precision fit after split cluster.
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersBase< TrackParametersDim, Charged > TrackParameters
bool isMdt() const
returns whether this is a MDT chamber