Skip to content

Commit b14a4b8

Browse files
victor-gonzalezVictor
andauthored
[PWGCF] DptDpt - Fine tune on the fly initialization (#15269)
Co-authored-by: Victor <[email protected]>
1 parent fcf7577 commit b14a4b8

File tree

2 files changed

+35
-27
lines changed

2 files changed

+35
-27
lines changed

PWGCF/TableProducer/dptDptFilter.cxx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,24 +434,28 @@ struct Multiplicity {
434434
if (fhCL1EtaGapMultiplicity != nullptr) {
435435
fhCL1EtaGapMultiplicity->Fill(cl1EtaGapM, dNchdEta);
436436
}
437+
/* if there is not calibration assign 50% mutltiplicity */
438+
if (fhV0MMultPercentile == nullptr && fhCL1MultPercentile == nullptr && fhCL1EtaGapMultPercentile == nullptr) {
439+
multiplicityClass = 50;
440+
}
437441
switch (classestimator) {
438442
case kV0M:
439443
if (fhV0MMultPercentile != nullptr) {
440444
multiplicityClass = fhV0MMultPercentile->GetBinContent(fhV0MMultPercentile->FindFixBin(v0am + v0cm));
441-
multiplicity = v0am + v0cm;
442445
}
446+
multiplicity = v0am + v0cm;
443447
break;
444448
case kCL1:
445449
if (fhCL1MultPercentile != nullptr) {
446450
multiplicityClass = fhCL1MultPercentile->GetBinContent(fhCL1MultPercentile->FindFixBin(cl1m));
447-
multiplicity = cl1m;
448451
}
452+
multiplicity = cl1m;
449453
break;
450454
case kCL1GAP:
451455
if (fhCL1EtaGapMultPercentile != nullptr) {
452456
multiplicityClass = fhCL1EtaGapMultPercentile->GetBinContent(fhCL1EtaGapMultPercentile->FindFixBin(cl1EtaGapM));
453-
multiplicity = cl1EtaGapM;
454457
}
458+
multiplicity = cl1EtaGapM;
455459
break;
456460
default:
457461
break;
@@ -639,10 +643,10 @@ struct DptDptFilter {
639643
triggerSelectionFlags = getTriggerSelection(cfgEventSelection.triggSel.value.c_str());
640644
traceCollId0 = cfgTraceCollId0;
641645

642-
/* get the system type */
646+
/* get the data type and the system type */
647+
fDataType = getDataType(cfgDataType);
643648
fSystem = getSystemType(cfgSystemForPeriod.value);
644649
fLhcRun = multRunForSystemMap.at(fSystem);
645-
fDataType = getDataType(cfgDataType);
646650

647651
/* the multiplicities outliers exclusion */
648652
multiplicityCentralityCorrelationsExclusion = getExclusionFormula(cfgEventSelection.multiplicitiesExclusionFormula->getData()[fSystem][0].c_str());
@@ -1200,13 +1204,13 @@ struct DptDptFilterTracks {
12001204
tpcExcluder = TpcExcludeTrack(tpcExclude);
12011205
tpcExcluder.setCuts(pLowCut, pUpCut, nLowCut, nUpCut);
12021206

1203-
/* self configure system type and data type */
1204-
o2::framework::LabeledArray<std::string> tmpLabeledArray = {};
1205-
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgSystemForPeriod", tmpLabeledArray, false);
1206-
fSystem = getSystemType(tmpLabeledArray);
1207+
/* self configure data type and system */
12071208
std::string tmpstr;
12081209
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgDataType", tmpstr, false);
12091210
fDataType = getDataType(tmpstr);
1211+
o2::framework::LabeledArray<std::string> tmpLabeledArray = {};
1212+
getTaskOptionValue(initContext, "dpt-dpt-filter", "cfgSystemForPeriod", tmpLabeledArray, false);
1213+
fSystem = getSystemType(tmpLabeledArray);
12101214

12111215
/* required ambiguous tracks checks? */
12121216
if (dofilterDetectorLevelWithoutPIDAmbiguous || dofilterDetectorLevelWithPIDAmbiguous || dofilterDetectorLevelWithFullPIDAmbiguous ||

PWGCF/TableProducer/dptDptFilter.h

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -896,27 +896,31 @@ inline std::bitset<32> getTriggerSelection(std::string_view const& triggstr)
896896

897897
inline SystemType getSystemType(auto const& periodsForSysType)
898898
{
899-
auto period = metadataInfo.get("LPMProductionTag");
900-
auto anchoredPeriod = metadataInfo.get("AnchorProduction");
901-
bool checkAnchor = anchoredPeriod.length() > 0;
902-
903-
for (SystemType sT = SystemNoSystem; sT < SystemNoOfSystems; ++sT) {
904-
const std::string& periods = periodsForSysType[static_cast<int>(sT)][0];
905-
auto contains = [periods](auto const& period) {
906-
if (periods.find(period) != std::string::npos) {
907-
return true;
908-
}
909-
return false;
910-
};
911-
if (periods.length() > 0) {
912-
if (contains(period) || (checkAnchor && contains(anchoredPeriod))) {
913-
LOGF(info, "DptDptCorrelations::getSystemType(). Assigned system type %s for period %s", systemExternalNamesMap.at(static_cast<int>(sT)).data(), period.c_str());
914-
return sT;
899+
if (fDataType != kOnTheFly) {
900+
auto period = metadataInfo.get("LPMProductionTag");
901+
auto anchoredPeriod = metadataInfo.get("AnchorProduction");
902+
bool checkAnchor = anchoredPeriod.length() > 0;
903+
904+
for (SystemType sT = SystemNoSystem; sT < SystemNoOfSystems; ++sT) {
905+
const std::string& periods = periodsForSysType[static_cast<int>(sT)][0];
906+
auto contains = [periods](auto const& period) {
907+
if (periods.find(period) != std::string::npos) {
908+
return true;
909+
}
910+
return false;
911+
};
912+
if (periods.length() > 0) {
913+
if (contains(period) || (checkAnchor && contains(anchoredPeriod))) {
914+
LOGF(info, "DptDptCorrelations::getSystemType(). Assigned system type %s for period %s", systemExternalNamesMap.at(static_cast<int>(sT)).data(), period.c_str());
915+
return sT;
916+
}
915917
}
916918
}
919+
LOGF(fatal, "DptDptCorrelations::getSystemType(). No system type for period: %s", period.c_str());
920+
return SystemPbPb;
921+
} else {
922+
return SystemNeNeRun3;
917923
}
918-
LOGF(fatal, "DptDptCorrelations::getSystemType(). No system type for period: %s", period.c_str());
919-
return SystemPbPb;
920924
}
921925

922926
/// \brief Type of data according to the configuration string

0 commit comments

Comments
 (0)