Skip to content

Commit 88ea918

Browse files
authored
Merge 67955bf into sapling-pr-archive-ktf
2 parents 82a21e9 + 67955bf commit 88ea918

File tree

4 files changed

+48
-41
lines changed

4 files changed

+48
-41
lines changed

Detectors/GlobalTrackingWorkflow/study/include/GlobalTrackingStudy/TrackInfoExt.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ struct TrackInfoExt {
3030
DCA dcaTPC{};
3131
VtxTrackIndex gid;
3232
MatchInfoTOF infoTOF;
33+
std::array<float, 3> innerTPCPos{}; // innermost cluster position at assigned time
34+
std::array<float, 3> innerTPCPos0{}; // innermost cluster position at nominal time0
3335
float ttime = 0;
3436
float ttimeE = 0;
3537
float xmin = 0;
@@ -44,7 +46,15 @@ struct TrackInfoExt {
4446
uint8_t rowMinTPC = 0;
4547
uint8_t rowMaxTPC = 0;
4648
uint8_t rowCountTPC = 0;
47-
ClassDefNV(TrackInfoExt, 2);
49+
50+
float getTPCInX() const { return innerTPCPos[0]; }
51+
float getTPCInY() const { return innerTPCPos[1]; }
52+
float getTPCInZ() const { return innerTPCPos[2]; }
53+
float getTPCInX0() const { return innerTPCPos0[0]; }
54+
float getTPCInY0() const { return innerTPCPos0[1]; }
55+
float getTPCInZ0() const { return innerTPCPos0[2]; }
56+
57+
ClassDefNV(TrackInfoExt, 3);
4858
};
4959

5060
} // namespace dataformats

Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -248,26 +248,30 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
248248
auto vdrit = mTPCVDriftHelper.getVDriftObject().getVDrift();
249249
bool tpcTrackOK = recoData.isTrackSourceLoaded(GTrackID::TPC);
250250

251-
auto getTPCClInfo = [&recoData](const o2::tpc::TrackTPC& trc) {
251+
auto fillTPCClInfo = [&recoData, this](const o2::tpc::TrackTPC& trc, o2::dataformats::TrackInfoExt& trExt, float timestampTB = -1e9) {
252252
const auto clRefs = recoData.getTPCTracksClusterRefs();
253-
std::array<int, 3> clinfo = {};
254253
if (recoData.inputsTPCclusters) {
255254
uint8_t clSect = 0, clRow = 0, clRowP = -1;
256255
uint32_t clIdx = 0;
257256
for (int ic = 0; ic < trc.getNClusterReferences(); ic++) {
258257
trc.getClusterReference(clRefs, ic, clSect, clRow, clIdx);
259258
if (clRow != clRowP) {
260-
clinfo[2]++;
259+
trExt.rowCountTPC++;
261260
clRowP = clRow;
262261
}
263262
}
264-
const auto clRefs = recoData.getTPCTracksClusterRefs();
265263
trc.getClusterReference(clRefs, trc.getNClusterReferences() - 1, clSect, clRow, clIdx);
266-
clinfo[0] = clRow;
264+
trExt.rowMinTPC = clRow;
265+
const auto& clus = recoData.inputsTPCclusters->clusterIndex.clusters[clSect][clRow][clIdx];
266+
this->mTPCCorrMapsLoader.Transform(clSect, clRow, clus.getPad(), clus.getTime(), trExt.innerTPCPos0[0], trExt.innerTPCPos0[1], trExt.innerTPCPos0[2], trc.getTime0()); // nominal time of the track
267+
if (timestampTB > -1e8) {
268+
this->mTPCCorrMapsLoader.Transform(clSect, clRow, clus.getPad(), clus.getTime(), trExt.innerTPCPos[0], trExt.innerTPCPos[1], trExt.innerTPCPos[2], timestampTB); // time assigned from the global track track
269+
} else {
270+
trExt.innerTPCPos = trExt.innerTPCPos0;
271+
}
267272
trc.getClusterReference(clRefs, 0, clSect, clRow, clIdx);
268-
clinfo[1] = clRow;
273+
trExt.rowMaxTPC = clRow;
269274
}
270-
return clinfo;
271275
};
272276

273277
for (int iv = 0; iv < nv; iv++) {
@@ -276,7 +280,6 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
276280
if (iv != nv - 1) {
277281
auto& pve = pveVec[iv];
278282
static_cast<o2::dataformats::PrimaryVertex&>(pve) = pvvec[iv];
279-
280283
// find best matching FT0 signal
281284
float bestTimeDiff = 1000, bestTime = -999;
282285
int bestFTID = -1;
@@ -319,15 +322,13 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
319322
GTrackID tpcTrID;
320323
const o2::tpc::TrackTPC* tpcTr = nullptr;
321324
int nclTPC = 0;
322-
std::array<int, 3> tpcClInfo{};
323325
if (dm[DetID::TPC] && tpcTrackOK) {
324326
tpcTrID = recoData.getTPCContributorGID(vid);
325327
tpcTr = &recoData.getTPCTrack(tpcTrID);
326328
nclTPC = tpcTr->getNClusters();
327329
if (nclTPC < mMinTPCClusters) {
328330
continue;
329331
}
330-
tpcClInfo = getTPCClInfo(*tpcTr);
331332
}
332333
bool ambig = vid.isAmbiguous();
333334
auto trc = recoData.getTrackParam(vid);
@@ -364,11 +365,19 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
364365
continue;
365366
}
366367
{
367-
o2::dataformats::DCA dcaTPC;
368-
dcaTPC.set(-999.f, -999.f);
368+
auto& trcExt = trcExtVec.emplace_back();
369+
recoData.getTrackTime(vid, trcExt.ttime, trcExt.ttimeE);
370+
trcExt.track = trc;
371+
trcExt.dca = dca;
372+
trcExt.gid = vid;
373+
trcExt.xmin = xmin;
374+
trcExt.dcaTPC.set(-999.f, -999.f);
375+
369376
if (tpcTr) {
377+
float tsuse = trcExt.ttime / (8 * o2::constants::lhc::LHCBunchSpacingMUS);
370378
if (is == GTrackID::TPC) {
371-
dcaTPC = dca;
379+
trcExt.dcaTPC = dca;
380+
tsuse = -1e9;
372381
} else {
373382
o2::track::TrackParCov tmpTPC(*tpcTr);
374383
if (iv < nv - 1 && is == GTrackID::TPC && tpcTr && !tpcTr->hasBothSidesClusters()) { // for unconstrained TPC tracks correct track Z
@@ -378,18 +387,12 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
378387
}
379388
tmpTPC.setZ(tmpTPC.getZ() + corz);
380389
}
381-
if (!prop->propagateToDCA(iv == nv - 1 ? vtxDummy : pvvec[iv], tmpTPC, prop->getNominalBz(), 2., o2::base::PropagatorF::MatCorrType::USEMatCorrLUT, &dcaTPC)) {
382-
dcaTPC.set(-999.f, -999.f);
390+
if (!prop->propagateToDCA(iv == nv - 1 ? vtxDummy : pvvec[iv], tmpTPC, prop->getNominalBz(), 2., o2::base::PropagatorF::MatCorrType::USEMatCorrLUT, &trcExt.dcaTPC)) {
391+
trcExt.dcaTPC.set(-999.f, -999.f);
383392
}
384393
}
394+
fillTPCClInfo(*tpcTr, trcExt, tsuse);
385395
}
386-
auto& trcExt = trcExtVec.emplace_back();
387-
recoData.getTrackTime(vid, trcExt.ttime, trcExt.ttimeE);
388-
trcExt.track = trc;
389-
trcExt.dca = dca;
390-
trcExt.dcaTPC = dcaTPC;
391-
trcExt.gid = vid;
392-
trcExt.xmin = xmin;
393396
auto gidRefs = recoData.getSingleDetectorRefs(vid);
394397
if (gidRefs[GTrackID::ITS].isIndexSet()) {
395398
const auto& itsTr = recoData.getITSTrack(gidRefs[GTrackID::ITS]);
@@ -412,9 +415,6 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
412415
if (gidRefs[GTrackID::TPC].isIndexSet()) {
413416
trcExt.q2ptTPC = recoData.getTrackParam(gidRefs[GTrackID::TPC]).getQ2Pt();
414417
trcExt.nClTPC = nclTPC;
415-
trcExt.rowMinTPC = tpcClInfo[0];
416-
trcExt.rowMaxTPC = tpcClInfo[1];
417-
trcExt.rowCountTPC = tpcClInfo[2];
418418
}
419419
if (gidRefs[GTrackID::ITSTPC].isIndexSet()) {
420420
const auto& trTPCITS = recoData.getTPCITSTrack(gidRefs[GTrackID::ITSTPC]);

Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
615615
LOG(debug) << "TRD refit outwards failed";
616616
return false;
617617
}
618-
619618
// refit ITS-TPC-TRD track inwards to innermost ITS cluster
620619
// here we also calculate the LT integral for matching to TOF
621620
float chi2In = 0.f;
@@ -629,6 +628,12 @@ bool TRDGlobalTracking::refitITSTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::gl
629628
LOG(debug) << "TPC refit inwards failed";
630629
return false;
631630
}
631+
// if for some reason the track was overshoot over the inner field cage, bring it back w/o material correction and LTintegral update
632+
if (trk.getX() < o2::constants::geom::XTPCInnerRef &&
633+
!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrNONE)) {
634+
LOG(debug) << "BACK-Propagationto inner boundary failed";
635+
return false;
636+
}
632637
auto posEnd = trk.getXYZGlo();
633638
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
634639
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());
@@ -718,7 +723,12 @@ bool TRDGlobalTracking::refitTPCTRDTrack(TrackTRD& trk, float timeTRD, o2::globa
718723
if (pileUpOn) { // account pileup time uncertainty in Z errors
719724
trk.updateCov(timeZErr, o2::track::CovLabels::kSigZ2);
720725
}
721-
726+
// if for some reason the track was overshoot over the inner field cage, bring it back w/o material correction and LTintegral update
727+
if (trk.getX() < o2::constants::geom::XTPCInnerRef &&
728+
!propagator->PropagateToXBxByBz(trk, o2::constants::geom::XTPCInnerRef, o2::base::Propagator::MAX_SIN_PHI, o2::base::Propagator::MAX_STEP, o2::base::Propagator::MatCorrType::USEMatCorrNONE)) {
729+
LOG(debug) << "BACK-Propagationto inner boundary failed";
730+
return false;
731+
}
722732
auto posEnd = trk.getXYZGlo();
723733
auto lInt = propagator->estimateLTIncrement(trk, posStart, posEnd);
724734
trk.getLTIntegralOut().addStep(lInt, trk.getP2Inv());

Framework/Core/src/CommonDataProcessors.cxx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,26 @@
1717
#include "Framework/DataProcessingHeader.h"
1818
#include "Framework/DataDescriptorQueryBuilder.h"
1919
#include "Framework/DataDescriptorMatcher.h"
20-
#include "Framework/DataOutputDirector.h"
2120
#include "Framework/DataProcessorSpec.h"
2221
#include "Framework/DataProcessingStats.h"
2322
#include "Framework/DataSpecUtils.h"
24-
#include "Framework/TableBuilder.h"
25-
#include "Framework/EndOfStreamContext.h"
2623
#include "Framework/InitContext.h"
2724
#include "Framework/InputSpec.h"
28-
#include "Framework/Logger.h"
29-
#include "Framework/OutputSpec.h"
3025
#include "Framework/RawDeviceService.h"
3126
#include "Framework/TimesliceIndex.h"
3227
#include "Framework/Variant.h"
33-
#include "../../../Algorithm/include/Algorithm/HeaderStack.h"
34-
#include "Framework/OutputObjHeader.h"
35-
#include "Framework/StringHelpers.h"
3628
#include "Framework/ChannelSpec.h"
37-
#include "Framework/ChannelSpecHelpers.h"
3829
#include "Framework/ExternalFairMQDeviceProxy.h"
3930
#include "Framework/RuntimeError.h"
4031
#include "Framework/RateLimiter.h"
4132
#include "Framework/PluginManager.h"
42-
#include "Framework/DeviceSpec.h"
43-
#include "WorkflowHelpers.h"
4433
#include <Monitoring/Monitoring.h>
4534

4635
#include <fairmq/Device.h>
47-
#include <chrono>
4836
#include <fstream>
4937
#include <functional>
5038
#include <memory>
5139
#include <string>
52-
#include <thread>
5340

5441
using namespace o2::framework::data_matcher;
5542

0 commit comments

Comments
 (0)