ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
ActsTrk::PRDSourceLinkCalibrator Struct Reference

#include <KalmanFitterTool.h>

Collaboration diagram for ActsTrk::PRDSourceLinkCalibrator:

Public Member Functions

template<typename trajectory_t >
void calibrate (const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, typename trajectory_t::TrackStateProxy trackState) const
 

Public Attributes

const Trk::IRIO_OnTrackCreatorrotCreator {nullptr}
 
const Trk::IRIO_OnTrackCreatorbroadRotCreator {nullptr}
 
const ActsTrk::IActsToTrkConverterToolconverterTool {nullptr}
 

Detailed Description

Definition at line 69 of file KalmanFitterTool.h.

Member Function Documentation

◆ calibrate()

template<typename trajectory_t >
void ActsTrk::PRDSourceLinkCalibrator::calibrate ( const Acts::GeometryContext &  gctx,
const Acts::CalibrationContext &  cctx,
const Acts::SourceLink &  sl,
typename trajectory_t::TrackStateProxy  trackState 
) const

Definition at line 61 of file KalmanFitterTool.cxx.

64  {
65 
66  const Trk::PrepRawData* prd = sl.template get<PRDSourceLink>().prd;
67  trackState.setUncalibratedSourceLink(Acts::SourceLink{sl});
68 
69  const Acts::BoundTrackParameters actsParam(trackState.referenceSurface().getSharedPtr(),
70  trackState.predicted(),
71  trackState.predictedCovariance(),
73  std::unique_ptr<const Trk::TrackParameters> trkParam = converterTool->actsTrackParametersToTrkParameters(actsParam, gctx);
74 
75  //RIO_OnTrack creation from the PrepRawData
76  const Trk::Surface & prdsurf = prd->detectorElement()->surface(prd->identify());
77  const Trk::RIO_OnTrack *rot = nullptr;
78  const Trk::PlaneSurface *plsurf = nullptr;
79  if (prdsurf.type() == Trk::SurfaceType::Plane)
80  plsurf = static_cast < const Trk::PlaneSurface *>(&prdsurf);
81 
82  const Trk::StraightLineSurface *slsurf = nullptr;
83 
84  if (prdsurf.type() == Trk::SurfaceType::Line)
85  slsurf = static_cast < const Trk::StraightLineSurface *>(&prdsurf);
86 
87  //@TODO, there is no way to put a MSG in this framework yet. So the next 3 lines are commented
88  //if ((slsurf == nullptr) && (plsurf == nullptr)) {
89  //msg(MSG::ERROR) << "Surface is neither PlaneSurface nor StraightLineSurface!" << endmsg; //ATH_MSG_ERROR doesn't work here because (ActsTrk::PRDSourceLinkCalibrator' has no member named 'msg')
90  // }
91  if (slsurf != nullptr) {
93  slsurf->center(),
94  trackState.predicted()[Trk::phi],
95  trackState.predicted()[Trk::theta],
96  trackState.predicted()[Trk::qOverP],
97  *slsurf
98  );
99  if(broadRotCreator){
100  rot = broadRotCreator->correct(*prd, atasl,Gaudi::Hive::currentContext());
101  }
102  else{
103  rot = rotCreator->correct(*prd, atasl,Gaudi::Hive::currentContext());
104  }
105  } else if (plsurf != nullptr) {
106  if ((trkParam.get())->covariance() != nullptr) {
107  Trk::AtaPlane atapl(
108  plsurf->center(),
109  trackState.predicted()[Trk::phi],
110  trackState.predicted()[Trk::theta],
111  trackState.predicted()[Trk::qOverP],
112  *plsurf,
113  AmgSymMatrix(5)(*trkParam.get()->covariance())
114  );
115  rot = rotCreator->correct(*prd, atapl,Gaudi::Hive::currentContext());
116  } else {
117  Trk::AtaPlane atapl(
118  plsurf->center(),
119  trackState.predicted()[Trk::phi],
120  trackState.predicted()[Trk::theta],
121  trackState.predicted()[Trk::qOverP],
122  *plsurf
123  );
124  rot = rotCreator->correct(*prd, atapl,Gaudi::Hive::currentContext());
125  }
126  } // End of RIO_OnTrack creation from the PrepRawData
127 
128  int dim = (*rot).localParameters().dimension();
129  trackState.allocateCalibrated(dim);
130 
131  //Writting the calibrated ROT measurment into the trackState
132  if (dim == 0)
133  {
134  throw std::runtime_error("Cannot create dim 0 measurement");
135  } else if (dim == 1) {
136  trackState.template calibrated<1>() = (*rot).localParameters().template head<1>();
137  trackState.template calibratedCovariance<1>() = (*rot).localCovariance().template topLeftCorner<1, 1>();
138  Acts::BoundSubspaceIndices subspaceIndices;
139  if ((*rot).associatedSurface().bounds().type() == Trk::SurfaceBounds::Annulus) {
140  subspaceIndices = {Acts::eBoundLoc1}; // y coordinate is l0
141  } else {
142  subspaceIndices = {Acts::eBoundLoc0}; // x coordinate is l0
143  }
144  trackState.setProjectorSubspaceIndices(subspaceIndices);
145  }
146  else if (dim == 2)
147  {
148  trackState.template calibrated<2>() = (*rot).localParameters().template head<2>();
149  trackState.template calibratedCovariance<2>() = (*rot).localCovariance().template topLeftCorner<2, 2>();
150  Acts::BoundSubspaceIndices subspaceIndices = {Acts::eBoundLoc0, Acts::eBoundLoc1};
151  trackState.setProjectorSubspaceIndices(subspaceIndices);
152  }
153  else
154  {
155  throw std::runtime_error("Dim " + std::to_string(dim) +
156  " currently not supported.");
157  }
158  delete rot; //Delete rot as a precaution
159 
160 }

Member Data Documentation

◆ broadRotCreator

const Trk::IRIO_OnTrackCreator* ActsTrk::PRDSourceLinkCalibrator::broadRotCreator {nullptr}

Definition at line 77 of file KalmanFitterTool.h.

◆ converterTool

const ActsTrk::IActsToTrkConverterTool* ActsTrk::PRDSourceLinkCalibrator::converterTool {nullptr}

Definition at line 78 of file KalmanFitterTool.h.

◆ rotCreator

const Trk::IRIO_OnTrackCreator* ActsTrk::PRDSourceLinkCalibrator::rotCreator {nullptr}

Definition at line 76 of file KalmanFitterTool.h.


The documentation for this struct was generated from the following files:
Trk::IRIO_OnTrackCreator::correct
virtual RIO_OnTrack * correct(const PrepRawData &hit, const TrackParameters &trk, const EventContext &ctx) const =0
abstract base method for the creation of RIO_OnTrack it takes a RIO (PrepRawData) and the given Track...
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
ActsTrk::PRDSourceLinkCalibrator::rotCreator
const Trk::IRIO_OnTrackCreator * rotCreator
Definition: KalmanFitterTool.h:76
ActsTrk::PRDSourceLinkCalibrator::converterTool
const ActsTrk::IActsToTrkConverterTool * converterTool
Definition: KalmanFitterTool.h:78
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
xAOD::pion
@ pion
Definition: TrackingPrimitives.h:196
Trk::SurfaceBounds::Annulus
@ Annulus
Definition: SurfaceBounds.h:70
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
ActsTrk::PRDSourceLinkCalibrator::broadRotCreator
const Trk::IRIO_OnTrackCreator * broadRotCreator
Definition: KalmanFitterTool.h:77
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
Trk::theta
@ theta
Definition: ParamDefs.h:66
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
Trk::PrepRawData
Definition: PrepRawData.h:62
ActsTrk::IActsToTrkConverterTool::actsTrackParametersToTrkParameters
virtual std::unique_ptr< Trk::TrackParameters > actsTrackParametersToTrkParameters(const Acts::BoundTrackParameters &actsParameter, const Acts::GeometryContext &gctx) const =0
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Trk::PlaneSurface
Definition: PlaneSurface.h:64
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
Trk::SurfaceType::Plane
@ Plane
Trk::phi
@ phi
Definition: ParamDefs.h:75
Trk::SurfaceType::Line
@ Line
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::Surface::type
constexpr virtual SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
Trk::PrepRawData::detectorElement
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...