Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: eic/EICrecon
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e440a3b
Choose a base ref
...
head repository: eic/EICrecon
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3f7fb58
Choose a head ref
  • 8 commits
  • 9 files changed
  • 2 contributors

Commits on Jan 17, 2025

  1. fix: rm unused options in IterativeVertexFinder.cc (#1712)

    ### Briefly, what does this PR introduce?
    This PR removes an entirely unused options variable (and type alias) in
    IterativeVertexFinder.
    
    ### What kind of change does this PR introduce?
    - [x] Bug fix (issue: unused code)
    - [ ] New feature (issue #__)
    - [ ] Documentation update
    - [ ] Other: __
    
    ### Please check if this PR fulfills the following:
    - [ ] Tests for the changes have been added
    - [ ] Documentation has been added / updated
    - [ ] Changes have been communicated to collaborators
    
    ### Does this PR introduce breaking changes? What changes might users
    need to make to their code?
    No.
    
    ### Does this PR change default behavior?
    No.
    wdconinc authored Jan 17, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6dce610 View commit details
  2. BUGFIX: PhotoMultiplierHitDigi: allow bypassing QE, enable that for D…

    …IRC (#1713)
    
    ### Briefly, what does this PR introduce?
    
    Quantum efficiency for DIRC was moved to npsim
    
    https://github.com/eic/npsim/blob/e3dc454951288c9439a16e38c138a4aeb2896a24/src/dd4pod/python/npsim.py#L66-L94
    we should not apply it twice
    
    ### What kind of change does this PR introduce?
    - [x] Bug fix (issue #__)
    - [ ] New feature (issue #__)
    - [ ] Documentation update
    - [ ] Other: __
    
    ### Please check if this PR fulfills the following:
    - [ ] Tests for the changes have been added
    - [ ] Documentation has been added / updated
    - [ ] Changes have been communicated to collaborators
    
    ### Does this PR introduce breaking changes? What changes might users
    need to make to their code?
    No
    
    ### Does this PR change default behavior?
    Yes
    veprbl authored Jan 17, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1b90796 View commit details
  3. fix: skip non-class definition headers in make_datamodel_glue.py (#1706)

    ### Briefly, what does this PR introduce?
    In recent versions of EDM4hep, deprecated data types are defined as
    aliases to the recommended new data type: e.g.
    ```cpp
    namespace edm4hep {
    using MCRecoCaloParticleAssociation [[deprecated("use CaloHitMCParticleLink instead")]] =
        edm4hep::CaloHitMCParticleLink;
    }
    ```
    This leads to issues in the `datamodel_glue.h` header, which defines
    them as a class, e.g.
    ```
    /opt/local/include/edm4hep/MCRecoCaloParticleAssociation.h:7:7: error: typedef redefinition with different types ('edm4hep::CaloHitMCParticleLink' vs 'edm4hep::MCRecoCaloParticleAssociation')
        7 | using MCRecoCaloParticleAssociation [[deprecated("use CaloHitMCParticleLink instead")]] =
          |       ^
    /home/wdconinc/git/EICrecon/build/include/services/io/podio/datamodel_glue.h:326:11: note: previous definition is here
      326 |     class MCRecoCaloParticleAssociation;
          |           ^
    ```
    
    This PR avoids listing `using` aliases in the `datamodel_glue.h` headers
    by only processing data type headers with an actual `class` definition.
    
    ### What kind of change does this PR introduce?
    - [ ] Bug fix (issue #__)
    - [x] New feature (support for EDM4hep-0.99)
    - [ ] Documentation update
    - [ ] Other: __
    
    ### Please check if this PR fulfills the following:
    - [ ] Tests for the changes have been added
    - [ ] Documentation has been added / updated
    - [ ] Changes have been communicated to collaborators
    
    ### Does this PR introduce breaking changes? What changes might users
    need to make to their code?
    No.
    
    ### Does this PR change default behavior?
    No.
    wdconinc authored Jan 17, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c70ecbe View commit details
  4. Copy the full SHA
    1ca5ce2 View commit details
  5. run clang-format in CI

    veprbl committed Jan 17, 2025
    Copy the full SHA
    b512bd3 View commit details
  6. Copy the full SHA
    340bcd9 View commit details
  7. Copy the full SHA
    9d68c9a View commit details
  8. eicrecon.cc: clang-format pragma

    veprbl committed Jan 17, 2025
    Copy the full SHA
    3f7fb58 View commit details
4 changes: 3 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ BasedOnStyle: LLVM
BreakConstructorInitializersBeforeComma: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
Standard: Cpp11
Standard: c++20
#SpaceBeforeParens: ControlStatements
SpaceAfterControlStatementKeyword: true
PointerBindsToType: true
@@ -12,4 +12,6 @@ UseTab: Never
ColumnLimit: 100
NamespaceIndentation: Inner
AlignConsecutiveAssignments: true
SortIncludes: Never
ReflowComments: false
...
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
ci:
skip: [clang-format]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.4
hooks:
- id: clang-format
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
@@ -18,11 +21,6 @@ repos:
- id: forbid-tabs
- id: remove-tabs
args: [--whitespaces-count, '8']
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
args: [-i]
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
24 changes: 13 additions & 11 deletions src/algorithms/digi/PhotoMultiplierHitDigi.cc
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ void PhotoMultiplierHitDigi::process(
if (m_rngUni() > m_cfg.safetyFactor) continue;

// quantum efficiency
if (!qe_pass(edep_eV, m_rngUni())) continue;
if (m_cfg.enableQuantumEfficiency and !qe_pass(edep_eV, m_rngUni())) continue;

// pixel gap cuts
if(m_cfg.enablePixelGaps) {
@@ -205,16 +205,18 @@ void PhotoMultiplierHitDigi::qe_init()
debug(" {:>10.4} {:<}",en,qe);
trace("{:=^60}","");

// sanity checks
if (qeff.empty()) {
qeff = {{2.6, 0.3}, {7.0, 0.3}};
warning("Invalid quantum efficiency data provided, using default values {} {:.2f} {} {:.2f} {} {:.2f} {} {:.2f} {}","{{", qeff.front().first, ",", qeff.front().second, "},{",qeff.back().first,",",qeff.back().second,"}}");
}
if (qeff.front().first > 3.0) {
warning("Quantum efficiency data start from {:.2f} {}", qeff.front().first, " eV, maybe you are using wrong units?");
}
if (qeff.back().first < 3.0) {
warning("Quantum efficiency data end at {:.2f} {}", qeff.back().first, " eV, maybe you are using wrong units?");
if (m_cfg.enableQuantumEfficiency) {
// sanity checks
if (qeff.empty()) {
qeff = {{2.6, 0.3}, {7.0, 0.3}};
warning("Invalid quantum efficiency data provided, using default values {} {:.2f} {} {:.2f} {} {:.2f} {} {:.2f} {}","{{", qeff.front().first, ",", qeff.front().second, "},{",qeff.back().first,",",qeff.back().second,"}}");
}
if (qeff.front().first > 3.0) {
warning("Quantum efficiency data start from {:.2f} {}", qeff.front().first, " eV, maybe you are using wrong units?");
}
if (qeff.back().first < 3.0) {
warning("Quantum efficiency data end at {:.2f} {}", qeff.back().first, " eV, maybe you are using wrong units?");
}
}
}

1 change: 1 addition & 0 deletions src/algorithms/digi/PhotoMultiplierHitDigiConfig.h
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ namespace eicrecon {
double safetyFactor = 1.0; // allowed range: (0,1]

// quantum efficiency
bool enableQuantumEfficiency = true;
// - wavelength units are [nm]
// FIXME: figure out how users can override this, maybe an external `yaml` file
std::vector<std::pair<double, double> > quantumEfficiency = {
2 changes: 2 additions & 0 deletions src/algorithms/interfaces/ParticleSvc.cc
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
namespace algorithms {

const std::shared_ptr<ParticleSvc::ParticleMap> ParticleSvc::kParticleMap =
// clang-format off
std::make_shared<ParticleSvc::ParticleMap>(ParticleSvc::ParticleMap{
{ 0, { 0, 0, 0.0 , "unknown" }},
{ 11, { 11, -1, 0.000510998928, "e-" }},
@@ -248,5 +249,6 @@ const std::shared_ptr<ParticleSvc::ParticleMap> ParticleSvc::kParticleMap =
{ 1000020030, { 1000020030, 2, 2.80923 , "He-3" }},
{ 1000020040, { 1000020040, 2, 3.72742 , "Alpha" }},
});
// clang-format on

} // namespace algorithms
2 changes: 0 additions & 2 deletions src/algorithms/tracking/IterativeVertexFinder.cc
Original file line number Diff line number Diff line change
@@ -73,7 +73,6 @@ std::unique_ptr<edm4eic::VertexCollection> eicrecon::IterativeVertexFinder::prod
auto outputVertices = std::make_unique<edm4eic::VertexCollection>();

using Propagator = Acts::Propagator<Acts::EigenStepper<>>;
using PropagatorOptions = Acts::PropagatorOptions<>;
#if Acts_VERSION_MAJOR >= 33
using Linearizer = Acts::HelicalTrackLinearizer;
using VertexFitter = Acts::FullBilloirVertexFitter;
@@ -102,7 +101,6 @@ std::unique_ptr<edm4eic::VertexCollection> eicrecon::IterativeVertexFinder::prod
auto propagator = std::make_shared<Propagator>(
stepper, Acts::detail::VoidNavigator{}, logger().cloneWithSuffix("Prop"));
#endif
Acts::PropagatorOptions opts(m_geoctx, m_fieldctx);

// Setup the track linearizer
#if Acts_VERSION_MAJOR >= 33
36 changes: 3 additions & 33 deletions src/detectors/DIRC/DIRC.cc
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
// Copyright 2022,2023 Christopher Dilks, Nilanga Wickramaarachchi
// Subject to the terms in the LICENSE file found in the top-level directory.
//
//

// SPDX-License-Identifier: LGPL-3.0-or-later
// Copyright (C) 2024, Dmitry Kalinkin
// Copyright (C) 2022 - 2025 Christopher Dilks, Nilanga Wickramaarachchi, Dmitry Kalinkin

#include <DD4hep/Detector.h>
#include <JANA/JApplication.h>
#include <stddef.h>
#include <algorithm>
#include <gsl/pointers>
#include <memory>
@@ -46,34 +40,10 @@ extern "C" {
digi_cfg.pedError = 3.0;
digi_cfg.enablePixelGaps = false;
digi_cfg.safetyFactor = 1.0;
// Actual efficiency is implemented in npsim via a stacking action
digi_cfg.enableQuantumEfficiency = false;
digi_cfg.quantumEfficiency.clear();

std::vector<double> sensor_qe{
0, 0, 14.0, 14.8, 14.5, 14.9, 14.4, 14.2, 13.9, 14.6, 15.2, 15.7, 16.4, 16.9, 17.5,
17.7, 18.1, 18.8, 19.3, 19.8, 20.6, 21.4, 22.4, 23.1, 23.6, 24.1, 24.2, 24.6, 24.8, 25.2,
25.7, 26.5, 27.1, 28.2, 29.0, 29.9, 30.8, 31.1, 31.7, 31.8, 31.6, 31.5, 31.5, 31.3, 31.0,
30.8, 30.8, 30.4, 30.2, 30.3, 30.2, 30.1, 30.1, 30.1, 29.8, 29.9, 29.8, 29.7, 29.7, 29.7,
29.8, 29.8, 29.9, 29.9, 29.8, 29.9, 29.8, 29.9, 29.8, 29.7, 29.8, 29.7, 29.8, 29.6, 29.5,
29.7, 29.7, 29.8, 30.1, 30.4, 31.0, 31.3, 31.5, 31.8, 31.8, 31.9, 32.0, 32.0, 32.0, 32.0,
32.2, 32.2, 32.1, 31.8, 31.8, 31.8, 31.7, 31.6, 31.6, 31.7, 31.5, 31.5, 31.4, 31.3, 31.3,
31.2, 30.8, 30.7, 30.5, 30.3, 29.9, 29.5, 29.3, 29.2, 28.6, 28.2, 27.9, 27.8, 27.3, 27.0,
26.6, 26.1, 25.9, 25.5, 25.0, 24.6, 24.2, 23.8, 23.4, 23.0, 22.7, 22.4, 21.9, 21.4, 21.2,
20.7, 20.3, 19.8, 19.6, 19.3, 18.9, 18.7, 18.3, 17.9, 17.8, 17.8, 16.7, 16.5, 16.4, 16.0,
15.6, 15.6, 15.2, 14.9, 14.6, 14.4, 14.1, 13.8, 13.6, 13.3, 13.0, 12.8, 12.6, 12.3, 12.0,
11.9, 11.7, 11.5, 11.2, 11.1, 10.9, 10.7, 10.4, 10.3, 9.9, 9.8, 9.6, 9.3, 9.1, 9.0,
8.8, 8.5, 8.3, 8.3, 8.2, 7.9, 7.8, 7.7, 7.5, 7.3, 7.1, 6.9, 6.7, 6.6, 6.3,
6.2, 6.0, 5.8, 5.7, 5.6, 5.4, 5.2, 5.1, 4.9, 4.8, 4.6, 4.5, 4.4, 4.2, 4.1,
4.0, 3.8, 3.7, 3.5, 3.3, 3.2, 3.1, 3.0, 2.9, 2.5, 2.4, 2.4, 2.3, 2.3, 2.1,
1.8, 1.6, 1.5, 1.5, 1.6, 1.8, 1.9, 1.4, 0.8, 0.9, 0.8, 0.7, 0.6, 0.3, 0.3,
0.5, 0.3, 0.4, 0.3, 0.1, 0.2, 0.1, 0.2, 0.3, 0.0};

for(size_t i=0; i < sensor_qe.size(); i++)
{
double wavelength = 180 + i * 2; // wavelength units are [nm]
digi_cfg.quantumEfficiency.push_back({wavelength, sensor_qe[i]*0.01});
}


// digitization
app->Add(new JOmniFactoryGeneratorT<PhotoMultiplierHitDigi_factory>(
"DIRCRawHits",
5 changes: 5 additions & 0 deletions src/services/io/podio/make_datamodel_glue.py
Original file line number Diff line number Diff line change
@@ -67,6 +67,11 @@

def AddCollections(datamodelName, collectionfiles):
for f in collectionfiles:
# require at least a class definition, not a using alias
with open(f, 'r') as file:
if not "class" in file.read():
continue

header_fname = f.split('/'+datamodelName)[-1]
basename = header_fname.split('/')[-1].split('Collection.h')[0]

75 changes: 38 additions & 37 deletions src/utilities/eicrecon/eicrecon.cc
Original file line number Diff line number Diff line change
@@ -12,43 +12,44 @@
/// The default plugins
/// Add new default plugin names here and the main() will do JApplication::AddPlugin() for you.
std::vector<std::string> EICRECON_DEFAULT_PLUGINS = {

"log",
"dd4hep",
"acts",
"algorithms_init",
"evaluator",
"pid_lut",
"richgeo",
"rootfile",
"beam",
"reco",
"tracking",
"pid",
"EEMC",
"BEMC",
"FEMC",
"EHCAL",
"BHCAL",
"FHCAL",
"B0ECAL",
"ZDC",
"BTRK",
"BVTX",
"PFRICH",
"DIRC",
"DRICH",
"ECTRK",
"MPGD",
"B0TRK",
"RPOTS",
"FOFFMTRK",
"BTOF",
"ECTOF",
"LOWQ2",
"LUMISPECCAL",
"podio",
"janatop",
// clang-format off
"log",
"dd4hep",
"acts",
"algorithms_init",
"evaluator",
"pid_lut",
"richgeo",
"rootfile",
"beam",
"reco",
"tracking",
"pid",
"EEMC",
"BEMC",
"FEMC",
"EHCAL",
"BHCAL",
"FHCAL",
"B0ECAL",
"ZDC",
"BTRK",
"BVTX",
"PFRICH",
"DIRC",
"DRICH",
"ECTRK",
"MPGD",
"B0TRK",
"RPOTS",
"FOFFMTRK",
"BTOF",
"ECTOF",
"LOWQ2",
"LUMISPECCAL",
"podio",
"janatop",
// clang-format on
};

int main( int narg, char **argv)