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

#include <GlobalChiSquareFitterTool.h>

Collaboration diagram for ActsTrk::PRDSourceLinkCalibratorGX2F:

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
 The following is the implementation of the PRDSourceLinkCalibratorGX2F. More...
 

Public Attributes

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

Detailed Description

Definition at line 59 of file GlobalChiSquareFitterTool.h.

Member Function Documentation

◆ calibrate()

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

The following is the implementation of the PRDSourceLinkCalibratorGX2F.

To use this implementation, the flag for a refitting from PRD measurement has to be turned on in the appropriate Acts config.

Definition at line 57 of file GlobalChiSquareFitterTool.cxx.

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

Member Data Documentation

◆ broadRotCreator

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

Definition at line 67 of file GlobalChiSquareFitterTool.h.

◆ converterTool

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

Definition at line 68 of file GlobalChiSquareFitterTool.h.

◆ rotCreator

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

Definition at line 66 of file GlobalChiSquareFitterTool.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
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
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
ActsTrk::PRDSourceLinkCalibratorGX2F::rotCreator
const Trk::IRIO_OnTrackCreator * rotCreator
Definition: GlobalChiSquareFitterTool.h:66
Trk::theta
@ theta
Definition: ParamDefs.h:66
ActsTrk::PRDSourceLinkCalibratorGX2F::converterTool
const ActsTrk::IActsToTrkConverterTool * converterTool
Definition: GlobalChiSquareFitterTool.h:68
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
ActsTrk::PRDSourceLinkCalibratorGX2F::broadRotCreator
const Trk::IRIO_OnTrackCreator * broadRotCreator
Definition: GlobalChiSquareFitterTool.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...