Skip to content

Commit 036922d

Browse files
authored
Merge c693d09 into sapling-pr-archive-ktf
2 parents b072fc8 + c693d09 commit 036922d

File tree

8 files changed

+67
-24
lines changed

8 files changed

+67
-24
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ class MatchInfoTOF
8686
hasT0_1BCbefore = 0x1 << 8,
8787
hasT0_2BCbefore = 0x1 << 9 };
8888

89+
void setFT0Best(double val, float res = 200.)
90+
{
91+
mFT0Best = val;
92+
mFT0BestRes = res;
93+
}
94+
double getFT0Best() const { return mFT0Best; }
95+
float getFT0BestRes() const { return mFT0BestRes; }
96+
8997
private:
9098
int mIdLocal; // track id in sector of the pair track-TOFcluster
9199
float mChi2; // chi2 of the pair track-TOFcluster
@@ -106,7 +114,10 @@ class MatchInfoTOF
106114
float mTgeant = 0.0; ///< geant time in MC
107115
double mT0true = 0.0; ///< t0true
108116

109-
ClassDefNV(MatchInfoTOF, 8);
117+
double mFT0Best = 0.0; //< best info for collision time
118+
float mFT0BestRes = 200.0; //< resolution (in ps) of the best info for collision time
119+
120+
ClassDefNV(MatchInfoTOF, 9);
110121
};
111122
} // namespace dataformats
112123
} // namespace o2

Detectors/GlobalTracking/src/MatchTOF.cxx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,8 @@ void MatchTOF::doMatchingForTPC(int sec)
15811581
//______________________________________________
15821582
int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, unsigned long firstOrbit)
15831583
{
1584+
const auto& FT0Params = o2::ft0::InteractionTag::Instance();
1585+
15841586
if ((!mHasFillScheme) && o2::tof::Utils::hasFillScheme()) {
15851587
mHasFillScheme = true;
15861588
for (int ibc = 0; ibc < o2::tof::Utils::getNinteractionBC(); ibc++) {
@@ -1598,6 +1600,10 @@ int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FI
15981600
const int distThr = 8;
15991601

16001602
for (unsigned int i = 0; i < FITRecPoints.size(); i++) {
1603+
const auto& ft = FITRecPoints[i];
1604+
if (!FT0Params.isSelected(ft)) {
1605+
continue;
1606+
}
16011607
const o2::InteractionRecord ir = FITRecPoints[i].getInteractionRecord();
16021608
if (mHasFillScheme && !mFillScheme[ir.bc]) {
16031609
continue;
@@ -1702,8 +1708,8 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17021708
matchingPair.setT0true(TOFClusWork[matchingPair.getTOFClIndex()].getT0true());
17031709

17041710
// let's check if cluster has multiple-hits (noferini)
1705-
if (TOFClusWork[matchingPair.getTOFClIndex()].getNumOfContributingChannels() > 1) {
1706-
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
1711+
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
1712+
if (tofcl.getNumOfContributingChannels() > 1) {
17071713
// has an additional hit Up or Down (Z-dir)
17081714
matchingPair.setHitPatternUpDown(tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUp) ||
17091715
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) ||
@@ -1719,6 +1725,19 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17191725
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight) ||
17201726
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpRight));
17211727
}
1728+
1729+
// estimate collision time using FT0 info if available
1730+
ULong64_t bclongtofCal = (matchingPair.getSignal() - 10000) * o2::tof::Geo::BC_TIME_INPS_INV;
1731+
double t0Best = bclongtofCal * o2::tof::Geo::BC_TIME_INPS; // here just BC
1732+
float t0BestRes = 200;
1733+
if (FITRecPoints.size() > 0) {
1734+
int index = findFITIndex(bclongtofCal, FITRecPoints, mFirstTForbit);
1735+
if (index > -1 && FITRecPoints[index].isValidTime(1) && FITRecPoints[index].isValidTime(2)) { // require A and C
1736+
t0Best += FITRecPoints[index].getCollisionTime(0);
1737+
t0BestRes = 15;
1738+
}
1739+
}
1740+
matchingPair.setFT0Best(t0Best, t0BestRes);
17221741
matchedTracks[trkTypeSplitted].push_back(matchingPair); // array of MatchInfoTOF
17231742

17241743
// get fit info

Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
114114
}
115115
}
116116

117-
if (!writecalib) {
118-
useFIT = false;
119-
}
117+
// if (!writecalib) {
118+
// useFIT = false;
119+
// }
120120

121121
LOG(debug) << "TOF MATCHER WORKFLOW configuration";
122122
LOG(debug) << "TOF track inputs = " << configcontext.options().get<std::string>("track-sources");

Detectors/ITSMFT/ITS/tracking/src/TrackingInterface.cxx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void ITSTrackingInterface::run(framework::ProcessingContext& pc)
9999
irFrames.reserve(trackROFvec.size());
100100
int nBCPerTF = alpParams.roFrameLengthInBC;
101101

102-
LOGP(info, "ITSTracker pulled {} clusters, {} RO frames", compClusters.size(), trackROFvec.size());
102+
LOGP(info, "ITSTracker pulled {} clusters, {} RO frames {}", compClusters.size(), trackROFvec.size(), compClusters.empty() ? " -> received no processable data will skip" : "");
103103
const dataformats::MCTruthContainer<MCCompLabel>* labels = nullptr;
104104
gsl::span<itsmft::MC2ROFRecord const> mc2rofs;
105105
if (mIsMC) {
@@ -157,7 +157,9 @@ void ITSTrackingInterface::run(framework::ProcessingContext& pc)
157157
if (mRunVertexer) {
158158
vertROFvec.reserve(trackROFvec.size());
159159
// Run seeding vertexer
160-
vertexerElapsedTime = mVertexer->clustersToVertices(logger);
160+
if (!compClusters.empty()) {
161+
vertexerElapsedTime = mVertexer->clustersToVertices(logger);
162+
}
161163
} else { // cosmics
162164
mTimeFrame->resetRofPV();
163165
}
@@ -226,7 +228,7 @@ void ITSTrackingInterface::run(framework::ProcessingContext& pc)
226228
mTimeFrame->addPrimaryVertices(vtxVecLoc, 0);
227229
}
228230
}
229-
if (mRunVertexer) {
231+
if (mRunVertexer && !compClusters.empty()) {
230232
LOG(info) << fmt::format(" - Vertex seeding total elapsed time: {} ms for {} ({} + {}) vertices found in {}/{} ROFs",
231233
vertexerElapsedTime,
232234
mTimeFrame->getPrimaryVerticesNum(),
@@ -244,14 +246,15 @@ void ITSTrackingInterface::run(framework::ProcessingContext& pc)
244246
if (mCosmicsProcessing && compClusters.size() > 1500 * trackROFspan.size()) {
245247
LOG(error) << "Cosmics processing was requested with an average detector occupancy exceeding 1.e-7, skipping TF processing.";
246248
} else {
247-
248-
mTimeFrame->setMultiplicityCutMask(processingMask);
249-
mTimeFrame->setROFMask(processUPCMask);
250-
// Run CA tracker
251-
if (mMode == o2::its::TrackingMode::Async && o2::its::TrackerParamConfig::Instance().fataliseUponFailure) {
252-
mTracker->clustersToTracks(logger, fatalLogger);
253-
} else {
254-
mTracker->clustersToTracks(logger, errorLogger);
249+
if (!compClusters.empty()) {
250+
mTimeFrame->setMultiplicityCutMask(processingMask);
251+
mTimeFrame->setROFMask(processUPCMask);
252+
// Run CA tracker
253+
if (mMode == o2::its::TrackingMode::Async && o2::its::TrackerParamConfig::Instance().fataliseUponFailure) {
254+
mTracker->clustersToTracks(logger, fatalLogger);
255+
} else {
256+
mTracker->clustersToTracks(logger, errorLogger);
257+
}
255258
}
256259
size_t totTracks{mTimeFrame->getNumberOfTracks()}, totClusIDs{mTimeFrame->getNumberOfUsedClusters()};
257260
if (totTracks) {

Detectors/ITSMFT/MFT/calibration/src/NoiseCalibratorSpec.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ void NoiseCalibratorSpec::sendOutputDcs(DataAllocator& output)
378378
<< " : " << infoDcs.getEndValidityTimestamp();
379379

380380
using clbUtilsDcs = o2::calibration::Utils;
381-
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBPayload, "MFT_NoiseMap", 0}, *imageDcs.get());
382-
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBWrapper, "MFT_NoiseMap", 0}, infoDcs);
381+
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBPayload, "MFT_NoiseMap", 1}, *imageDcs.get());
382+
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBWrapper, "MFT_NoiseMap", 1}, infoDcs);
383383
}
384384

385385
void NoiseCalibratorSpec::sendOutputDcsMerge(DataAllocator& output)
@@ -447,8 +447,8 @@ void NoiseCalibratorSpec::sendOutputDcsMerge(DataAllocator& output)
447447
<< " : " << infoDcs.getEndValidityTimestamp();
448448

449449
using clbUtilsDcs = o2::calibration::Utils;
450-
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBPayload, "MFT_NoiseMap", 0}, *imageDcs.get());
451-
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBWrapper, "MFT_NoiseMap", 0}, infoDcs);
450+
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBPayload, "MFT_NoiseMap", 1}, *imageDcs.get());
451+
output.snapshot(Output{clbUtilsDcs::gDataOriginCDBWrapper, "MFT_NoiseMap", 1}, infoDcs);
452452
}
453453

454454
void NoiseCalibratorSpec::endOfStream(o2::framework::EndOfStreamContext& ec)

Detectors/TPC/workflow/src/CalibratordEdxSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ DataProcessorSpec getCalibratordEdxSpec(const o2::base::Propagator::MatCorrType
235235
Options{
236236
{"tf-per-slot", VariantType::UInt32, 6000u, {"number of TFs per calibration time slot, is overwritten by seconds-per-slot if > 0"}},
237237
{"seconds-per-slot", VariantType::Int, 180, {"seconds per calibration time slot, overwrites tf-per-slot if > 0"}},
238-
{"max-delay", VariantType::UInt32, 10u, {"number of slots in past to consider"}},
238+
{"max-delay", VariantType::UInt32, 1u, {"number of slots in past to consider"}},
239239
{"min-entries", VariantType::Int, 10000, {"minimum entries per stack to fit a single time slot"}},
240240
{"calib-interval-extension", VariantType::UInt32, 3600u, {"seconds by which to extend the calibration interval beyond the end of the time slot"}},
241241

Framework/AnalysisSupport/src/AODWriterHelpers.cxx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#include "Framework/TableConsumer.h"
2222
#include "Framework/DataOutputDirector.h"
2323
#include "Framework/TableTreeHelpers.h"
24+
#include "Framework/Monitoring.h"
2425

26+
#include <Monitoring/Monitoring.h>
2527
#include <TFile.h>
2628
#include <TFile.h>
2729
#include <TTree.h>
@@ -235,6 +237,7 @@ AlgorithmSpec AODWriterHelpers::getOutputTTreeWriter(ConfigContext const& ctx)
235237

236238
AlgorithmSpec AODWriterHelpers::getOutputObjHistWriter(ConfigContext const& ctx)
237239
{
240+
using namespace monitoring;
238241
auto& ac = ctx.services().get<AnalysisContext>();
239242
auto tskmap = ac.outTskMap;
240243
auto objmap = ac.outObjHistMap;
@@ -269,7 +272,7 @@ AlgorithmSpec AODWriterHelpers::getOutputObjHistWriter(ConfigContext const& ctx)
269272

270273
callbacks.set<CallbackService::Id::EndOfStream>(endofdatacb);
271274
return [inputObjects, objmap, tskmap](ProcessingContext& pc) mutable -> void {
272-
auto mergePart = [&inputObjects, &objmap, &tskmap](DataRef const& ref) {
275+
auto mergePart = [&inputObjects, &objmap, &tskmap, &pc](DataRef const& ref) {
273276
if (!ref.header) {
274277
LOG(error) << "Header not found";
275278
return;
@@ -381,7 +384,13 @@ AlgorithmSpec AODWriterHelpers::getOutputObjHistWriter(ConfigContext const& ctx)
381384
if (object->InheritsFrom(TList::Class())) {
382385
writeListToFile(static_cast<TList*>(object), parentDir->mkdir(object->GetName(), object->GetName(), true));
383386
} else {
384-
parentDir->WriteObjectAny(object, object->Class(), object->GetName());
387+
int objSize = parentDir->WriteObjectAny(object, object->Class(), object->GetName());
388+
static int maxSizeWritten = 0;
389+
if (objSize > maxSizeWritten) {
390+
auto& monitoring = pc.services().get<Monitoring>();
391+
maxSizeWritten = objSize;
392+
monitoring.send(Metric{fmt::format("{}/{}:{}", object->ClassName(), object->GetName(), objSize), "aod-largest-object-written"}.addTag(tags::Key::Subsystem, tags::Value::DPL));
393+
}
385394
auto* written = list->Remove(object);
386395
delete written;
387396
}

Framework/Core/src/runDataProcessing.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,7 @@ std::vector<std::regex> getDumpableMetrics()
12331233
dumpableMetrics.emplace_back("^aod-bytes-read-uncompressed$");
12341234
dumpableMetrics.emplace_back("^aod-bytes-read-compressed$");
12351235
dumpableMetrics.emplace_back("^aod-file-read-info$");
1236+
dumpableMetrics.emplace_back("^aod-largest-object-written$");
12361237
dumpableMetrics.emplace_back("^table-bytes-.*");
12371238
dumpableMetrics.emplace_back("^total-timeframes.*");
12381239
dumpableMetrics.emplace_back("^device_state.*");

0 commit comments

Comments
 (0)