Skip to content

Commit 75a357d

Browse files
wpierozakwpierozakwpierozakalibuild
authored
Afit 124 (#14985)
* FV0: included dead channel map in reconstruction * FV0: fixed fetch of dead channel map in reco * FV0:Added debug log when data from dead channel is discard * FV0: changed handling of dead channel in reco * Implementation DeadChannelMap in FDD/FT0 * Updaed FDD reco * FIT:Fixed application of DeadChannelMap in FV0 and FDD reconstruction task * Fixed missing constructor arguments for FDD RecoSepc * Please consider the following formatting changes --------- Co-authored-by: wpierozak <wpierozak@Laptop-Wiktor.play.pl> Co-authored-by: wpierozak <wpierozak@localhost.localdomain> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 23a36df commit 75a357d

File tree

21 files changed

+135
-44
lines changed

21 files changed

+135
-44
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <vector>
1818
#include "DataFormatsFDD/Digit.h"
1919
#include "DataFormatsFDD/RecPoint.h"
20+
#include "DataFormatsFIT/DeadChannelMap.h"
2021
namespace o2
2122
{
2223
namespace fdd
@@ -30,10 +31,16 @@ class Reconstructor
3031
gsl::span<const o2::fdd::ChannelData> inChData,
3132
std::vector<o2::fdd::RecPoint>& RecPoints,
3233
std::vector<o2::fdd::ChannelDataFloat>& outChData);
33-
3434
void finish();
3535

36+
void setDeadChannelMap(o2::fit::DeadChannelMap const* deadChannelMap)
37+
{
38+
LOG(info) << "Updated dead channel map";
39+
mDeadChannelMap = deadChannelMap;
40+
}
41+
3642
private:
43+
o2::fit::DeadChannelMap const* mDeadChannelMap = nullptr;
3744
ClassDefNV(Reconstructor, 3);
3845
};
3946
} // namespace fdd

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ 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++) {
38+
if (mDeadChannelMap && !mDeadChannelMap->isChannelAlive(inChData[ich].mPMNumber)) {
39+
LOG(debug) << "Channel " << ich << " is dead - discarding data";
40+
continue;
41+
}
3742
bool inTime = inChData[ich].getFlag(ChannelData::EEventDataBit::kIsEventInTVDC);
3843
bool inAdcGate = inChData[ich].getFlag(ChannelData::EEventDataBit::kIsCFDinADCgate);
3944
if (inAdcGate) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace o2
2020
{
2121
namespace fdd
2222
{
23-
framework::WorkflowSpec getRecoWorkflow(bool useMC, bool disableRootInp, bool disableRootOut);
23+
framework::WorkflowSpec getRecoWorkflow(bool useMC, bool disableRootInp, bool disableRootOut, bool useDeadChannelMap);
2424
} // namespace fdd
2525
} // namespace o2
2626
#endif

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "Framework/Task.h"
1919
#include "FDDReconstruction/Reconstructor.h"
2020
#include "DataFormatsFDD/RecPoint.h"
21+
#include "DataFormatsFIT/DeadChannelMap.h"
22+
#include "Framework/ConcreteDataMatcher.h"
2123

2224
using namespace o2::framework;
2325

@@ -29,21 +31,25 @@ namespace fdd
2931
class FDDReconstructorDPL : public Task
3032
{
3133
public:
32-
FDDReconstructorDPL(bool useMC) : mUseMC(useMC) {}
34+
FDDReconstructorDPL(bool useMC, bool useDeadChannelMap) : mUseMC(useMC), mUseDeadChannelMap(useDeadChannelMap) {}
3335
~FDDReconstructorDPL() override = default;
3436
void init(InitContext& ic) final;
3537
void run(ProcessingContext& pc) final;
38+
void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) final;
3639

3740
private:
3841
bool mUseMC = true;
42+
bool mUseDeadChannelMap = true;
43+
bool mUpdateDeadChannelMap = true;
3944
std::vector<o2::fdd::RecPoint> mRecPoints;
4045
std::vector<o2::fdd::ChannelDataFloat> mRecChData;
46+
o2::fit::DeadChannelMap const* mDeadChannelMap;
4147
o2::fdd::Reconstructor mReco;
4248
o2::header::DataOrigin mOrigin = o2::header::gDataOriginFDD;
4349
};
4450

4551
/// create a processor spec
46-
framework::DataProcessorSpec getFDDReconstructorSpec(bool useMC = true);
52+
framework::DataProcessorSpec getFDDReconstructorSpec(bool useMC = true, bool useDeadChannelMap = true);
4753

4854
} // namespace fdd
4955
} // namespace o2

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ namespace o2
2222
namespace fdd
2323
{
2424

25-
framework::WorkflowSpec getRecoWorkflow(bool useMC, bool disableRootInp, bool disableRootOut)
25+
framework::WorkflowSpec getRecoWorkflow(bool useMC, bool disableRootInp, bool disableRootOut, bool useDeadChannelMap)
2626
{
2727
framework::WorkflowSpec specs;
2828

2929
if (!disableRootInp) {
3030
specs.emplace_back(o2::fdd::getFDDDigitReaderSpec(useMC));
3131
}
32-
specs.emplace_back(o2::fdd::getFDDReconstructorSpec(useMC));
32+
specs.emplace_back(o2::fdd::getFDDReconstructorSpec(useMC, useDeadChannelMap));
3333
if (!disableRootOut) {
3434
specs.emplace_back(o2::fdd::getFDDRecPointWriterSpec(useMC));
3535
}

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "FDDWorkflow/ReconstructorSpec.h"
1919
#include "DataFormatsFDD/Digit.h"
2020
#include "DataFormatsFDD/MCLabel.h"
21+
#include "Framework/CCDBParamSpec.h"
2122

2223
using namespace o2::framework;
2324

@@ -44,6 +45,11 @@ void FDDReconstructorDPL::run(ProcessingContext& pc)
4445
// lblPtr = labels.get();
4546
LOG(info) << "Ignoring MC info";
4647
}
48+
if (mUseDeadChannelMap && mUpdateDeadChannelMap) {
49+
LOG(info) << "Populating reconsturctor object with Dead Channel Map object";
50+
auto deadChannelMap = pc.inputs().get<o2::fit::DeadChannelMap*>("deadChannelMap");
51+
mReco.setDeadChannelMap(deadChannelMap.get());
52+
}
4753
int nDig = digitsBC.size();
4854
mRecPoints.reserve(nDig);
4955
mRecChData.reserve(digitsCh.size());
@@ -58,24 +64,37 @@ void FDDReconstructorDPL::run(ProcessingContext& pc)
5864
pc.outputs().snapshot(Output{mOrigin, "RECCHDATA", 0}, mRecChData);
5965
}
6066

61-
DataProcessorSpec getFDDReconstructorSpec(bool useMC)
67+
void FDDReconstructorDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
68+
{
69+
if (matcher == ConcreteDataMatcher("FDD", "DeadChannelMap", 0)) {
70+
mUpdateDeadChannelMap = false;
71+
return;
72+
}
73+
}
74+
75+
DataProcessorSpec getFDDReconstructorSpec(bool useMC, bool useDeadChannelMap)
6276
{
6377
std::vector<InputSpec> inputSpec;
6478
std::vector<OutputSpec> outputSpec;
6579
inputSpec.emplace_back("digitsBC", o2::header::gDataOriginFDD, "DIGITSBC", 0, Lifetime::Timeframe);
6680
inputSpec.emplace_back("digitsCh", o2::header::gDataOriginFDD, "DIGITSCH", 0, Lifetime::Timeframe);
81+
6782
if (useMC) {
6883
LOG(info) << "Currently FDDReconstructor does not consume and provide MC truth";
6984
// inputSpec.emplace_back("labels", o2::header::gDataOriginFDD, "DIGITSMCTR", 0, Lifetime::Timeframe);
7085
}
86+
if (useDeadChannelMap) {
87+
LOG(info) << "Dead channel map will be applied during reconstruction";
88+
inputSpec.emplace_back("deadChannelMap", o2::header::gDataOriginFDD, "DeadChannelMap", 0, Lifetime::Condition, ccdbParamSpec("FDD/Calib/DeadChannelMap"));
89+
}
7190
outputSpec.emplace_back(o2::header::gDataOriginFDD, "RECPOINTS", 0, Lifetime::Timeframe);
7291
outputSpec.emplace_back(o2::header::gDataOriginFDD, "RECCHDATA", 0, Lifetime::Timeframe);
7392

7493
return DataProcessorSpec{
7594
"fdd-reconstructor",
7695
inputSpec,
7796
outputSpec,
78-
AlgorithmSpec{adaptFromTask<FDDReconstructorDPL>(useMC)},
97+
AlgorithmSpec{adaptFromTask<FDDReconstructorDPL>(useMC, useDeadChannelMap)},
7998
Options{}};
8099
}
81100

Detectors/FIT/FDD/workflow/src/fdd-reco-workflow.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3838
{"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
3939
{"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input readers"}},
4040
{"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writers"}},
41+
{"disable-dead-channel-map", o2::framework::VariantType::Bool, false, {"disable dead channel map"}},
4142
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
4243
o2::raw::HBFUtilsInitializer::addConfigOption(options);
4344
std::swap(workflowOptions, options);
@@ -57,8 +58,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
5758
auto useMC = !configcontext.options().get<bool>("disable-mc");
5859
auto disableRootInp = configcontext.options().get<bool>("disable-root-input");
5960
auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
61+
bool useDeadChannelMap = !configcontext.options().get<bool>("disable-dead-channel-map");
6062

61-
auto wf = o2::fdd::getRecoWorkflow(useMC, disableRootInp, disableRootOut);
63+
auto wf = o2::fdd::getRecoWorkflow(useMC, disableRootInp, disableRootOut, useDeadChannelMap);
6264

6365
// configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
6466
o2::raw::HBFUtilsInitializer hbfIni(configcontext, wf);

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "DataFormatsFT0/FT0ChannelTimeCalibrationObject.h"
2222
#include "DataFormatsFT0/SpectraInfoObject.h"
2323
#include "DataFormatsFT0/SlewingCoef.h"
24+
#include "DataFormatsFIT/DeadChannelMap.h"
2425
#include <gsl/span>
2526
#include <array>
2627
#include <vector>
@@ -57,10 +58,16 @@ class CollisionTimeRecoTask
5758
LOG(info) << "Init for slewing calib object";
5859
mCalibSlew = calibSlew->makeSlewingPlots();
5960
};
61+
void SetDeadChannelMap(const o2::fit::DeadChannelMap* deadChannelMap)
62+
{
63+
LOG(info) << "Updated dead channel map for CollisionTimeRecoTask";
64+
mDeadChannelMap = deadChannelMap;
65+
}
6066
float getTimeInPS(const o2::ft0::ChannelData& channelData);
6167

6268
private:
6369
o2::ft0::TimeSpectraInfoObject const* mTimeCalibObject = nullptr;
70+
const o2::fit::DeadChannelMap* mDeadChannelMap = nullptr;
6471
typename o2::ft0::SlewingCoef::SlewingPlots_t mCalibSlew{};
6572
};
6673
} // namespace ft0

Detectors/FIT/FT0/reconstruction/src/CollisionTimeRecoTask.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ RP CollisionTimeRecoTask::processDigit(const o2::ft0::Digit& digit,
6767
// Reference channels shouldn't participate in reco at all!
6868
continue;
6969
}
70+
if (mDeadChannelMap && !mDeadChannelMap->isChannelAlive(channelData.ChId)) {
71+
LOG(debug) << "Channel " << channelData.ChId << " is dead - discarding data";
72+
continue;
73+
}
7074
const float timeInPS = getTimeInPS(channelData);
7175
if (ChannelFilterParam::Instance().checkAll(channelData)) {
7276
outChData.emplace_back(channelData.ChId, timeInPS, (float)channelData.QTCAmpl, channelData.ChainQTC);

Detectors/FIT/FT0/workflow/include/FT0Workflow/RecoWorkflow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace o2
2020
{
2121
namespace ft0
2222
{
23-
framework::WorkflowSpec getRecoWorkflow(bool useMC, std::string ccdbpath, bool useTimeOffsetCalib, bool useSlewingCalib, bool disableRootInp, bool disableRootOut);
23+
framework::WorkflowSpec getRecoWorkflow(bool useMC, std::string ccdbpath, bool useTimeOffsetCalib, bool useSlewingCalib, bool disableRootInp, bool disableRootOut, bool useDeadChannelMap = true);
2424
} // namespace ft0
2525
} // namespace o2
2626
#endif

0 commit comments

Comments
 (0)