Skip to content

Commit 8d3d941

Browse files
authored
PWGCF: flow-task: remove filterflag and add more bool for Event selection checks (AliceO2Group#8042)
* found some bug in new results, roll back code, remove cfgFilterFlag and ITScls Cut * add more options for detailed checks
1 parent 6e59c39 commit 8d3d941

File tree

1 file changed

+26
-47
lines changed

1 file changed

+26
-47
lines changed

PWGCF/Flow/Tasks/FlowTask.cxx

Lines changed: 26 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ using namespace o2::framework::expressions;
4747

4848
struct FlowTask {
4949

50-
O2_DEFINE_CONFIGURABLE(cfgFilterFlag, int, 0, "0 for IsGlobalTrack, 1 for IsGlobalTrackSDD, 2 for IsGlobalTrackWoTPCCluster, 3 for IsGlobalTrackWoPtEta, 4 for IsGlobalTrackWoDCA, 5 for IsGlobalTrackWoDCATPCCluster")
5150
O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range")
5251
O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal pT for poi tracks")
5352
O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMax, float, 10.0f, "Maximal pT for poi tracks")
@@ -57,11 +56,15 @@ struct FlowTask {
5756
O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 10.0f, "Maximal pT for all tracks")
5857
O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks")
5958
O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5f, "max chi2 per TPC clusters")
60-
O2_DEFINE_CONFIGURABLE(cfgCutChi2prITScls, float, 36.0f, "max chi2 per cluster ITS")
6159
O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 70.0f, "minimum TPC clusters")
6260
O2_DEFINE_CONFIGURABLE(cfgCutDCAz, float, 2.0f, "max DCA to vertex z")
63-
O2_DEFINE_CONFIGURABLE(cfgCutDCAxy, float, 3.675e-4f, "max DCA to vertex xy, default 0.0105 * 0.035 * pT^-1.1")
6461
O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations")
62+
O2_DEFINE_CONFIGURABLE(cfgTriggerkTVXinTRD, bool, true, "TRD triggered")
63+
O2_DEFINE_CONFIGURABLE(cfgEvSelkNoSameBunchPileup, bool, true, "rejects collisions which are associated with the same found-by-T0 bunch crossing")
64+
O2_DEFINE_CONFIGURABLE(cfgEvSelkIsGoodZvtxFT0vsPV, bool, true, "removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference, use this cut at low multiplicities with caution")
65+
O2_DEFINE_CONFIGURABLE(cfgEvSelkNoCollInTimeRangeStandard, bool, true, "no collisions in specified time range")
66+
O2_DEFINE_CONFIGURABLE(cfgEvSelMultCorrelation, bool, true, "Multiplicity correlation cut")
67+
O2_DEFINE_CONFIGURABLE(cfgEvSelV0AT0ACut, bool, true, "V0A T0A 5 sigma cut")
6568
O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, false, "Use additional track cut on phi")
6669
O2_DEFINE_CONFIGURABLE(cfgGetInteractionRate, bool, false, "Get interaction rate from CCDB")
6770
O2_DEFINE_CONFIGURABLE(cfgUseInteractionRateCut, bool, false, "Use events with low interaction rate")
@@ -72,6 +75,7 @@ struct FlowTask {
7275
O2_DEFINE_CONFIGURABLE(cfgEfficiency, std::string, "", "CCDB path to efficiency object")
7376
O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object")
7477
O2_DEFINE_CONFIGURABLE(cfgMagnetField, std::string, "GLO/Config/GRPMagField", "CCDB path to Magnet field object")
78+
O2_DEFINE_CONFIGURABLE(cfgEvSelOccupancy, bool, true, "Occupancy cut")
7579
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 500, "High cut on TPC occupancy")
7680
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy")
7781
O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode")
@@ -94,7 +98,7 @@ struct FlowTask {
9498
ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -1, 1}, "DCA_{xy} (cm)"};
9599

96100
Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
97-
Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (aod::track::itsChi2NCl < cfgCutChi2prITScls);
101+
Filter trackFilter = ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgCutDCAz);
98102

99103
// Corrections
100104
TH1D* mEfficiency = nullptr;
@@ -501,31 +505,21 @@ struct FlowTask {
501505
template <typename TCollision>
502506
bool eventSelected(TCollision collision, const int multTrk, const float centrality)
503507
{
504-
if (collision.alias_bit(kTVXinTRD)) {
508+
if (cfgTriggerkTVXinTRD && collision.alias_bit(kTVXinTRD)) {
505509
// TRD triggered
506510
return 0;
507511
}
508-
if (!collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
509-
// reject collisions close to Time Frame borders
510-
// https://its.cern.ch/jira/browse/O2-4623
511-
return 0;
512-
}
513-
if (!collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
514-
// reject events affected by the ITS ROF border
515-
// https://its.cern.ch/jira/browse/O2-4309
516-
return 0;
517-
}
518-
if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
512+
if (cfgEvSelkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
519513
// rejects collisions which are associated with the same "found-by-T0" bunch crossing
520514
// https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof
521515
return 0;
522516
}
523-
if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
517+
if (cfgEvSelkIsGoodZvtxFT0vsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
524518
// removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference
525519
// use this cut at low multiplicities with caution
526520
return 0;
527521
}
528-
if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
522+
if (cfgEvSelkNoCollInTimeRangeStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
529523
// no collisions in specified time range
530524
return 0;
531525
}
@@ -538,22 +532,22 @@ struct FlowTask {
538532
}
539533
auto multNTracksPV = collision.multNTracksPV();
540534
auto occupancy = collision.trackOccupancyInTimeRange();
541-
542-
if (fabs(vtxz) > cfgCutVertex)
543-
return 0;
544-
if (multNTracksPV < fMultPVCutLow->Eval(centrality))
545-
return 0;
546-
if (multNTracksPV > fMultPVCutHigh->Eval(centrality))
547-
return 0;
548-
if (multTrk < fMultCutLow->Eval(centrality))
549-
return 0;
550-
if (multTrk > fMultCutHigh->Eval(centrality))
551-
return 0;
552-
if (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh)
535+
if (cfgEvSelOccupancy && (occupancy < cfgCutOccupancyLow || occupancy > cfgCutOccupancyHigh))
553536
return 0;
554537

538+
if (cfgEvSelMultCorrelation) {
539+
if (multNTracksPV < fMultPVCutLow->Eval(centrality))
540+
return 0;
541+
if (multNTracksPV > fMultPVCutHigh->Eval(centrality))
542+
return 0;
543+
if (multTrk < fMultCutLow->Eval(centrality))
544+
return 0;
545+
if (multTrk > fMultCutHigh->Eval(centrality))
546+
return 0;
547+
}
548+
555549
// V0A T0A 5 sigma cut
556-
if (fabs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > 5 * fT0AV0ASigma->Eval(collision.multFT0A()))
550+
if (cfgEvSelV0AT0ACut && (fabs(collision.multFV0A() - fT0AV0AMean->Eval(collision.multFT0A())) > 5 * fT0AV0ASigma->Eval(collision.multFT0A())))
557551
return 0;
558552

559553
return 1;
@@ -576,22 +570,7 @@ struct FlowTask {
576570
template <typename TTrack>
577571
bool trackSelected(TTrack track)
578572
{
579-
switch (cfgFilterFlag) {
580-
case 0:
581-
return track.isGlobalTrack();
582-
case 1:
583-
return (track.isGlobalTrackSDD() == (uint8_t) true);
584-
case 2:
585-
return (track.isGlobalTrackWoTPCCluster() && track.tpcNClsFound() >= cfgCutTPCclu);
586-
case 3:
587-
return (track.isGlobalTrackWoPtEta() && (fabs(track.eta()) < cfgCutEta) && (track.pt() > cfgCutPtMin) && (track.pt() < cfgCutPtMax));
588-
case 4:
589-
return (track.isGlobalTrackWoDCA() && fabs(track.dcaZ()) <= cfgCutDCAz && fabs(track.dcaXY()) <= cfgCutDCAxy * pow(track.pt(), -1.1));
590-
case 5:
591-
return (track.isGlobalTrackWoDCATPCCluster() && fabs(track.dcaZ()) <= cfgCutDCAz && fabs(track.dcaXY()) <= cfgCutDCAxy * pow(track.pt(), -1.1) && track.tpcNClsFound() >= cfgCutTPCclu);
592-
default:
593-
return false;
594-
}
573+
return (track.tpcNClsFound() >= cfgCutTPCclu);
595574
}
596575

597576
template <typename TTrack>

0 commit comments

Comments
 (0)