Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::aod;
using namespace o2::aod::rctsel;

// Declare Joins used in the various process functions
using MyBarrelTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection,
Expand Down Expand Up @@ -178,6 +179,12 @@ struct TableMakerMC {
Configurable<std::string> fConfigMuonCutsJSON{"cfgMuonCutsJSON", "", "Additional list of muon cuts in JSON format"};
} fConfigCuts;

// RCT selection
struct : ConfigurableGroup {
Configurable<bool> fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"};
Configurable<std::string> fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"};
} fConfigRCT;

// MC signals to be skimmed
Configurable<std::string> fConfigMCSignals{"cfgMCsignals", "", "Comma separated list of MC signals"};
Configurable<std::string> fConfigMCSignalsJSON{"cfgMCsignalsJSON", "", "Additional list of MC signals via JSON"};
Expand Down Expand Up @@ -261,6 +268,9 @@ struct TableMakerMC {
std::array<double, 1> cutValues;
std::vector<int> cutDirMl;

// RCT flag checker
RCTFlagsChecker rctChecker{"CBT"};

void init(o2::framework::InitContext& context)
{
// Check whether barrel or muon are enabled
Expand Down Expand Up @@ -398,6 +408,10 @@ struct TableMakerMC {
matchingMlResponse.cacheInputFeaturesIndices(fConfigVariousOptions.fInputFeatures.value);
matchingMlResponse.init();
}

if (fConfigRCT.fConfigUseRCT.value) {
rctChecker.init(fConfigRCT.fConfigRCTLabel);
}
}

void DefineCuts()
Expand Down Expand Up @@ -634,7 +648,7 @@ struct TableMakerMC {
(reinterpret_cast<TH2I*>(fStatsList->At(0)))->Fill(2.0, static_cast<float>(o2::aod::evsel::kNsel));

// Apply the user specified event selection
if (!fEventCut->IsSelected(VarManager::fgValues)) {
if (!fEventCut->IsSelected(VarManager::fgValues) || (fConfigRCT.fConfigUseRCT.value && !(rctChecker(collision)))) {
continue;
}

Expand Down
18 changes: 16 additions & 2 deletions PWGDQ/TableProducer/tableMaker_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::aod;
using namespace o2::aod::rctsel;

Zorro zorro;

Expand Down Expand Up @@ -204,6 +205,12 @@ struct TableMaker {
Configurable<std::string> fConfigMuonCutsJSON{"cfgMuonCutsJSON", "", "Additional list of muon cuts in JSON format"};
} fConfigCuts;

// RCT selection
struct : ConfigurableGroup {
Configurable<bool> fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"};
Configurable<std::string> fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"};
} fConfigRCT;

// Zorro selection
struct : ConfigurableGroup {
Configurable<bool> fConfigRunZorro{"cfgRunZorro", false, "Enable event selection with zorro"};
Expand Down Expand Up @@ -312,6 +319,9 @@ struct TableMaker {
std::array<double, 1> cutValues;
std::vector<int> cutDirMl;

// RCT flag checker
RCTFlagsChecker rctChecker{"CBT"};

// FIXME: For now, the skimming is done using the Common track-collision association task, which does not allow to use
// our own Filtered tracks. If the filter is very selective, then it may be worth to run the association in this workflow
// using the Common/CollisionAssociation class
Expand Down Expand Up @@ -467,6 +477,10 @@ struct TableMaker {
matchingMlResponse.cacheInputFeaturesIndices(fConfigVariousOptions.fInputFeatures.value);
matchingMlResponse.init();
}

if (fConfigRCT.fConfigUseRCT.value) {
rctChecker.init(fConfigRCT.fConfigRCTLabel);
}
}

void DefineCuts()
Expand Down Expand Up @@ -995,7 +1009,7 @@ struct TableMaker {
zorro.initCCDB(fCCDB.service, fCurrentRun, bc.timestamp(), fConfigZorro.fConfigZorroTrigMask.value);
zorro.populateExternalHists(fCurrentRun, reinterpret_cast<TH2D*>(fStatsList->At(kStatsZorroInfo)), reinterpret_cast<TH2D*>(fStatsList->At(kStatsZorroSel)));

if (!fEventCut->IsSelected(VarManager::fgValues)) {
if (!fEventCut->IsSelected(VarManager::fgValues) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) {
continue;
}

Expand All @@ -1007,7 +1021,7 @@ struct TableMaker {
continue;
}
} else {
if (!fEventCut->IsSelected(VarManager::fgValues)) {
if (!fEventCut->IsSelected(VarManager::fgValues) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) {
continue;
}
}
Expand Down
Loading