Skip to content

Commit 0c44541

Browse files
committed
Geometry and Data source updates
1 parent 95895a1 commit 0c44541

16 files changed

+1123
-106
lines changed

docker/tdis-pre/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ARG BUILD_THREADS=8
1414
# Software versions
1515

1616
ARG VERSION_CERN_ROOT=v6-32-06
17-
ARG VERSION_ACTS=v37.2.0
17+
ARG VERSION_ACTS=v37.4.0
1818
ARG VERSION_PODIO=v01-01
1919
ARG VERSION_JANA2=v2.3.2
2020

@@ -93,7 +93,7 @@ RUN edpm config root branch=${VERSION_CERN_ROOT} &&\
9393

9494

9595
RUN edpm config acts branch=${VERSION_ACTS} &&\
96-
edpm config acts cmake_flags='-DACTS_BUILD_PLUGIN_TGEO=ON -DACTS_BUILD_PLUGIN_DD4HEP=OFF -DACTS_BUILD_PLUGIN_JSON=ON -DACTS_BUILD_PLUGIN_ACTSVG=OFF' &&\
96+
edpm config acts cmake_flags='-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON -DACTS_BUILD_PLUGIN_TGEO=ON -DACTS_BUILD_PLUGIN_DD4HEP=OFF -DACTS_BUILD_PLUGIN_JSON=ON -DACTS_BUILD_PLUGIN_ACTSVG=OFF' &&\
9797
edpm install acts
9898

9999
RUN edpm config podio branch=${VERSION_PODIO} &&\

source/tdis/CKFTracking.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ namespace eicrecon {
3838

3939
class CKFTracking: public WithPodConfig<eicrecon::CKFTrackingConfig> {
4040
public:
41-
/// Track finder function that takes input measurements, initial trackstate
42-
/// and track finder options and returns some track-finder-specific result.
43-
using TrackFinderOptions =
44-
Acts::CombinatorialKalmanFilterOptions<ActsExamples::IndexSourceLinkAccessor::Iterator,
45-
Acts::VectorMultiTrajectory>;
46-
using TrackFinderResult =
47-
Acts::Result<std::vector<ActsExamples::TrackContainer::TrackProxy>>;
41+
4842

4943
/// Find function that takes the above parameters
5044
/// @note This is separated into a virtual interface to keep compilation units

source/tdis/CMakeLists.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ add_executable(tdis
4545
tracking/ActsGeometryService.cc
4646
tracking/ActsGeometryService.h
4747
tracking/ReconstructedHitFactory.h
48+
49+
tracking/BuildTelescopeDetector.cpp
50+
tracking/BuildTelescopeDetector.hpp
51+
tracking/TelescopeDetector.cpp
52+
tracking/TelescopeDetector.hpp
53+
tracking/TelescopeDetectorElement.cpp
54+
tracking/TelescopeDetectorElement.hpp
55+
# tracking/CKFTrackingFunction.cc
4856
# tracking/DD4hepBField.h
4957
# /tracking/DD4hepBField.cc
5058
)
@@ -73,7 +81,39 @@ set_target_properties(tdis PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
7381
target_include_directories(tdis PRIVATE "podio_model")
7482
target_include_directories(tdis SYSTEM PUBLIC ${JANA_INCLUDE_DIR} ${ROOT_INCLUDE_DIRS})
7583

84+
# ----------- Configure ACTS ExamplesLibrary --------
85+
# ExamplesLibrary actually creates ACTS event model
86+
# Get ActsExamples base
87+
get_target_property(ActsCore_LOCATION ActsCore LOCATION)
88+
get_filename_component(ActsCore_PATH ${ActsCore_LOCATION} DIRECTORY)
89+
set(ActsExamples_LIB ${ActsCore_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}ActsExamplesFramework${CMAKE_SHARED_LIBRARY_SUFFIX})
90+
91+
# If acts is installed to / we are good but if acts is installed in some directory with structure /bin /include /lib
92+
# we need to get this directory and try to include include
93+
get_filename_component(Acts_HOME "${ActsCore_PATH}" DIRECTORY)
94+
set(Acts_HOME_INCLUDE "${Acts_HOME}/include")
95+
96+
# List all ACTS variables
97+
message(STATUS "ACTS List all variables : ${ActsExample_LIB}")
98+
get_cmake_property(_variableNames VARIABLES)
99+
foreach (_variableName ${_variableNames})
100+
if (_variableName MATCHES "^Acts")
101+
message(STATUS " ${_variableName} = ${${_variableName}}")
102+
endif()
103+
endforeach()
104+
105+
# Add examples library and includes
76106

107+
# Check if the directory exists and is accessible on the disk
108+
if(EXISTS "${Acts_HOME_INCLUDE}")
109+
# Add the directory to the target's include directories only if it exists
110+
target_include_directories(tdis PUBLIC SYSTEM "${Acts_HOME_INCLUDE}")
111+
message(STATUS "Added include directory: ${Acts_HOME_INCLUDE}")
112+
else()
113+
message(STATUS "Directory does not exist or is not accessible: ${Acts_HOME_INCLUDE}. It is OK if ACTS is installed in /")
114+
endif()
115+
116+
target_include_directories(tdis PUBLIC ${CMAKE_CURRENT_LIST_DIR} "${CMAKE_CURRENT_LIST_DIR}/..")
77117

78118
# ----------- install destination -------------------
79119
install(TARGETS tdis DESTINATION bin)

source/tdis/io/DigitizedDataEventSource.hpp

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ namespace tdis::io {
5959

6060
/** POD structure for readout hits **/
6161
struct DigitizedReadoutHit {
62-
double time; // - Time of arrival at Pad (ns)
63-
double adc; // - Amplitude (ADC bin of sample)
64-
int ring; // - Ring (id of rin, 0 is innermost).
65-
int pad; // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
66-
int plane; // - Plane(id of z plane from 0 upstream to 9 downstream)
67-
double zToGem; // - ZtoGEM (m)
62+
double time; // - Time of arrival at Pad (ns)
63+
double adc; // - Amplitude (ADC bin of sample)
64+
int ring; // - Ring (id of rin, 0 is innermost).
65+
int pad; // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
66+
int plane; // - Plane(id of z plane from 0 upstream to 9 downstream)
67+
double zToGem; // - ZtoGEM (m)
68+
double true_x; // - True hit x info (quiet_NaN() if not provided)
69+
double true_y; // - True hit y info (quiet_NaN() if not provided)
70+
double true_z; // - True hit z info (quiet_NaN() if not provided)
6871
};
6972

7073
/** POD structure for readout track **/
@@ -240,12 +243,31 @@ namespace tdis::io {
240243
return false;
241244
}
242245

243-
result.time = std::stod(tokens[0]); // - Time of arrival at Pad (ns)
244-
result.adc = std::stod(tokens[1]); // - Amplitude (ADC bin of sample)
245-
result.ring = std::stoi(tokens[2]); // - Ring (id of rin, 0 is innermost).
246-
result.pad = std::stoi(tokens[3]); // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
247-
result.plane = std::stoi(tokens[4]); // - Plane(id of z plane from 0 upstream to 9 downstream)
248-
result.zToGem = std::stod(tokens[5]); // - ZtoGEM (m)
246+
if(tokens.size() == 6) {
247+
// Files with no true X Y Z hit info
248+
result.time = std::stod(tokens[0]); // - Time of arrival at Pad (ns)
249+
result.adc = std::stod(tokens[1]); // - Amplitude (ADC bin of sample)
250+
result.ring = std::stoi(tokens[2]); // - Ring (id of rin, 0 is innermost).
251+
result.pad = std::stoi(tokens[3]); // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
252+
result.plane = std::stoi(tokens[4]); // - Plane(id of z plane from 0 upstream to 9 downstream)
253+
result.zToGem = std::stod(tokens[5]); // - ZtoGEM (m)
254+
255+
// True hit information is not set
256+
result.true_x = std::numeric_limits<double>::quiet_NaN();
257+
result.true_y = std::numeric_limits<double>::quiet_NaN();
258+
result.true_z = std::numeric_limits<double>::quiet_NaN();
259+
} else {
260+
result.time = std::stod(tokens[0]); // - Time of arrival at Pad (ns)
261+
result.adc = std::stod(tokens[1]); // - Amplitude (ADC bin of sample)
262+
result.true_x = std::stod(tokens[2]); // True X Y Z of hit
263+
result.true_y = std::stod(tokens[3]);
264+
result.true_z = std::stod(tokens[4]);
265+
result.ring = std::stoi(tokens[5]); // - Ring (id of rin, 0 is innermost).
266+
result.pad = std::stoi(tokens[6]); // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
267+
result.plane = std::stoi(tokens[7]); // - Plane(id of z plane from 0 upstream to 9 downstream)
268+
result.zToGem = std::stod(tokens[8]); // - ZtoGEM (m)
269+
}
270+
249271
return true;
250272
}
251273

source/tdis/layout.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ datatypes :
289289
- int pad // - Pad (id of pad, 0 is at or closest to phi=0 and numbering is clockwise).
290290
- int plane // - Plane(id of z plane from 0 upstream to 9 downstream)
291291
- double zToGem // - ZtoGEM (m)
292+
- double true_x // - True hit x info (quiet_NaN() if not provided)
293+
- double true_y // - True hit y info (quiet_NaN() if not provided)
294+
- double true_z // - True hit z info (quiet_NaN() if not provided)
292295

293296
edm4eic::TrackerHit:
294297
Description: "Tracker hit (reconstructed from Raw)"

source/tdis/tdis_main.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
#include <utility>
1616

1717
#include "CLI/CLI.hpp"
18-
#include "io/PodioWriteProcessor.hpp"
1918
#include "io/DigitizedDataEventSource.hpp"
19+
#include "io/PodioWriteProcessor.hpp"
2020
#include "services/LogService.hpp"
21+
#include "tracking/ActsGeometryService.h"
22+
#include "tracking/ReconstructedHitFactory.h"
2123

2224
struct ProgramArguments {
2325
std::map<std::string, std::string> params;
@@ -106,12 +108,15 @@ int main(int argc, char* argv[]) {
106108
parameterManager->SetParameter(name, value);
107109
}
108110

111+
JApplication app(parameterManager);
109112

113+
// Register services:
114+
app.ProvideService(std::make_shared<tdis::services::LogService>(&app));
115+
app.ProvideService(std::make_shared<tdis::tracking::ActsGeometryService>());
110116

111-
JApplication app(parameterManager);
112117
app.Add(new JEventSourceGeneratorT<tdis::io::DigitizedDataEventSource>);
113118
app.Add(new tdis::io::PodioWriteProcessor(&app));
114-
app.ProvideService(std::make_shared<tdis::services::LogService>(&app));
119+
app.Add(new JFactoryGeneratorT<tdis::tracking::ReconstructedHitFactory>);
115120
// app.Add(new JEventProcessorPodio);
116121
// app.Add(new JFactoryGeneratorT<ExampleClusterFactory>());
117122
// app.Add(new JFactoryGeneratorT<ExampleMultifactory>());

0 commit comments

Comments
 (0)