Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Start to migrate the R4-MS segment fit #4108

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Core/include/Acts/EventData/StationSpacePoint.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// This file is part of the ACTS project.
//
// Copyright (C) 2025 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#pragma once

#include "Acts/Definitions/Algebra.hpp"

#include <type_traits>


namespace Acts{
/** @brief Concept definition of the station space points. They're primarly used in composite detectors,
* like the Muon chambers in side the ATLAS experiment. The chambers usually consist of few layers
* of drift tubes which maybe sandwiched by other strip detector layers to measure the local coordinates
* on the reference plane the particle's passage.
*
* To describe the
*/
template <typename SpacePointType>
concept StationSpacePoint = requires(SpacePointType sp) {
/** @brief Local position of the space point measurement. It'either
* the position of the wire or the position of the fired strip in the chamber */
{ sp.localPosition() } -> std::same_as<const Acts::Vector3&>;
/** @brief Orientation of the sensor, which is either the wire orientation or
* the strip orientation. Travelling along the direction does not alter the residual */
{ sp.sensorDirection()} -> std::same_as<const Acts::Vector3&>;
/** @brief Normal vector on the strip-plane. */
{ sp.stripPlaneNormal()} -> std::same_as<const Acts::Vector3&>;
/** @brief Radius of the tube drift-measurement. The returned value is zero for strip measurements */
{ sp.driftRadius() } -> std::same_as<double>;
/** @brief Time when the measurement was taken */
{ sp.time()} -> std::same_as<double>;
};

template<StationSpacePoint>
class MeasurementSorter{
public:
MeasurementSorter() = default;
};

}
1 change: 1 addition & 0 deletions Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "ActsExamples/TrackFinding/MuonHoughSeeder.hpp"

#include "ActsExamples/EventData/MuonSimHit.hpp"
#include "ActsExamples/EventData/MuonSpacePoint.hpp"

#include <algorithm>
#include <cmath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "ActsExamples/EventData/IndexSourceLink.hpp"
#include "ActsExamples/EventData/SimHit.hpp"

#include "ActsExamples/EventData/MuonSpacePoint.hpp"
#include <cmath>
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

#pragma once

#include "Acts/EventData/StationSpacePoint.hpp"

namespace Acts{
class MuonSpacePoint {
public:
/** @brief Return the local meaurement position */
const Acts::Vector3& localPosition() const{
return m_pos;
}
/** @brief Return the local sensor direction */
const Acts::Vector3& sensorDirection() const{
return m_dir;
}
/** @brief Return the normal vector to the plane */
const Acts::Vector3& stripPlaneNormal() const {
return m_pos;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

A disturbance in the Force, I sense. Wrong member variable returned, it is.

Return m_pos instead of m_norm, this function does. A critical error this is, young padawan.

Fix this, you must:

-                    return m_pos;
+                    return m_norm;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const Acts::Vector3& stripPlaneNormal() const {
return m_pos;
}
const Acts::Vector3& stripPlaneNormal() const {
return m_norm;
}

/** @brief Return the drift radius */
double driftRadius() const{
return m_radius;
}
/** @brief Return the measurement time */
double time() const {
return m_time;
}
/** @brief Define the space point coordinates.
* @param pos: Space point position
* @param sensorDir: Direction of the sensor */
void defineCoordinates(Acts::Vector3&& pos,
Acts::Vector3&& sensorDir){
m_pos = std::move(pos);
m_dir = std::move(sensorDir);
}
/** @brief Define the space point normal*/
void defineNormal(Acts::Vector3&& norm) {
m_norm = std::move(norm);
}
/** @brief Define the space point radius */
void setRadius(const double r) {
m_radius = r;
}
/** @brief Define the time of the space point measurement */
void setTime(const double t){
m_time = t;
}
private:
Acts::Vector3 m_pos{Acts::Vector3::Zero()};
Acts::Vector3 m_dir{Acts::Vector3::Zero()};
Acts::Vector3 m_norm{Acts::Vector3::Zero()};
double m_radius{0.};
double m_time{0.};

};

}
43 changes: 43 additions & 0 deletions Examples/Io/Csv/src/CsvOutputData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,49 @@ struct MuonDriftCircleData {
tubelayer, tube);
};

struct MuonSpacePointData{
/** @brief Identifier hash encoding the spectrometer sector, layer & detector side */
int sectorId{0};
/** @brief Number of the associated bucket inside the container. A change of bucket Id
* pushes the space point into a new bucket container */
int bucketId{0};
/** @brief Local position of the space point measurement */
float localPositionX{0.f};
float localPositionY{0.f};
float localPositionZ{0.f};
/** @brief Direction of the sensor line */
float locSensorDirX{0.f};
float locSensorDirY{0.f};
float locSensorDirZ{0.f};
/** @brief Direction of the vector normal to the plane */
float locPlaneNormX{0.f};
float locPlaneNormY{0.f};
float locPlaneNormZ{0.f};
/** @brief Measurement covariance entries in the local x-y plane */
float covX{0.f};
float covXY{0.f};
float covYX{0.f};
float covY{0.f};
/** @brief Drift radius */
float driftR{0.f};
/** @brief Technology type */
unsigned short technology{0u};
/** @brief Associated gasGap type */
unsigned short gasGap{0u};
/** @brief Primary measurement channel */
unsigned short primaryCh{0u};
/** @brief Secondary measurement channel */
int secondaryCh{-1};

DFE_NAMEDTUPLE(MuonSpacePointData, sectorId, bucketId,
localPositionX ,localPositionY ,localPositionZ,
locSensorDirX, locSensorDirY, locSensorDirZ,
locPlaneNormX, locPlaneNormY, locPlaneNormZ,
covX, covXY, covYX, covY, driftR,
technology, gasGap, primaryCh, secondaryCh);

};

struct TruthHitData {
/// Event-unique hit identifier. As defined for the simulated hit below and
/// used to link back to it; same value can appear multiple times here due to
Expand Down
Loading