 |
ATLAS Offline Software
|
#include <HGTDTrackExtensionAlg.h>
|
struct | TrackExtensionData |
| Data structure to hold HGTD track extension results Contains information about hits, timing, and extrapolation for each HGTD layer. More...
|
|
|
virtual | ~HGTDTrackExtensionAlg ()=default |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute (const EventContext &) const override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
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 | 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 |
|
|
xAOD::TrackParticle * | CKFTrackExtension (const Acts::BoundTrackParameters *parameters) |
|
const Acts::Logger & | logger () const |
| Private access to the logger. More...
|
|
StatusCode | collectMeasurements (const EventContext &context, detail::TrackFindingMeasurements &measurements) const |
|
TrackExtensionData | processTrackExtension (const EventContext &ctx, const xAOD::TrackParticle *trackParticle, const detail::RecoTrackContainer::TrackProxy &trackProxy) const |
|
std::pair< float, float > | correctTOF (const xAOD::TrackParticle *trackParticle, const xAOD::HGTDCluster *cluster, float measuredTime, float measuredTimeErr, const Acts::TrackingGeometry *trackingGeometry, const Acts::GeometryContext &geoContext) const |
|
const xAOD::HGTDCluster * | getHGTDClusterFromState (const ActsTrk::detail::RecoConstTrackStateContainerProxy &state) const |
|
std::size_t | getHGTDLayerIndex (const Acts::GeometryIdentifier &geoID) const |
|
bool | isHGTDSurface (const Acts::GeometryIdentifier &geoID) const |
|
bool | getExtrapolationPosition (const EventContext &ctx, const detail::RecoTrackContainer::TrackProxy &track, float &x, float &y, float &z) const |
|
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...
|
|
|
SG::ReadHandleKey< xAOD::TrackParticleContainer > | m_trackParticleContainerName {this, "TrackParticleContainerName", "", "Name of the TrackParticle container"} |
|
SG::ReadHandleKey< xAOD::HGTDClusterContainer > | m_HGTDClusterContainerName {this, "HGTDClusterContainerName", "", "the HGTD clusters"} |
|
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > | m_numHGTDHitsKey {this, "numHGTDHits", m_trackParticleContainerName, "numHGTDHits", "Number of HGTD hits on the track extension"} |
|
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > | m_layerHasExtensionKey { this, "HGTD_has_extension", m_trackParticleContainerName, "HGTD_has_extension", "Decoration for layer extension" } |
|
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > | m_layerExtensionChi2Key { this, "HGTD_extension_chi2", m_trackParticleContainerName, "HGTD_extension_chi2", "Decoration for chi2 of extension" } |
|
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > | m_layerClusterRawTimeKey { this, "HGTD_cluster_raw_time", m_trackParticleContainerName, "HGTD_cluster_raw_time", "Decoration for raw time of cluster" } |
|
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > | m_layerClusterTimeKey { this, "HGTD_cluster_time", m_trackParticleContainerName, "HGTD_cluster_time", "Decoration for cluster time" } |
|
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > | m_extrapXKey { this, "HGTD_extrap_x", m_trackParticleContainerName, "HGTD_extrap_x", "Decoration for extrapolated X coordinate" } |
|
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > | m_extrapYKey { this, "HGTD_extrap_y", m_trackParticleContainerName, "HGTD_extrap_y", "Decoration for extrapolated Y coordinate" } |
|
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > | m_actsTrackLinkKey {this, "ActsTrackLink", m_trackParticleContainerName, "actsTrack", "Link to Acts track"} |
|
Gaudi::Property< float > | m_minEtaAcceptance {this, "MinEtaAcceptance", 2.38, "Minimum eta to consider a track for extension"} |
|
Gaudi::Property< float > | m_maxEtaAcceptance {this, "MaxEtaAcceptance", 4.00, "Maximum eta to consider a track for extension"} |
|
ToolHandle< GenericMonitoringTool > | m_monTool {this, "MonTool", "", "Monitoring tool"} |
|
PublicToolHandle< ActsTrk::ITrackingGeometryTool > | m_trackingGeometryTool {this, "TrackingGeometryTool", ""} |
|
ToolHandle< IActsExtrapolationTool > | m_extrapolationTool {this, "ExtrapolationTool", ""} |
|
ToolHandle< ActsTrk::IOnTrackCalibratorTool< detail::RecoTrackStateContainer > > | m_pixelCalibTool {this, "PixelCalibrator", "", "Opt. pixel measurement calibrator"} |
|
ToolHandle< ActsTrk::IOnTrackCalibratorTool< detail::RecoTrackStateContainer > > | m_stripCalibTool {this, "StripCalibrator", "", "Opt. strip measurement calibrator"} |
|
ToolHandle< ActsTrk::IOnTrackCalibratorTool< detail::RecoTrackStateContainer > > | m_hgtdCalibTool {this, "HGTDCalibrator", "", "Opt. HGTD measurement calibrator"} |
|
ToolHandle< ActsTrk::TrackStatePrinterTool > | m_trackStatePrinter {this, "TrackStatePrinter", "", "optional track state printer"} |
|
ActsTrk::detail::xAODUncalibMeasSurfAcc | m_surfAcc {} |
|
SG::ReadHandleKey< xAOD::UncalibratedMeasurementContainer > | m_uncalibratedMeasurementContainerKey_HGTD {this, "UncalibratedMeasurementContainerKey_HGTD", "", "input cluster collections for HGTD"} |
|
std::unique_ptr< const Acts::Logger > | m_logger |
|
std::unique_ptr< detail::CKF_config > | m_trackFinder |
|
Acts::CalibrationContext | m_calibrationContext |
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
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 |
|
Definition at line 61 of file HGTDTrackExtensionAlg.h.
◆ CKFOptions
◆ StoreGateSvc_t
◆ ~HGTDTrackExtensionAlg()
virtual ActsTrk::HGTDTrackExtensionAlg::~HGTDTrackExtensionAlg |
( |
| ) |
|
|
virtualdefault |
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ CKFTrackExtension()
◆ collectMeasurements()
Definition at line 348 of file HGTDTrackExtensionAlg.cxx.
366 if (not surface)
continue;
371 auto localPosition = cluster->localPosition<3>();
372 double clusterTime = localPosition[2];
381 mon_cluster_x, mon_cluster_y, mon_cluster_z,
386 measurements.addMeasurements(0,
390 return StatusCode::SUCCESS;
◆ correctTOF()
std::pair< float, float > ActsTrk::HGTDTrackExtensionAlg::correctTOF |
( |
const xAOD::TrackParticle * |
trackParticle, |
|
|
const xAOD::HGTDCluster * |
cluster, |
|
|
float |
measuredTime, |
|
|
float |
measuredTimeErr, |
|
|
const Acts::TrackingGeometry * |
trackingGeometry, |
|
|
const Acts::GeometryContext & |
geoContext |
|
) |
| const |
|
private |
Definition at line 733 of file HGTDTrackExtensionAlg.cxx.
743 if (!trackParticle || !cluster) {
745 return {measuredTime, measuredTimeErr};
749 const Acts::Surface* surface =
nullptr;
754 return {measuredTime, measuredTimeErr};
758 ATH_MSG_WARNING(
"Could not determine surface for HGTD cluster with id "
760 return {measuredTime, measuredTimeErr};
764 Acts::Vector3 globalHitPos;
769 globalHitPos = surface->localToGlobal(
771 Acts::Vector2(localPos[0], localPos[1]),
776 globalHitPos = surface->center(geoContext);
788 double d0 = trackParticle->
d0();
789 double z0 = trackParticle->
z0();
790 double phi0 = trackParticle->
phi0();
794 ATH_MSG_DEBUG(
"Track origin (perigee): (" << trackOrigin.x() <<
", "
795 << trackOrigin.y() <<
", " << trackOrigin.z() <<
")");
798 float dx = globalHitPos.x() - trackOrigin.x();
799 float dy = globalHitPos.y() - trackOrigin.y();
800 float dz = globalHitPos.z() - trackOrigin.z();
807 float correctedTime = measuredTime - tof;
810 << trackOrigin.y() <<
", " << trackOrigin.z() <<
")");
812 << globalHitPos.y() <<
", " << globalHitPos.z() <<
")");
814 <<
" ns, Corrected time = " << correctedTime);
816 return {correctedTime, measuredTimeErr};
◆ 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);
◆ 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.
◆ 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.
◆ 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]
◆ execute()
StatusCode ActsTrk::HGTDTrackExtensionAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 120 of file HGTDTrackExtensionAlg.cxx.
135 ATH_MSG_DEBUG(
"Size of trackParticles collection " << trackParticles->size());
156 ATH_MSG_DEBUG(
"Retrieved " << uncalibratedMeasurementContainer->size()
172 std::unordered_set<uint32_t> hgtdVolumes {};
173 std::unordered_map<uint32_t, std::unordered_set<uint32_t>> hgtdLayers {};
179 Acts::GeometryIdentifier geoID = surface->geometryId();
183 hgtdVolumes.insert(vol);
184 hgtdLayers[vol].insert(
layer);
188 ATH_MSG_ERROR(
"Failed to retrieve surface for cluster " << cluster->index());
189 return StatusCode::FAILURE;
193 ATH_MSG_DEBUG(
"Found " << hgtdVolumes.size() <<
" different HGTD volumes");
195 ATH_MSG_DEBUG(
"HGTD Volume " << vol <<
" has " << hgtdLayers[vol].
size() <<
" layers:");
202 detail::TrackFindingMeasurements measurements(1
ul);
205 using DefaultTrackStateCreator = Acts::TrackStateCreator<ActsTrk::detail::UncalibSourceLinkAccessor::Iterator,detail::RecoTrackContainer>;
208 DefaultTrackStateCreator::SourceLinkAccessor slAccessorDelegate;
213 ATH_MSG_DEBUG(
"Create " << uncalibratedMeasurementContainer->size()
214 <<
" source links from measurements in "
219 {uncalibratedMeasurementContainer},
220 measurements.measurementOffsets());
223 Acts::PropagatorPlainOptions plainOptions(geoContext, mfContext);
224 plainOptions.direction = Acts::Direction::Forward();
233 auto calibrator = detail::OnTrackCalibrator<detail::RecoTrackStateContainer>(
m_trackingGeometryTool.get(),
239 defaultTrackStateCreator.sourceLinkAccessor = slAccessorDelegate;
240 defaultTrackStateCreator.calibrator.template connect<&detail::OnTrackCalibrator<detail::RecoTrackStateContainer>::calibrate>(&calibrator);
243 &DefaultTrackStateCreator::createTrackStates>(&defaultTrackStateCreator);
252 TrackExtensionData trackData;
255 if (!link_to_track.
isValid()) {
256 ATH_MSG_ERROR(
"Invalid ACTS track link for TrackParticle " << trackParticle->index());
257 return StatusCode::FAILURE;
260 std::optional<ActsTrk::TrackContainer::ConstTrackProxy> optional_track = *link_to_track;
261 if (!optional_track.has_value()) {
262 ATH_MSG_ERROR(
"No valid ACTS track associated with TrackParticle " << trackParticle->index());
263 return StatusCode::FAILURE;
266 const ActsTrk::TrackContainer::ConstTrackProxy&
track = optional_track.value();
268 Acts::VectorTrackContainer trackBackend;
269 Acts::VectorMultiTrajectory trackStateBackend;
280 <<
"], skipping extension ------ !!!!!");
283 layerHasExtensionHandle(*trackParticle) = trackData.hasClusterVec;
284 layerExtensionChi2Handle(*trackParticle) = trackData.chi2Vec;
285 layerClusterRawTimeHandle(*trackParticle) = trackData.rawTimeVec;
286 layerClusterTimeHandle(*trackParticle) = trackData.timeVec;
287 extrapXHandle(*trackParticle) = trackData.extrapX;
288 extrapYHandle(*trackParticle) = trackData.extrapY;
289 numHGTDHitsHandle(*trackParticle) = trackData.numHGTDHits;
294 float trackpT =
track.transverseMomentum();
296 float trackNmeasurements =
track.nMeasurements();
298 ATH_MSG_DEBUG(
"TrackParticle " << trackParticle->index() <<
" has ACTS track with eta: " <<
trackEta <<
", phi = " <<
trackPhi <<
" pT: " << trackpT <<
" and nMeasurements: " << trackNmeasurements);
301 const auto lastMeasurementState = Acts::findLastMeasurementState(
track);
302 if (not lastMeasurementState.ok()) {
303 ATH_MSG_ERROR(
"Problem finding last measurement state for acts track");
304 return StatusCode::FAILURE;
306 const Acts::BoundTrackParameters lastMeasurementStateParameters =
track.createParametersFromState(*lastMeasurementState);
309 const Acts::Surface& refSurface =
track.referenceSurface();
310 const Acts::BoundTrackParameters parametersAtRefSurface(refSurface.getSharedPtr(),
313 track.particleHypothesis());
315 ATH_MSG_DEBUG(
"Initial track parameters for extension - lastMeasurementStateParameters:");
317 ATH_MSG_DEBUG(
" - phi: " << lastMeasurementStateParameters.phi());
318 ATH_MSG_DEBUG(
" - pT: " << std::abs(1./lastMeasurementStateParameters.qOverP() *
std::sin(lastMeasurementStateParameters.theta())));
319 ATH_MSG_DEBUG(
" - theta: " << lastMeasurementStateParameters.theta());
320 ATH_MSG_DEBUG(
" - qOverP: " << lastMeasurementStateParameters.qOverP());
321 ATH_MSG_DEBUG(
" - covariance exists: " << (lastMeasurementStateParameters.covariance().has_value() ?
"yes" :
"no"));
326 ATH_MSG_DEBUG(
"Built " << tracksContainerTemp.size() <<
" tracks from it");
328 for (
const detail::RecoTrackContainer::TrackProxy trackProxy : tracksContainerTemp) {
333 layerHasExtensionHandle(*trackParticle) = trackData.hasClusterVec;
334 layerExtensionChi2Handle(*trackParticle) = trackData.chi2Vec;
335 layerClusterRawTimeHandle(*trackParticle) = trackData.rawTimeVec;
336 layerClusterTimeHandle(*trackParticle) = trackData.timeVec;
337 extrapXHandle(*trackParticle) = trackData.extrapX;
338 extrapYHandle(*trackParticle) = trackData.extrapY;
339 numHGTDHitsHandle(*trackParticle) = trackData.numHGTDHits;
343 return StatusCode::SUCCESS;
◆ 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
◆ extraOutputDeps()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ filterPassed()
◆ getExtrapolationPosition()
bool ActsTrk::HGTDTrackExtensionAlg::getExtrapolationPosition |
( |
const EventContext & |
ctx, |
|
|
const detail::RecoTrackContainer::TrackProxy & |
track, |
|
|
float & |
x, |
|
|
float & |
y, |
|
|
float & |
z |
|
) |
| const |
|
private |
Definition at line 648 of file HGTDTrackExtensionAlg.cxx.
659 bool foundHGTDSurface =
false;
663 track.container().trackStateContainer().visitBackwards(
665 [
this, &foundHGTDSurface, &
x, &
y, &
z, geoContext](
const auto& state) {
667 if (foundHGTDSurface || !state.hasReferenceSurface()) {
671 const auto& surface = state.referenceSurface();
672 Acts::GeometryIdentifier geoID = surface.geometryId();
677 if (state.hasPredicted()) {
679 const auto& predicted = state.predicted();
683 Acts::Vector2 localPos(predicted[Acts::eBoundLoc0], predicted[Acts::eBoundLoc1]);
686 Acts::Vector3 globalPos = surface.localToGlobal(
689 Acts::Vector3::Zero());
696 ATH_MSG_DEBUG(
"Predicted position on HGTD surface: (" << x <<
", " << y <<
", " << z <<
")");
697 foundHGTDSurface = true;
700 Acts::Vector3 globalPos = surface.center(geoContext);
705 ATH_MSG_DEBUG(
"Fallback to surface center for HGTD: (" << x <<
", " << y <<
", " << z <<
")");
706 foundHGTDSurface = true;
711 return foundHGTDSurface;
◆ getHGTDClusterFromState()
Definition at line 819 of file HGTDTrackExtensionAlg.cxx.
820 if (state.hasUncalibratedSourceLink()) {
821 auto sl = state.getUncalibratedSourceLink().template get<ATLASUncalibSourceLink>();
822 assert( sl !=
nullptr);
831 ATH_MSG_DEBUG(
"Source link contains non-HGTD measurement type: " <<
static_cast<int>(clusterType));
835 if (state.hasReferenceSurface()) {
836 const auto& surface = state.referenceSurface();
837 Acts::GeometryIdentifier geoID = surface.geometryId();
841 ATH_MSG_DEBUG(
"This is an HGTD surface with ID: " << geoID.volume() <<
":" << geoID.layer());
844 EventContext ctx = Gaudi::Hive::currentContext();
850 if (!hgtdClusters.isValid()) {
857 Acts::Vector3 statePos = surface.center(geoContext);
861 double minDistance = 100.0;
865 const Acts::Surface* clusterSurface =
m_surfAcc.
get(cluster);
867 if (!clusterSurface)
continue;
870 Acts::GeometryIdentifier clusterGeoID = clusterSurface->geometryId();
871 if (clusterGeoID.volume() == geoID.volume() && clusterGeoID.layer() == geoID.layer()) {
873 Acts::Vector3 clusterPos = clusterSurface->center(geoContext);
876 double dx = clusterPos.x() - statePos.x();
877 double dy = clusterPos.y() - statePos.y();
883 closestCluster = cluster;
889 if (closestCluster) {
890 ATH_MSG_DEBUG(
"Found closest cluster at distance " << minDistance <<
" mm");
891 return closestCluster;
898 ATH_MSG_DEBUG(
"State doesn't have uncalibrated source link");
◆ getHGTDLayerIndex()
std::size_t ActsTrk::HGTDTrackExtensionAlg::getHGTDLayerIndex |
( |
const Acts::GeometryIdentifier & |
geoID | ) |
const |
|
private |
Definition at line 615 of file HGTDTrackExtensionAlg.cxx.
621 bool isPositiveEndcap = (volume == 25);
622 bool isNegativeEndcap = (volume == 2);
625 if (isPositiveEndcap) {
634 }
else if (isNegativeEndcap) {
◆ initialize()
StatusCode ActsTrk::HGTDTrackExtensionAlg::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 42 of file HGTDTrackExtensionAlg.cxx.
80 auto magneticField = std::make_unique<ATLASMagneticFieldWrapper>();
81 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry =
m_trackingGeometryTool->trackingGeometry();
84 detail::Navigator::Config
cfg{trackingGeometry};
85 cfg.resolvePassive =
true;
86 cfg.resolveMaterial =
true;
87 cfg.resolveSensitive =
true;
95 Acts::TrackSelector::EtaBinnedConfig trackSelectorCfg(std::vector<double>({0, 4}));
96 trackSelectorCfg.cutSets[0].ptMin = 500;
97 trackSelectorCfg.cutSets[0].ptMax = 1000000;
98 trackSelectorCfg.cutSets[0].minMeasurements = 1;
99 trackSelectorCfg.cutSets[0].maxHoles = 4;
100 trackSelectorCfg.cutSets[0].maxOutliers = 4;
101 trackSelectorCfg.cutSets[0].maxHolesAndOutliers = 4;
102 trackSelectorCfg.cutSets[0].maxSharedHits = 4;
103 trackSelectorCfg.cutSets[0].maxChi2 = 10000000.0;
107 detail::CKF_config ckfConfig{
108 std::move(extrapolator),
111 Acts::TrackSelector{trackSelectorCfg}};
113 m_trackFinder = std::make_unique<detail::CKF_config>(std::move(ckfConfig));
115 return StatusCode::SUCCESS;
◆ 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.
◆ isClonable()
◆ isHGTDSurface()
bool ActsTrk::HGTDTrackExtensionAlg::isHGTDSurface |
( |
const Acts::GeometryIdentifier & |
geoID | ) |
const |
|
private |
◆ logger()
const Acts::Logger& ActsTrk::HGTDTrackExtensionAlg::logger |
( |
| ) |
const |
|
inlineprivate |
◆ 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.
◆ processTrackExtension()
Definition at line 393 of file HGTDTrackExtensionAlg.cxx.
398 TrackExtensionData
data;
408 std::size_t nMeasurements = 0;
409 std::size_t nHoles = 0;
410 std::size_t nOutliers = 0;
411 std::size_t nHGTDHits = 0;
413 std::vector<bool> hasHitInLayer = {
false,
false,
false,
false};
414 std::vector<float> chi2PerLayer = {0.0, 0.0, 0.0, 0.0};
415 std::vector<float> timePerLayer = {0.0, 0.0, 0.0, 0.0};
416 std::vector<float> rawTimePerLayer = {0.0, 0.0, 0.0, 0.0};
418 std::vector<int> truthClassPerLayer = {-1, -1, -1, -1};
419 std::vector<bool> isShadowedPerLayer = {
false,
false,
false,
false};
420 std::vector<bool> isMergedPerLayer = {
false,
false,
false,
false};
421 std::vector<bool> primaryExpectedPerLayer = {
false,
false,
false,
false};
427 bool foundExtrapolation =
false;
429 trackProxy.container().trackStateContainer().visitBackwards(
430 trackProxy.tipIndex(),
431 [&](
const auto& state) {
432 auto flags = state.typeFlags();
433 if (flags.test(Acts::TrackStateFlag::HoleFlag)) {
435 }
else if (
flags.test(Acts::TrackStateFlag::OutlierFlag)) {
437 }
else if (
flags.test(Acts::TrackStateFlag::MeasurementFlag)) {
441 if (state.hasReferenceSurface() && flags.test(Acts::TrackStateFlag::MeasurementFlag)) {
442 const auto& surface = state.referenceSurface();
443 Acts::GeometryIdentifier geoID = surface.geometryId();
445 if (isHGTDSurface(geoID)) {
446 std::size_t layerIndex = getHGTDLayerIndex(geoID);
448 const auto& calibrated = state.template calibrated<3>();
449 const auto& predicted = state.predicted();
450 const auto& calibCov = state.template calibratedCovariance<3>();
454 Eigen::Vector2d residual2d;
455 residual2d(0) = calibrated(0) - predicted(Acts::eBoundLoc0);
456 residual2d(1) = calibrated(1) - predicted(Acts::eBoundLoc1);
459 AmgSymMatrix(2) cov_2d{calibCov.template block<2,2>(0,0)};
462 const auto& predictedCov = state.predictedCovariance();
463 AmgSymMatrix(2) predicted_cov_2d{predictedCov.template block<2,2>(0,0)};
466 AmgSymMatrix(2) residual_cov = cov_2d + predicted_cov_2d;
472 if (residual_cov.determinant() != 0)
474 chi2 = residual2d.transpose() * residual_cov.inverse() * residual2d;
481 if (layerIndex < 4) {
483 hasHitInLayer[layerIndex] = true;
484 chi2PerLayer[layerIndex] =chi2/ndf;
488 float rawTime = 0.0f;
489 float calibratedTime = 0.0f;
491 if (state.hasCalibrated()) {
494 const auto& calibrated = state.template calibrated<3>();
495 calibratedTime = static_cast<float>(calibrated(2));
496 ATH_MSG_DEBUG(
"Got time from calibrated<3>: " << calibratedTime);
497 } catch (const std::exception& e) {
498 ATH_MSG_WARNING(
"Failed to extract time from calibrated<3>: " << e.what());
504 const xAOD::HGTDCluster* cluster = getHGTDClusterFromState(state);
507 auto localPos = cluster->localPosition<3>();
508 rawTime = static_cast<float>(localPos[2]);
509 ATH_MSG_DEBUG(
"Got raw time from cluster local position: " << rawTime);
511 ATH_MSG_WARNING(
"Could not get cluster from state");
515 rawTimePerLayer[layerIndex] = rawTime;
519 auto [correctedTime, timeErr] = correctTOF(
524 acts_tracking_geometry,
526 timePerLayer[layerIndex] = correctedTime;
527 ATH_MSG_DEBUG(
"Applied TOF correction: " << calibratedTime <<
" -> " << correctedTime);
530 timePerLayer[layerIndex] = calibratedTime;
531 ATH_MSG_DEBUG(
"No cluster found for TOF correction, using calibrated time: " << calibratedTime);
536 ATH_MSG_DEBUG(
"State does not have calibrated data");
540 if (!foundExtrapolation) {
541 foundExtrapolation = true;
542 if (state.hasPredicted()) {
544 const auto& predicted = state.predicted();
545 Acts::Vector2 localPos(predicted[Acts::eBoundLoc0], predicted[Acts::eBoundLoc1]);
548 Acts::Vector3 globalPos = surface.localToGlobal(
551 Acts::Vector3::Zero());
553 extrapX = globalPos.x();
554 extrapY = globalPos.y();
555 extrapZ = globalPos.z();
557 ATH_MSG_DEBUG(
"Extrapolated position (predicted) at HGTD: x=" << extrapX
558 <<
", y=" << extrapY <<
", z=" << extrapZ);
561 Acts::Vector3 globalPos = surface.center(geoContext);
562 extrapX = globalPos.x();
563 extrapY = globalPos.y();
564 extrapZ = globalPos.z();
566 ATH_MSG_DEBUG(
"Extrapolated position (surface center) at HGTD: x=" << extrapX
567 <<
", y=" << extrapY <<
", z=" << extrapZ);
571 ATH_MSG_DEBUG(
"Found HGTD hit on layer " << layerIndex
572 <<
", chi2=" << chi2PerLayer[layerIndex]
573 <<
", time=" << timePerLayer[layerIndex]);
584 if (nHGTDHits == 0 && !foundExtrapolation) {
588 ATH_MSG_DEBUG(
"!!! Didn't find any HGTD hits but calculated extrapolation position: x=" << extrapX
589 <<
", y=" << extrapY <<
", z=" << extrapZ);
590 foundExtrapolation =
true;
595 <<
" nMeasurements=" << nMeasurements
596 <<
" nHGTDHits=" << nHGTDHits
597 <<
" nHoles=" << nHoles
598 <<
" nOutliers=" << nOutliers
599 <<
" extrapolation found: " << (foundExtrapolation ?
"yes" :
"no"));
603 data.hasClusterVec = {hasHitInLayer[0], hasHitInLayer[1], hasHitInLayer[2], hasHitInLayer[3]};
604 data.chi2Vec = {chi2PerLayer[0], chi2PerLayer[1], chi2PerLayer[2], chi2PerLayer[3]};
605 data.timeVec = {timePerLayer[0], timePerLayer[1], timePerLayer[2], timePerLayer[3]};
606 data.rawTimeVec = {rawTimePerLayer[0], rawTimePerLayer[1], rawTimePerLayer[2], rawTimePerLayer[3]};
607 data.extrapX = extrapX;
608 data.extrapY = extrapY;
609 data.extrapZ = extrapZ;
610 data.numHGTDHits = nHGTDHits;
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ 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_actsTrackLinkKey
◆ m_calibrationContext
Acts::CalibrationContext ActsTrk::HGTDTrackExtensionAlg::m_calibrationContext |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.h.
◆ m_extrapolationTool
ToolHandle<IActsExtrapolationTool> ActsTrk::HGTDTrackExtensionAlg::m_extrapolationTool {this, "ExtrapolationTool", ""} |
|
private |
◆ m_extrapXKey
◆ m_extrapYKey
◆ m_hgtdCalibTool
◆ m_HGTDClusterContainerName
◆ m_layerClusterRawTimeKey
◆ m_layerClusterTimeKey
◆ m_layerExtensionChi2Key
◆ m_layerHasExtensionKey
◆ m_logger
std::unique_ptr<const Acts::Logger> ActsTrk::HGTDTrackExtensionAlg::m_logger |
|
private |
◆ m_maxEtaAcceptance
Gaudi::Property<float> ActsTrk::HGTDTrackExtensionAlg::m_maxEtaAcceptance {this, "MaxEtaAcceptance", 4.00, "Maximum eta to consider a track for extension"} |
|
private |
◆ m_minEtaAcceptance
Gaudi::Property<float> ActsTrk::HGTDTrackExtensionAlg::m_minEtaAcceptance {this, "MinEtaAcceptance", 2.38, "Minimum eta to consider a track for extension"} |
|
private |
◆ m_monTool
◆ m_numHGTDHitsKey
◆ m_pixelCalibTool
◆ m_stripCalibTool
◆ m_surfAcc
◆ m_trackFinder
◆ m_trackingGeometryTool
◆ m_trackParticleContainerName
◆ m_trackStatePrinter
ToolHandle<ActsTrk::TrackStatePrinterTool> ActsTrk::HGTDTrackExtensionAlg::m_trackStatePrinter {this, "TrackStatePrinter", "", "optional track state printer"} |
|
private |
◆ m_uncalibratedMeasurementContainerKey_HGTD
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
const Acts::Surface * get(const xAOD::UncalibratedMeasurement *meas) const
Operator.
char data[hepevt_bytes_allocation_ATLAS]
ToolHandle< ActsTrk::TrackStatePrinterTool > m_trackStatePrinter
Group
Properties of a chain group.
const_pointer_type cptr()
Dereference the pointer.
std::unique_ptr< detail::CKF_config > m_trackFinder
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterRawTimeKey
Scalar eta() const
pseudorapidity method
Acts::Navigator Navigator
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)
float z0() const
Returns the parameter.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
ToolHandle< ActsTrk::IOnTrackCalibratorTool< detail::RecoTrackStateContainer > > m_pixelCalibTool
bool msgLvl(const MSG::Level lvl) const
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerHasExtensionKey
Acts::TrackContainer< Acts::VectorTrackContainer, Acts::VectorMultiTrajectory > RecoTrackContainer
bool isValid() const
Test to see if the link can be dereferenced.
float d0() const
Returns the parameter.
def timer(name, disabled=False)
Gaudi::Property< float > m_minEtaAcceptance
virtual void setOwner(IDataHandleHolder *o)=0
ToolHandle< ActsTrk::IOnTrackCalibratorTool< detail::RecoTrackStateContainer > > m_hgtdCalibTool
ToolHandle< IActsExtrapolationTool > m_extrapolationTool
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
bool getExtrapolationPosition(const EventContext &ctx, const detail::RecoTrackContainer::TrackProxy &track, float &x, float &y, float &z) const
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_actsTrackLinkKey
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_extrapXKey
Handle class for reading a decoration on an object.
Accessor for the above source link container.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
std::unique_ptr< const Acts::Logger > m_logger
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
std::pair< Iterator, Iterator > range(const Acts::Surface &surface) const
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Handle class for adding a decoration to an object.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerName
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
SG::ReadHandleKey< xAOD::HGTDClusterContainer > m_HGTDClusterContainerName
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerExtensionChi2Key
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< float > m_maxEtaAcceptance
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
StatusCode collectMeasurements(const EventContext &context, detail::TrackFindingMeasurements &measurements) const
float phi0() const
Returns the parameter, which has range to .
Acts::CombinatorialKalmanFilterOptions< detail::RecoTrackContainer > CKFOptions
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Eigen::Matrix< double, 3, 1 > Vector3D
Acts::SympyStepper Stepper
Adapted from Acts Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction....
TrackExtensionData processTrackExtension(const EventContext &ctx, const xAOD::TrackParticle *trackParticle, const detail::RecoTrackContainer::TrackProxy &trackProxy) const
const Acts::Logger & logger() const
Private access to the logger.
ActsTrk::detail::xAODUncalibMeasSurfAcc m_surfAcc
ToolHandle< GenericMonitoringTool > m_monTool
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTimeKey
Acts::Propagator< Stepper, Navigator > Propagator
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< xAOD::UncalibratedMeasurementContainer > m_uncalibratedMeasurementContainerKey_HGTD
bool isHGTDSurface(const Acts::GeometryIdentifier &geoID) const
UncalibMeasType
Define the type of the uncalibrated measurement.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
Acts::CalibrationContext m_calibrationContext
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_extrapYKey
Acts::CombinatorialKalmanFilter< Propagator, RecoTrackContainer > CKF
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
Class describing a TrackParticle.
Declare a monitored scalar variable.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_numHGTDHitsKey
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
size_type size() const noexcept
Returns the number of elements in the collection.
Acts::TrackStateCreator< ActsTrk::detail::UncalibSourceLinkAccessor::Iterator, detail::RecoTrackContainer > DefaultTrackStateCreator
ToolHandle< ActsTrk::IOnTrackCalibratorTool< detail::RecoTrackStateContainer > > m_stripCalibTool
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)