Skip to content

Commit 740e7a0

Browse files
authored
Merge branch 'AliceO2Group:dev' into new_geometry
2 parents 52c0ea3 + 2c6742c commit 740e7a0

89 files changed

Lines changed: 3273 additions & 2226 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Common/MathUtils/include/MathUtils/detail/trigonometric.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,11 @@ GPUhdi() constexpr T fastATan2(T y, T x)
275275
// Average inaccuracy: 0.00048
276276
// Max inaccuracy: 0.00084
277277
// Speed: 6.2 times faster than atan2f()
278-
constexpr T Pi = 3.1415926535897932384626433832795;
279-
280278
auto atan = [](T a) -> T {
281279
// returns the arctan for the angular range [-Pi/4, Pi/4]
282280
// the polynomial coefficients are taken from:
283281
// https://stackoverflow.com/questions/42537957/fast-accurate-atan-arctan-approximation-algorithm
282+
constexpr T Pi = 3.1415926535897932384626433832795;
284283
constexpr T A = 0.0776509570923569;
285284
constexpr T B = -0.287434475393028;
286285
constexpr T C = ((Pi / 4) - A - B);
@@ -290,6 +289,7 @@ GPUhdi() constexpr T fastATan2(T y, T x)
290289

291290
auto atan2P = [atan](T yy, T xx) -> T {
292291
// fast atan2(yy,xx) for the angular range [0,+Pi]
292+
constexpr T Pi = 3.1415926535897932384626433832795;
293293
constexpr T Pi025 = 1 * Pi / 4;
294294
constexpr T Pi075 = 3 * Pi / 4;
295295
const T x1 = xx + yy; // point p1 (x1,y1) = (xx,yy) - Pi/4

‎DataFormats/Reconstruction/include/ReconstructionDataFormats/GlobalTrackID.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ GPUconstexpr() GlobalTrackID::mask_t sMasks[GlobalTrackID::NSources] = ///< dete
165165
GlobalTrackID::mask_t(math_utils::bit2Mask(GlobalTrackID::MCHMID)) // Temporary ordering
166166
};
167167

168-
#ifndef __OPENCL__
168+
#if !defined(__OPENCL__) && !defined(__METAL__)
169169
GPUconstexpr() GlobalTrackID::mask_t sTrackSources =
170170
sMasks[GlobalTrackID::ITS] | sMasks[GlobalTrackID::TPC] | sMasks[GlobalTrackID::MFT] | sMasks[GlobalTrackID::MCH] | sMasks[GlobalTrackID::ITSTPC] | sMasks[GlobalTrackID::TPCTOF] |
171171
sMasks[GlobalTrackID::TPCTRD] | sMasks[GlobalTrackID::MFTMCH] | sMasks[GlobalTrackID::ITSTPCTRD] | sMasks[GlobalTrackID::ITSTPCTOF] | sMasks[GlobalTrackID::TPCTRDTOF] |
@@ -177,7 +177,7 @@ GPUconstexpr() GlobalTrackID::mask_t sTrackSources =
177177
GPUdi() constexpr GlobalTrackID::DetID::mask_t GlobalTrackID::getSourceDetectorsMask(int i) { return globaltrackid_internal::SourceDetectorsMasks[i]; }
178178
GPUdi() constexpr GlobalTrackID::mask_t GlobalTrackID::getSourceMask(int s) { return globaltrackid_internal::sMasks[s]; }
179179

180-
#ifndef __OPENCL__
180+
#if !defined(__OPENCL__) && !defined(__METAL__)
181181
GPUdi() bool GlobalTrackID::isTrackSource(int s)
182182
{
183183
return globaltrackid_internal::sTrackSources[s];

‎Detectors/Base/include/DetectorsBase/GRPGeomHelper.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ struct GRPGeomRequest {
9191
enum GeomRequest { None,
9292
Aligned,
9393
Ideal,
94-
Alignments };
94+
Alignments,
95+
AlignmentsAndAligned };
9596

9697
bool askAggregateRunInfo = false;
9798
bool askGRPECS = false;

‎Detectors/Base/src/GRPGeomHelper.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ namespace o2d = o2::dataformats;
3939
GRPGeomRequest::GRPGeomRequest(bool orbitResetTime, bool GRPECS, bool GRPLHCIF, bool GRPMagField, bool askMatLUT, GeomRequest geom, std::vector<o2::framework::InputSpec>& inputs, bool askOnce, bool needPropD, std::string detMaskString)
4040
: askGRPECS(GRPECS), askGRPLHCIF(GRPLHCIF), askGRPMagField(GRPMagField), askMatLUT(askMatLUT), askTime(orbitResetTime), askOnceAllButField(askOnce), needPropagatorD(needPropD)
4141
{
42-
if (geom == Aligned) {
42+
if (geom == Aligned || geom == AlignmentsAndAligned) {
4343
askGeomAlign = true;
4444
addInput({"geomAlg", "GLO", "GEOMALIGN", 0, Lifetime::Condition, ccdbParamSpec("GLO/Config/GeometryAligned")}, inputs);
4545
} else if (geom == Ideal || geom == Alignments) {
4646
askGeomIdeal = true;
4747
addInput({"geomIdeal", "GLO", "GEOMIDEAL", 0, Lifetime::Condition, ccdbParamSpec("GLO/Config/Geometry")}, inputs);
4848
}
49-
if (geom == Alignments) {
49+
if (geom == Alignments || geom == AlignmentsAndAligned) {
5050
askAlignments = true;
5151
o2::detectors::DetID::mask_t algDetMask = DetID::getMask(detMaskString);
5252
for (auto id = DetID::First; id <= DetID::Last; id++) {

‎Detectors/GlobalTrackingWorkflow/study/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12-
#add_compile_options(-O0 -g -fPIC)
12+
# add_compile_options(-O0 -g -fPIC)
1313

1414
o2_add_library(GlobalTrackingStudy
1515
TARGETVARNAME targetName

‎Detectors/GlobalTrackingWorkflow/study/src/CheckResidSpec.cxx‎

Lines changed: 138 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "DataFormatsGlobalTracking/RecoContainer.h"
2727
#include "DataFormatsITSMFT/TrkClusRef.h"
2828
#include "DataFormatsITSMFT/ClustersPerLayer.h"
29+
#include "ITSMFTReconstruction/ChipMappingITS.h"
2930
#include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h"
3031
#include "ReconstructionDataFormats/TrackTPCITS.h"
3132
#include "ReconstructionDataFormats/GlobalTrackID.h"
@@ -106,6 +107,7 @@ class CheckResidSpec final : public Task
106107
void postProcessHistos();
107108
void drawHistos();
108109

110+
o2::itsmft::ChipMappingITS mChipMap;
109111
o2::globaltracking::RecoContainer* mRecoData = nullptr;
110112
int mNThreads = 1;
111113
bool mMeanVertexUpdated = false;
@@ -632,6 +634,7 @@ bool CheckResidSpec::refitITStrack(o2::track::TrackParCov& track, GTrackID gid)
632634
void CheckResidSpec::fillHistos(const o2::checkresid::Track& trc)
633635
{
634636
const auto& params = CheckResidConfig::Instance();
637+
auto geom = o2::its::GeometryTGeo::Instance();
635638
int np = trc.points.size();
636639
auto pt = trc.track.getPt();
637640
if (pt < params.minPt || pt > params.maxPt) {
@@ -662,6 +665,21 @@ void CheckResidSpec::fillHistos(const o2::checkresid::Track& trc)
662665
mHMan->getHisto2F(il * 10 + 1 * 100 + 5 + 2000)->Fill(pt, pull);
663666
mHMan->getHisto2F(il * 10 + 1 * 100 + 5 + 3000)->Fill(trc.track.getTgl(), pull);
664667
}
668+
if (pnt.lr >= 0 && pnt.sens >= 0 && geom->getLayer(pnt.sens) == pnt.lr) {
669+
const int halfBarrel = geom->getHalfBarrel(pnt.sens);
670+
const int chip = geom->getFirstChipIndex(pnt.lr) + geom->getChipIdInLayer(pnt.sens);
671+
const int chipHistoID = (2 * il + halfBarrel) * 100 + 15000;
672+
if (halfBarrel >= 0 && halfBarrel < 2) {
673+
mHMan->getHisto2F(chipHistoID)->Fill(chip, pnt.dy);
674+
mHMan->getHisto2F(chipHistoID + 10)->Fill(chip, pnt.dz);
675+
if (pnt.sig2y > 0) {
676+
mHMan->getHisto2F(chipHistoID + 5)->Fill(chip, pnt.dy / std::sqrt(pnt.sig2y));
677+
}
678+
if (pnt.sig2z > 0) {
679+
mHMan->getHisto2F(chipHistoID + 15)->Fill(chip, pnt.dz / std::sqrt(pnt.sig2z));
680+
}
681+
}
682+
}
665683
}
666684
//--------------
667685
if (trc.trIBOut.getX() > 1 && std::abs(trc.trIBOut.getX() - trc.trOBInw.getX()) < 0.1) {
@@ -726,6 +744,18 @@ void CheckResidSpec::bookHistos()
726744
mHMan->addHisto(htgl2, il * 10 + iyz * 100 + 3000);
727745
auto htgl2p = new TH2F(fmt::format("{}_{}_{}_pull", dname, lrName, "tgl").c_str(), fmt::format("pull {}_{{{}}} vs {};tg#lambda; pull{}", dtit, lrName, "tg#lambda", dtit).c_str(), params.nBinsTgl, -params.maxTgl, params.maxTgl, params.nBinsRes, -params.maxPull, params.maxPull);
728746
mHMan->addHisto(htgl2p, il * 10 + iyz * 100 + 5 + 3000);
747+
748+
if (il > 0) {
749+
const int ilr = il - 1;
750+
const int nChips = mChipMap.getNChipsOnLayer(ilr) / 2;
751+
for (int ib = 0; ib < 2; ++ib) { // chips per halfbarrel
752+
const int startChip = ib * nChips + mChipMap.getFirstChipsOnLayer(ilr);
753+
auto h2 = new TH2F(fmt::format("{}_{}_{}", dname, lrName, ib).c_str(), fmt::format("{} Lr{} HB{};chip;{}", dname, lrName, ib, dtit).c_str(), nChips, startChip - 0.5, startChip - 0.5 + nChips, params.nBinsRes, -params.maxDYZ[il], params.maxDYZ[il]);
754+
mHMan->addHisto(h2, (2 * il + ib) * 100 + iyz * 10 + 15000);
755+
auto h2p = new TH2F(fmt::format("{}_{}_{}_pull", dname, lrName, ib).c_str(), fmt::format("{} Lr{} HB{} pull;chip;pull{}", dname, lrName, ib, dtit).c_str(), nChips, startChip - 0.5, startChip - 0.5 + nChips, params.nBinsRes, -params.maxPull, params.maxPull);
756+
mHMan->addHisto(h2p, (2 * il + ib) * 100 + iyz * 10 + 5 + 15000);
757+
}
758+
}
729759
}
730760
}
731761

@@ -805,14 +835,23 @@ void CheckResidSpec::postProcessHistos()
805835
}
806836
}
807837
}
808-
histm->write();
838+
for (int il = 1; il < 8; il++) {
839+
for (int ib = 0; ib < 2; ib++) {
840+
for (int iyz = 0; iyz < 2; iyz++) {
841+
for (int iht = 0; iht < 2; iht++) {
842+
const int offsV = iht == 0 ? 0 : 5;
843+
fitSlices((2 * il + ib) * 100 + iyz * 10 + offsV + 15000);
844+
}
845+
}
846+
}
847+
}
809848
}
810849
delete gs;
811850
}
812851

813852
void CheckResidSpec::drawHistos()
814853
{
815-
gROOT->SetBatch(true);
854+
// gROOT->SetBatch(true);
816855
gStyle->SetTitleX(0.2);
817856
gStyle->SetTitleY(0.88);
818857
gStyle->SetTitleW(0.25);
@@ -928,6 +967,8 @@ void CheckResidSpec::drawHistos()
928967
}
929968
TCanvas cly("cly", "", 600, 800), clz("clz", "", 600, 800), clpar("clpar", "", 600, 800);
930969
TCanvas czly("czly", "", 600, 800), czlz("czlz", "", 600, 800), czlpar("czlpar", "", 600, 800);
970+
TCanvas cchip("cchip", "", 600, 800);
971+
constexpr std::array<const char*, 4> chipTitles{"#DeltaY", "pull #DeltaY", "#DeltaZ", "pull #DeltaZ"};
931972
auto AddLabel = [](const char* txt, float x = 0.1, float y = 0.9, int color = kBlack, float size = 0.04) {
932973
TLatex* lt = new TLatex(x, y, txt);
933974
lt->SetNDC();
@@ -1062,6 +1103,94 @@ void CheckResidSpec::drawHistos()
10621103
AddLabel("IB-OB tracks params differences at R = 12 cm", 0.2, 0.8);
10631104
czlpar.Print(Form("%s_hman.pdf", params.outname.c_str()));
10641105

1106+
auto getHMinMax = [this](int id, float marginFrac, float maxDev, int roundToMicrons) -> std::tuple<float, float, float> {
1107+
float maxV = std::numeric_limits<float>::min(), minV = std::numeric_limits<float>::max();
1108+
const int nh = this->mHManV.size();
1109+
for (int j = 0; j < nh; j++) {
1110+
if (auto histo = this->mHManV[j]->getHisto(id); histo != nullptr) {
1111+
const int nb = histo->GetNbinsX();
1112+
for (int ib = 1; ib <= nb; ib++) {
1113+
float v = histo->GetBinContent(ib);
1114+
maxV = std::max(maxV, v);
1115+
minV = std::min(minV, v);
1116+
}
1117+
}
1118+
}
1119+
if (maxV < minV) {
1120+
return {0.f, 1.f, 0.1f};
1121+
}
1122+
auto delta = maxV - minV;
1123+
maxV += delta * marginFrac;
1124+
minV -= delta * marginFrac;
1125+
if (roundToMicrons > 0) {
1126+
maxV = ((int(std::ceil(maxV * 1e4)) / roundToMicrons + 1) * roundToMicrons) * 1e-4;
1127+
minV = ((int(std::floor(minV * 1e4)) / roundToMicrons - 1) * roundToMicrons) * 1e-4;
1128+
}
1129+
minV = std::max(minV, -maxDev);
1130+
maxV = std::min(maxV, maxDev);
1131+
return {minV, maxV, std::max(std::abs(minV), std::abs(maxV))};
1132+
};
1133+
auto collectSpread = [](TH1* hin, TH1* hout) {
1134+
const int nb = hin->GetNbinsX();
1135+
for (int ib = 1; ib <= nb; ib++) {
1136+
if (hin->GetBinError(ib) != 0) {
1137+
hout->Fill(hin->GetBinContent(ib));
1138+
}
1139+
}
1140+
hout->SetLineColor(hin->GetLineColor());
1141+
hout->SetMarkerColor(hin->GetMarkerColor());
1142+
hout->SetMarkerStyle(hin->GetMarkerStyle());
1143+
};
1144+
int nh = this->mHManV.size();
1145+
for (int il = 1; il < 8; ++il) {
1146+
for (int ib = 0; ib < 2; ib++) {
1147+
cchip.Clear();
1148+
cchip.Divide(1, 4);
1149+
for (int iyz = 0; iyz < 2; iyz++) {
1150+
for (int iv = 0; iv < 2; iv++) { // mean or sigma
1151+
const float yRange = iyz == 0 ? params.resMMLrY[il] : params.resMMLrZ[il];
1152+
bool drawn = false;
1153+
const int id = 15000 + iyz * 10 + (2 * il + ib) * 100 + 1 + iv;
1154+
auto [minV, maxV, absMax] = getHMinMax(id, 0.15, (iv == 0 ? 2 : 4) * yRange, 10);
1155+
TH1* firstAuto = nullptr;
1156+
float maxAuto = 0.f;
1157+
for (int j = 0; j < nh; j++) {
1158+
auto hman = this->mHManV[j].get();
1159+
auto histo = hman->getHisto(id);
1160+
if (histo) {
1161+
histo->SetMaximum(absMax);
1162+
histo->SetMinimum(iv ? 0 : -absMax);
1163+
if (il > 3) {
1164+
histo->SetMarkerSize(0.3);
1165+
histo->SetLineStyle(3);
1166+
}
1167+
cchip.cd(2 * iv + 1);
1168+
histo->Draw(drawn ? "same" : "");
1169+
if (!drawn) {
1170+
gPad->SetGrid();
1171+
}
1172+
auto hmeans = new TH1F(Form("%s_spread", histo->GetName()), Form("%s spread", histo->GetTitle()), params.nBinsRes, iv == 0 ? minV : std::max(0.f, minV), maxV);
1173+
collectSpread(histo, hmeans);
1174+
hman->addHisto(hmeans, id + 2);
1175+
cchip.cd(2 * iv + 2);
1176+
if (!drawn) {
1177+
firstAuto = hmeans;
1178+
}
1179+
maxAuto = std::max(maxAuto, (float)hmeans->GetMaximum());
1180+
hmeans->Draw(drawn ? "same" : "");
1181+
drawn = true;
1182+
}
1183+
}
1184+
if (firstAuto) {
1185+
firstAuto->SetMaximum(maxAuto * 1.25);
1186+
gPad->SetGrid();
1187+
gPad->Modified();
1188+
}
1189+
}
1190+
cchip.Print(Form("%s_hman.pdf", params.outname.c_str()));
1191+
}
1192+
}
1193+
}
10651194
cly.Print(Form("%s_hman.pdf]", params.outname.c_str()));
10661195
}
10671196

@@ -1074,6 +1203,13 @@ void CheckResidSpec::endOfStream(EndOfStreamContext& ec)
10741203
if (mDraw) {
10751204
drawHistos();
10761205
}
1206+
if (auto nh = mHManV.size(); nh > 0) {
1207+
for (int ihm = 0; ihm < nh; ihm++) {
1208+
if (mHManV[ihm]) {
1209+
mHManV[ihm].get()->write();
1210+
}
1211+
}
1212+
}
10771213
}
10781214

10791215
void CheckResidSpec::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)

‎Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCResidualWriterSpec.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace tpc
2222
{
2323

2424
/// create a processor spec
25-
framework::DataProcessorSpec getTPCResidualWriterSpec(bool writeTrackData, bool debugOutput);
25+
framework::DataProcessorSpec getTPCResidualWriterSpec(bool writeTrackData, bool debugOutput, bool writeTrackDataMC);
2626

2727
} // namespace tpc
2828
} // namespace o2

‎Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCUnbinnedResidualReaderSpec.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,28 @@ namespace tpc
3030
class TPCUnbinnedResidualReader : public o2::framework::Task
3131
{
3232
public:
33-
TPCUnbinnedResidualReader(bool trkInput) : mTrackInput(trkInput){};
33+
TPCUnbinnedResidualReader(bool trkInput, bool mcInput) : mTrackInput(trkInput), mMCInput(mcInput) {};
3434
~TPCUnbinnedResidualReader() override = default;
3535
void init(o2::framework::InitContext& ic) final;
3636
void run(o2::framework::ProcessingContext& pc) final;
3737

3838
private:
3939
void connectTree();
4040
bool mTrackInput = false;
41+
bool mMCInput = false;
4142
std::unique_ptr<TFile> mFileIn;
4243
std::unique_ptr<TTree> mTreeIn;
4344
std::string mInFileName;
4445
std::string mInTreeName;
4546
std::vector<UnbinnedResid> mUnbinnedResid, *mUnbinnedResidPtr = &mUnbinnedResid;
4647
std::vector<DetInfoResid> mDetInfoUnbRes, *mDetInfoUnbResPtr = &mDetInfoUnbRes;
4748
std::vector<TrackData> mTrackData, *mTrackDataPtr = &mTrackData;
49+
std::vector<TrackDataMC> mTrackDataMC, *mTrackDataMCPtr = &mTrackDataMC;
4850
std::vector<TrackDataCompact> mTrackDataCompact, *mTrackDataCompactPtr = &mTrackDataCompact;
4951
};
5052

51-
/// read unbinned TPC residuals and reference tracks from a root file
52-
framework::DataProcessorSpec getUnbinnedTPCResidualsReaderSpec(bool trkInput);
53+
/// read unbinned TPC residuals and reference tracks (with mcInput also their MC truth) from a root file
54+
framework::DataProcessorSpec getUnbinnedTPCResidualsReaderSpec(bool trkInput, bool mcInput);
5355

5456
} // namespace tpc
5557
} // namespace o2

‎Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCResidualWriterSpec.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace tpc
2929
template <typename T>
3030
using BranchDefinition = MakeRootTreeWriterSpec::BranchDefinition<T>;
3131

32-
DataProcessorSpec getTPCResidualWriterSpec(bool writeTrackData, bool debugOutput)
32+
DataProcessorSpec getTPCResidualWriterSpec(bool writeTrackData, bool debugOutput, bool writeTrackDataMC)
3333
{
3434
bool writeUnfiltered = SpacePointsCalibConfParam::Instance().writeUnfiltered;
3535
return MakeRootTreeWriterSpec("tpc-residuals-writer",
@@ -39,6 +39,7 @@ DataProcessorSpec getTPCResidualWriterSpec(bool writeTrackData, bool debugOutput
3939
BranchDefinition<std::vector<DetInfoResid>>{InputSpec{"detInfo", "GLO", "DETINFORES"}, "detInfo"},
4040
BranchDefinition<std::vector<TrackDataCompact>>{InputSpec{"trackRefs", "GLO", "TRKREFS"}, "trackRefs"},
4141
BranchDefinition<std::vector<TrackData>>{InputSpec{"tracks", "GLO", "TRKDATA"}, "tracks", (writeTrackData ? 1 : 0)},
42+
BranchDefinition<std::vector<TrackDataMC>>{InputSpec{"tracksMC", "GLO", "TRKDATAMC"}, "tracksMC", (writeTrackDataMC ? 1 : 0)},
4243
BranchDefinition<std::vector<TrackDataExtended>>{InputSpec{"trackExt", "GLO", "TRKDATAEXT"}, "trackExt", (debugOutput ? 1 : 0)})();
4344
}
4445

‎Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCUnbinnedResidualReaderSpec.cxx‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ void TPCUnbinnedResidualReader::connectTree()
5252
if (mTrackInput) {
5353
mTreeIn->SetBranchAddress("tracks", &mTrackDataPtr);
5454
}
55+
if (mMCInput) {
56+
if (!mTreeIn->GetBranch("tracksMC")) {
57+
LOG(fatal) << "No tracksMC branch found in the unbinned residuals tree, the interpolation workflow must run with --enable-mc";
58+
}
59+
mTreeIn->SetBranchAddress("tracksMC", &mTrackDataMCPtr);
60+
}
5561
LOG(info) << "Loaded tree from " << mInFileName << " with " << mTreeIn->GetEntries() << " entries";
5662
}
5763

@@ -68,14 +74,17 @@ void TPCUnbinnedResidualReader::run(ProcessingContext& pc)
6874
LOG(info) << "Pushing " << mTrackData.size() << " reference tracks for these residuals";
6975
pc.outputs().snapshot(Output{"GLO", "TRKDATA", 0}, mTrackData);
7076
}
77+
if (mMCInput) {
78+
pc.outputs().snapshot(Output{"GLO", "TRKDATAMC", 0}, mTrackDataMC);
79+
}
7180

7281
if (mTreeIn->GetReadEntry() + 1 >= mTreeIn->GetEntries()) {
7382
pc.services().get<ControlService>().endOfStream();
7483
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
7584
}
7685
}
7786

78-
DataProcessorSpec getUnbinnedTPCResidualsReaderSpec(bool trkInput)
87+
DataProcessorSpec getUnbinnedTPCResidualsReaderSpec(bool trkInput, bool mcInput)
7988
{
8089
std::vector<OutputSpec> outputs;
8190
outputs.emplace_back("GLO", "UNBINNEDRES", 0, Lifetime::Timeframe);
@@ -84,12 +93,15 @@ DataProcessorSpec getUnbinnedTPCResidualsReaderSpec(bool trkInput)
8493
if (trkInput) {
8594
outputs.emplace_back("GLO", "TRKDATA", 0, Lifetime::Timeframe);
8695
}
96+
if (mcInput) {
97+
outputs.emplace_back("GLO", "TRKDATAMC", 0, Lifetime::Timeframe);
98+
}
8799

88100
return DataProcessorSpec{
89101
"TPCUnbinnedResidualReader",
90102
Inputs{},
91103
outputs,
92-
AlgorithmSpec{adaptFromTask<TPCUnbinnedResidualReader>(trkInput)},
104+
AlgorithmSpec{adaptFromTask<TPCUnbinnedResidualReader>(trkInput, mcInput)},
93105
Options{
94106
{"input-filename", VariantType::String, "o2residuals_tpc.root", {"Name of the input file"}},
95107
{"input-dir", VariantType::String, "none", {"Input directory"}},

0 commit comments

Comments
 (0)