Skip to content

Commit d13595b

Browse files
committed
TrackTools: integrate header-only geometry interface with O2 packaging
Address the maintainer feedback on AliceO2 PR #15999. - Register a public header-only O2::TrackTools interface in Common CMake. - Propagate the required O2::CommonConstants, MathUtils, ReconstructionDataFormats, TPCBase and DetectorsBase dependencies. - Install the header under include/TrackTools/TrackGeometry.h. - Reuse the clang-format bot's formatted implementation without changing numerical algorithms; add the O2 copyright notice and include guard. - Update PyROOT tests and README to include TrackTools/TrackGeometry.h. - Correct outdated portable-test scope and build-install documentation. Exact changed-file inventory (7 paths): - Common/CMakeLists.txt - Common/TrackTools/CMakeLists.txt - Common/TrackTools/include/TrackTools/TrackGeometry.h - Common/TrackTools/README.md - Common/TrackTools/test/README_TESTS.md - Common/TrackTools/test/python/conftest.py - Common/TrackTools/include/TrackGeometry.h (removed) Validation: static checks of the unchanged formatted C++ implementation, header guard, license text, public includes, LF endings and CMake wiring. O2 configure/build and PyROOT tests must be rerun on alma2; not claimed here. No unrelated line-ending changes or numerical-tolerance modifications.
1 parent 8bebc01 commit d13595b

6 files changed

Lines changed: 155 additions & 109 deletions

File tree

‎Common/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
add_subdirectory(Constants)
1212
add_subdirectory(MathUtils)
13+
add_subdirectory(TrackTools)
1314
add_subdirectory(Field)
1415
add_subdirectory(Types)
1516
add_subdirectory(Utils)

‎Common/TrackTools/CMakeLists.txt‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2026-2026 CERN and copyright holders of ALICE O2.
2+
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
# All rights not expressly granted are reserved.
4+
#
5+
# This software is distributed under the terms of the GNU General Public
6+
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
#
8+
# In applying this license CERN does not waive the privileges and immunities
9+
# granted to it by virtue of its status as an Intergovernmental Organization
10+
# or submit itself to any jurisdiction.
11+
12+
# Expose and install the shared public TrackTools headers without compiled sources.
13+
o2_add_header_only_library(
14+
TrackTools
15+
INTERFACE_LINK_LIBRARIES
16+
O2::CommonConstants
17+
O2::MathUtils
18+
O2::ReconstructionDataFormats
19+
O2::TPCBase
20+
O2::DetectorsBase)

‎Common/TrackTools/README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The preferred input is an existing full `o2::track::TrackPar`: local fitted para
3333
Include the single component header in a configured O2 environment:
3434

3535
```cpp
36-
#include "TrackGeometry.h"
36+
#include "TrackTools/TrackGeometry.h"
3737
```
3838

3939
| Capability | Current C++ interface |
@@ -68,7 +68,7 @@ The partition is `Crossed = Dead + Excluded + Available` for row membership and
6868
This is a typical use inside an O2 or O2Physics track loop. `track` is the actual fitted `o2::track::TrackPar`; `signedBzKG`, both guard widths and the cut threshold come from the **run/analysis configuration**. The two output counters are kept separately. Using **two configurations** on the same track makes it possible to compare selections across reconstruction passes or systematic variations.
6969

7070
```cpp
71-
#include "TrackGeometry.h"
71+
#include "TrackTools/TrackGeometry.h"
7272

7373
// Call this in an O2/O2Physics track loop. The run configuration supplies
7474
// signedBzKG, both guard widths and minAvailableRows.
@@ -119,18 +119,18 @@ Changing the guard changes **Excluded/Available**, not the physical Mapper **Dea
119119
120120
This is a **real, user-executed ROOT/Cling session** using the full-5D candidate header, not pseudocode or a compiled macro. It shows the workflow that can then be moved almost unchanged into an O2Physics track loop: start with one track, inspect `dSector`, vary the active-pad-edge guard, read out the available rows and lengths, apply two cuts, and compare L with H.
121121
122-
Start a **fresh ROOT session** in the O2 environment, pointing to the header that implements the full-`TrackPar` overloads. Do not use the old `#include "include/TrackGeometry.h"` from an unsynchronized O2 checkout; that earlier file exposed only the reduced-primary TPC-row signatures.
122+
Start a **fresh ROOT session** in the O2 environment from the O2 repository root. Use the public `include/TrackTools/` layout; the same `#include "TrackTools/TrackGeometry.h"` works in compiled O2 applications.
123123
124124
```bash
125-
ROOT_INCLUDE_PATH="$dEdxAI_CODE/o2reco/cpp${ROOT_INCLUDE_PATH:+:$ROOT_INCLUDE_PATH}" root -l
125+
ROOT_INCLUDE_PATH="$PWD/Common/TrackTools/include${ROOT_INCLUDE_PATH:+:$ROOT_INCLUDE_PATH}" root -l
126126
```
127127

128-
For an installed O2 component, use the corresponding configured O2 header include directory instead. The following expressions are entered **one line at a time** at the ROOT prompt; no multiline `std::cout` statement is required.
128+
The header-only `O2::TrackTools` CMake target installs the public header under `TrackTools/`. The following expressions are entered **one line at a time** at the ROOT prompt; no multiline `std::cout` statement is required.
129129

130130
### 1. Construct a complete local O2 track and query the 85 cm surface
131131

132132
```cpp
133-
#include "TrackGeometry.h"
133+
#include "TrackTools/TrackGeometry.h"
134134
#include <iostream>
135135
namespace geo = o2::recohelpers;
136136
namespace tpc = o2::tpc::recohelpers;
@@ -303,4 +303,4 @@ To investigate those comparisons in Python, keep the same `adfSynthetic` sample
303303

304304
---
305305

306-
**Component status.** `TrackGeometry.h` is the implemented component covered above. Some field/curvature and physical pad-row-centre validation remains under technical review, as does the O2 build/install integration. For the exact current revision, test logs and identified follow-up work, consult the associated PR/CRR rather than treating this user manual as a debugging report.
306+
**Component status.** `TrackGeometry.h` is the implemented component covered above. Some field/curvature and physical pad-row-centre validation remains under technical review, while O2 build/CI validation remains under technical review. For the exact current revision, test logs and identified follow-up work, consult the associated PR/CRR rather than treating this user manual as a debugging report.

0 commit comments

Comments
 (0)