Commit bd093139 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Clang-tidy fixes

parent 90323e27
......@@ -9,6 +9,7 @@ Checks: '
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-readability-magic-numbers
-readability-magic-numbers,
-cppcoreguidelines-avoid-magic-numbers
'
FormatStyle: file
......@@ -22,6 +22,8 @@ if(ENABLE_CLANG_TIDY)
endif()
endif()
find_package(Microsoft.GSL CONFIG)
find_package(EICD REQUIRED)
find_package(EDM4HEP 0.4.1 REQUIRED)
......
......@@ -4,7 +4,7 @@
#include "GaudiKernel/MsgStream.h"
namespace Acts {
std::unique_ptr<const Logger> getDefaultLogger(const std::string& name, const Logging::Level& lvl, std::ostream*) {
std::unique_ptr<const Logger> getDefaultLogger(const std::string& name, const Logging::Level& lvl, std::ostream* /* unused */) {
using namespace Logging;
//ServiceHandle<IMessageSvc>* msgSvc = new ServiceHandle<IMessageSvc>("MessageSvc", name);
ServiceHandle<IMessageSvc> msgSvc("MessageSvc", name);
......
......@@ -6,7 +6,8 @@
int wildcmp(const char* wild, const char* string) {
// Written by Jack Handy - <A href="mailto:jakkhandy@hotmail.com">jakkhandy@hotmail.com</A>
const char *cp = nullptr, *mp = nullptr;
const char *cp = nullptr;
const char *mp = nullptr;
while ((*string) && (*wild != '*')) {
if ((*wild != *string) && (*wild != '?')) {
return 0;
......@@ -40,17 +41,19 @@ std::vector<std::string> split(const std::string& s, char delim) {
std::stringstream ss(s);
std::string item;
while (std::getline(ss, item, delim)) {
if (item != "") elems.push_back(item);
if (!item.empty()) {
elems.push_back(item);
}
}
return elems;
}
bool KeepDropSwitch::isOn(const std::string& astring) const {
typedef std::map<std::string, bool>::const_iterator MIter;
MIter im = m_cache.find(astring);
if (im != m_cache.end())
using MIter = std::map<std::string, bool>::const_iterator;
auto im = m_cache.find(astring);
if (im != m_cache.end()) {
return im->second;
else {
} else {
bool val = getFlag(astring);
m_cache.insert(std::pair<std::string, bool>(astring, val));
return val;
......@@ -69,11 +72,11 @@ bool KeepDropSwitch::getFlag(const std::string& astring) const {
std::string cmd = words[0];
std::string pattern = words[1];
Cmd theCmd = UNKNOWN;
if (cmd == "keep")
if (cmd == "keep") {
theCmd = KEEP;
else if (cmd == "drop")
} else if (cmd == "drop") {
theCmd = DROP;
else {
} else {
std::ostringstream msg;
msg << "malformed command in line: " << std::endl;
msg << cmdline << std::endl;
......@@ -81,20 +84,22 @@ bool KeepDropSwitch::getFlag(const std::string& astring) const {
throw std::invalid_argument(msg.str());
}
bool match = wildcmp(pattern.c_str(), astring.c_str());
if (not match)
if (not match) {
continue;
else if (theCmd == KEEP)
} else if (theCmd == KEEP) {
flag = true;
else
} else {
flag = false;
}
}
return flag;
}
KeepDropSwitch::Cmd KeepDropSwitch::extractCommand(const std::string cmdline) const {
std::vector<std::string> words = split(cmdline, ' ');
for (auto& word : words)
for (auto& word : words) {
std::cout << "'" << word << "' ";
}
std::cout << std::endl;
return UNKNOWN;
}
......@@ -16,16 +16,16 @@ StatusCode PodioDataSvc::initialize() {
m_cnvSvc = svc_loc->service("EventPersistencySvc");
status = setDataLoader(m_cnvSvc);
if (m_filename != "") {
if (!m_filename.empty()) {
m_filenames.push_back(m_filename);
}
if (m_filenames.size() > 0) {
if (m_filenames[0] != "") {
if (!m_filenames.empty()) {
if (!m_filenames[0].empty()) {
m_reader.openFiles(m_filenames);
m_eventMax = m_reader.getEntries();
m_provider.setReader(&m_reader);
auto idTable = m_reader.getCollectionIDTable();
auto* idTable = m_reader.getCollectionIDTable();
setCollectionIDs(idTable);
if (m_1stEvtEntry != 0) {
......@@ -71,7 +71,7 @@ void PodioDataSvc::endOfRead() {
m_reader.endOfEvent();
if (m_eventNum++ > m_eventMax) {
info() << "Reached end of file with event " << m_eventMax << endmsg;
IEventProcessor* eventProcessor;
IEventProcessor* eventProcessor = nullptr;
auto ret = service("ApplicationMgr", eventProcessor);
// FIXME: deal with errors
ret = eventProcessor->stopRun();
......@@ -81,9 +81,7 @@ void PodioDataSvc::endOfRead() {
}
void PodioDataSvc::setCollectionIDs(podio::CollectionIDTable* collectionIds) {
if (m_collectionIDs != nullptr) {
delete m_collectionIDs;
}
delete m_collectionIDs;
m_collectionIDs = collectionIds;
}
......@@ -95,25 +93,25 @@ PodioDataSvc::PodioDataSvc(const std::string& name, ISvcLocator* svc)
}
/// Standard Destructor
PodioDataSvc::~PodioDataSvc() {}
PodioDataSvc::~PodioDataSvc() = default;
StatusCode PodioDataSvc::readCollection(const std::string& collName, int collectionID) {
StatusCode PodioDataSvc::readCollection(const std::string& collectionName, int collectionID) {
podio::CollectionBase* collection(nullptr);
m_provider.get(collectionID, collection);
auto wrapper = new DataWrapper<podio::CollectionBase>;
const int id = m_collectionIDs->add(collName);
auto* wrapper = new DataWrapper<podio::CollectionBase>;
const int id = m_collectionIDs->add(collectionName);
collection->setID(id);
collection->prepareAfterRead();
wrapper->setData(collection);
m_readCollections.emplace_back(std::make_pair(collName, collection));
return DataSvc::registerObject("/Event", "/" + collName, wrapper);
m_readCollections.emplace_back(std::make_pair(collectionName, collection));
return DataSvc::registerObject("/Event", "/" + collectionName, wrapper);
}
StatusCode PodioDataSvc::registerObject(std::string_view parentPath, std::string_view fullPath, DataObject* pObject) {
DataWrapperBase* wrapper = dynamic_cast<DataWrapperBase*>(pObject);
if (wrapper) {
auto* wrapper = dynamic_cast<DataWrapperBase*>(pObject);
if (wrapper != nullptr) {
podio::CollectionBase* coll = wrapper->collectionBase();
if (coll) {
if (coll != nullptr) {
const size_t pos = fullPath.find_last_of("/");
const std::string shortPath(fullPath.substr(pos + 1, fullPath.length()));
const int id = m_collectionIDs->add(shortPath);
......
......@@ -8,13 +8,13 @@
#include "JugBase/Utilities/Helpers.hpp"
namespace Jug {
#include <gsl/gsl>
namespace PlotHelpers {
namespace Jug::PlotHelpers {
TH1F* bookHisto(const char* histName, const char* histTitle,
const Binning& varBinning) {
TH1F* hist = new TH1F(histName, histTitle, varBinning.nBins, varBinning.min,
varBinning.max);
gsl::owner<TH1F*> hist = new TH1F(histName, histTitle, varBinning.nBins, varBinning.min,
varBinning.max);
hist->GetXaxis()->SetTitle(varBinning.title.c_str());
hist->GetYaxis()->SetTitle("Entries");
hist->Sumw2();
......@@ -23,9 +23,9 @@ TH1F* bookHisto(const char* histName, const char* histTitle,
TH2F* bookHisto(const char* histName, const char* histTitle,
const Binning& varXBinning, const Binning& varYBinning) {
TH2F* hist = new TH2F(histName, histTitle, varXBinning.nBins, varXBinning.min,
varXBinning.max, varYBinning.nBins, varYBinning.min,
varYBinning.max);
gsl::owner<TH2F*> hist = new TH2F(histName, histTitle, varXBinning.nBins, varXBinning.min,
varXBinning.max, varYBinning.nBins, varYBinning.min,
varYBinning.max);
hist->GetXaxis()->SetTitle(varXBinning.title.c_str());
hist->GetYaxis()->SetTitle(varYBinning.title.c_str());
hist->Sumw2();
......@@ -47,7 +47,7 @@ void anaHisto(TH1D* inputHist, int j, TH1F* meanHist, TH1F* widthHist) {
assert(inputHist != nullptr);
if (inputHist->GetEntries() > 0) {
TFitResultPtr r = inputHist->Fit("gaus", "QS0");
if (r.Get() and ((r->Status() % 1000) == 0)) {
if (r.Get() != nullptr and ((r->Status() % 1000) == 0)) {
// fill the mean and width into 'j'th bin of the meanHist and widthHist,
// respectively
meanHist->SetBinContent(j, r->Parameter(1));
......@@ -60,14 +60,14 @@ void anaHisto(TH1D* inputHist, int j, TH1F* meanHist, TH1F* widthHist) {
TEfficiency* bookEff(const char* effName, const char* effTitle,
const Binning& varBinning) {
TEfficiency* efficiency = new TEfficiency(effName, effTitle, varBinning.nBins,
varBinning.min, varBinning.max);
auto* efficiency = new TEfficiency(effName, effTitle, varBinning.nBins,
varBinning.min, varBinning.max);
return efficiency;
}
TEfficiency* bookEff(const char* effName, const char* effTitle,
const Binning& varXBinning, const Binning& varYBinning) {
TEfficiency* efficiency = new TEfficiency(
auto* efficiency = new TEfficiency(
effName, effTitle, varXBinning.nBins, varXBinning.min, varXBinning.max,
varYBinning.nBins, varYBinning.min, varYBinning.max);
return efficiency;
......@@ -85,7 +85,7 @@ void fillEff(TEfficiency* efficiency, float xValue, float yValue, bool status) {
TProfile* bookProf(const char* profName, const char* profTitle,
const Binning& varXBinning, const Binning& varYBinning) {
TProfile* prof =
auto* prof =
new TProfile(profName, profTitle, varXBinning.nBins, varXBinning.min,
varXBinning.max, varYBinning.min, varYBinning.max);
prof->GetXaxis()->SetTitle(varXBinning.title.c_str());
......@@ -98,6 +98,4 @@ void fillProf(TProfile* profile, float xValue, float yValue, float weight) {
profile->Fill(xValue, yValue, weight);
}
} // namespace PlotHelpers
} // namespace Jug
} // namespace Jug::PlotHelpers
......@@ -106,7 +106,7 @@ std::pair<size_t, size_t> Jug::determineEventFilesRange(
// should only occur if no files matched and the initial values persisted.
if (eventMax < eventMin) {
return std::make_pair(0u, 0u);
return std::make_pair(0U, 0U);
}
return std::make_pair(eventMin, eventMax + 1);
}
......@@ -12,4 +12,4 @@ EICDataSvc::EICDataSvc(const std::string& name, ISvcLocator* svc) : PodioDataSvc
}
/// Standard Destructor
EICDataSvc::~EICDataSvc() {}
EICDataSvc::~EICDataSvc() = default;
......@@ -29,7 +29,7 @@
#include "TGeoMaterialInterface.h"
#include "PlanarMeasurement.h"
static const std::map<int, Acts::Logging::Level> _msgMap = {
static const std::map<int, Acts::Logging::Level> s_msgMap = {
{MSG::DEBUG, Acts::Logging::DEBUG},
{MSG::VERBOSE, Acts::Logging::VERBOSE},
{MSG::INFO, Acts::Logging::INFO},
......@@ -45,7 +45,7 @@ void draw_surfaces(std::shared_ptr<const Acts::TrackingGeometry> trk_geo, const
trk_geo->visitSurfaces([&](const Acts::Surface* surface) {
// for now we just require a valid surface
if (not surface) {
if (surface == nullptr) {
std::cout << " Not a surface \n";
return;
}
......@@ -56,8 +56,8 @@ void draw_surfaces(std::shared_ptr<const Acts::TrackingGeometry> trk_geo, const
os << std::fixed << std::setprecision(6);
size_t nVtx = 0;
for (const auto& srfx : surfaces) {
const PlaneSurface* srf = dynamic_cast<const PlaneSurface*>(srfx);
const PlanarBounds* bounds = dynamic_cast<const PlanarBounds*>(&srf->bounds());
const auto* srf = dynamic_cast<const PlaneSurface*>(srfx);
const auto* bounds = dynamic_cast<const PlanarBounds*>(&srf->bounds());
for (const auto& vtxloc : bounds->vertices()) {
Vector3 vtx = srf->transform(geo_ctx) * Vector3(vtxloc.x(), vtxloc.y(), 0);
os << "v " << vtx.x() << " " << vtx.y() << " " << vtx.z() << "\n";
......@@ -83,7 +83,7 @@ GeoSvc::GeoSvc(const std::string& name, ISvcLocator* svc)
, m_log(msgSvc(), name) {}
GeoSvc::~GeoSvc() {
if (m_dd4hepGeo) {
if (m_dd4hepGeo != nullptr) {
try {
m_dd4hepGeo->destroyInstance();
m_dd4hepGeo = 0;
......@@ -94,8 +94,9 @@ GeoSvc::~GeoSvc() {
StatusCode GeoSvc::initialize() {
StatusCode sc = Service::initialize();
if (!sc.isSuccess())
if (!sc.isSuccess()) {
return sc;
}
// Turn off TGeo printouts if appropriate for the msg level
if (msgLevel() >= MSG::INFO) {
TGeoManager::SetVerboseLevel(0);
......@@ -103,10 +104,11 @@ StatusCode GeoSvc::initialize() {
uint printoutLevel = msgLevel();
dd4hep::setPrintLevel(dd4hep::PrintLevel(printoutLevel));
// m_incidentSvc->addListener(this, "GeometryFailure");
if (buildDD4HepGeo().isFailure())
if (buildDD4HepGeo().isFailure()) {
m_log << MSG::ERROR << "Could not build DD4Hep geometry" << endmsg;
else
} else {
m_log << MSG::INFO << "DD4Hep geometry SUCCESSFULLY built" << endmsg;
}
// Genfit
genfit::FieldManager::getInstance()->init(new genfit::ConstField(
......@@ -116,7 +118,7 @@ StatusCode GeoSvc::initialize() {
// create a list of all surfaces in the detector:
dd4hep::rec::SurfaceManager surfMan( *m_dd4hepGeo ) ;
debug() << " surface manager " << endmsg;
const auto sM = surfMan.map("tracker") ;
const auto* const sM = surfMan.map("tracker") ;
if (sM != nullptr) {
debug() << " surface map size: " << sM->size() << endmsg;
// setup dd4hep surface map
......@@ -132,8 +134,8 @@ StatusCode GeoSvc::initialize() {
}
// Set ACTS logging level
auto im = _msgMap.find(msgLevel());
if (im != _msgMap.end()) {
auto im = s_msgMap.find(msgLevel());
if (im != s_msgMap.end()) {
m_actsLoggingLevel = im->second;
}
......@@ -176,21 +178,21 @@ StatusCode GeoSvc::initialize() {
debug() << "visiting all the surfaces " << endmsg;
m_trackingGeo->visitSurfaces([this](const Acts::Surface* surface) {
// for now we just require a valid surface
if (not surface) {
if (surface == nullptr) {
info() << "no surface??? " << endmsg;
return;
}
auto det_element =
const auto* det_element =
dynamic_cast<const Acts::DD4hepDetectorElement*>(surface->associatedDetectorElement());
if (!det_element) {
if (det_element == nullptr) {
error() << "invalid det_element!!! " << endmsg;
return;
}
// more verbose output is lower enum value
debug() << " det_element->identifier() " << det_element->identifier() << endmsg;
auto volman = m_dd4hepGeo->volumeManager();
auto vol_ctx = volman.lookupContext(det_element->identifier());
auto* vol_ctx = volman.lookupContext(det_element->identifier());
auto vol_id = vol_ctx->identifier;
if (msgLevel() <= MSG::DEBUG) {
......
......@@ -15,8 +15,7 @@
#include "edm4hep/SimTrackerHitCollection.h"
namespace Jug {
namespace Base {
namespace Jug::Base {
/** Need to fix a bug.
*
......@@ -47,7 +46,7 @@ namespace Jug {
// input collection
const T_IN* simhits = m_inputHitCollection.get();
// output collection
auto out_parts = m_outputHitCollection.createAndPut();
auto* out_parts = m_outputHitCollection.createAndPut();
for (const auto& ahit : *simhits) {
out_parts->push_back(ahit.clone());
}
......@@ -70,6 +69,5 @@ namespace Jug {
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
DECLARE_COMPONENT(MCCopier)
} // namespace Examples
} // namespace Gaudi
} // namespace Jug::Base
......@@ -249,7 +249,7 @@ const IParticleSvc::ParticleMap kParticleMap = {
ParticleSvc::ParticleSvc(const std::string& name, ISvcLocator* svc)
: base_class(name, svc), m_particleMap{kParticleMap} {}
ParticleSvc::~ParticleSvc() {}
ParticleSvc::~ParticleSvc() = default;
StatusCode ParticleSvc::initialize()
{
......
......@@ -9,7 +9,8 @@
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
DECLARE_COMPONENT(PodioInput)
PodioInput::PodioInput(const std::string& name, ISvcLocator* svcLoc) : GaudiAlgorithm(name, svcLoc) {}
PodioInput::PodioInput(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc),m_podioDataSvc(nullptr) {}
StatusCode PodioInput::initialize() {
if (GaudiAlgorithm::initialize().isFailure()) {
......@@ -18,11 +19,11 @@ StatusCode PodioInput::initialize() {
// check whether we have the PodioEvtSvc active
m_podioDataSvc = dynamic_cast<PodioDataSvc*>(evtSvc().get());
if (!m_podioDataSvc) {
if (m_podioDataSvc == nullptr) {
return StatusCode::FAILURE;
}
auto idTable = m_podioDataSvc->getCollectionIDs();
auto* idTable = m_podioDataSvc->getCollectionIDs();
for (auto& name : m_collectionNames) {
debug() << "Finding collection " << name << " in collection registry." << endmsg;
if (!idTable->present(name)) {
......@@ -50,6 +51,8 @@ StatusCode PodioInput::execute() {
}
StatusCode PodioInput::finalize() {
if (GaudiAlgorithm::finalize().isFailure()) return StatusCode::FAILURE;
if (GaudiAlgorithm::finalize().isFailure()) {
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
......@@ -9,15 +9,18 @@
DECLARE_COMPONENT(PodioOutput)
PodioOutput::PodioOutput(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc), m_firstEvent(true) {}
: GaudiAlgorithm(name, svcLoc), m_firstEvent(true),
m_podioDataSvc(nullptr), m_datatree(nullptr), m_metadatatree(nullptr),
m_runMDtree(nullptr), m_evtMDtree(nullptr), m_colMDtree(nullptr) {}
StatusCode PodioOutput::initialize() {
if (GaudiAlgorithm::initialize().isFailure())
if (GaudiAlgorithm::initialize().isFailure()) {
return StatusCode::FAILURE;
}
// check whether we have the PodioEvtSvc active
m_podioDataSvc = dynamic_cast<PodioDataSvc*>(evtSvc().get());
if (!m_podioDataSvc) {
if (m_podioDataSvc == nullptr) {
error() << "Failed to get the DataSvc" << endmsg;
return StatusCode::FAILURE;
}
......@@ -38,25 +41,25 @@ StatusCode PodioOutput::initialize() {
}
void PodioOutput::resetBranches(const std::vector<std::pair<std::string, podio::CollectionBase*>>& collections) {
for (auto& [collName, collBuffers] : collections) {
for (const auto& [collName, collBuffers] : collections) {
auto buffers = collBuffers->getBuffers();
auto data = buffers.data;
auto references = buffers.references;
auto vecmembers = buffers.vectorMembers;
auto* data = buffers.data;
auto* references = buffers.references;
auto* vecmembers = buffers.vectorMembers;
if (m_switch.isOn(collName)) {
// Reconnect branches and collections
m_datatree->SetBranchAddress(collName.c_str(), data);
auto colls = references;
if (colls) {
auto* colls = references;
if (colls != nullptr) {
for (size_t j = 0; j < colls->size(); ++j) {
const auto brName = podio::root_utils::refBranch(collName, j);
auto l_branch = m_datatree->GetBranch(brName.c_str());
auto* l_branch = m_datatree->GetBranch(brName.c_str());
l_branch->SetAddress(&(*colls)[j]);
}
}
auto colls_v = vecmembers;
if (colls_v) {
auto* colls_v = vecmembers;
if (colls_v != nullptr) {
int j = 0;
for (auto& [dataType, add] : (*colls_v)) {
const auto brName = podio::root_utils::vecBranch(collName, j);
......@@ -71,14 +74,14 @@ void PodioOutput::resetBranches(const std::vector<std::pair<std::string, podio::
void PodioOutput::createBranches(const std::vector<std::pair<std::string, podio::CollectionBase*>>& collections) {
// collectionID, collection type, subset collection
std::vector<std::tuple<int, std::string, bool>>* collectionInfo = new std::vector<std::tuple<int, std::string, bool>>();
auto* collectionInfo = new std::vector<std::tuple<int, std::string, bool>>();
collectionInfo->reserve(collections.size());
for (auto& [collName, collBuffers] : collections) {
for (const auto& [collName, collBuffers] : collections) {
auto buffers = collBuffers->getBuffers();
auto data = buffers.data;
auto references = buffers.references;
auto vecmembers = buffers.vectorMembers;
auto* data = buffers.data;
auto* references = buffers.references;
auto* vecmembers = buffers.vectorMembers;
const std::string className = collBuffers->getValueTypeName();
const std::string collClassName = "vector<" + className + "Data>";
......@@ -88,7 +91,7 @@ void PodioOutput::createBranches(const std::vector<std::pair<std::string, podio:
isOn = 1;
m_datatree->Branch(collName.c_str(), collClassName.c_str(), data);
// Create branches for collections holding relations
if (auto refColls = references) {
if (auto* refColls = references) {
int j = 0;
for (auto& c : (*refColls)) {
const auto brName = podio::root_utils::refBranch(collName, j);
......@@ -97,7 +100,7 @@ void PodioOutput::createBranches(const std::vector<std::pair<std::string, podio:
}
}
// vector members
if (auto vminfo = vecmembers) {
if (auto* vminfo = vecmembers) {
int j = 0;
for (auto& [dataType, add] : (*vminfo)) {
const std::string typeName = "vector<" + dataType + ">";
......
......@@ -8,6 +8,7 @@
#include "TTree.h"
#include <vector>
#include <gsl/gsl>
// forward declarations
class TFile;
......@@ -46,12 +47,12 @@ private:
/// The actual ROOT file
std::unique_ptr<TFile> m_file;
/// The tree to be filled with collections
TTree* m_datatree;
gsl::owner<TTree*> m_datatree;
/// The tree to be filled with meta data
TTree* m_metadatatree;
TTree* m_runMDtree;
TTree* m_evtMDtree;
TTree* m_colMDtree;
gsl::owner<TTree*> m_metadatatree;
gsl::owner<TTree*> m_runMDtree;
gsl::owner<TTree*> m_evtMDtree;
gsl::owner<TTree*> m_colMDtree;
/// The stored collections
std::vector<podio::CollectionBase*> m_storedCollections;
};
......
......@@ -12,7 +12,7 @@ public:
declareProperty("genParticles", m_genParticles, "mc particles to read");
}
~ReadTestConsumer(){};
~ReadTestConsumer() = default;
StatusCode initialize() {
warning() << "This is a deprecated test algorithm" << endmsg;
......
......@@ -44,7 +44,7 @@ namespace Jug::Digi {
SmartIF<IParticleSvc> m_pidSvc;
// unitless conterpart of arguments
double birksConstant;
double birksConstant{0};
// ill-formed: using GaudiAlgorithm::GaudiAlgorithm;
CalorimeterBirksCorr(const std::string& name, ISvcLocator* svcLoc)
......
......@@ -70,10 +70,10 @@ namespace Jug::Digi {
Gaudi::Property<std::string> m_readout{this, "readoutClass", ""};
// unitless counterparts of inputs
double dyRangeADC, stepTDC, tRes, eRes[3] = {0., 0., 0.};
double dyRangeADC{0}, stepTDC{0}, tRes{0}, eRes[3] = {0., 0., 0.};