diff --git a/DataFormats/Detectors/FIT/FV0/CMakeLists.txt b/DataFormats/Detectors/FIT/FV0/CMakeLists.txt index 35bc653a8234e..c8bcd89fe1b37 100644 --- a/DataFormats/Detectors/FIT/FV0/CMakeLists.txt +++ b/DataFormats/Detectors/FIT/FV0/CMakeLists.txt @@ -17,6 +17,7 @@ o2_add_library(DataFormatsFV0 src/RawEventData.cxx src/CTF.cxx src/LookUpTable.cxx + src/FV0RecoConfig.cxx PUBLIC_LINK_LIBRARIES O2::FV0Base O2::DataFormatsFIT O2::SimulationDataFormat @@ -35,4 +36,6 @@ o2_target_root_dictionary(DataFormatsFV0 include/DataFormatsFV0/RecPoints.h include/DataFormatsFV0/RawEventData.h include/DataFormatsFV0/LookUpTable.h - include/DataFormatsFV0/CTF.h) + include/DataFormatsFV0/CTF.h + include/DataFormatsFV0/FV0RecoConfig.h +) diff --git a/DataFormats/Detectors/FIT/FV0/include/DataFormatsFV0/FV0RecoConfig.h b/DataFormats/Detectors/FIT/FV0/include/DataFormatsFV0/FV0RecoConfig.h new file mode 100644 index 0000000000000..27ee06ab37f80 --- /dev/null +++ b/DataFormats/Detectors/FIT/FV0/include/DataFormatsFV0/FV0RecoConfig.h @@ -0,0 +1,36 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#ifndef ALICEO2_FV0_DIGIT_FILTER_PARAM +#define ALICEO2_FV0_DIGIT_FILTER_PARAM + +#include "CommonUtils/ConfigurableParamHelper.h" +#include "DataFormatsFV0/ChannelData.h" + +namespace o2::fv0 +{ +struct FV0RecoConfig : o2::conf::ConfigurableParamHelper { + double AmplitudeLowerThreshold = 24; // only channels with amplitude higher will participate in calibration and collision time + double AmplitudeThreholdForMeanTime = 5; // Charge threshold, only above which the time is taken into account in calculating the mean time of all qualifying channels + double TimeUpperThershold = 1000.0; // only channels with time below will participate in calibration and collision time + uint8_t mValidPmInputFlagMask = ~(1u << ChannelData::kNumberADC); + uint8_t mValidPmInputFlags = static_cast((1u << ChannelData::kIsCFDinADCgate) | (1u << ChannelData::kIsEventInTVDC)); + + bool areChannelDataFlagsGood(uint8_t flags) const + { + return (flags & mValidPmInputFlagMask) == mValidPmInputFlags; + } + O2ParamDef(FV0RecoConfig, "FV0RecoConfig"); +}; + +} // namespace o2::fv0 + +#endif \ No newline at end of file diff --git a/DataFormats/Detectors/FIT/FV0/src/DataFormatsFV0LinkDef.h b/DataFormats/Detectors/FIT/FV0/src/DataFormatsFV0LinkDef.h index ab23b4aa727bc..83d27ccd2037d 100644 --- a/DataFormats/Detectors/FIT/FV0/src/DataFormatsFV0LinkDef.h +++ b/DataFormats/Detectors/FIT/FV0/src/DataFormatsFV0LinkDef.h @@ -40,4 +40,5 @@ #pragma link C++ class o2::fv0::FV0CalibrationInfoObject + ; #pragma link C++ class o2::fv0::FV0ChannelTimeCalibrationObject + ; +#pragma link C++ class o2::fv0::FV0RecoConfig + ; #endif diff --git a/DataFormats/Detectors/FIT/FV0/src/FV0RecoConfig.cxx b/DataFormats/Detectors/FIT/FV0/src/FV0RecoConfig.cxx new file mode 100644 index 0000000000000..a50fc03f7b30b --- /dev/null +++ b/DataFormats/Detectors/FIT/FV0/src/FV0RecoConfig.cxx @@ -0,0 +1,15 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include "DataFormatsFV0/FV0RecoConfig.h" + +using namespace o2::fv0; +O2ParamImpl(FV0RecoConfig); \ No newline at end of file diff --git a/Detectors/FIT/FV0/reconstruction/src/BaseRecoTask.cxx b/Detectors/FIT/FV0/reconstruction/src/BaseRecoTask.cxx index 8032220f8996d..1f7f0c2db1d60 100644 --- a/Detectors/FIT/FV0/reconstruction/src/BaseRecoTask.cxx +++ b/Detectors/FIT/FV0/reconstruction/src/BaseRecoTask.cxx @@ -17,6 +17,7 @@ #include "FV0Base/Geometry.h" #include "FV0Simulation/FV0DigParam.h" #include "FV0Simulation/DigitizationConstant.h" +#include "DataFormatsFV0/FV0RecoConfig.h" #include #include #include @@ -56,14 +57,14 @@ RP BaseRecoTask::process(o2::fv0::Digit const& bcd, const auto& currentOutCh = outChData.back(); // Conditions for reconstructing collision time (3 variants: first, average-relaxed and average-tight) - if (currentOutCh.charge > FV0DigParam::Instance().chargeThrForMeanTime) { + if (currentOutCh.charge > FV0RecoConfig::Instance().AmplitudeThreholdForMeanTime) { sideAtimeFirst = std::min(static_cast(sideAtimeFirst), currentOutCh.time); - if (inChData[ich].areAllFlagsGood()) { - if (std::abs(currentOutCh.time) < FV0DigParam::Instance().mTimeThresholdForReco) { + if (FV0RecoConfig::Instance().areChannelDataFlagsGood(inChData[ich].ChainQTC)) { + if (std::abs(currentOutCh.time) < FV0RecoConfig::Instance().TimeUpperThershold) { sideAtimeAvg += currentOutCh.time; ndigitsA++; } - if (currentOutCh.charge > FV0DigParam::Instance().mAmpThresholdForReco && std::abs(currentOutCh.time) < FV0DigParam::Instance().mTimeThresholdForReco) { + if (currentOutCh.charge > FV0RecoConfig::Instance().AmplitudeLowerThreshold && std::abs(currentOutCh.time) < FV0RecoConfig::Instance().TimeUpperThershold) { sideAtimeAvgSelected += currentOutCh.time; ndigitsASelected++; }