Skip to content

Commit 8b85e39

Browse files
committed
select events by Run condition table
1 parent 947d1a3 commit 8b85e39

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

DPG/Tasks/TPC/tpcSkimsTableCreator.cxx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
2626
#include "PWGLF/DataModel/LFStrangenessTables.h"
2727

28+
#include "Common/CCDB/RCTSelectionFlags.h"
2829
#include "Common/CCDB/ctpRateFetcher.h"
2930
#include "Common/DataModel/EventSelection.h"
3031
#include "Common/DataModel/Multiplicity.h"
@@ -101,6 +102,11 @@ struct TreeWriterTpcV0 {
101102
Configurable<float> maxPt4dwnsmplTsalisProtons{"maxPt4dwnsmplTsalisProtons", 100., "Maximum Pt for applying downsampling factor of protons"};
102103
Configurable<float> maxPt4dwnsmplTsalisElectrons{"maxPt4dwnsmplTsalisElectrons", 100., "Maximum Pt for applying downsampling factor of electrons"};
103104
Configurable<float> maxPt4dwnsmplTsalisKaons{"maxPt4dwnsmplTsalisKaons", 100., "Maximum Pt for applying downsampling factor of kaons"};
105+
// Configurables for run condtion table
106+
Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"};
107+
Configurable<bool> checkZdc{"checkZdc", false, "set ZDC flag for PbPb"};
108+
Configurable<bool> treatLimitedAcceptanceAsBad{"treatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"};
109+
Configurable<bool> requireGoodRct{"requireGoodRct", false, "require good detector flag in run condtion table"};
104110

105111
// an arbitrary value of N sigma TOF assigned by TOF task to tracks which are not matched to TOF hits
106112
constexpr static float NSigmaTofUnmatched{o2::aod::v0data::kNoTOFValue};
@@ -149,6 +155,8 @@ struct TreeWriterTpcV0 {
149155

150156
ctpRateFetcher mRateFetcher;
151157

158+
o2::aod::rctsel::RCTFlagsChecker rctChecker;
159+
152160
TRandom3* fRndm = new TRandom3(0);
153161

154162
using Trks = soa::Join<aod::Tracks, aod::V0Bits, aod::TracksExtra, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFFullEl, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::TrackSelection>;
@@ -171,6 +179,8 @@ struct TreeWriterTpcV0 {
171179
ccdb->setURL("http://alice-ccdb.cern.ch");
172180
ccdb->setCaching(true);
173181
ccdb->setFatalWhenNull(false);
182+
183+
rctChecker.init(rctLabel, checkZdc, treatLimitedAcceptanceAsBad);
174184
}
175185

176186
template <bool IsCorrectedDeDx, typename V0Casc, typename T>
@@ -413,6 +423,11 @@ struct TreeWriterTpcV0 {
413423
if (!isEventSelected(collision, applyEvSel)) {
414424
continue;
415425
}
426+
const bool isGoodRctEvent = rctChecker.checkTable(collision);
427+
if (requireGoodRct && !isGoodRctEvent) {
428+
continue;
429+
}
430+
416431
const auto& v0s = myV0s.sliceBy(perCollisionV0s, static_cast<int>(collision.globalIndex()));
417432
const auto& cascs = myCascs.sliceBy(perCollisionCascs, static_cast<int>(collision.globalIndex()));
418433
const auto& bc = collision.bc_as<BCType>();
@@ -614,6 +629,11 @@ struct TreeWriterTpcTof {
614629
Configurable<float> downsamplingTsalisProtons{"downsamplingTsalisProtons", -1., "Downsampling factor to reduce the number of protons"};
615630
Configurable<float> downsamplingTsalisKaons{"downsamplingTsalisKaons", -1., "Downsampling factor to reduce the number of kaons"};
616631
Configurable<float> downsamplingTsalisPions{"downsamplingTsalisPions", -1., "Downsampling factor to reduce the number of pions"};
632+
// Configurables for run condtion table
633+
Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"};
634+
Configurable<bool> checkZdc{"checkZdc", false, "set ZDC flag for PbPb"};
635+
Configurable<bool> treatLimitedAcceptanceAsBad{"treatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"};
636+
Configurable<bool> requireGoodRct{"requireGoodRct", false, "require good detector flag in run condtion table"};
617637

618638
struct TofTrack {
619639
bool isApplyHardCutOnly;
@@ -636,6 +656,8 @@ struct TreeWriterTpcTof {
636656

637657
ctpRateFetcher mRateFetcher;
638658

659+
o2::aod::rctsel::RCTFlagsChecker rctChecker;
660+
639661
TRandom3* fRndm = new TRandom3(0);
640662

641663
using Trks = soa::Join<aod::Tracks, aod::TracksExtra,
@@ -665,6 +687,8 @@ struct TreeWriterTpcTof {
665687
ccdb->setURL("http://alice-ccdb.cern.ch");
666688
ccdb->setCaching(true);
667689
ccdb->setFatalWhenNull(false);
690+
691+
rctChecker.init(rctLabel, checkZdc, treatLimitedAcceptanceAsBad);
668692
}
669693

670694
template <bool DoCorrectDeDx, int ModeId, typename T, typename C>
@@ -779,6 +803,11 @@ struct TreeWriterTpcTof {
779803
if (!isEventSelected(collision, applyEvSel)) {
780804
continue;
781805
}
806+
const bool isGoodRctEvent = rctChecker.checkTable(collision);
807+
if (requireGoodRct && !isGoodRctEvent) {
808+
continue;
809+
}
810+
782811
auto tracksWithITSPid = soa::Attach<TrksType,
783812
aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr,
784813
aod::pidits::ITSNSigmaDe, aod::pidits::ITSNSigmaTr>(tracks);

0 commit comments

Comments
 (0)