24 base_class(ty, na, pa), m_magFieldProperties(
Trk::
NoField) {}
46 return StatusCode::SUCCESS;
50 const std::set<Identifier>& chIds)
const {
52 std::vector<const MdtPrepData*> mdtPrds =
extractPrds(ctx, chIds);
54 if (mdtPrds.empty()) {
64 const std::set<IdentifierHash>& chIdHs)
const {
66 std::vector<const MdtPrepData*> mdtPrds =
extractPrds(ctx, chIdHs);
68 if (mdtPrds.empty()) {
78 const std::vector<const MdtPrepData*>& mdtPrds)
const {
80 bool doHoleSearch =
true;
83 std::vector<const MdtDriftCircleOnTrack*> mdtROTs;
84 mdtROTs.reserve(mdtPrds.size());
87 if (mdtROTs.empty()) {
93 double roadWidthEta = 1.;
94 if (
pars.covariance()) {
97 if (trackError < 0.2) trackError = 0.2;
98 roadWidthEta = 5. * trackError;
103 std::vector<std::vector<const MdtDriftCircleOnTrack*> > mdtROTsVec;
104 mdtROTsVec.push_back(mdtROTs);
105 std::vector<std::vector<const MuonClusterOnTrack*> > clusterROTsVec;
109 doHoleSearch ?
m_segMaker->find(road, mdtROTsVec, clusterROTsVec, segments.get(),
true)
110 :
m_segMakerNoHoles->find(road, mdtROTsVec, clusterROTsVec, segments.get(),
true);
127 if (MuonDetMgr ==
nullptr) {
128 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
133 std::set<IdentifierHash> chIdHs;
136 std::set<Identifier>::const_iterator chit = chIds.begin();
137 std::set<Identifier>::const_iterator chit_end = chIds.end();
138 for (; chit != chit_end; ++chit) {
153 std::vector<const MdtPrepData*> mdtPrds =
extractPrds(ctx, chIdHs);
159 const std::set<IdentifierHash>& chIdHs)
const {
163 mdtPrdContainer = h_mdtPrdCont.
cptr();
170 std::vector<const MdtPrepData*> mdtPrds;
173 std::set<IdentifierHash>::const_iterator chit = chIdHs.begin();
174 std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end();
175 for (; chit != chit_end; ++chit) {
176 const auto* collptr = mdtPrdContainer->
indexFindPtr(*chit);
177 if (collptr ==
nullptr) {
continue; }
180 mdtPrds.insert(mdtPrds.end(), collptr->begin(), collptr->end());
187 std::vector<const MdtPrepDataCollection*>&
target)
const {
191 if (mdtPrdContainer->empty())
return;
194 std::set<IdentifierHash>::const_iterator chit = chIdHs.begin();
195 std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end();
196 for (; chit != chit_end; ++chit) {
197 const auto* collptr = mdtPrdContainer->indexFindPtr(*chit);
198 if (collptr ==
nullptr || collptr->empty()) {
continue; }
203 target.push_back(collptr);
208 std::vector<const RpcPrepDataCollection*>&
target)
const {
211 if (rpcPrdContainer->empty())
return;
214 std::set<IdentifierHash>::const_iterator chit = chIdHs.begin();
215 std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end();
216 for (; chit != chit_end; ++chit) {
217 const auto* collptr = rpcPrdContainer->indexFindPtr(*chit);
218 if (collptr ==
nullptr || collptr->empty()) {
continue; }
223 target.push_back(collptr);
228 std::vector<const TgcPrepDataCollection*>&
target)
const {
231 if (tgcPrdContainer->empty())
return;
234 std::set<IdentifierHash>::const_iterator chit = chIdHs.begin();
235 std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end();
236 for (; chit != chit_end; ++chit) {
237 const auto* collptr = tgcPrdContainer->indexFindPtr(*chit);
238 if (collptr ==
nullptr || collptr->empty()) {
continue; }
243 target.push_back(collptr);
248 std::vector<const CscPrepDataCollection*>&
target)
const {
254 if (cscPrdContainer->empty())
return;
257 std::set<IdentifierHash>::const_iterator chit = chIdHs.begin();
258 std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end();
259 for (; chit != chit_end; ++chit) {
260 const auto* collptr = cscPrdContainer->indexFindPtr(*chit);
261 if (collptr ==
nullptr || collptr->empty()) {
continue; }
267 target.push_back(collptr);
275 std::vector<const sTgcPrepDataCollection*>&
target)
const {
284 stgcPrdContainer = h_stgcPrdCont.
cptr();
289 if (stgcPrdContainer->
empty())
return;
292 std::set<IdentifierHash>::const_iterator chit = chIdHs.begin();
293 std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end();
294 for (; chit != chit_end; ++chit) {
295 const auto* collptr = stgcPrdContainer->
indexFindPtr(*chit);
296 if (collptr ==
nullptr || collptr->empty()) {
continue; }
301 target.push_back(collptr);
307 std::vector<const MMPrepDataCollection*>&
target)
const {
316 mmPrdContainer = h_mmPrdCont.
cptr();
321 if (mmPrdContainer->
empty())
return;
324 std::set<IdentifierHash>::const_iterator chit = chIdHs.begin();
325 std::set<IdentifierHash>::const_iterator chit_end = chIdHs.end();
326 for (; chit != chit_end; ++chit) {
327 const auto* collptr = mmPrdContainer->
indexFindPtr(*chit);
328 if (collptr ==
nullptr || collptr->empty()) {
continue; }
332 target.push_back(collptr);
337 const std::vector<const MdtPrepData*>& mdtPrdCols,
338 std::vector<const MdtDriftCircleOnTrack*>& mdtROTs,
bool& doHoleSearch)
const {
339 ATH_MSG_VERBOSE(
" in selectAndCalibrate, get PRDs " << mdtPrdCols.size());
342 std::vector<const MdtPrepData*>::const_iterator mit = mdtPrdCols.begin();
343 std::vector<const MdtPrepData*>::const_iterator mit_end = mdtPrdCols.end();
344 for (; mit != mit_end; ++mit) {
352 mdtROTs.push_back(mdt);
354 ATH_MSG_VERBOSE(
" calibrated " << mdtROTs.size() <<
" prds out of " << mdtPrdCols.size());
358 const MdtPrepData& mdtPrd,
bool& doHoleSearch)
const {
376 double distanceToWire = exPars->parameters()[
Trk::locR];
377 double posAlongWire = exPars->parameters()[
Trk::locZ];
379 double errorR = exPars->covariance() ? fabs(
Amg::error(*exPars->covariance(),
Trk::locR)) : 500.;
380 double errorZ = exPars->covariance() ? fabs(
Amg::error(*exPars->covariance(),
Trk::locZ)) : 300.;
383 bool isOnSurface = surf.
isOnSurface(exPars->position(),
true, 5 * errorR, 5 * errorZ);
392 double roadWidthR = 5 * errorR + 4 * tubeRadius;
393 double roadWidthZ = 5 * errorZ + 100.;
396 double nSigmaFromTrack = fabs(fabs(distanceToWire) - mdtPrd.
localPosition()[
Trk::locR]) / sqrt(errorR * errorR + driftdr * driftdr);
399 std::string boundCheckStr = isOnSurface ?
" onSurface" :
" outOfSurface";
401 << roadWidthR <<
" z " << posAlongWire <<
" range " << halfTubeLength + roadWidthZ << boundCheckStr;
405 if (nSigmaFromTrack >
m_maxSigma || fabs(posAlongWire) > halfTubeLength + roadWidthZ) {
412 if (doHoleSearch && fabs(posAlongWire) < halfTubeLength + roadWidthZ) doHoleSearch =
false;
430 double error = driftdr;
432 double fullError = sqrt(errorR * errorR +
error *
error);
433 double radialPull =
residual / fullError;
435 if (fabs(radialPull) < 5)
437 else if (fabs(radialPull) > 5 &&
residual > 0)
440 hitType =
"outOfTime";