Skip to content

Commit cf66e02

Browse files
author
wpierozak
committed
FIT:Fixed application of DeadChannelMap in FV0 and FDD reconstruction task
1 parent 38b7fa9 commit cf66e02

File tree

9 files changed

+41
-29
lines changed

9 files changed

+41
-29
lines changed

Detectors/FIT/FDD/reconstruction/include/FDDReconstruction/Reconstructor.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ class Reconstructor
3333
std::vector<o2::fdd::ChannelDataFloat>& outChData);
3434
void finish();
3535

36-
void setDeadChannelMap(const o2::fit::DeadChannelMap* deadChannelMap) {mDeadChannelMap = deadChannelMap;}
36+
void setDeadChannelMap(o2::fit::DeadChannelMap const* deadChannelMap)
37+
{
38+
LOG(info) << "Updated dead channel map";
39+
mDeadChannelMap = deadChannelMap;
40+
}
3741

3842
private:
39-
const o2::fit::DeadChannelMap* mDeadChannelMap;
43+
o2::fit::DeadChannelMap const* mDeadChannelMap = nullptr;
4044
ClassDefNV(Reconstructor, 3);
4145
};
4246
} // namespace fdd

Detectors/FIT/FDD/reconstruction/src/Reconstructor.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ void Reconstructor::process(o2::fdd::Digit const& digitBC, gsl::span<const o2::f
3333
int firstEntry = outChData.size();
3434
int nStored = 0;
3535
int nch = inChData.size();
36+
3637
for (int ich = 0; ich < nch; ich++) {
37-
if(mDeadChannelMap && !mDeadChannelMap->isChannelAlive(ich)) {
38+
if (mDeadChannelMap && !mDeadChannelMap->isChannelAlive(inChData[ich].mPMNumber)) {
3839
LOG(debug) << "Channel " << ich << " is dead - discarding data";
3940
continue;
4041
}

Detectors/FIT/FDD/workflow/include/FDDWorkflow/ReconstructorSpec.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "FDDReconstruction/Reconstructor.h"
2020
#include "DataFormatsFDD/RecPoint.h"
2121
#include "DataFormatsFIT/DeadChannelMap.h"
22+
#include "Framework/ConcreteDataMatcher.h"
2223

2324
using namespace o2::framework;
2425

@@ -34,15 +35,15 @@ class FDDReconstructorDPL : public Task
3435
~FDDReconstructorDPL() override = default;
3536
void init(InitContext& ic) final;
3637
void run(ProcessingContext& pc) final;
37-
38-
void setDeadChannelMap(const o2::fit::DeadChannelMap* deadChannelMap) {mDeadChannelMap = deadChannelMap;}
38+
void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) final;
3939

4040
private:
4141
bool mUseMC = true;
4242
bool mUseDeadChannelMap = true;
43+
bool mUpdateDeadChannelMap = true;
4344
std::vector<o2::fdd::RecPoint> mRecPoints;
4445
std::vector<o2::fdd::ChannelDataFloat> mRecChData;
45-
const o2::fit::DeadChannelMap* mDeadChannelMap;
46+
o2::fit::DeadChannelMap const* mDeadChannelMap;
4647
o2::fdd::Reconstructor mReco;
4748
o2::header::DataOrigin mOrigin = o2::header::gDataOriginFDD;
4849
};

Detectors/FIT/FDD/workflow/src/ReconstructorSpec.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ void FDDReconstructorDPL::run(ProcessingContext& pc)
4646
// lblPtr = labels.get();
4747
LOG(info) << "Ignoring MC info";
4848
}
49-
if(mUseDeadChannelMap) {
49+
if (mUseDeadChannelMap && mUpdateDeadChannelMap) {
50+
LOG(info) << "Populating reconsturctor object with Dead Channel Map object";
5051
auto deadChannelMap = pc.inputs().get<o2::fit::DeadChannelMap*>("deadChannelMap");
5152
mReco.setDeadChannelMap(deadChannelMap.get());
5253
}
@@ -64,6 +65,14 @@ void FDDReconstructorDPL::run(ProcessingContext& pc)
6465
pc.outputs().snapshot(Output{mOrigin, "RECCHDATA", 0}, mRecChData);
6566
}
6667

68+
void FDDReconstructorDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
69+
{
70+
if (matcher == ConcreteDataMatcher("FDD", "DeadChannelMap", 0)) {
71+
mUpdateDeadChannelMap = false;
72+
return;
73+
}
74+
}
75+
6776
DataProcessorSpec getFDDReconstructorSpec(bool useMC, bool useDeadChannelMap)
6877
{
6978
std::vector<InputSpec> inputSpec;

Detectors/FIT/FT0/reconstruction/include/FT0Reconstruction/CollisionTimeRecoTask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class CollisionTimeRecoTask
6060
};
6161
void SetDeadChannelMap(const o2::fit::DeadChannelMap * deadChannelMap)
6262
{
63-
LOG(debug) << "Updated dead channel map for CollisionTimeRecoTask";
63+
LOG(info) << "Updated dead channel map for CollisionTimeRecoTask";
6464
mDeadChannelMap = deadChannelMap;
6565
}
6666
float getTimeInPS(const o2::ft0::ChannelData& channelData);

Detectors/FIT/FT0/workflow/src/ReconstructionSpec.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ void ReconstructionDPL::run(ProcessingContext& pc)
7070
mReco.SetSlewingCalibObject(slewingCalibObject.get());
7171
}
7272

73-
if (mUseDeadChannelMap) {
73+
if (mUseDeadChannelMap && mUpdateDeadChannelMap) {
7474
LOG(debug) << "Applying dead channel map";
7575
auto deadChannelMap = pc.inputs().get<o2::fit::DeadChannelMap*>("deadChannelMap");
7676
mReco.SetDeadChannelMap(deadChannelMap.get());
7777
}
78-
78+
7979
mRecPoints.reserve(digits.size());
8080
mRecChData.reserve(channels.size());
8181
mReco.processTF(digits, channels, mRecPoints, mRecChData);

Detectors/FIT/FV0/reconstruction/include/FV0Reconstruction/BaseRecoTask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BaseRecoTask
3434
~BaseRecoTask() = default;
3535
o2::fv0::RecPoints process(o2::fv0::Digit const& bcd,
3636
gsl::span<const o2::fv0::ChannelData> inChData,
37-
gsl::span<o2::fv0::ChannelDataFloat> outChData);
37+
std::vector<o2::fv0::ChannelDataFloat>& outChData);
3838
void FinishTask();
3939
void SetChannelOffset(o2::fv0::FV0ChannelTimeCalibrationObject const* caliboffsets) { mCalibOffset = caliboffsets; };
4040
void SetDeadChannelMap(o2::fit::DeadChannelMap const* deadChannelMap) { mDeadChannelMap = deadChannelMap; }

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using RP = o2::fv0::RecPoints;
2727

2828
RP BaseRecoTask::process(o2::fv0::Digit const& bcd,
2929
gsl::span<const o2::fv0::ChannelData> inChData,
30-
gsl::span<o2::fv0::ChannelDataFloat> outChData)
30+
std::vector<o2::fv0::ChannelDataFloat>& outChData)
3131
{
3232
LOG(debug) << "Running reconstruction on new event";
3333

@@ -44,27 +44,27 @@ RP BaseRecoTask::process(o2::fv0::Digit const& bcd,
4444
int nch = inChData.size();
4545
for (int ich = 0; ich < nch; ich++) {
4646
LOG(debug) << " channel " << ich << " / " << nch;
47-
int offsetChannel = getOffset(int(inChData[ich].ChId));
48-
if(mDeadChannelMap && !mDeadChannelMap->isChannelAlive(ich)) {
47+
if (mDeadChannelMap && !mDeadChannelMap->isChannelAlive(inChData[ich].ChId)) {
4948
LOG(debug) << "Channel " << ich << " is dead - discarding data";
50-
outChData[ich] = o2::fv0::ChannelDataFloat{inChData[ich].ChId, 0.0, 0.0, 0};
5149
continue;
5250
}
53-
outChData[ich] = o2::fv0::ChannelDataFloat{inChData[ich].ChId,
54-
(inChData[ich].CFDTime - offsetChannel) * DigitizationConstant::TIME_PER_TDCCHANNEL,
55-
(float)inChData[ich].QTCAmpl,
56-
inChData[ich].ChainQTC};
51+
int offsetChannel = getOffset(int(inChData[ich].ChId));
52+
outChData.emplace_back(o2::fv0::ChannelDataFloat{inChData[ich].ChId,
53+
(inChData[ich].CFDTime - offsetChannel) * DigitizationConstant::TIME_PER_TDCCHANNEL,
54+
(float)inChData[ich].QTCAmpl,
55+
inChData[ich].ChainQTC});
56+
const auto& currentOutCh = outChData.back();
5757

5858
// Conditions for reconstructing collision time (3 variants: first, average-relaxed and average-tight)
59-
if (outChData[ich].charge > FV0DigParam::Instance().chargeThrForMeanTime) {
60-
sideAtimeFirst = std::min(static_cast<Double_t>(sideAtimeFirst), outChData[ich].time);
59+
if (currentOutCh.charge > FV0DigParam::Instance().chargeThrForMeanTime) {
60+
sideAtimeFirst = std::min(static_cast<Double_t>(sideAtimeFirst), currentOutCh.time);
6161
if (inChData[ich].areAllFlagsGood()) {
62-
if (std::abs(outChData[ich].time) < FV0DigParam::Instance().mTimeThresholdForReco) {
63-
sideAtimeAvg += outChData[ich].time;
62+
if (std::abs(currentOutCh.time) < FV0DigParam::Instance().mTimeThresholdForReco) {
63+
sideAtimeAvg += currentOutCh.time;
6464
ndigitsA++;
6565
}
66-
if (outChData[ich].charge > FV0DigParam::Instance().mAmpThresholdForReco && std::abs(outChData[ich].time) < FV0DigParam::Instance().mTimeThresholdForReco) {
67-
sideAtimeAvgSelected += outChData[ich].time;
66+
if (currentOutCh.charge > FV0DigParam::Instance().mAmpThresholdForReco && std::abs(currentOutCh.time) < FV0DigParam::Instance().mTimeThresholdForReco) {
67+
sideAtimeAvgSelected += currentOutCh.time;
6868
ndigitsASelected++;
6969
}
7070
}

Detectors/FIT/FV0/workflow/src/ReconstructionSpec.cxx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ void ReconstructionDPL::run(ProcessingContext& pc)
6262
int nDig = digits.size();
6363
LOG(debug) << " nDig " << nDig << " | ndigch " << digch.size();
6464
mRecPoints.reserve(nDig);
65-
mRecChData.resize(digch.size());
6665
for (int id = 0; id < nDig; id++) {
6766
const auto& digit = digits[id];
6867
LOG(debug) << " ndig " << id << " bc " << digit.getBC() << " orbit " << digit.getOrbit();
6968
auto channels = digit.getBunchChannelData(digch);
70-
gsl::span<o2::fv0::ChannelDataFloat> out_ch(mRecChData);
71-
out_ch = out_ch.subspan(digit.ref.getFirstEntry(), digit.ref.getEntries());
72-
mRecPoints.emplace_back(mReco.process(digit, channels, out_ch));
69+
mRecPoints.emplace_back(mReco.process(digit, channels, mRecChData));
7370
}
7471

7572
LOG(debug) << "FV0 reconstruction pushes " << mRecPoints.size() << " RecPoints";

0 commit comments

Comments
 (0)