Commit 5cf08946 authored by lkosarz's avatar lkosarz
Browse files

Merge branch 'master' of https://eicweb.phy.anl.gov/EIC/juggler.git into BHCalReco

parents 322c2bcf dc6d5a23
......@@ -71,7 +71,6 @@ juggler:local:
matrix:
- CMAKE_CXX_STANDARD:
- 17
- 20
script:
## first install EICD to ensure the latest version, then build juggler
- |
......@@ -81,7 +80,7 @@ juggler:local:
cmake --build /tmp/build -j40 -- install
rm -rf /tmp/build /tmp/eicd
- |
cmake -Bbuild -S.
cmake -Bbuild -S. -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build -j20
artifacts:
expire_in: 1 hour
......
......@@ -8,7 +8,7 @@ cmake_policy(SET CMP0074 NEW)
project(Juggler VERSION 4.3.0)
set(CMAKE_CXX_STANDARD 20 CACHE STRING "")
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
if(NOT CMAKE_CXX_STANDARD MATCHES "17|20")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()
......@@ -30,6 +30,25 @@ if(ENABLE_CLANG_TIDY)
endif()
endif()
# Set default build type
set(default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(default_build_type "Debug")
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
# Set all warnings
if(NOT CMAKE_BUILD_TYPE MATCHES Release)
add_compile_options(-Wall -Wextra -Werror)
endif()
find_package(Microsoft.GSL CONFIG)
find_package(EICD REQUIRED)
......
......@@ -52,7 +52,6 @@ std::vector<std::string> split(const std::string& s, char delim) {
}
bool KeepDropSwitch::isOn(const std::string& astring) const {
using MIter = std::map<std::string, bool>::const_iterator;
auto im = m_cache.find(astring);
if (im != m_cache.end()) {
return im->second;
......
......@@ -51,9 +51,9 @@ namespace Jug::Digi {
Gaudi::Property<double> m_tRes{this, "timeResolution", 0.0 * ns};
// digitization settings
Gaudi::Property<int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<unsigned int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<double> m_dyRangeADC{this, "dynamicRangeADC", 100 * MeV};
Gaudi::Property<int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<unsigned int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<double> m_pedSigmaADC{this, "pedestalSigma", 3.2};
Gaudi::Property<double> m_resolutionTDC{this, "resolutionTDC", 10 * ps};
......@@ -243,8 +243,8 @@ namespace Jug::Digi {
m_normDist() * eRes[2] / edep;
}
double ped = m_pedMeanADC + m_normDist() * m_pedSigmaADC;
long long adc = std::llround(ped + edep * (1. + eResRel) / dyRangeADC * m_capADC);
long long tdc = std::llround((time + m_normDist() * tRes) * stepTDC);
unsigned long long adc = std::llround(ped + edep * (1. + eResRel) / dyRangeADC * m_capADC);
unsigned long long tdc = std::llround((time + m_normDist() * tRes) * stepTDC);
eicd::RawCalorimeterHit rawhit(
id,
......
......@@ -44,9 +44,9 @@ private:
Gaudi::Property<double> m_lUnit{this, "lengthUnit", dd4hep::mm};
// digitization settings, must be consistent with digi class
Gaudi::Property<int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<unsigned int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<double> m_dyRangeADC{this, "dynamicRangeADC", 100. * MeV};
Gaudi::Property<int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<unsigned int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<double> m_pedSigmaADC{this, "pedestalSigma", 3.2};
Gaudi::Property<double> m_resolutionTDC{this, "resolutionTDC", 10 * ps};
......@@ -170,15 +170,22 @@ public:
// energy time reconstruction
for (const auto& rh : rawhits) {
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wsign-conversion"
// did not pass the zero-suppression threshold
if ((signed)(rh.getAmplitude() - m_pedMeanADC) < thresholdADC) {
if (rh.getAmplitude() < m_pedMeanADC + thresholdADC) {
continue;
}
// convert ADC -> energy
const float energy =
(signed)(rh.getAmplitude() - m_pedMeanADC) / static_cast<float>(m_capADC.value()) * dyRangeADC / m_sampFrac;
(((signed)rh.getAmplitude() - (signed)m_pedMeanADC)) / static_cast<float>(m_capADC.value()) * dyRangeADC / m_sampFrac;
const float time = rh.getTimeStamp() / stepTDC;
#pragma GCC diagnostic pop
const auto cellID = rh.getCellID();
const int lid = id_dec != nullptr && !m_layerField.value().empty() ? static_cast<int>(id_dec->get(cellID, layer_idx)) : -1;
const int sid = id_dec != nullptr && !m_sectorField.value().empty() ? static_cast<int>(id_dec->get(cellID, sector_idx)) : -1;
......@@ -210,7 +217,7 @@ public:
const decltype(eicd::CalorimeterHitData::dimension) dimension(
cdim[0] / m_lUnit, cdim[1] / m_lUnit, cdim[2] / m_lUnit
);
const decltype(eicd::CalorimeterHitData::local) local(
const decltype(eicd::CalorimeterHitData::local) local_position(
pos.x() / m_lUnit, pos.y() / m_lUnit, pos.z() / m_lUnit
);
......@@ -225,7 +232,7 @@ public:
// Local hit info
sid,
lid,
local, // local pos
local_position, // local pos
});
info() << hits.at(hits.size()-1) << endmsg;
......
......@@ -48,8 +48,8 @@ private:
// length unit (from dd4hep geometry service)
Gaudi::Property<double> m_lUnit{this, "lengthUnit", dd4hep::mm};
// digitization parameters
Gaudi::Property<int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<unsigned int> m_capADC{this, "capacityADC", 8096};
Gaudi::Property<unsigned int> m_pedMeanADC{this, "pedestalMean", 400};
Gaudi::Property<double> m_dyRangeADC{this, "dynamicRangeADC", 100 * MeV};
Gaudi::Property<double> m_pedSigmaADC{this, "pedestalSigma", 3.2};
Gaudi::Property<double> m_thresholdADC{this, "thresholdFactor", 3.0};
......@@ -116,13 +116,20 @@ public:
// energy time reconstruction
for (const auto& rh : rawhits) {
#pragma GCC diagnostic push
#pragma GCC diagnostic error "-Wsign-conversion"
// did not pass the threshold
if ((rh.getAmplitude() - m_pedMeanADC) < m_thresholdADC * m_pedSigmaADC) {
if (rh.getAmplitude() < m_pedMeanADC + m_thresholdADC * m_pedSigmaADC) {
continue;
}
const double energy =
(rh.getAmplitude() - m_pedMeanADC) / (double)m_capADC * dyRangeADC / m_sampFrac; // convert ADC -> energy
(((signed)rh.getAmplitude() - (signed)m_pedMeanADC)) / (double)m_capADC * dyRangeADC / m_sampFrac; // convert ADC -> energy
const double time = rh.getTimeStamp() * 1.e-6; // ns
#pragma GCC diagnostic pop
const auto id = rh.getCellID();
// @TODO remove
const int lid = (int)id_dec->get(id, layer_idx);
......
......@@ -214,7 +214,6 @@ public:
}
// DIS kinematics calculations
const auto mass = pi_coll[0].getPDG() == 2212 ? m_proton : m_neutron;
const auto ef = electrons.front();
const auto q = ei - ef;
const auto q_dot_pi = q.Dot(pi);
......
......@@ -28,6 +28,7 @@ gaudi_add_module(JugTrackPlugins
src/components/ParticlesFromTrackFit.cpp
#src/components/TrajectoryFromTrackFit.cpp
src/components/TruthTrackSeeding.cpp
src/components/TrackParamACTSSeeding.cpp
LINK
Gaudi::GaudiAlgLib Gaudi::GaudiKernel
JugBase
......
......@@ -98,9 +98,7 @@ namespace Jug::Reco {
// Get the fitted track parameter
//
bool hasFittedParams = false;
if (traj.hasTrackParameters(trackTip)) {
hasFittedParams = true;
const auto& boundParam = traj.trackParameters(trackTip);
const auto& parameter = boundParam.parameters();
const auto& covariance = *boundParam.covariance();
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment