Skip to content

Commit bb8659e

Browse files
committed
add event sel
1 parent 2d27a92 commit bb8659e

File tree

1 file changed

+76
-1
lines changed

1 file changed

+76
-1
lines changed

PWGHF/HFC/Tasks/taskFlow.cxx

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,21 @@ enum MultiplicityEstimators {
144144
MultFT0M
145145
};
146146

147+
enum SpecificEventSelectionStep {
148+
AllEventsPrecise = 0,
149+
IsSel8,
150+
IsNoSameBunchPileup,
151+
IsGoodItsLayersAll,
152+
IsGoodZvtxFT0vsPV,
153+
IsNoCollInRofStandard,
154+
IsNoCollInRofStrict,
155+
IsNoCollInTimeRangeStandard,
156+
IsNoCollInTimeRangeStrict,
157+
IsNoHighMultCollInPrevRof,
158+
IsRctFlagChecked,
159+
NSpecificEventSelectionSteps
160+
};
161+
147162
enum TrackSelection {
148163
TrackSelectionNoCut = 0,
149164
TrackSelectionGlobalTrack
@@ -199,11 +214,13 @@ struct HfTaskFlow {
199214
Configurable<bool> isApplyNoCollInRofStrict{"isApplyNoCollInRofStrict", false, ""};
200215
Configurable<bool> isApplyNoCollInTimeRangeStandard{"isApplyNoCollInTimeRangeStandard", false, ""};
201216
Configurable<bool> isApplyNoCollInTimeRangeStrict{"isApplyNoCollInTimeRangeStrict", false, ""};
217+
Configurable<bool> isApplyNoHighMultCollInPrevRof{"isApplyNoHighMultCollInPrevRof", false, ""};
202218
Configurable<bool> isApplySameBunchPileup{"isApplySameBunchPileup", false, "Enable SameBunchPileup cut"};
203219
Configurable<int> maxMultiplicity{"maxMultiplicity", 300, "maximum multiplicity selection for collision"};
204220
Configurable<int> minMultiplicity{"minMultiplicity", 0, "minimum multiplicity selection for collision"};
205221
Configurable<int> multiplicityEstimator{"multiplicityEstimator", 0, "0: multNTracksPV, 1: numContrib, 2: multFT0C, 3: multFT0M, 4: centFT0C, 5: centFT0CVariants1s, 6: centFT0M, 7: centFV0A, 8: centNTracksPV, 9: centNGlobal, 10: centMFT"};
206222
Configurable<bool> requireRCTFlagChecker{"requireRCTFlagChecker", false, "Check event quality in run condition table"};
223+
Configurable<bool> requireCorrelationAnalysisRCTFlagChecker{"requireCorrelationAnalysisRCTFlagChecker", false, "Check event quality in run condition table for correlation analysis"};
207224
Configurable<std::string> setRCTFlagCheckerLabel{"setRCTFlagCheckerLabel", "CBT_muon_global", "Evt sel: RCT flag checker label"};
208225
Configurable<bool> requireRCTFlagCheckerLimitAcceptanceAsBad{"requireRCTFlagCheckerLimitAcceptanceAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"};
209226
Configurable<bool> requireZDCCheck{"requireZDCCheck", false, "Evt sel: RCT flag checker ZDC check"};
@@ -281,6 +298,7 @@ struct HfTaskFlow {
281298
o2::fv0::Geometry* fv0Det{};
282299
std::vector<float> cstFT0RelGain{};
283300
RCTFlagsChecker rctChecker;
301+
RCTFlagsChecker correlationAnalysisRctChecker{kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad};
284302

285303
// =========================
286304
// using declarations : DATA
@@ -460,6 +478,7 @@ struct HfTaskFlow {
460478
// =========================
461479

462480
rctChecker.init(configCollision.setRCTFlagCheckerLabel, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad);
481+
correlationAnalysisRctChecker.init({kFT0Bad, kITSBad, kTPCBadTracking, kMFTBad}, configCollision.requireZDCCheck, configCollision.requireRCTFlagCheckerLimitAcceptanceAsBad);
463482

464483
registry.add("Data/hVtxZ", "v_{z} (cm)", {HistType::kTH1D, {configAxis.axisVertex}});
465484
registry.add("Data/hNTracks", "", {HistType::kTH1F, {configAxis.axisMultiplicity}});
@@ -475,6 +494,25 @@ struct HfTaskFlow {
475494
registry.get<TH1>(HIST("Data/hEventCounter"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data());
476495
}
477496

497+
registry.add("Data/hPreciseEventCounter", "hPreciseEventCounter", {HistType::kTH1D, {{SpecificEventSelectionStep::NSpecificEventSelectionSteps, -0.5, +SpecificEventSelectionStep::NSpecificEventSelectionSteps - 0.5}}});
498+
std::string labelsPreciseEventSelection[SpecificEventSelectionStep::NSpecificEventSelectionSteps];
499+
labelsPreciseEventSelection[SpecificEventSelectionStep::AllEventsPrecise] = "all";
500+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsSel8] = "sel8";
501+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsNoSameBunchPileup] = "IsNoSameBunchPileup";
502+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsGoodItsLayersAll] = "IsGoodItsLayersAll";
503+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsGoodZvtxFT0vsPV] = "IsGoodZvtxFT0vsPV";
504+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsNoCollInRofStandard] = "IsNoCollInRofStandard";
505+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsNoCollInRofStrict] = "IsNoCollInRofStrict";
506+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsNoCollInTimeRangeStandard] = "IsNoCollInTimeRangeStandard";
507+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsNoCollInTimeRangeStrict] = "IsNoCollInTimeRangeStrict";
508+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsNoHighMultCollInPrevRof] = "IsNoHighMultCollInPrevRof";
509+
labelsPreciseEventSelection[SpecificEventSelectionStep::IsRctFlagChecked] = "IsRctFlagChecked";
510+
registry.get<TH1>(HIST("Data/hPreciseEventCounter"))->SetMinimum(0);
511+
512+
for (int iBin = 0; iBin < SpecificEventSelectionStep::NSpecificEventSelectionSteps; iBin++) {
513+
registry.get<TH1>(HIST("Data/hPreciseEventCounter"))->GetXaxis()->SetBinLabel(iBin + 1, labelsPreciseEventSelection[iBin].data());
514+
}
515+
478516
mPairCuts.SetHistogramRegistry(&registry);
479517
if (configCentral.pairCut->get("Photon") > 0 || configCentral.pairCut->get("K0") > 0 || configCentral.pairCut->get("Lambda") > 0 || configCentral.pairCut->get("Phi") > 0 || configCentral.pairCut->get("Rho") > 0) {
480518
mPairCuts.SetPairCut(PairCuts::Photon, configCentral.pairCut->get("Photon"));
@@ -923,35 +961,72 @@ struct HfTaskFlow {
923961
{
924962
if (fillHistograms) {
925963
registry.fill(HIST("Data/hEventCounter"), EventSelectionStep::AllEvents);
964+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::AllEventsPrecise);
926965
}
927966

928967
if (!collision.sel8()) {
929968
return false;
930969
}
970+
if (fillHistograms) {
971+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsSel8);
972+
}
931973
if (configCollision.isApplySameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
932974
return false;
933975
}
976+
if (fillHistograms) {
977+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsNoSameBunchPileup);
978+
}
979+
if (configCollision.isApplyGoodItsLayersAll && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
980+
return false;
981+
}
982+
if (fillHistograms) {
983+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsGoodItsLayersAll);
984+
}
934985
if (configCollision.isApplyGoodZvtxFT0vsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
935986
return false;
936987
}
988+
if (fillHistograms) {
989+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsGoodZvtxFT0vsPV);
990+
}
937991
if (configCollision.isApplyNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) {
938992
return false;
939993
}
994+
if (fillHistograms) {
995+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsNoCollInRofStandard);
996+
}
940997
if (configCollision.isApplyNoCollInRofStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) {
941998
return false;
942999
}
1000+
if (fillHistograms) {
1001+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsNoCollInRofStrict);
1002+
}
9431003
if (configCollision.isApplyNoCollInTimeRangeStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
9441004
return false;
9451005
}
1006+
if (fillHistograms) {
1007+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsNoCollInTimeRangeStandard);
1008+
}
9461009
if (configCollision.isApplyNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) {
9471010
return false;
9481011
}
949-
if (configCollision.isApplyGoodItsLayersAll && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
1012+
if (fillHistograms) {
1013+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsNoCollInTimeRangeStrict);
1014+
}
1015+
if (configCollision.isApplyNoHighMultCollInPrevRof && !collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) {
9501016
return false;
9511017
}
1018+
if (fillHistograms) {
1019+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsNoHighMultCollInPrevRof);
1020+
}
9521021
if (configCollision.requireRCTFlagChecker && !rctChecker(collision)) {
9531022
return false;
9541023
}
1024+
if (configCollision.requireCorrelationAnalysisRCTFlagChecker && !correlationAnalysisRctChecker(collision)) {
1025+
return false;
1026+
}
1027+
if (fillHistograms) {
1028+
registry.fill(HIST("Data/hPreciseEventCounter"), SpecificEventSelectionStep::IsRctFlagChecked);
1029+
}
9551030

9561031
if (fillHistograms) {
9571032
registry.fill(HIST("Data/hEventCounter"), EventSelectionStep::AfterEventSelection);

0 commit comments

Comments
 (0)