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

#include <MuonTrackTagTestTool.h>

Inheritance diagram for MuonCombined::MuonTrackTagTestTool:
Collaboration diagram for MuonCombined::MuonTrackTagTestTool:

Public Member Functions

 MuonTrackTagTestTool (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~MuonTrackTagTestTool ()=default
 
StatusCode initialize () override
 
double chi2 (const Trk::TrackParameters &idParsAtEntry, const Trk::TrackParameters &msParsAtEntry) const override
 
double chi2 (const Trk::Track &id, const Trk::Track &ms, const EventContext &ctx) const override
 
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 ()
 

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

const Trk::TrackingVolumegetVolume (const std::string &&vol_name, const EventContext &ctx) const
 
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
 
SG::ReadCondHandleKey< Trk::TrackingGeometrym_trackingGeometryReadKey
 
double m_chi2cut
 
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 21 of file MuonTrackTagTestTool.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

◆ MuonTrackTagTestTool()

MuonCombined::MuonTrackTagTestTool::MuonTrackTagTestTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 29 of file MuonTrackTagTestTool.cxx.

29  :
31  declareInterface<IMuonTrackTagTool>(this);
32  declareProperty("Chi2Cut", m_chi2cut = 50.);
33 #ifdef MUONCOMBDEBUG
34  declareProperty("Truth", m_truth = false);
35 #endif
36  }

◆ ~MuonTrackTagTestTool()

MuonCombined::MuonTrackTagTestTool::~MuonTrackTagTestTool ( )
default

Member Function Documentation

◆ chi2() [1/2]

double MuonCombined::MuonTrackTagTestTool::chi2 ( const Trk::Track id,
const Trk::Track ms,
const EventContext &  ctx 
) const
overridevirtual

Implements MuonCombined::IMuonTrackTagTool.

Definition at line 51 of file MuonTrackTagTestTool.cxx.

51  {
52  const Trk::TrackingVolume *msEntrance = getVolume("MuonSpectrometerEntrance", ctx);
53  if (!msEntrance) {
54  ATH_MSG_ERROR("No MS entrance available");
55  return dummy_chi2;
56  }
57  if (idTrack.perigeeParameters() == nullptr) {
58  ATH_MSG_WARNING("Skipping track combination - no perigee parameters for ID track");
59  return dummy_chi2;
60  }
61  if (msTrack.perigeeParameters() == nullptr) {
62  ATH_MSG_WARNING("Skipping track combination - no perigee parameters for MS track");
63  return dummy_chi2;
64  }
65  // skip tracks from backtracking
66  if (dynamic_cast<const Trk::StraightLineSurface *>(&(**idTrack.measurementsOnTrack()->begin()).associatedSurface())) return 0;
67  if (idTrack.measurementsOnTrack()->size() < 7 ||
68  dynamic_cast<const Trk::StraightLineSurface *>(&(*idTrack.measurementsOnTrack())[6]->associatedSurface()) ||
69  !dynamic_cast<const InDet::PixelClusterOnTrack *>(*idTrack.measurementsOnTrack()->begin()))
70  return 0;
71  Trk::TrackStates::const_iterator itStates = idTrack.trackStateOnSurfaces()->begin();
72  Trk::TrackStates::const_iterator endState = idTrack.trackStateOnSurfaces()->end();
73  int noutl = 0, ntrt = 0;
74  for (; itStates != endState; ++itStates) {
75  if ((**itStates).measurementOnTrack()) {
76  const InDet::TRT_DriftCircleOnTrack *trthit =
77  dynamic_cast<const InDet::TRT_DriftCircleOnTrack *>((**itStates).measurementOnTrack());
78  if (trthit) {
79  if ((**itStates).type(Trk::TrackStateOnSurface::Outlier))
80  noutl++;
81  else
82  ntrt++;
83  }
84  }
85  }
86  double eta = idTrack.perigeeParameters()->eta();
87  ATH_MSG_DEBUG("ntrt: " << ntrt << " ntrtoutl: " << noutl << " eta: " << eta);
88  if (noutl >= 15 || (ntrt == 0 && std::abs(eta) > .1 && std::abs(eta) < 1.9)) return 0;
89 
90  // skip tracks below 2.5 GeV
91  double idqoverp = idTrack.perigeeParameters()->parameters()[Trk::qOverP];
92  if (idqoverp != 0 && std::abs(1 / idqoverp) < 2500) return 0;
93 
94  const Trk::TrackParameters *muonpar = msTrack.trackParameters()->front();
95 
96  bool checkphiflip = false, muonisstraight = false;
97 
98  if (std::abs(muonpar->parameters()[Trk::qOverP]) < 1.e-9) checkphiflip = muonisstraight = true;
99 
100  double phiID = (**idTrack.trackParameters()->rbegin()).parameters()[Trk::phi], phiMS = muonpar->position().phi();
101  double thetaID = (**idTrack.trackParameters()->rbegin()).parameters()[Trk::theta], thetaMS = muonpar->parameters()[Trk::theta];
102 
103  ATH_MSG_DEBUG("phi ID: " << phiID << " phi MS: " << phiMS << " diff: " << phiID - phiMS
104  << " pt ID: " << idTrack.perigeeParameters()->pT() << " pt ms: " << muonpar->pT());
105  ATH_MSG_DEBUG("theta ID: " << thetaID << " theta MS: " << thetaMS << " diff: " << thetaID - thetaMS);
106  double phidiff = std::abs(phiID - phiMS);
107  if (std::abs(phidiff - 2 * M_PI) < phidiff) phidiff = 2 * M_PI - phidiff;
108  if (checkphiflip && std::abs(phidiff - M_PI) < phidiff) phidiff = std::abs(M_PI - phidiff);
109  double thetalimit = .6, philimit = .8;
110  if (muonisstraight) {
111  thetalimit = 1.;
112  philimit = 2;
113  }
114  if (!(std::abs(thetaID - thetaMS) < thetalimit && std::abs(phidiff) < philimit)) return 0;
115 
116  const Trk::TrackParameters *lastmeasidpar = nullptr;
117  int index = (int)idTrack.trackParameters()->size();
118  while (!lastmeasidpar && index > 0) {
119  index--;
120  lastmeasidpar = (*idTrack.trackParameters())[index]->covariance() ? (*idTrack.trackParameters())[index] : nullptr;
121  }
122  if (!lastmeasidpar) {
123  ATH_MSG_WARNING("ID track parameters don't have error matrix!");
124  return 0;
125  }
126 
127  const Trk::TrackParameters *mspar = nullptr;
128  Trk::TrackStates::const_iterator tsosit = msTrack.trackStateOnSurfaces()->begin();
129 
130  while (tsosit != msTrack.trackStateOnSurfaces()->end() && !mspar) {
131  if ((**tsosit).type(Trk::TrackStateOnSurface::Measurement) && !(**tsosit).type(Trk::TrackStateOnSurface::Outlier)) {
132  mspar = (**tsosit).trackParameters();
133  }
134  ++tsosit;
135  }
136 
137  if (!mspar) {
138  ATH_MSG_WARNING("Could not find muon track parameters!");
139  return 0;
140  }
141 
142  std::unique_ptr<const Trk::TrackParameters> idextrapolatedpar = std::unique_ptr<const Trk::TrackParameters>(
143  m_extrapolator->extrapolateToVolume(ctx, *lastmeasidpar, *msEntrance, Trk::alongMomentum, Trk::muon));
144 
145  if (!idextrapolatedpar && lastmeasidpar->parameters()[Trk::qOverP] != 0 &&
146  std::abs(1. / lastmeasidpar->parameters()[Trk::qOverP]) < 5. * CLHEP::GeV) {
147  ATH_MSG_DEBUG("Extrapolating with p=5 GeV");
148  AmgVector(5) params = lastmeasidpar->parameters();
149  double sign = (params[Trk::qOverP] > 0) ? 1 : -1;
150  double newqoverp = sign / (5. * CLHEP::GeV);
151  params[Trk::qOverP] = newqoverp;
152  std::unique_ptr<const Trk::TrackParameters> newlastidpar = lastmeasidpar->associatedSurface().createUniqueTrackParameters(
153  params[0], params[1], params[2], params[3], params[4], AmgSymMatrix(5)(*lastmeasidpar->covariance()));
154  if (newlastidpar) {
155  idextrapolatedpar = std::unique_ptr<const Trk::TrackParameters>(
156  m_extrapolator->extrapolateToVolume(ctx, *newlastidpar, *msEntrance, Trk::alongMomentum, Trk::muon));
157  }
158  }
159 
160  if (!idextrapolatedpar || !idextrapolatedpar->covariance()) {
161  ATH_MSG_DEBUG("ID extrapolated par null or missing error matrix, par: " << idextrapolatedpar.get());
162  return 0;
163  }
164  const Trk::TrackParameters *msparforextrapolator = mspar;
165  std::unique_ptr<const Trk::TrackParameters> created_mspar;
166  if (muonisstraight) {
167  const AmgSymMatrix(5) &idcovmat = *idextrapolatedpar->covariance();
168  AmgVector(5) params = mspar->parameters();
169  params[Trk::qOverP] = idextrapolatedpar->parameters()[Trk::qOverP];
170  if (!mspar->covariance()) {
171  ATH_MSG_DEBUG("Muons parameters missing Error matrix: " << mspar);
172  return 1e5; // Sometimes it's 0, sometimes 1e15. Maybe for comparison of chi2? Just in case, will copy this
173  // value from earlier check on ms track. EJWM.
174  }
175  AmgSymMatrix(5) newcovmat = AmgSymMatrix(5)(*mspar->covariance());
176  for (int i = 0; i < 5; i++) (newcovmat)(i, 4) = idcovmat(i, 4);
177  created_mspar = msparforextrapolator->associatedSurface().createUniqueTrackParameters(params[0], params[1], params[2],
178  params[3], params[4], newcovmat);
179  msparforextrapolator = created_mspar.get();
180  }
182  Trk::DistanceSolution distsol = idextrapolatedpar->associatedSurface().straightLineDistanceEstimate(
183  msparforextrapolator->position(), msparforextrapolator->momentum().unit());
184  double distance = 0;
185  if (distsol.numberOfSolutions() == 1)
186  distance = distsol.first();
187  else if (distsol.numberOfSolutions() == 2) {
188  distance = (std::abs(distsol.first()) < std::abs(distsol.second())) ? distsol.first() : distsol.second();
189  }
190 
191  if (distance > 0 && distsol.numberOfSolutions() > 0) propdir = Trk::alongMomentum;
192 
193  std::unique_ptr<const Trk::TrackParameters> msextrapolatedpar = std::unique_ptr<const Trk::TrackParameters>(
194  m_extrapolator->extrapolate(ctx, *msparforextrapolator, idextrapolatedpar->associatedSurface(), propdir, false, Trk::muon));
195 
196  if (muonisstraight) { ATH_MSG_DEBUG("Muon track is straight line"); }
197 
198  if ((!msextrapolatedpar && !muonisstraight)) {
199  ATH_MSG_DEBUG("extrapolation failed, id:" << idextrapolatedpar.get() << " ms: " << msextrapolatedpar.get());
200  return 0;
201  }
202  double mychi2 = 1e15;
203  if (msextrapolatedpar) mychi2 = chi2(*idextrapolatedpar, *msextrapolatedpar);
204  if (muonisstraight) {
205  std::unique_ptr<const Trk::TrackParameters> idpar_firsthit = std::unique_ptr<const Trk::TrackParameters>(
206  m_extrapolator->extrapolate(ctx, *idextrapolatedpar, mspar->associatedSurface(), Trk::alongMomentum, false, Trk::muon));
207  if (idpar_firsthit) {
208  double chi2_2 = chi2(*idpar_firsthit, *mspar);
209  if (chi2_2 < mychi2) mychi2 = chi2_2;
210  }
211  }
212  return mychi2;
213  }

◆ chi2() [2/2]

double MuonCombined::MuonTrackTagTestTool::chi2 ( const Trk::TrackParameters idParsAtEntry,
const Trk::TrackParameters msParsAtEntry 
) const
overridevirtual

Implements MuonCombined::IMuonTrackTagTool.

Definition at line 215 of file MuonTrackTagTestTool.cxx.

215  {
216  double loc1ID = idextrapolatedpar.parameters()[Trk::loc1];
217  double loc2ID = idextrapolatedpar.parameters()[Trk::loc2];
218  double phiID = idextrapolatedpar.parameters()[Trk::phi];
219  double thetaID = idextrapolatedpar.parameters()[Trk::theta];
220 
221  double loc1MS = msextrapolatedpar.parameters()[Trk::loc1];
222  double loc2MS = msextrapolatedpar.parameters()[Trk::loc2];
223  double phiMS = msextrapolatedpar.parameters()[Trk::phi];
224  double thetaMS = msextrapolatedpar.parameters()[Trk::theta];
225 
226  if (!idextrapolatedpar.covariance() || !msextrapolatedpar.covariance()) {
227  ATH_MSG_DEBUG("track parameters don't have error matrix! id: " << idextrapolatedpar.covariance()
228  << " ms: " << msextrapolatedpar.covariance());
229  return 1e15;
230  }
231  const AmgSymMatrix(5) &idcovmat = *idextrapolatedpar.covariance();
232  const AmgSymMatrix(5) &mscovmat = *msextrapolatedpar.covariance();
233 
234  double loc1diff = std::abs(loc1ID - loc1MS);
235  double loc2diff = std::abs(loc2ID - loc2MS);
236  const Trk::CylinderSurface *cylsurf = dynamic_cast<const Trk::CylinderSurface *>(&idextrapolatedpar.associatedSurface());
237  const Trk::DiscSurface *discsurf = dynamic_cast<const Trk::DiscSurface *>(&idextrapolatedpar.associatedSurface());
238 
239  if (cylsurf) {
240  double length = 2 * M_PI * cylsurf->bounds().r();
241  if (std::abs(loc1diff - length) < loc1diff) loc1diff = length - loc1diff;
242  }
243  if (discsurf) {
244  if (std::abs(loc2diff - 2 * M_PI) < loc2diff) loc2diff = 2 * M_PI - loc2diff;
245  }
246  double phidiff = std::abs(phiID - phiMS);
247  if (std::abs(phidiff - 2 * M_PI) < phidiff) phidiff = 2 * M_PI - phidiff;
248  if (std::abs(phidiff - M_PI) < phidiff) phidiff -= M_PI; // catch singularity in phi near theta=0
249 
250  double thetadiff = thetaID - thetaMS;
251 
252  double chi2 = loc1diff * loc1diff / (idcovmat(0, 0) + mscovmat(0, 0)) + loc2diff * loc2diff / (idcovmat(1, 1) + mscovmat(1, 1)) +
253  phidiff * phidiff / (idcovmat(2, 2) + mscovmat(2, 2)) + thetadiff * thetadiff / (idcovmat(3, 3) + mscovmat(3, 3));
254  chi2 = std::abs(chi2);
255 
256  ATH_MSG_DEBUG(" chi2: " << chi2);
257  return chi2;
258  }

◆ 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

◆ getVolume()

const Trk::TrackingVolume* MuonCombined::MuonTrackTagTestTool::getVolume ( const std::string &&  vol_name,
const EventContext &  ctx 
) const
inlineprivate

Tracking geometry is provided by the TrackingGeometryAlg

Definition at line 45 of file MuonTrackTagTestTool.h.

45  {
48  if (!handle.isValid()) {
49  ATH_MSG_WARNING("Could not retrieve a valid tracking geometry");
50  return nullptr;
51  }
52  return handle.cptr()->trackingVolume(vol_name);
53 
54  }

◆ initialize()

StatusCode MuonCombined::MuonTrackTagTestTool::initialize ( )
override

Definition at line 38 of file MuonTrackTagTestTool.cxx.

38  {
39  ATH_CHECK(m_extrapolator.retrieve());
42  } else {
43  ATH_MSG_ERROR("Could not retrieve a valid tracking geometry");
44  }
45 
46  ATH_MSG_INFO("Initialized successfully");
47 
48  return StatusCode::SUCCESS;
49  }

◆ 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& MuonCombined::IMuonTrackTagTool::interfaceID ( )
inlinestaticinherited

Definition at line 17 of file IMuonTrackTagTool.h.

17  {
18  static const InterfaceID IID_IMuonTrackTagTool("MuonCombined::IMuonTrackTagTool", 1, 0);
19  return IID_IMuonTrackTagTool;
20  }

◆ 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.

◆ 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_chi2cut

double MuonCombined::MuonTrackTagTestTool::m_chi2cut
private

Definition at line 41 of file MuonTrackTagTestTool.h.

◆ 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_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> MuonCombined::MuonTrackTagTestTool::m_extrapolator
private
Initial value:
{
this,
"ExtrapolatorTool",
"Trk::Extrapolator/AtlasExtrapolator",
}

Definition at line 32 of file MuonTrackTagTestTool.h.

◆ m_trackingGeometryReadKey

SG::ReadCondHandleKey<Trk::TrackingGeometry> MuonCombined::MuonTrackTagTestTool::m_trackingGeometryReadKey
private
Initial value:
{this, "TrackingGeometryReadKey", "",
"Key of input TrackingGeometry"}

Definition at line 37 of file MuonTrackTagTestTool.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:
MuonCombined::MuonTrackTagTestTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuonTrackTagTestTool.h:32
MuonCombined::MuonTrackTagTestTool::chi2
double chi2(const Trk::TrackParameters &idParsAtEntry, const Trk::TrackParameters &msParsAtEntry) const override
Definition: MuonTrackTagTestTool.cxx:215
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Muon::nsw::STGTPSegments::MergedSegmentProperty::phiID
@ phiID
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Trk::oppositeMomentum
@ oppositeMomentum
Definition: PropDirection.h:21
index
Definition: index.py:1
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
M_PI
#define M_PI
Definition: ActiveFraction.h:11
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
Trk::loc2
@ loc2
generic first and second local coordinate
Definition: ParamDefs.h:41
Trk::CylinderSurface::bounds
virtual const CylinderBounds & bounds() const override final
This method returns the CylinderBounds by reference (NoBounds is not possible for cylinder)
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
Trk::DiscSurface
Definition: DiscSurface.h:54
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:52
xAOD::TrackParameters
TrackParameters_v1 TrackParameters
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParameters.h:11
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
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
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
lumiFormat.i
int i
Definition: lumiFormat.py:92
Trk::theta
@ theta
Definition: ParamDefs.h:72
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::CylinderSurface
Definition: CylinderSurface.h:55
AmgVector
AmgVector(4) T2BSTrackFilterTool
Definition: T2BSTrackFilterTool.cxx:114
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
test_pyathena.parent
parent
Definition: test_pyathena.py:15
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:127
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
MuonCombined::MuonTrackTagTestTool::m_trackingGeometryReadKey
SG::ReadCondHandleKey< Trk::TrackingGeometry > m_trackingGeometryReadKey
Definition: MuonTrackTagTestTool.h:37
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ParametersBase::pT
double pT() const
Access method for transverse momentum.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
MuonCombined::MuonTrackTagTestTool::m_chi2cut
double m_chi2cut
Definition: MuonTrackTagTestTool.h:41
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
a
TList * a
Definition: liststreamerinfos.cxx:10
h
InDet::PixelClusterOnTrack
Definition: PixelClusterOnTrack.h:51
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::phi
@ phi
Definition: ParamDefs.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
Trk::loc1
@ loc1
Definition: ParamDefs.h:40
Trk::TrackingVolume
Definition: TrackingVolume.h:121
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
MuonCombined::MuonTrackTagTestTool::getVolume
const Trk::TrackingVolume * getVolume(const std::string &&vol_name, const EventContext &ctx) const
Definition: MuonTrackTagTestTool.h:45
fitman.k
k
Definition: fitman.py:528
Trk::CylinderBounds::r
virtual double r() const override final
This method returns the radius.