File indexing completed on 2025-12-11 09:40:23
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/TrackParametrization.hpp"
0013
0014 #include <array>
0015 #include <tuple>
0016 #include <vector>
0017
0018 class TTree;
0019
0020 namespace Acts {
0021 class GeometryIdentifier;
0022 }
0023
0024 namespace ActsPlugins {
0025
0026
0027
0028 class RootMeasurementIo {
0029 public:
0030
0031 struct Config {
0032
0033 std::vector<Acts::BoundIndices>& recoIndices;
0034
0035
0036 std::vector<Acts::BoundIndices>& clusterIndices;
0037 };
0038
0039
0040
0041
0042 explicit RootMeasurementIo(const Config& config);
0043
0044
0045
0046
0047 void connectForWrite(TTree& measurementTree);
0048
0049
0050
0051
0052
0053 void fillIdentification(int evnt, const Acts::GeometryIdentifier& geoId);
0054
0055
0056
0057
0058
0059
0060
0061 void fillTruthParameters(const Acts::Vector2& lp, const Acts::Vector4& xt,
0062 const Acts::Vector3& dir,
0063 const std::pair<double, double> angles);
0064
0065
0066
0067
0068
0069
0070
0071 void fillBoundMeasurement(const std::vector<double>& measurement,
0072 const std::vector<double>& variances,
0073 const std::vector<unsigned int>& subspaceIndex);
0074
0075
0076
0077
0078 void fillGlobalPosition(const Acts::Vector3& pos);
0079
0080
0081
0082
0083
0084 void fillCluster(const std::vector<std::tuple<int, int, float>>& channels);
0085
0086
0087 void clear();
0088
0089 private:
0090
0091 static constexpr std::array<std::string, Acts::eBoundSize> bNames = {
0092 "loc0", "loc1", "phi", "theta", "qop", "time"};
0093
0094
0095 Config m_cfg;
0096
0097 struct MeasurementPayload {
0098
0099 int eventNr = 0;
0100 int volumeID = 0;
0101 int layerID = 0;
0102 int surfaceID = 0;
0103 int extraID = 0;
0104
0105
0106 std::array<float, Acts::eBoundSize> recBound = {};
0107 std::array<float, Acts::eBoundSize> varBound = {};
0108
0109 float recGx = 0.;
0110 float recGy = 0.;
0111 float recGz = 0.;
0112
0113
0114 std::array<float, Acts::eBoundSize> trueBound = {};
0115 float trueGx = 0.;
0116 float trueGy = 0.;
0117 float trueGz = 0.;
0118 float incidentPhi = 0.;
0119 float incidentTheta = 0.;
0120
0121
0122 std::array<float, Acts::eBoundSize> residual = {};
0123 std::array<float, Acts::eBoundSize> pull = {};
0124 };
0125
0126 struct ClusterPayload {
0127
0128 int nch = 0;
0129 std::array<int, 2> clusterSize = {0, 0};
0130 std::array<std::vector<int>, 2> chId;
0131 std::vector<float> chValue = {};
0132 };
0133
0134 MeasurementPayload m_measurementPayload;
0135 ClusterPayload m_clusterPayload;
0136 };
0137 }