Skip to content

Commit da1f395

Browse files
MaximVirtaMaxim Virtaalibuild
authored
[PWGCF] Bitmask selections updated for the V02 analysis code (#18506)
Co-authored-by: Maxim Virta <maximus@Maxims-MacBook-Pro.local> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 3064f6d commit da1f395

1 file changed

Lines changed: 57 additions & 7 deletions

File tree

‎PWGCF/GenericFramework/Tasks/flowGfwV02.cxx‎

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "PWGCF/JCorran/DataModel/JCatalyst.h"
2222

2323
#include "Common/CCDB/EventSelectionParams.h"
24+
#include "Common/CCDB/TriggerAliases.h"
2425
#include "Common/DataModel/Centrality.h"
2526
#include "Common/DataModel/EventSelection.h"
2627
#include "Common/DataModel/Multiplicity.h"
@@ -214,8 +215,8 @@ struct FlowGfwV02 {
214215
// // Filters to be applied to the received data.
215216
// // The analysis assumes the data has been subjected to a QA of its selection,
216217
// // and thus only the final distributions of the data for analysis are saved.
217-
// Derived-data bit masks. Every listed track bit is required; see gfwcollision::EventSel and gfwtrack::TrackSelection.
218-
O2_DEFINE_CONFIGURABLE(cfgEventBitMask, uint16_t, static_cast<uint16_t>(o2::aod::gfwcollision::DefaultEventMask), "Required event-selection bits for GFW derived data");
218+
// Derived-data track mask. Every listed track bit is required; see gfwtrack::TrackSelection.
219+
// The event mask is built from cfgEventCutFlags when a GFW derived process is enabled.
219220
Configurable<std::vector<int>> cfgBitmaskSelections{"cfgBitmaskSelections", {0, 3, 6, 9, 12}, "Enabled TrackSelection bit indices for GFW derived data. DCA 0-5, TPC track 6-13, TPC PID 14-22, TOF PID 23-31. The default is the nominal quality selection"};
220221
O2_DEFINE_CONFIGURABLE(cfgPidWindow, int, static_cast<int>(o2::aod::gfwtrack::PidWindowNominal), "PID nSigma window for GFW derived data: 0 nominal, 1 tight, 2 loose");
221222

@@ -300,6 +301,7 @@ struct FlowGfwV02 {
300301

301302
std::unique_ptr<TF1> fPtDepDCAxy;
302303
uint32_t trackBitMask = o2::aod::gfwtrack::NominalMask;
304+
uint16_t eventBitMask = o2::aod::gfwcollision::DefaultEventMask;
303305

304306
using GFWTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;
305307

@@ -319,6 +321,52 @@ struct FlowGfwV02 {
319321
IndProtonLow
320322
};
321323

324+
// Required gfwcollision::EventSel bits for derived data, taken from the event-cut configurables.
325+
uint16_t eventSelectionMask()
326+
{
327+
uint16_t mask = 0;
328+
if (cfgEventCutFlags.cfgNoSameBunchPileupCut) {
329+
mask |= o2::aod::gfwcollision::kNoSameBunchPileup;
330+
}
331+
if (cfgEventCutFlags.cfgIsGoodZvtxFT0vsPV) {
332+
mask |= o2::aod::gfwcollision::kIsGoodZvtxFT0vsPV;
333+
}
334+
if (cfgEventCutFlags.cfgNoCollInTimeRangeStandard) {
335+
mask |= o2::aod::gfwcollision::kNoCollInTimeRangeStandard;
336+
}
337+
if (cfgEventCutFlags.cfgNoCollInRofStandard) {
338+
mask |= o2::aod::gfwcollision::kNoCollInRofStandard;
339+
}
340+
if (cfgEventCutFlags.cfgNoHighMultCollInPrevRof) {
341+
mask |= o2::aod::gfwcollision::kNoHighMultCollInPrevRof;
342+
}
343+
if (cfgEventCutFlags.cfgIsVertexITSTPC) {
344+
mask |= o2::aod::gfwcollision::kIsVertexITSTPC;
345+
}
346+
if (cfgEventCutFlags.cfgIsGoodITSLayersAll) {
347+
mask |= o2::aod::gfwcollision::kIsGoodITSLayersAll;
348+
}
349+
if (cfgEventCutFlags.cfgNoTimeFrameBorder) {
350+
mask |= o2::aod::gfwcollision::kNoTimeFrameBorder;
351+
}
352+
if (cfgEventCutFlags.cfgNoITSROFrameBorder) {
353+
mask |= o2::aod::gfwcollision::kNoITSROFrameBorder;
354+
}
355+
if (cfgEventCutFlags.cfgTVXinTRD) {
356+
mask |= o2::aod::gfwcollision::kNotTVXinTRD;
357+
}
358+
if (cfgTrackCuts.cfgOccupancySelection >= 0) {
359+
mask |= o2::aod::gfwcollision::kOccupancy;
360+
}
361+
if (cfgUseAdditionalEventCut) {
362+
mask |= o2::aod::gfwcollision::kGoodVertex;
363+
if (cfgMultCut) {
364+
mask |= o2::aod::gfwcollision::kMultCorr;
365+
}
366+
}
367+
return mask;
368+
}
369+
322370
void init(InitContext const&)
323371
{
324372
trackBitMask = 0;
@@ -327,6 +375,10 @@ struct FlowGfwV02 {
327375
trackBitMask |= static_cast<uint32_t>(1u << bit);
328376
}
329377
}
378+
if (doprocessDerived || doprocessDerivedCorrected) {
379+
eventBitMask = eventSelectionMask();
380+
LOGF(info, "GFW derived event-selection mask: %u", static_cast<unsigned>(eventBitMask));
381+
}
330382

331383
projectMatrix(nSigmas->getData(), pidStates.tpcNsigmaCut, pidStates.tofNsigmaCut, pidStates.itsNsigmaCut);
332384
projectMatrix(nSigmasHighPurity->getData(), pidStates.highPurityTpcNsigmaCut, pidStates.highPurityTofNsigmaCut, pidStates.highPurityItsNsigmaCut);
@@ -816,7 +868,7 @@ struct FlowGfwV02 {
816868
bool eventSelected(TCollision const& collision, const int& multTrk, const float& centrality)
817869
{
818870
if (cfgEventCutFlags.cfgTVXinTRD) {
819-
if (collision.alias_bit(kTVXinTRD)) {
871+
if (collision.alias_bit(::kTVXinTRD)) {
820872
// TRD triggered
821873
// "CMTVX-B-NOPF-TRD,minbias_TVX"
822874
return 0;
@@ -1520,8 +1572,7 @@ struct FlowGfwV02 {
15201572
}
15211573
loadCorrections(run);
15221574

1523-
const uint16_t eventMask = cfgEventBitMask;
1524-
if ((collision.eventSel() & eventMask) != eventMask) {
1575+
if ((collision.eventSel() & eventBitMask) != eventBitMask) {
15251576
return;
15261577
}
15271578
if (std::abs(collision.posZ()) > cfgEventCuts.cfgZvtxMax) {
@@ -1543,8 +1594,7 @@ struct FlowGfwV02 {
15431594
LOGF(info, "run = %d", run);
15441595
}
15451596

1546-
const uint16_t eventMask = cfgEventBitMask;
1547-
if ((collision.eventSel() & eventMask) != eventMask) {
1597+
if ((collision.eventSel() & eventBitMask) != eventBitMask) {
15481598
return;
15491599
}
15501600
if (std::abs(collision.posZ()) > cfgEventCuts.cfgZvtxMax) {

0 commit comments

Comments
 (0)