Skip to content

Commit

Permalink
Add a comment in the workflow and preprocessor checks for the vector …
Browse files Browse the repository at this point in the history
…constructor
  • Loading branch information
jmcarcell committed Jan 9, 2025
1 parent 7b56bfb commit 9948664
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
echo "::group::CMakeConfig 2"
cmake -DDD4HEP_HEPMC3_COMPRESSION_SUPPORT=ON ..
fi
# Make sure DD4hep can be built with an older version of EDM4hep (0.10.5 for LCG_106)
if [[ ${{ matrix.LCG }} =~ 106 ]]; then
echo "::group::CMakeConfig Enable EDM4hep"
cmake -DDD4HEP_USE_EDM4HEP=ON ..
Expand Down
12 changes: 12 additions & 0 deletions DDDigi/io/DigiIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <DD4hep/Printout.h>
#include "DigiIO.h"

#include <edm4hep/EDM4hepVersion.h>

/// C/C++ include files
#include <limits>

Expand Down Expand Up @@ -171,8 +173,13 @@ namespace dd4hep {
mcp.setCharge(3.0*p.charge);
mcp.setVertex( _toVectorD(p.start_position) );
mcp.setEndpoint( _toVectorD(p.end_position) );
#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0)
mcp.setMomentum( _toVectorF(p.momentum) );
mcp.setMomentumAtEndpoint( _toVectorF(p.momentum) );
#else
mcp.setMomentum( _toVectorD(p.momentum) );
mcp.setMomentumAtEndpoint( _toVectorD(p.momentum) );
#endif
}

template <> template <>
Expand Down Expand Up @@ -552,8 +559,13 @@ namespace dd4hep {
const PropertyMask mask(status);
mcp.setPDG(p.pdgID);

#if EDM4HEP_BUILD_VERSION < EDM4HEP_VERSION(0, 99, 0)
mcp.setMomentum( _toVectorF( { p.psx, p.psy, p.psz } ) );
mcp.setMomentumAtEndpoint( _toVectorF( {p.pex, p.pey, p.pez} ) );
#else
mcp.setMomentum( _toVectorD( { p.psx, p.psy, p.psz } ) );
mcp.setMomentumAtEndpoint( _toVectorD( {p.pex, p.pey, p.pez} ) );
#endif
mcp.setVertex( _toVectorD( { p.vsx, p.vsy, p.vsz } ) );
mcp.setEndpoint( _toVectorD( { p.vex, p.vey, p.vez } ) );

Expand Down

0 comments on commit 9948664

Please sign in to comment.