Skip to content

Commit 72a6ea2

Browse files
author
Lucia Anna Tarasovicova
committed
add CBT event selection
1 parent a15dee1 commit 72a6ea2

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "PWGLF/DataModel/LFStrangenessTables.h"
1818

1919
#include "Common/CCDB/EventSelectionParams.h"
20+
#include "Common/CCDB/RCTSelectionFlags.h"
2021
#include "Common/CCDB/TriggerAliases.h"
2122
#include "Common/CCDB/ctpRateFetcher.h"
2223
#include "Common/Core/RecoDecay.h"
@@ -85,6 +86,15 @@ struct Derivedcascadeanalysis {
8586
Configurable<std::string> irSource{"irSource", "T0VTX", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
8687
Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
8788

89+
o2::aod::rctsel::RCTFlagsChecker rctFlagsChecker{rctConfigurations.cfgRCTLabel.value};
90+
91+
struct : ConfigurableGroup {
92+
std::string prefix = "rctConfigurations"; // JSON group name
93+
Configurable<std::string> cfgRCTLabel{"cfgRCTLabel", "", "Which detector condition requirements? (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"};
94+
Configurable<bool> cfgCheckZDC{"cfgCheckZDC", false, "Include ZDC flags in the bit selection (for Pb-Pb only)"};
95+
Configurable<bool> cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"};
96+
} rctConfigurations;
97+
8898
struct : ConfigurableGroup {
8999
std::string prefix = "qa";
90100
Configurable<bool> doFillNsigmaTPCHistPionBach{"doFillNsigmaTPCHistPionBach", false, ""};
@@ -114,6 +124,7 @@ struct Derivedcascadeanalysis {
114124
Configurable<bool> doNoCollInRofStandardCut{"doNoCollInRofStandardCut", true, "Enable an evevnt selection which rejects a collision if there are other events within the same ITS ROF with mult above threshold"};
115125
Configurable<bool> doMultiplicityCorrCut{"doMultiplicityCorrCut", false, "Enable multiplicity vs centrality correlation cut"};
116126
Configurable<bool> doITSallLayersCut{"doITSallLayersCut", false, "Enable event selection which rejects collisions when ITS was rebooting."};
127+
Configurable<bool> doCBTselection{"doCBTselection", true, "Require only events with good PID (CBT_hadronPID)"};
117128
Configurable<int> minOccupancy{"minOccupancy", -1, "Minimal occupancy"};
118129
Configurable<int> maxOccupancy{"maxOccupancy", -1, "Maximal occupancy"};
119130
Configurable<float> minOccupancyFT0{"minOccupancyFT0", -1, "Minimal occupancy"};
@@ -311,13 +322,15 @@ struct Derivedcascadeanalysis {
311322
SETBIT(selectionCheckMask, 11);
312323
}
313324

325+
rctFlagsChecker.init(rctConfigurations.cfgRCTLabel.value, rctConfigurations.cfgCheckZDC, rctConfigurations.cfgTreatLimitedAcceptanceAsBad);
326+
314327
histos.add("hEventVertexZ", "hEventVertexZ", kTH1F, {vertexZ});
315328
histos.add("hEventMultFt0C", "", kTH1F, {{500, 0, 5000}});
316329
histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{101, 0, 101}});
317330

318331
histos.add("hEventSelection", "hEventSelection", kTH1F, {{22, 0, 22}});
319332
// TODO adjust labels
320-
std::array<TString, 22> eventSelLabelRun3 = {"all", "sel8", "TVX", "PV_{z}", "cent", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "kIsVertexITSTPC", "kIsVertexTOFmatched", "kIsVertexTRDmatched", "kNoITSROFrameBorder", "kNoTimeFrameBorder", "MultCorrCut", "kNoCollInTimeRangeStrict", "kNoCollInTimeRangeStandard", "min Occup", "mxOccup", "kNoCollInRofStrict", "kNoCollInRofStandard", "kIsGoodITSLayersAll", "occupFt0", "-"};
333+
std::array<TString, 22> eventSelLabelRun3 = {"all", "sel8", "TVX", "PV_{z}", "cent", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "kIsVertexITSTPC", "kIsVertexTOFmatched", "kIsVertexTRDmatched", "kNoITSROFrameBorder", "kNoTimeFrameBorder", "MultCorrCut", "kNoCollInTimeRangeStrict", "kNoCollInTimeRangeStandard", "min Occup", "mxOccup", "kNoCollInRofStrict", "kNoCollInRofStandard", "kIsGoodITSLayersAll", "occupFt0", "CBT sel"};
321334
std::array<TString, 22> eventSelLabelRun2 = {"all", "sel8", "TVX", "PV_{z}", "cent", "sel7", "kINT7", "kNoIncompleteDAQ", "kNoInconsistentVtx", "kNoPileupFromSPD", "kNoV0PFPileup", "kNoPileupInMultBins", "kNoPileupMV", "kNoPileupTPC", "kNoV0MOnVsOfPileup", "kNoSPDOnVsOfPileup", "kNoSPDClsVsTklBG", "INEL0", "-", "-", "-", "-"};
322335
for (int i = 1; i <= histos.get<TH1>(HIST("hEventSelection"))->GetNbinsX(); i++) {
323336
if (doprocessCascades || doprocessCascadesMCrec || doprocessCascadesMCforEff) {
@@ -798,6 +811,13 @@ struct Derivedcascadeanalysis {
798811
}
799812

800813
interactionRate = rateFetcher.fetch(ccdb.service, coll.timestamp(), coll.runNumber(), irSource) * 1.e-3;
814+
815+
if (eventSelectionRun3Flags.doCBTselection && !rctConfigurations.cfgRCTLabel.value.empty() && !rctFlagsChecker(coll)) {
816+
return false;
817+
}
818+
if (fillHists) {
819+
histos.fill(HIST("hEventSelection"), 21.5 /* Pass CBT condition */);
820+
}
801821
} else {
802822
centrality = eventSelectionRun2Flags.useSPDTrackletsCent ? coll.centRun2SPDTracklets() : coll.centRun2V0M();
803823

0 commit comments

Comments
 (0)