Skip to content

Commit f2fdcac

Browse files
mfasDashahor02
authored andcommitted
[EMCAL-1105, EMCAL-687] Reject EMCAL trigger classes for incomplete events
Incomplete events (data from at least one link missing) are rejected in the synchronous reconstruction, and instead a trigger record with a dedicated bit and no payload is store in the CTF. CTP trigger classes triggering the EMC cluster for the corresponding BCs need to be removed since the corresponding payload is not available.
1 parent 68e8e3b commit f2fdcac

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "ZDCBase/Constants.h"
3131
#include "GlobalTracking/MatchGlobalFwd.h"
3232

33+
#include <set>
3334
#include <string>
3435
#include <vector>
3536

@@ -252,6 +253,7 @@ class AODProducerWorkflowDPL : public Task
252253
TString mRecoPass{""};
253254
TStopwatch mTimer;
254255
bool mEMCselectLeading{false};
256+
uint64_t mEMCALTrgClassMask = 0;
255257

256258
// unordered map connects global indices and table indices of barrel tracks
257259
std::unordered_map<GIndex, int> mGIDToTableID;
@@ -541,6 +543,8 @@ class AODProducerWorkflowDPL : public Task
541543
void fillCaloTable(TCaloCursor& caloCellCursor, TCaloTRGCursor& caloTRGCursor,
542544
TMCCaloLabelCursor& mcCaloCellLabelCursor, const std::map<uint64_t, int>& bcsMap,
543545
const o2::globaltracking::RecoContainer& data);
546+
547+
std::set<uint64_t> filterEMCALIncomplete(const gsl::span<const o2::emcal::TriggerRecord> triggers);
544548
};
545549

546550
/// create a processor spec

Detectors/AOD/src/AODProducerWorkflowSpec.cxx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,13 +2114,20 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
21142114
fillStrangenessTrackingTables(recoData, trackedV0Cursor, trackedCascadeCursor, tracked3BodyCurs);
21152115

21162116
// helper map for fast search of a corresponding class mask for a bc
2117+
auto emcalIncomplete = filterEMCALIncomplete(recoData.getEMCALTriggers());
21172118
std::unordered_map<uint64_t, std::pair<uint64_t, uint64_t>> bcToClassMask;
21182119
if (mInputSources[GID::CTP]) {
21192120
LOG(debug) << "CTP input available";
21202121
for (auto& ctpDigit : ctpDigits) {
21212122
uint64_t bc = ctpDigit.intRecord.toLong();
21222123
uint64_t classMask = ctpDigit.CTPClassMask.to_ulong();
21232124
uint64_t inputMask = ctpDigit.CTPInputMask.to_ulong();
2125+
if (emcalIncomplete.find(bc) != emcalIncomplete.end()) {
2126+
// reject EMCAL triggers as BC was rejected as incomplete at readout level
2127+
auto classMaskOrig = classMask;
2128+
classMask = classMask & ~mEMCALTrgClassMask;
2129+
LOG(debug) << "Found EMCAL incomplete event, mask before " << std::bitset<64>(classMaskOrig) << ", after " << std::bitset<64>(classMask);
2130+
}
21242131
bcToClassMask[bc] = {classMask, inputMask};
21252132
// LOG(debug) << Form("classmask:0x%llx", classMask);
21262133
}
@@ -2518,6 +2525,18 @@ void AODProducerWorkflowDPL::extrapolateToCalorimeters(TrackExtraInfo& extraInfo
25182525
//
25192526
}
25202527

2528+
std::set<uint64_t> AODProducerWorkflowDPL::filterEMCALIncomplete(const gsl::span<const o2::emcal::TriggerRecord> triggers)
2529+
{
2530+
std::set<uint64_t> emcalIncompletes;
2531+
for (const auto& trg : triggers) {
2532+
if (trg.getTriggerBits() & o2::emcal::triggerbits::Inc) {
2533+
// trigger record masked at incomplete at readout level
2534+
emcalIncompletes.insert(trg.getBCData().toLong());
2535+
}
2536+
}
2537+
return emcalIncompletes;
2538+
}
2539+
25212540
void AODProducerWorkflowDPL::updateTimeDependentParams(ProcessingContext& pc)
25222541
{
25232542
o2::base::GRPGeomHelper::instance().checkUpdates(pc);
@@ -2550,6 +2569,8 @@ void AODProducerWorkflowDPL::updateTimeDependentParams(ProcessingContext& pc)
25502569
mNSigmaTimeTrack = pvParams.nSigmaTimeTrack;
25512570
mTimeMarginTrackTime = pvParams.timeMarginTrackTime * 1.e3;
25522571
mFieldON = std::abs(o2::base::Propagator::Instance()->getNominalBz()) > 0.01;
2572+
2573+
pc.inputs().get<o2::ctp::CTPConfiguration*>("ctpconfig");
25532574
}
25542575
if (mPropTracks) {
25552576
pc.inputs().get<o2::dataformats::MeanVertexObject*>("meanvtx");
@@ -2583,6 +2604,17 @@ void AODProducerWorkflowDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* ob
25832604
mVtx = *(const o2::dataformats::MeanVertexObject*)obj;
25842605
return;
25852606
}
2607+
if (matcher == ConcreteDataMatcher("CTP", "CTPCONFIG", 0)) {
2608+
// construct mask with EMCAL trigger classes for rejection of incomplete triggers
2609+
auto ctpconfig = *(const o2::ctp::CTPConfiguration*)obj;
2610+
mEMCALTrgClassMask = 0;
2611+
for (const auto& trgclass : ctpconfig.getCTPClasses()) {
2612+
if (trgclass.cluster->maskCluster[o2::detectors::DetID::EMC]) {
2613+
mEMCALTrgClassMask |= trgclass.classMask;
2614+
}
2615+
}
2616+
LOG(info) << "Loaded EMCAL trigger class mask: " << std::bitset<64>(mEMCALTrgClassMask);
2617+
}
25862618
}
25872619

25882620
void AODProducerWorkflowDPL::addRefGlobalBCsForTOF(const o2::dataformats::VtxTrackRef& trackRef, const gsl::span<const GIndex>& GIndices,

0 commit comments

Comments
 (0)