Skip to content

Commit 2329b3b

Browse files
author
ayatsuji
committed
Fix split-veto event histogram guards and remove duplicate rotations
1 parent a5f2578 commit 2329b3b

1 file changed

Lines changed: 13 additions & 31 deletions

File tree

‎PWGDQ/Tasks/tableReader_withAssoc.h‎

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,8 @@ struct AnalysisSameEventPairing {
14711471
bool fEnableBarrelMuonHistos = false;
14721472
bool fEnableBarrelMuonMixingHistos = false;
14731473

1474+
bool fSplitCheckEnabled = false;
1475+
14741476
o2::framework::NoBinningPolicy<o2::aod::dqanalysisflags::MixingHash> hashBin;
14751477

14761478
o2::framework::Preslice<o2::soa::Join<o2::aod::ReducedTracksAssoc, o2::aod::BarrelTrackCuts, o2::aod::Prefilter>> trackAssocsPerCollision = o2::aod::reducedtrack_association::reducedeventId;
@@ -1817,13 +1819,15 @@ struct AnalysisSameEventPairing {
18171819
}
18181820
}
18191821

1822+
o2::common::core::getTaskOptionValue<bool>(context, "analysis-event-selection", "cfgCheckSplitCollisions", fSplitCheckEnabled, false);
1823+
18201824
if (fConfigQA) {
18211825
fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars);
18221826
fHistMan->SetUseDefaultVariableNames(true);
18231827
fHistMan->SetDefaultVarNames(dqtablereader_helpers::varNames(), dqtablereader_helpers::varUnits());
18241828
VarManager::SetCollisionSystem((TString)fConfigOptions.collisionSystem, fConfigOptions.centerMassEnergy); // set collision system and center of mass energy
1825-
if (fConfigCuts.event.value) {
1826-
DefineHistograms(fHistMan, "EventafterSplitCollisionRemoval", fConfigAddEventHistogram.value.data()); // define event histograms after removing collision splitting candidates
1829+
if (fConfigCuts.event.value && fSplitCheckEnabled) {
1830+
DefineHistograms(fHistMan, "Event_AfterSplitVeto", fConfigAddEventHistogram.value.data()); // define event histograms after removing collision splitting candidates
18271831
o2::aod::dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONEventHistograms.value.c_str());
18281832
}
18291833
DefineHistograms(fHistMan, histNames.Data(), fConfigAddSEPHistogram.value.data()); // define all histograms
@@ -2007,8 +2011,8 @@ struct AnalysisSameEventPairing {
20072011
VarManager::FillEvent<TEventFillMap>(event, dqtablereader_helpers::varValues());
20082012

20092013
// fill the event histograms
2010-
if (fConfigQA && fConfigCuts.event) {
2011-
fHistMan->FillHistClass("EventafterSplitCollisionRemoval", dqtablereader_helpers::varValues());
2014+
if (fConfigQA && fConfigCuts.event && fSplitCheckEnabled) {
2015+
fHistMan->FillHistClass("Event_AfterSplitVeto", dqtablereader_helpers::varValues());
20122016
}
20132017

20142018
auto groupedAssocs = assocs.sliceBy(preslice, event.globalIndex());
@@ -2563,20 +2567,6 @@ struct AnalysisSameEventPairing {
25632567
}
25642568
}
25652569
}
2566-
if (fConfigTRPairs) {
2567-
// mixing event track should be rotated, so second parameter
2568-
if (fConfigNRotations.value != 1 && fConfigNRotations.value != 3) {
2569-
LOGF(fatal, "Unsupported number of rotations: %d, only 1 and 3 are supported", fConfigNRotations.value);
2570-
}
2571-
for (int irot = 1; irot <= fConfigNRotations.value; ++irot) {
2572-
VarManager::FillPairRotation_ME(t2, t1, irot);
2573-
for (int icut = 0; icut < ncuts; icut++) {
2574-
if (mixedTwoTrackFilter & (static_cast<uint32_t>(1) << icut)) {
2575-
fHistMan->FillHistClass(Form("PairsBarrelTR_MEPM_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
2576-
}
2577-
}
2578-
}
2579-
}
25802570
}
25812571
// run ++ pairing
25822572
for (auto const& t2 : poolEvent.tracks1) {
@@ -2624,19 +2614,6 @@ struct AnalysisSameEventPairing {
26242614
}
26252615
}
26262616
}
2627-
if (fConfigTRPairs) {
2628-
if (fConfigNRotations.value != 1 && fConfigNRotations.value != 3) {
2629-
LOGF(fatal, "Unsupported number of rotations: %d, only 1 and 3 are supported", fConfigNRotations.value);
2630-
}
2631-
for (int irot = 1; irot <= fConfigNRotations.value; ++irot) {
2632-
VarManager::FillPairRotation_ME(t2, t1, irot);
2633-
for (int icut = 0; icut < ncuts; icut++) {
2634-
if (mixedTwoTrackFilter & (static_cast<uint32_t>(1) << icut)) {
2635-
fHistMan->FillHistClass(Form("PairsBarrelTR_MEPM_%s", fTrackCuts[icut].Data()), dqtablereader_helpers::varValues());
2636-
}
2637-
}
2638-
}
2639-
}
26402617
}
26412618
// run -- pairing
26422619
for (auto const& t2 : poolEvent.tracks2) {
@@ -2904,6 +2881,11 @@ struct AnalysisSameEventPairing {
29042881
VarManager::ResetValues(0, VarManager::kNVars);
29052882
VarManager::FillEvent<TEventFillMap>(event, dqtablereader_helpers::varValues());
29062883

2884+
// fill the event histograms
2885+
if (fConfigQA && fConfigCuts.event && fSplitCheckEnabled) {
2886+
fHistMan->FillHistClass("Event_AfterSplitVeto", dqtablereader_helpers::varValues());
2887+
}
2888+
29072889
auto groupedAssocs1 = assocs1.sliceBy(preslice1, event.globalIndex());
29082890
if (groupedAssocs1.size() == 0) {
29092891
continue;

0 commit comments

Comments
 (0)