 |
ATLAS Offline Software
|
#include <AlignResidualCalculator.h>
|
| AlignResidualCalculator (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~AlignResidualCalculator () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual double | setResiduals (DataVector< AlignTSOS > *alignTSOSColl, const Track *track) override |
| sets residuals for AlignTSOS on AlignTrack and returns total chi2 More...
|
|
virtual double | setResiduals (AlignTrack *alignTrack, const Track *track) override |
| sets residuals for AlignTSOS on AlignTrack and returns total chi2 More...
|
|
virtual double | setResiduals (DataVector< AlignTSOS >::iterator firstAtsos, DataVector< AlignTSOS >::iterator lastAtsos, const Track *track, bool newTrack) override |
| sets residuals for AlignTSOS on AlignTrack and returns total chi2 More...
|
|
virtual double | chi2ForMeasType (int measType) const override |
| returns chi2 summed over hits of a particular MeasurementType 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, V, H > &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 |
|
|
double | setResidualsOnATSOS (AlignTSOS *atsos, const TrackStateOnSurface *tsos) |
|
void | accumulateScattering (const TrackStateOnSurface *tsos) |
|
const TrackStateOnSurface * | getMatchingTSOS (const AlignTSOS *atsos, const Track *track) |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 39 of file AlignResidualCalculator.h.
◆ StoreGateSvc_t
◆ AlignResidualCalculator()
AlignResidualCalculator::AlignResidualCalculator |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~AlignResidualCalculator()
AlignResidualCalculator::~AlignResidualCalculator |
( |
| ) |
|
|
virtual |
◆ accumulateScattering()
Definition at line 290 of file AlignResidualCalculator.cxx.
293 const MaterialEffectsOnTrack* meot =
dynamic_cast<const MaterialEffectsOnTrack*
>(tsos->materialEffectsOnTrack());
299 const EnergyLoss* energyLoss = meot->energyLoss();
302 if (!
dynamic_cast<const CaloEnergy*
>(energyLoss)) {
◆ chi2ForMeasType()
virtual double Trk::AlignResidualCalculator::chi2ForMeasType |
( |
int |
measType | ) |
const |
|
inlineoverridevirtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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 AlignResidualCalculator::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getMatchingTSOS()
Definition at line 310 of file AlignResidualCalculator.cxx.
312 const TrackStateOnSurface* tsos(
nullptr);
314 if (atsos->rio() || atsos->crio()) {
316 for (
const TrackStateOnSurface* itTsos : *
track->trackStateOnSurfaces()) {
320 const MeasurementBase* mesb = itTsos->measurementOnTrack();
325 rio = &(crio->rioOnTrack(0));
328 if (rio->identify() == atsos->rio()->identify()) {
329 ATH_MSG_DEBUG(
"matched TSOS with identifier: "<<rio->identify());
338 const Amg::Vector3D origPosition=atsos->trackParameters()->position();
342 for (
const TrackStateOnSurface* itTsos : *
track->trackStateOnSurfaces()) {
345 if (!
dynamic_cast<const MaterialEffectsOnTrack*
>(itTsos->materialEffectsOnTrack()))
continue;
346 if (!itTsos->trackParameters()) {
ATH_MSG_WARNING(
"no track parameters!");
continue; }
347 const Amg::Vector3D newPosition=itTsos->trackParameters()->position();
348 ATH_MSG_DEBUG(
"origPos: "<<origPosition<<
", newPos: "<<newPosition);
349 double newdist2=(newPosition - origPosition).
mag2();
357 if (!tsos)
return nullptr;
358 const Amg::Vector3D addPosition=tsos->trackParameters()->position();
364 ATH_MSG_WARNING(
"TSOS already found with position "<<addPosition<<
"!");
◆ initialize()
StatusCode AlignResidualCalculator::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
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 & IAlignResidualCalculator::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ setResiduals() [1/3]
◆ setResiduals() [2/3]
◆ setResiduals() [3/3]
◆ setResidualsOnATSOS()
Definition at line 130 of file AlignResidualCalculator.cxx.
139 atsos->clearResiduals();
149 ATH_MSG_WARNING(
"When using unbiased residuals including scatterers doesn't make sense!");
151 const MaterialEffectsBase* meb = tsos->materialEffectsOnTrack();
153 const ScatteringAngles* scatterer = (meot) ? meot->
scatteringAngles() :
nullptr;
157 nscatparam = (scatterer) ? 2 : 1;
159 for (
int iparam=0;iparam<nscatparam;iparam++) {
170 errSq = scatterer->sigmaDeltaTheta();
171 ATH_MSG_DEBUG(
"sigmaDeltaTheta="<<scatterer->sigmaDeltaTheta());
172 ATH_MSG_DEBUG(
"sigmaDeltaPhi ="<<scatterer->sigmaDeltaPhi());
178 errSq = scatterer->sigmaDeltaTheta();
187 atsos->addResidual(
res);
189 dchi2 +=
res.residualNorm()*
res.residualNorm();
192 else if (!atsos->rio() && !atsos->crio()) {
200 double residual = .001*(E0-E1-energyLoss);
203 ATH_MSG_DEBUG(
"E0/E1/energyLoss: "<<E0<<
"/"<<E1<<
"/"<<energyLoss);
209 atsos->addResidual(
res);
210 dchi2 +=
res.residualNorm()*
res.residualNorm();
217 if (atsos->rio() || atsos->crio()) {
220 for (
int iparam=0;iparam<nparams;iparam++) {
226 (atsos->rio()!=
nullptr || atsos->crio()!=
nullptr) ) {
228 const MeasurementBase* mesb = tsos->measurementOnTrack();
231 std::optional<ResidualPull> resPull = std::nullopt;
239 mesb->localParameters(),
240 mesb->localCovariance()).release();
241 if (unbiasedTrackPars) {
242 trackPars = unbiasedTrackPars;
244 atsos->setUnbiasedTrackPars(unbiasedTrackPars);
247 ATH_MSG_WARNING(
"Could not get unbiased track parameters, use normal parameters");
250 ATH_MSG_DEBUG(
"Calling ResidualPullCalculator for residual type "
259 residual = (resPull->residual())[iparam];
260 double pull=(resPull->pull())[iparam];
267 <<mesb->globalPosition().y()<<
", "
268 <<mesb->globalPosition().z()<<
")");
275 << atsos->dumpType()<<
", meas type "<<atsos->measType() );
281 atsos->addResidual(
res);
282 dchi2 +=
res.residualNorm()*
res.residualNorm();
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_chi2ForMeasType
double* Trk::AlignResidualCalculator::m_chi2ForMeasType = nullptr |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_includeScatterers
BooleanProperty Trk::AlignResidualCalculator::m_includeScatterers {this, "IncludeScatterers", false} |
|
private |
◆ m_matchedTSOS
◆ m_nDoF
int Trk::AlignResidualCalculator::m_nDoF {} |
|
private |
◆ m_previousQOverP
double Trk::AlignResidualCalculator::m_previousQOverP {} |
|
private |
◆ m_pullCalculator
Initial value:{
this, "ResidualPullCalculator", "Trk::ResidualPullCalculator/ResidualPullCalculator"}
Definition at line 73 of file AlignResidualCalculator.h.
◆ m_qOverP
double Trk::AlignResidualCalculator::m_qOverP {} |
|
private |
◆ m_resType
IntegerProperty Trk::AlignResidualCalculator::m_resType |
|
private |
Initial value:{
"residual type as defined in the Trk::AlignResidualType enum"}
Definition at line 78 of file AlignResidualCalculator.h.
◆ m_updator
ToolHandle<IUpdator> Trk::AlignResidualCalculator::m_updator |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
class extending the basic Trk::EnergyLoss to describe the measured or parameterised muon energy loss ...
std::string find(const std::string &s)
return a remapped string
std::vector< const TrackStateOnSurface * > m_matchedTSOS
double sigmaDeltaE() const
returns the symmatric error
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
ResidualPull::ResidualType ResidualPullType(AlignResidualType type)
IntegerProperty m_resType
virtual void setOwner(IDataHandleHolder *o)=0
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
represents the full description of deflection and e-loss of a track in material.
double * m_chi2ForMeasType
Residual is a class that stores the residual, error, and type of residual.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::pair< std::vector< unsigned int >, bool > res
double deltaE() const
returns the
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ParametersBase< TrackParametersDim, Charged > TrackParameters
ToolHandle< IResidualPullCalculator > m_pullCalculator
Eigen::Matrix< double, 3, 1 > Vector3D
virtual double setResiduals(DataVector< AlignTSOS > *alignTSOSColl, const Track *track) override
sets residuals for AlignTSOS on AlignTrack and returns total chi2
ToolHandle< IUpdator > m_updator
BooleanProperty m_includeScatterers
const EnergyLoss * energyLoss() const
returns the energy loss object.
#define ATH_MSG_WARNING(x)
const ScatteringAngles * scatteringAngles() const
returns the MCS-angles object.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AlignResidualType is an enum describing the type of residual AlignMesType is an enum describing the t...
float distance2(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the squared distance between two point in 3D space
Scalar mag2() const
mag2 method - forward to squaredNorm()