ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Rec::MuidMuonRecovery Class Reference

#include <MuidMuonRecovery.h>

Inheritance diagram for Rec::MuidMuonRecovery:
Collaboration diagram for Rec::MuidMuonRecovery:

Public Member Functions

 MuidMuonRecovery (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~MuidMuonRecovery ()=default
 
StatusCode initialize () override
 
StatusCode finalize () override
 
std::unique_ptr< Trk::TrackrecoverableMatch (const Trk::Track &indetTrack, const Trk::Track &spectrometerTrack, const EventContext &ctx) const override
 IMuidMuonRecovery interface: algorithmic code for recovering muon spectrometer using the inner detector track. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool and IAlgTool interface methods. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ToolHandle< Trk::IExtrapolatorm_extrapolator
 
ServiceHandle< Muon::IMuonEDMHelperSvcm_edmHelperSvc
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc
 
PublicToolHandle< Muon::MuonEDMPrinterToolm_printer
 
ToolHandle< Trk::IResidualPullCalculatorm_residualCalculator
 
ToolHandle< ICombinedMuonTrackBuilderm_trackBuilder
 
Gaudi::Property< double > m_minP {this, "MinP", 10. * Gaudi::Units::GeV}
 
Gaudi::Property< double > m_minPt {this, "MinPt", 5. * Gaudi::Units::GeV}
 
Gaudi::Property< double > m_pullCut {this, "PullCut", 10.}
 
std::atomic< unsigned int > m_recoveryAttempts {0}
 
std::atomic< unsigned int > m_recoveryFitFailure {0}
 
std::atomic< unsigned int > m_recoverySuccess {0}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 30 of file MuidMuonRecovery.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuidMuonRecovery()

Rec::MuidMuonRecovery::MuidMuonRecovery ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 36 of file MuidMuonRecovery.cxx.

36  :
38  declareInterface<IMuidMuonRecovery>(this);
39  }

◆ ~MuidMuonRecovery()

Rec::MuidMuonRecovery::~MuidMuonRecovery ( )
default

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

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

◆ finalize()

StatusCode Rec::MuidMuonRecovery::finalize ( )
override

Definition at line 66 of file MuidMuonRecovery.cxx.

66  {
67  ATH_MSG_INFO("Recovery attempts " << m_recoveryAttempts << ", failedFit " << m_recoveryFitFailure << ", success "
69 
70  return StatusCode::SUCCESS;
71  }

◆ initialize()

StatusCode Rec::MuidMuonRecovery::initialize ( )
override

Definition at line 43 of file MuidMuonRecovery.cxx.

43  {
44  ATH_MSG_INFO("Initializing MuidMuonRecovery");
45 
46  // get the Tools
47  ATH_CHECK(m_extrapolator.retrieve());
48  ATH_MSG_INFO("Retrieved tool " << m_extrapolator);
49  ATH_CHECK(m_edmHelperSvc.retrieve());
50  ATH_MSG_INFO("Retrieved tool " << m_edmHelperSvc);
51  ATH_CHECK(m_idHelperSvc.retrieve());
52  ATH_MSG_INFO("Retrieved tool " << m_idHelperSvc);
53  ATH_CHECK(m_printer.retrieve());
54  ATH_MSG_INFO("Retrieved tool " << m_printer);
55  ATH_CHECK(m_residualCalculator.retrieve());
56  ATH_MSG_INFO("Retrieved tool " << m_residualCalculator);
57 
58  if (!m_trackBuilder.empty()) {
59  ATH_CHECK(m_trackBuilder.retrieve());
60  ATH_MSG_INFO("Retrieved tool " << m_trackBuilder);
61  }
62 
63  return StatusCode::SUCCESS;
64  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

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()

static const InterfaceID& Rec::IMuidMuonRecovery::interfaceID ( )
inlinestaticinherited

AlgTool and IAlgTool interface methods.

Definition at line 38 of file IMuidMuonRecovery.h.

38  {
39  static const InterfaceID IID_IMuidMuonRecovery("IMuidMuonRecovery", 1, 0);
40  return IID_IMuidMuonRecovery;
41  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ recoverableMatch()

std::unique_ptr< Trk::Track > Rec::MuidMuonRecovery::recoverableMatch ( const Trk::Track indetTrack,
const Trk::Track spectrometerTrack,
const EventContext &  ctx 
) const
overridevirtual

IMuidMuonRecovery interface: algorithmic code for recovering muon spectrometer using the inner detector track.

Implements Rec::IMuidMuonRecovery.

Definition at line 72 of file MuidMuonRecovery.cxx.

73  {
74  // skip low pt ID tracks
75  if (!indetTrack.perigeeParameters() || indetTrack.perigeeParameters()->momentum().mag() < m_minP ||
76  indetTrack.perigeeParameters()->momentum().perp() < m_minPt) {
77  return nullptr;
78  }
79 
81 
82  ATH_MSG_DEBUG("Entering new recovery" << std::endl
83  << " ID track " << m_printer->print(indetTrack) << std::endl
84  << " MS track " << m_printer->print(spectrometerTrack) << std::endl
85  << m_printer->printStations(spectrometerTrack));
86 
87  const Trk::TrackParameters* lastIndetPars = nullptr;
88  int index = static_cast<int>(indetTrack.trackParameters()->size());
89 
90  while (!lastIndetPars && index > 0) {
91  --index;
92  lastIndetPars = (*indetTrack.trackParameters())[index] ? (*indetTrack.trackParameters())[index] : nullptr;
93  }
94 
95  if (!lastIndetPars) {
96  ATH_MSG_WARNING("ID track parameters don't have error matrix!");
97  return nullptr;
98  }
99 
100  // track builder prefers estimate of inner, middle and outer spectrometer track parameters
101  std::unique_ptr<Trk::TrackParameters> innerParameters, middleParameters, outerParameters;
102  std::unique_ptr<Trk::TrackParameters> lastPars = lastIndetPars->uniqueClone();
103  bool innerParsSet{false};
104 
105  std::vector<const Trk::TrackStateOnSurface*> stations;
106  std::set<Muon::MuonStationIndex::StIndex> etaIndices, phiIndices, badEtaIndices, badPhiIndices;
107 
108  unsigned int nmeas = 0;
109 
110  for (const Trk::TrackStateOnSurface* tsosit : *spectrometerTrack.trackStateOnSurfaces()) {
111  const Trk::MeasurementBase* meas = tsosit->measurementOnTrack();
112  if (!meas) continue;
113 
114  if (tsosit->type(Trk::TrackStateOnSurface::Outlier)) continue;
115 
116  Identifier id = m_edmHelperSvc->getIdentifier(*meas);
117  if (!id.is_valid()) continue;
118 
120  bool measuresPhi = m_idHelperSvc->measuresPhi(id);
121  ++nmeas;
122 
123  if (measuresPhi) {
124  if (phiIndices.count(index)) continue;
125  ATH_MSG_DEBUG("Adding phi station " << m_idHelperSvc->toString(id));
126  phiIndices.insert(index);
127  } else if (m_idHelperSvc->isMdt(id) || (m_idHelperSvc->isCsc(id))) {
128  if (etaIndices.count(index)) continue;
129 
130  ATH_MSG_DEBUG("Adding eta station " << m_idHelperSvc->toString(id));
131  etaIndices.insert(index);
132  } else {
133  continue;
134  }
135 
136  std::unique_ptr<Trk::TrackParameters> exPars{};
137  if (lastPars->associatedSurface() == meas->associatedSurface()) {
138  ATH_MSG_DEBUG("Using existing pars");
139  exPars = std::move(lastPars);
140  } else {
141  exPars = m_extrapolator->extrapolate(ctx, *lastPars, meas->associatedSurface(), Trk::alongMomentum, false, Trk::muon);
142  }
143 
144  if (!exPars) {
145  ATH_MSG_DEBUG("Failed to extrapolate to station" << m_idHelperSvc->toStringChamber(id));
146  continue;
147  }
148 
149  std::optional<Trk::ResidualPull> res {m_residualCalculator->residualPull(meas, exPars.get(), Trk::ResidualPull::Unbiased)};
150 
151  ATH_MSG_DEBUG(" " << m_idHelperSvc->toStringChamber(id) << " residual " << m_printer->print(*res));
152 
153  if (std::abs(res->pull().front()) > m_pullCut) {
154  if (measuresPhi) {
155  badPhiIndices.insert(index);
156  } else {
157  badEtaIndices.insert(index);
158  }
159  }
160 
161 
162  if (msgLvl(MSG::DEBUG)) {
163  if (!m_idHelperSvc->measuresPhi(id)) {
164  const MuonGM::MuonReadoutElement* detEl = nullptr;
165  if (m_idHelperSvc->isMdt(id)) {
166  const Muon::MdtDriftCircleOnTrack* mdt = dynamic_cast<const Muon::MdtDriftCircleOnTrack*>(meas);
167  if (mdt) { detEl = mdt->detectorElement(); }
168  } else if (m_idHelperSvc->isCsc(id)) {
169  const Muon::CscClusterOnTrack* csc = dynamic_cast<const Muon::CscClusterOnTrack*>(meas);
170  if (csc) { detEl = csc->detectorElement(); }
171  }
172 
173  if (detEl) {
174  const Trk::PlaneSurface* detSurf = dynamic_cast<const Trk::PlaneSurface*>(&detEl->surface());
175  if (detSurf) {
176  Trk::LocalDirection idDir{};
177  detSurf->globalToLocalDirection(exPars->momentum(), idDir);
178 
179  const Trk::TrackParameters* pars = tsosit->trackParameters();
180  Trk::LocalDirection msDir{};
181  detSurf->globalToLocalDirection(pars->momentum(), msDir);
182  ATH_MSG_DEBUG(" local Angles: id (" << idDir.angleXZ() << "," << idDir.angleYZ() << ") ms ("
183  << msDir.angleXZ() << "," << msDir.angleYZ() << ")");
184  }
185  }
186  }
187  } // end DEBUG toggle
188 
189  if (!innerParsSet && !innerParameters && exPars && lastPars) {
190  innerParameters = std::move(exPars);
191  } else if (exPars && innerParameters && !middleParameters ) {
192  middleParameters = std::move(exPars);
193  } else {
194  lastPars = std::move(exPars);
195  }
196  innerParsSet = true;
197  }
198 
199  if (middleParameters) {
200  outerParameters = std::move(lastPars);
201  } else {
202  middleParameters = std::move(innerParameters);
203  if (!middleParameters) {
204  ATH_MSG_DEBUG("parameter extrapolation failed");
205  return nullptr;
206  }
207  }
208 
209  bool cleanEta = badEtaIndices.size() == 1 && etaIndices.size() > 1;
210  bool cleanPhi = badPhiIndices.size() == 1;
211 
212  if (!cleanPhi && !cleanEta) {
213  ATH_MSG_DEBUG("No layers removed");
214  return nullptr;
215  }
216 
217  if (badEtaIndices.size() == etaIndices.size()) {
218  ATH_MSG_DEBUG("All layers removed");
219  return nullptr;
220  }
221 
222  Trk::MeasurementSet spectrometerMeasurements;
223  for (const Trk::TrackStateOnSurface* tsosit : *spectrometerTrack.trackStateOnSurfaces()) {
224  const Trk::MeasurementBase* meas = tsosit->measurementOnTrack();
225  if (!meas) continue;
226  if (tsosit->type(Trk::TrackStateOnSurface::Outlier)) continue;
227 
228  Identifier id = m_edmHelperSvc->getIdentifier(*meas);
229  if (!id.is_valid()) continue;
230 
232  bool measuresPhi = m_idHelperSvc->measuresPhi(id);
233  if (cleanEta && !measuresPhi && badEtaIndices.count(index)) continue;
234  if (cleanPhi && measuresPhi && badPhiIndices.count(index)) continue;
235  spectrometerMeasurements.push_back(meas);
236  }
237 
238  ATH_MSG_DEBUG("Number of measurements before cleaning " << nmeas << " after cleaning " << spectrometerMeasurements.size());
239 
240  if (spectrometerMeasurements.size() < 6) {
241  ATH_MSG_DEBUG("Too few hits left - discarding fit");
242  return nullptr;
243  }
244 
245  // fit the combined track
246  std::unique_ptr<Trk::Track> combinedTrack;
247  if (!m_trackBuilder.empty()) {
248  combinedTrack = m_trackBuilder->indetExtension(ctx, indetTrack, spectrometerMeasurements, std::move(innerParameters), std::move(middleParameters),
249  std::move(outerParameters));
250  }
251  if (combinedTrack) {
253  combinedTrack->info().setPatternRecognitionInfo(Trk::TrackInfo::MuidMuonRecoveryTool);
254 
255  ATH_MSG_DEBUG("Recovered track " << std::endl
256  << m_printer->print(*combinedTrack) << std::endl
257  << m_printer->printStations(*combinedTrack));
258  } else {
260  ATH_MSG_DEBUG("track fit failure ");
261  }
262  return combinedTrack;
263  }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_edmHelperSvc

ServiceHandle<Muon::IMuonEDMHelperSvc> Rec::MuidMuonRecovery::m_edmHelperSvc
private
Initial value:
{
this,
"edmHelper",
"Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface",
}

Definition at line 52 of file MuidMuonRecovery.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> Rec::MuidMuonRecovery::m_extrapolator
private
Initial value:
{
this,
"Extrapolator",
"Trk::Extrapolator/AtlasExtrapolator",
"Extrapolator tool",
}

Definition at line 45 of file MuidMuonRecovery.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Rec::MuidMuonRecovery::m_idHelperSvc
private
Initial value:
{
this,
"MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
}

Definition at line 59 of file MuidMuonRecovery.h.

◆ m_minP

Gaudi::Property<double> Rec::MuidMuonRecovery::m_minP {this, "MinP", 10. * Gaudi::Units::GeV}
private

Definition at line 86 of file MuidMuonRecovery.h.

◆ m_minPt

Gaudi::Property<double> Rec::MuidMuonRecovery::m_minPt {this, "MinPt", 5. * Gaudi::Units::GeV}
private

Definition at line 87 of file MuidMuonRecovery.h.

◆ m_printer

PublicToolHandle<Muon::MuonEDMPrinterTool> Rec::MuidMuonRecovery::m_printer
private
Initial value:
{
this,
"Printer",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
"Tool to print EDM objects",
}

Definition at line 64 of file MuidMuonRecovery.h.

◆ m_pullCut

Gaudi::Property<double> Rec::MuidMuonRecovery::m_pullCut {this, "PullCut", 10.}
private

Definition at line 88 of file MuidMuonRecovery.h.

◆ m_recoveryAttempts

std::atomic<unsigned int> Rec::MuidMuonRecovery::m_recoveryAttempts {0}
mutableprivate

Definition at line 91 of file MuidMuonRecovery.h.

◆ m_recoveryFitFailure

std::atomic<unsigned int> Rec::MuidMuonRecovery::m_recoveryFitFailure {0}
mutableprivate

Definition at line 92 of file MuidMuonRecovery.h.

◆ m_recoverySuccess

std::atomic<unsigned int> Rec::MuidMuonRecovery::m_recoverySuccess {0}
mutableprivate

Definition at line 93 of file MuidMuonRecovery.h.

◆ m_residualCalculator

ToolHandle<Trk::IResidualPullCalculator> Rec::MuidMuonRecovery::m_residualCalculator
private
Initial value:
{
this,
"ResidualPullCalculator",
"Trk::ResidualPullCalculator/ResidualPullCalculator",
"Residual calculator tool",
}

Definition at line 71 of file MuidMuonRecovery.h.

◆ m_trackBuilder

ToolHandle<ICombinedMuonTrackBuilder> Rec::MuidMuonRecovery::m_trackBuilder
private
Initial value:
{
this,
"TrackBuilder",
"Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder",
"Track builder tool",
}

Definition at line 78 of file MuidMuonRecovery.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Rec::MuidMuonRecovery::m_trackBuilder
ToolHandle< ICombinedMuonTrackBuilder > m_trackBuilder
Definition: MuidMuonRecovery.h:78
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
index
Definition: index.py:1
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersBase::uniqueClone
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
Definition: ParametersBase.h:97
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Trk::ResidualPull::Unbiased
@ Unbiased
RP with track state that has measurement not included.
Definition: ResidualPull.h:57
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Rec::MuidMuonRecovery::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuidMuonRecovery.h:45
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
Rec::MuidMuonRecovery::m_residualCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualCalculator
Definition: MuidMuonRecovery.h:71
Rec::MuidMuonRecovery::m_recoveryFitFailure
std::atomic< unsigned int > m_recoveryFitFailure
Definition: MuidMuonRecovery.h:92
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon::MdtDriftCircleOnTrack::detectorElement
virtual const MuonGM::MdtReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
Definition: MdtDriftCircleOnTrack.h:268
Rec::MuidMuonRecovery::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuidMuonRecovery.h:52
Trk::combinedTrack
void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *par, double *covo)
Definition: XYZtrp.cxx:113
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Muon::CscClusterOnTrack::detectorElement
virtual const MuonGM::CscReadoutElement * detectorElement() const override final
Returns the detector element, associated with the PRD of this class.
Definition: CscClusterOnTrack.h:167
MuonGM::MuonReadoutElement
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:40
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Rec::MuidMuonRecovery::m_minP
Gaudi::Property< double > m_minP
Definition: MuidMuonRecovery.h:86
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::PlaneSurface::globalToLocalDirection
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
Definition: PlaneSurface.cxx:260
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
Trk::LocalDirection
represents the three-dimensional global direction with respect to a planar surface frame.
Definition: LocalDirection.h:81
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Rec::MuidMuonRecovery::m_pullCut
Gaudi::Property< double > m_pullCut
Definition: MuidMuonRecovery.h:88
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::Track::trackParameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:97
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Rec::MuidMuonRecovery::m_recoveryAttempts
std::atomic< unsigned int > m_recoveryAttempts
Definition: MuidMuonRecovery.h:91
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::MeasurementBase::associatedSurface
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
Rec::MuidMuonRecovery::m_recoverySuccess
std::atomic< unsigned int > m_recoverySuccess
Definition: MuidMuonRecovery.h:93
DeMoScan.index
string index
Definition: DeMoScan.py:364
Rec::MuidMuonRecovery::m_printer
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuidMuonRecovery.h:64
Muon::CscClusterOnTrack
Class to represent the calibrated clusters created from CSC strips.
Definition: CscClusterOnTrack.h:47
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::PlaneSurface
Definition: PlaneSurface.h:64
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Rec::MuidMuonRecovery::m_minPt
Gaudi::Property< double > m_minPt
Definition: MuidMuonRecovery.h:87
DEBUG
#define DEBUG
Definition: page_access.h:11
Trk::TrackInfo::MuidMuonRecoveryTool
@ MuidMuonRecoveryTool
Muons found by the ID seeded muon recovery.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:229
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Rec::MuidMuonRecovery::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuidMuonRecovery.h:59
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
Identifier
Definition: IdentifierFieldParser.cxx:14