Skip to content

Commit 4a654e8

Browse files
author
Wiktor Pierozak
committed
Merged Charge and Time fileters to one Fv0RecoConfig
1 parent 21b8265 commit 4a654e8

4 files changed

Lines changed: 14 additions & 28 deletions

File tree

DataFormats/Detectors/FIT/FV0/include/DataFormatsFV0/RecoFilterParam.h

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,22 @@
1313
#define ALICEO2_FV0_DIGIT_FILTER_PARAM
1414

1515
#include "CommonUtils/ConfigurableParamHelper.h"
16+
#include "DataFormatsFV0/ChannelData.h"
1617

1718
namespace o2::fv0
1819
{
19-
struct FV0RecoChargeFilter : o2::conf::ConfigurableParamHelper<FV0RecoChargeFilter> {
20+
struct FV0RecoConfig : o2::conf::ConfigurableParamHelper<FV0RecoConfig> {
2021
double AmplitudeLowerThreshold = 24; // only channels with amplitude higher will participate in calibration and collision time
2122
double AmplitudeThreholdForMeanTime = 5; // Charge threshold, only above which the time is taken into account in calculating the mean time of all qualifying channels
23+
double TimeUpperThershold = 1000.0; // only channels with time below will participate in calibration and collision time
24+
uint8_t mValidPmInputFlagMask = ~(1u << ChannelData::kNumberADC);
25+
uint8_t mValidPmInputFlags = static_cast<uint8_t>((1u << ChannelData::kIsCFDinADCgate) | (1u << ChannelData::kIsEventInTVDC));
2226

23-
bool validForMeanTimeCalculation(double charge) const
27+
bool areChannelDataFlagsGood(uint8_t flags) const
2428
{
25-
return charge > AmplitudeThreholdForMeanTime;
29+
return (flags & mValidPmInputFlagMask) == mValidPmInputFlags;
2630
}
27-
28-
bool validForCalibrationAndCollisionTime(double charge) const
29-
{
30-
return charge > AmplitudeLowerThreshold;
31-
}
32-
33-
O2ParamDef(FV0RecoChargeFilter, "FV0RecoChargeFilter");
34-
};
35-
36-
struct FV0RecoTimeFilter : o2::conf::ConfigurableParamHelper<FV0RecoTimeFilter> {
37-
double TimeUpperThershold = 1000.0; // only channels with time below will participate in calibration and collision time
38-
bool validForCalibrationAndCollisionTime(double time) const
39-
{
40-
return time < TimeUpperThershold;
41-
}
42-
43-
O2ParamDef(FV0RecoTimeFilter, "FV0RecoTimeFilter");
31+
O2ParamDef(FV0RecoConfig, "FV0RecoConfig");
4432
};
4533

4634
} // namespace o2::fv0

DataFormats/Detectors/FIT/FV0/src/DataFormatsFV0LinkDef.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,5 @@
4040
#pragma link C++ class o2::fv0::FV0CalibrationInfoObject + ;
4141
#pragma link C++ class o2::fv0::FV0ChannelTimeCalibrationObject + ;
4242

43-
#pragma link C++ class o2::fv0::FV0RecoChargeFilter + ;
44-
#pragma link C++ class o2::fv0::FV0RecoTimeFilter + ;
43+
#pragma link C++ class o2::fv0::FV0RecoConfig + ;
4544
#endif

DataFormats/Detectors/FIT/FV0/src/RecoFilterParam.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@
1212
#include "DataFormatsFV0/RecoFilterParam.h"
1313

1414
using namespace o2::fv0;
15-
O2ParamImpl(FV0RecoChargeFilter);
16-
O2ParamImpl(FV0RecoTimeFilter);
15+
O2ParamImpl(FV0RecoConfig);

Detectors/FIT/FV0/reconstruction/src/BaseRecoTask.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ RP BaseRecoTask::process(o2::fv0::Digit const& bcd,
5757
const auto& currentOutCh = outChData.back();
5858

5959
// Conditions for reconstructing collision time (3 variants: first, average-relaxed and average-tight)
60-
if (FV0RecoChargeFilter::Instance().validForMeanTimeCalculation(currentOutCh.charge)) {
60+
if (currentOutCh.charge > FV0RecoConfig::Instance().AmplitudeThreholdForMeanTime) {
6161
sideAtimeFirst = std::min(static_cast<Double_t>(sideAtimeFirst), currentOutCh.time);
62-
if (inChData[ich].areAllFlagsGood()) {
63-
if (FV0RecoTimeFilter::Instance().validForCalibrationAndCollisionTime(std::abs(currentOutCh.time))) {
62+
if (FV0RecoConfig::Instance().areChannelDataFlagsGood(inChData[ich].ChainQTC)) {
63+
if (std::abs(currentOutCh.time) < FV0RecoConfig::Instance().TimeUpperThershold) {
6464
sideAtimeAvg += currentOutCh.time;
6565
ndigitsA++;
6666
}
67-
if (FV0RecoChargeFilter::Instance().validForCalibrationAndCollisionTime(currentOutCh.charge) && FV0RecoTimeFilter::Instance().validForCalibrationAndCollisionTime(std::abs(currentOutCh.time))) {
67+
if (currentOutCh.charge > FV0RecoConfig::Instance().AmplitudeLowerThreshold && std::abs(currentOutCh.time) < FV0RecoConfig::Instance().TimeUpperThershold) {
6868
sideAtimeAvgSelected += currentOutCh.time;
6969
ndigitsASelected++;
7070
}

0 commit comments

Comments
 (0)