Skip to content

Commit 38b7fa9

Browse files
author
wpierozak
committed
Updaed FDD reco
1 parent 714626e commit 38b7fa9

File tree

15 files changed

+53
-21
lines changed

15 files changed

+53
-21
lines changed

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

Lines changed: 4 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,12 @@ 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(const o2::fit::DeadChannelMap* deadChannelMap) {mDeadChannelMap = deadChannelMap;}
37+
3638
private:
39+
const o2::fit::DeadChannelMap* mDeadChannelMap;
3740
ClassDefNV(Reconstructor, 3);
3841
};
3942
} // namespace fdd

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ void Reconstructor::process(o2::fdd::Digit const& digitBC, gsl::span<const o2::f
3434
int nStored = 0;
3535
int nch = inChData.size();
3636
for (int ich = 0; ich < nch; ich++) {
37+
if(mDeadChannelMap && !mDeadChannelMap->isChannelAlive(ich)) {
38+
LOG(debug) << "Channel " << ich << " is dead - discarding data";
39+
continue;
40+
}
3741
bool inTime = inChData[ich].getFlag(ChannelData::EEventDataBit::kIsEventInTVDC);
3842
bool inAdcGate = inChData[ich].getFlag(ChannelData::EEventDataBit::kIsCFDinADCgate);
3943
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/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: 8 additions & 1 deletion
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

@@ -28,6 +29,7 @@ namespace fdd
2829

2930
void FDDReconstructorDPL::init(InitContext& ic)
3031
{
32+
3133
}
3234

3335
void FDDReconstructorDPL::run(ProcessingContext& pc)
@@ -44,6 +46,10 @@ void FDDReconstructorDPL::run(ProcessingContext& pc)
4446
// lblPtr = labels.get();
4547
LOG(info) << "Ignoring MC info";
4648
}
49+
if(mUseDeadChannelMap) {
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());
@@ -70,7 +76,8 @@ DataProcessorSpec getFDDReconstructorSpec(bool useMC, bool useDeadChannelMap)
7076
// inputSpec.emplace_back("labels", o2::header::gDataOriginFDD, "DIGITSMCTR", 0, Lifetime::Timeframe);
7177
}
7278
if (useDeadChannelMap) {
73-
inputSpec.emplace_back("deadChannelMap", o2::header::gDataOriginFDD, "DeadChannelMap", 0, LifeTime::Condition, ccdbParamSpec("FDD/Calib/DeadChannelMap"));
79+
LOG(info) << "Dead channel map will be applied during reconstruction";
80+
inputSpec.emplace_back("deadChannelMap", o2::header::gDataOriginFDD, "DeadChannelMap", 0, Lifetime::Condition, ccdbParamSpec("FDD/Calib/DeadChannelMap"));
7481
}
7582
outputSpec.emplace_back(o2::header::gDataOriginFDD, "RECPOINTS", 0, Lifetime::Timeframe);
7683
outputSpec.emplace_back(o2::header::gDataOriginFDD, "RECCHDATA", 0, Lifetime::Timeframe);

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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ class CollisionTimeRecoTask
5858
LOG(info) << "Init for slewing calib object";
5959
mCalibSlew = calibSlew->makeSlewingPlots();
6060
};
61-
void SetDeadChannelMap(const o2::fit::DeadChannelMap * deadChannelMap) { mDeadChannelMap = deadChannelMap; }
61+
void SetDeadChannelMap(const o2::fit::DeadChannelMap * deadChannelMap)
62+
{
63+
LOG(debug) << "Updated dead channel map for CollisionTimeRecoTask";
64+
mDeadChannelMap = deadChannelMap;
65+
}
6266
float getTimeInPS(const o2::ft0::ChannelData& channelData);
6367

6468
private:

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ RP CollisionTimeRecoTask::processDigit(const o2::ft0::Digit& digit,
6969
}
7070
if(mDeadChannelMap && !mDeadChannelMap->isChannelAlive(channelData.ChId)) {
7171
LOG(debug) << "Channel " << channelData.ChId << " is dead - discarding data";
72-
outChData.emplace_back(channelData.ChId, 0.0, 0.0, 0);
7372
continue;
7473
}
7574
const float timeInPS = getTimeInPS(channelData);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class ReconstructionDPL : public Task
4747
bool mUseTimeOffsetCalib = true;
4848
bool mUseSlewingCalib = true;
4949
bool mUseDeadChannelMap = true;
50+
bool mUpdateDeadChannelMap = true;
5051
const std::string mCCDBpath = o2::base::NameConf::getCCDBServer();
5152
std::vector<o2::ft0::RecPoints> mRecPoints;
5253
std::vector<o2::ft0::ChannelDataFloat> mRecChData;

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void ReconstructionDPL::init(InitContext& ic)
4444
LOG(info) << "FT0 param mMinRMS: " << CalibParam::Instance().mMinRMS;
4545
LOG(info) << "FT0 param mMaxSigma: " << CalibParam::Instance().mMaxSigma;
4646
LOG(info) << "FT0 param mMaxDiffMean: " << CalibParam::Instance().mMaxDiffMean;
47+
LOG(info) << "FT0 dead channel map will be applied " << mUseDeadChannelMap;
4748
}
4849

4950
void ReconstructionDPL::run(ProcessingContext& pc)
@@ -70,10 +71,11 @@ void ReconstructionDPL::run(ProcessingContext& pc)
7071
}
7172

7273
if (mUseDeadChannelMap) {
74+
LOG(debug) << "Applying dead channel map";
7375
auto deadChannelMap = pc.inputs().get<o2::fit::DeadChannelMap*>("deadChannelMap");
7476
mReco.SetDeadChannelMap(deadChannelMap.get());
7577
}
76-
78+
7779
mRecPoints.reserve(digits.size());
7880
mRecChData.reserve(channels.size());
7981
mReco.processTF(digits, channels, mRecPoints, mRecChData);
@@ -96,6 +98,11 @@ void ReconstructionDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
9698
mUseSlewingCalib = false; // upload only once, slewing should be stable during the run
9799
return;
98100
}
101+
if (matcher == ConcreteDataMatcher("FT0", "DeadChannelMap", 0)) {
102+
LOG(debug) << "New DeadChannelMap is uploaded";
103+
mUpdateDeadChannelMap = false;
104+
return;
105+
}
99106
}
100107

101108
void ReconstructionDPL::endOfStream(EndOfStreamContext& ec)
@@ -128,6 +135,7 @@ DataProcessorSpec getReconstructionSpec(bool useMC, const std::string ccdbpath,
128135
}
129136

130137
if (useDeadChannelMap) {
138+
LOG(info) << "Dead channel map will be applied during reconstruction";
131139
inputSpec.emplace_back("deadChannelMap", o2::header::gDataOriginFT0, "DeadChannelMap", 0, Lifetime::Condition, ccdbParamSpec("FT0/Calib/DeadChannelMap"));
132140
}
133141

0 commit comments

Comments
 (0)