ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
InDet::SCT_ResidualPullCalculator Class Referencefinal

The InDet::SCT_ResidualPullCalculator is an AlgTool to calculate the residual and pull of a measurement and the related track state for the SCT. More...

#include <SCT_ResidualPullCalculator.h>

Inheritance diagram for InDet::SCT_ResidualPullCalculator:
Collaboration diagram for InDet::SCT_ResidualPullCalculator:

Public Member Functions

 SCT_ResidualPullCalculator (const std::string &type, const std::string &name, const IInterface *parent)
 constructor More...
 
virtual ~SCT_ResidualPullCalculator ()=default
 
virtual StatusCode initialize () override
 initialize More...
 
virtual std::optional< Trk::ResidualPullresidualPull (const Trk::MeasurementBase *measurement, const Trk::TrackParameters *trkPar, const Trk::ResidualPull::ResidualType resType, const Trk::TrackState::MeasurementType) const override
 This function returns (creates!) a Trk::ResidualPull object, which contains the values of residual and pull for the given measurement and track state. More...
 
virtual std::array< double, 5 > residuals (const Trk::MeasurementBase *measurement, const Trk::TrackParameters *trkPar, const Trk::ResidualPull::ResidualType resType, const Trk::TrackState::MeasurementType) const override
 This function is a light-weight version of the function above, designed for track fitters where speed is critical. More...
 
virtual std::optional< Trk::ResidualPullresidualPull (const Trk::MeasurementBase *, const Trk::TrackParameters *, const Trk::ResidualPull::ResidualType, const Trk::TrackState::MeasurementType, const std::vector< const Trk::AlignmentEffectsOnTrack * > &) const
 This function returns (creates!) a Trk::ResidualPull object, which contains the values of residual and pull for the given measurement and track state, and the Alignment effects. 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 ()
 Interface ID, declared here, and defined below. 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...
 

Static Private Member Functions

static double calcPull (const double residual, const double locMesCov, const double locTrkCov, const Trk::ResidualPull::ResidualType &, bool &pullIsValid)
 calc pull in 1 dimension More...
 

Private Attributes

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

The InDet::SCT_ResidualPullCalculator is an AlgTool to calculate the residual and pull of a measurement and the related track state for the SCT.

It is called by the Trk::ResidualPullCalculator in the case of SCT measurements. This tools assumes in any cases that the given measurement belongs to the SCT! Normaly it should not be called directly, but through the Trk::ResidualPullCalculator.

Definition at line 35 of file SCT_ResidualPullCalculator.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

◆ SCT_ResidualPullCalculator()

InDet::SCT_ResidualPullCalculator::SCT_ResidualPullCalculator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

constructor

Definition at line 22 of file SCT_ResidualPullCalculator.cxx.

24  declareInterface<IResidualPullCalculator>(this);
25 }

◆ ~SCT_ResidualPullCalculator()

virtual InDet::SCT_ResidualPullCalculator::~SCT_ResidualPullCalculator ( )
virtualdefault

Member Function Documentation

◆ calcPull()

double InDet::SCT_ResidualPullCalculator::calcPull ( const double  residual,
const double  locMesCov,
const double  locTrkCov,
const Trk::ResidualPull::ResidualType resType,
bool &  pullIsValid 
)
staticprivate

calc pull in 1 dimension

Definition at line 187 of file SCT_ResidualPullCalculator.cxx.

192  {
193 
194  double ErrorSum;
195  if (resType == Trk::ResidualPull::Unbiased) {
196  if ((locMesCov + locTrkCov) < 0.) {
197  pullIsValid=false;
198  return 0;
199  }
200  ErrorSum = sqrt(locMesCov + locTrkCov);
201  } else if (resType == Trk::ResidualPull::Biased) {
202  if ((locMesCov - locTrkCov) < 0.) {
203  pullIsValid=false;
204  return 0;
205  }
206  ErrorSum = sqrt(locMesCov - locTrkCov);
207  } else {
208  if (locMesCov < 0.) {
209  pullIsValid=false;
210  return 0;
211  }
212  ErrorSum = sqrt(locMesCov);
213  }
214  if (ErrorSum != 0) {
215  return residual/ErrorSum;
216  }
217  pullIsValid=false;
218  return 0;
219 }

◆ 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

◆ initialize()

StatusCode InDet::SCT_ResidualPullCalculator::initialize ( )
overridevirtual

initialize

Definition at line 30 of file SCT_ResidualPullCalculator.cxx.

30  {
31  ATH_MSG_DEBUG ("initialise successful in "<<name());
32  return StatusCode::SUCCESS;
33 }

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

const InterfaceID & Trk::IResidualPullCalculator::interfaceID ( )
inlinestaticinherited

Interface ID, declared here, and defined below.

Definition at line 84 of file IResidualPullCalculator.h.

84  {
85  return IID_IResidualPullCalculator;
86 }

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

◆ residualPull() [1/2]

virtual std::optional<Trk::ResidualPull> Trk::IResidualPullCalculator::residualPull ( const Trk::MeasurementBase ,
const Trk::TrackParameters ,
const Trk::ResidualPull::ResidualType  ,
const Trk::TrackState::MeasurementType  ,
const std::vector< const Trk::AlignmentEffectsOnTrack * > &   
) const
inlinevirtualinherited

This function returns (creates!) a Trk::ResidualPull object, which contains the values of residual and pull for the given measurement and track state, and the Alignment effects.

The track state can be an unbiased one (which can be retrieved by the Trk::IUpdator), a biased one (which contains the measurement), or a truth state. The enum residualTyp must be set according to this, otherwise the pulls will be wrong. Residuals differ in all three cases; please be aware of this.

This function determines the sub-detector type itself by using the ID helper

Reimplemented in Trk::ResidualPullCalculator.

Definition at line 64 of file IResidualPullCalculator.h.

69  {
70  return std::nullopt;
71  }

◆ residualPull() [2/2]

std::optional< Trk::ResidualPull > InDet::SCT_ResidualPullCalculator::residualPull ( const Trk::MeasurementBase measurement,
const Trk::TrackParameters trkPar,
const Trk::ResidualPull::ResidualType  resType,
const Trk::TrackState::MeasurementType   
) const
overridevirtual

This function returns (creates!) a Trk::ResidualPull object, which contains the values of residual and pull for the given measurement and track state.

calc residual and pull for SCT measurements

The track state can be an unbiased one (which can be retrieved by the Trk::IUpdator), a biased one (which contains the measurement), or a truth state. The enum ResidualType must be set according to this, otherwise the pulls will be wrong. Residuals differ in all three cases; please be aware of this!

Implements Trk::IResidualPullCalculator.

Definition at line 38 of file SCT_ResidualPullCalculator.cxx.

42  {
43 
44  // check the input:
45  const InDet::SCT_ClusterOnTrack *sctROT = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(measurement);
46  if (!sctROT) return std::nullopt;
47  if (!trkPar) return std::nullopt;
48 
49  // if no covariance for the track parameters is given the pull calculation is not valid
50  bool pullIsValid = trkPar->covariance()!=nullptr;
51 
52  // residual and pull are always 1-dim in the end
53  std::vector<double> residual(1);
54  std::vector<double> pull(1);
55  double sinAlpha = 0.0;
56 
57  // check if we have a 2-dim SCT cluster
58  if (sctROT->localParameters().parameterKey() == 1) {
59  // the (easy) 1-dim case:
60  residual[Trk::loc1] = sctROT->localParameters()[Trk::loc1] - trkPar->parameters()[Trk::loc1];
61  if (pullIsValid) {
64  (*trkPar->covariance())(Trk::loc1,Trk::loc1),
65  resType, pullIsValid);
66  } else {
69  0,
70  resType, pullIsValid);
71  }
72  } else {
73  // the 2-dim case:
74  // get the stereo angle (preferrably) from the PrepRawData
75  const InDet::SCT_Cluster *sctRIO = sctROT->prepRawData();
76  if (!sctRIO) {
78  sctROT->localParameters()[Trk::locY]);
79  sinAlpha = sctROT->detectorElement()->sinStereoLocal(p);
80  } else {
81  // Get angle of strip in local frame with respect to the etaAxis
82  // the position of the ROT is lorentz-drift corrected by up to 3 micron,
83  // leading to a strip frame slightly (~5murad) different than the original one
84  sinAlpha = sctRIO->detectorElement()->sinStereoLocal(sctRIO->localPosition());
85  }
86  double cosAlpha = sqrt(1 - sinAlpha*sinAlpha);
87 
88  // Calculate Residual for hit: res = (vec(x_track) - vec(x_hit)) * vec(n_perpendicular)
90  (measurement->localParameters()[Trk::locX] -
91  trkPar->parameters()[Trk::locX]) * cosAlpha
92  + (measurement->localParameters()[Trk::locY] -
93  trkPar->parameters()[Trk::locY]) * sinAlpha;
94 
95  // Fill transformation matrix to transform covariance matrices
96  Amg::MatrixX RotMat(2,2);
97  RotMat(0,0) = cosAlpha;
98  RotMat(0,1) = sinAlpha;
99  RotMat(1,0) = -sinAlpha;
100  RotMat(1,1) = cosAlpha;
101  // get the covariance matrix of the ROT and rotate it by stereo angle
102  Amg::MatrixX transformedROTCov = sctROT->localCovariance().similarity(RotMat);
103 
104  if (trkPar->covariance()) {
105  // Get local error matrix for track to calc pull
106  // Just use first local coordinates
107  // and rotate by the stereo angle
108  Amg::MatrixX RotMatTrk(2,2);
109  RotMatTrk(0,0) = (*trkPar->covariance())(0,0);
110  RotMatTrk(0,1) = (*trkPar->covariance())(0,1);
111  RotMatTrk(1,0) = (*trkPar->covariance())(1,0);
112  RotMatTrk(1,1) = (*trkPar->covariance())(1,1);
113 
114  Amg::MatrixX transformedTrkCov = RotMatTrk.similarity(RotMat);
115  // calc pull now
117  transformedROTCov(0,0),
118  transformedTrkCov(0,0),
119  resType, pullIsValid);
120  } else {
122  transformedROTCov(0,0),
123  0.,
124  resType, pullIsValid);
125  }
126 
127  }
128 
129  // create the Trk::ResidualPull:
130  // ParameterKey is always 1, because otherwise we rotated it back
131  return std::make_optional<Trk::ResidualPull>(std::move(residual),
132  std::move(pull), pullIsValid,
133  resType, 1, sinAlpha);
134 }

◆ residuals()

std::array< double, 5 > InDet::SCT_ResidualPullCalculator::residuals ( const Trk::MeasurementBase measurement,
const Trk::TrackParameters trkPar,
const Trk::ResidualPull::ResidualType  resType,
const Trk::TrackState::MeasurementType   
) const
overridevirtual

This function is a light-weight version of the function above, designed for track fitters where speed is critical.

calc residuals for SCT measurements

Implements Trk::IResidualPullCalculator.

Definition at line 140 of file SCT_ResidualPullCalculator.cxx.

144  {
145  std::array<double,5> residuals{};
146  // check the input:
147  const InDet::SCT_ClusterOnTrack *sctROT = dynamic_cast<const InDet::SCT_ClusterOnTrack*>(measurement);
148  if (!sctROT) return residuals;
149  if (!trkPar) return residuals;
150  double sinAlpha = 0.0;
151 
152  // check if we have a 2-dim SCT cluster
153  if (sctROT->localParameters().parameterKey() == 1) {
154  // the (easy) 1-dim case:
155  residuals[Trk::loc1] = sctROT->localParameters()[Trk::loc1] - trkPar->parameters()[Trk::loc1];
156  } else {
157  // the 2-dim case:
158  // get the stereo angle (preferrably) from the PrepRawData
159  const InDet::SCT_Cluster *sctRIO = sctROT->prepRawData();
160  if (!sctRIO) {
162  sctROT->localParameters()[Trk::locY]);
163  sinAlpha = sctROT->detectorElement()->sinStereoLocal(p);
164  } else {
165  // Get angle of strip in local frame with respect to the etaAxis
166  // the position of the ROT is lorentz-drift corrected by up to 3 micron,
167  // leading to a strip frame slightly (~5murad) different than the original one
168  sinAlpha = sctRIO->detectorElement()->sinStereoLocal(sctRIO->localPosition());
169  }
170  double cosAlpha = sqrt(1 - sinAlpha*sinAlpha);
171 
172  // Calculate Residual for hit: res = (vec(x_track) - vec(x_hit)) * vec(n_perpendicular)
174  (measurement->localParameters()[Trk::locX] -
175  trkPar->parameters()[Trk::locX]) * cosAlpha
176  + (measurement->localParameters()[Trk::locY] -
177  trkPar->parameters()[Trk::locY]) * sinAlpha;
178 
179  }
180  return residuals;
181 }

◆ 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_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_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:
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Trk::LocalParameters::parameterKey
int parameterKey() const
Identifier key for matrix expansion/reduction.
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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
InDet::SCT_ClusterOnTrack::prepRawData
virtual const InDet::SCT_Cluster * prepRawData() const override final
returns the PrepRawData - is a SCT_Cluster in this scope
Definition: SCT_ClusterOnTrack.h:145
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:282
InDet::SCT_ClusterOnTrack::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
returns the detector element, assoicated with the PRD of this class
Definition: SCT_ClusterOnTrack.h:158
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
InDet::SiCluster::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
Trk::ResidualPull::Biased
@ Biased
RP with track state including the hit.
Definition: ResidualPull.h:55
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDetDD::SiDetectorElement::sinStereoLocal
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
Definition: SiDetectorElement.cxx:288
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
InDet::SCT_ResidualPullCalculator::calcPull
static double calcPull(const double residual, const double locMesCov, const double locTrkCov, const Trk::ResidualPull::ResidualType &, bool &pullIsValid)
calc pull in 1 dimension
Definition: SCT_ResidualPullCalculator.cxx:187
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
InDet::SCT_ResidualPullCalculator::residuals
virtual std::array< double, 5 > residuals(const Trk::MeasurementBase *measurement, const Trk::TrackParameters *trkPar, const Trk::ResidualPull::ResidualType resType, const Trk::TrackState::MeasurementType) const override
This function is a light-weight version of the function above, designed for track fitters where speed...
Definition: SCT_ResidualPullCalculator.cxx:140
Trk::loc1
@ loc1
Definition: ParamDefs.h:34
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
InDet::SCT_ClusterOnTrack
Definition: SCT_ClusterOnTrack.h:44