Skip to content

Commit a7862bb

Browse files
committed
Fixing issues/14173
1 parent ac43779 commit a7862bb

1 file changed

Lines changed: 19 additions & 31 deletions

File tree

Common/TableProducer/occupancyTableProducer.cxx

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -433,47 +433,39 @@ struct OccupancyTableProducer {
433433
template <int processMode, int tableMode, int meanTableMode, int robustTableMode, int meanRobustTableMode, typename B, typename C, typename T>
434434
void executeOccProducerProcessing(B const& BCs, C const& collisions, T const& tracks)
435435
{
436-
if (tableMode == checkTableMode) {
436+
if constexpr (tableMode == checkTableMode) {
437437
if (buildFlag00OccTable) {
438438
executeOccProducerProcessing<processMode, fillOccTable, meanTableMode, robustTableMode, meanRobustTableMode>(BCs, collisions, tracks);
439439
} else {
440440
executeOccProducerProcessing<processMode, doNotFill, meanTableMode, robustTableMode, meanRobustTableMode>(BCs, collisions, tracks);
441441
}
442-
}
443-
if constexpr (tableMode == checkTableMode) {
444442
return;
445443
}
446444

447-
if (meanTableMode == checkTableMode) {
445+
if constexpr (meanTableMode == checkTableMode) {
448446
if (buildFlag01OccMeanTable) {
449447
executeOccProducerProcessing<processMode, tableMode, fillMeanOccTable, robustTableMode, meanRobustTableMode>(BCs, collisions, tracks);
450448
} else {
451449
executeOccProducerProcessing<processMode, tableMode, doNotFill, robustTableMode, meanRobustTableMode>(BCs, collisions, tracks);
452450
}
453-
}
454-
if constexpr (meanTableMode == checkTableMode) {
455451
return;
456452
}
457453

458-
if (robustTableMode == checkTableMode) {
454+
if constexpr (robustTableMode == checkTableMode) {
459455
if (buildFlag02OccRobustTable) {
460456
executeOccProducerProcessing<processMode, tableMode, meanTableMode, fillOccRobustTable, meanRobustTableMode>(BCs, collisions, tracks);
461457
} else {
462458
executeOccProducerProcessing<processMode, tableMode, meanTableMode, doNotFill, meanRobustTableMode>(BCs, collisions, tracks);
463459
}
464-
}
465-
if constexpr (robustTableMode == checkTableMode) {
466460
return;
467461
}
468462

469-
if (meanRobustTableMode == checkTableMode) {
463+
if constexpr (meanRobustTableMode == checkTableMode) {
470464
if (buildFlag03OccMeanRobustTable) {
471465
executeOccProducerProcessing<processMode, tableMode, meanTableMode, robustTableMode, fillOccMeanRobustTable>(BCs, collisions, tracks);
472466
} else {
473467
executeOccProducerProcessing<processMode, tableMode, meanTableMode, robustTableMode, doNotFill>(BCs, collisions, tracks);
474468
}
475-
}
476-
if constexpr (meanRobustTableMode == checkTableMode) {
477469
return;
478470
}
479471

@@ -802,7 +794,7 @@ struct OccupancyTableProducer {
802794

803795
auto& vecOccPrimUnfm80 = occPrimUnfm80[i];
804796
float meanOccPrimUnfm80 = TMath::Mean(vecOccPrimUnfm80.size(), vecOccPrimUnfm80.data());
805-
normalizeVector(vecOccPrimUnfm80, meanOccPrimUnfm80 / meanOccPrimUnfm80);
797+
//normalizeVector(vecOccPrimUnfm80, meanOccPrimUnfm80 / meanOccPrimUnfm80);
806798

807799
if constexpr (processMode == kProcessFullOccTableProducer || processMode == kProcessOnlyOccPrim || processMode == kProcessOnlyOccT0V0Prim || processMode == kProcessOnlyOccFDDT0V0Prim || processMode == kProcessOnlyOccNtrackDet || processMode == kProcessOnlyOccMultExtra) {
808800
if constexpr (tableMode == fillOccTable) {
@@ -1699,20 +1691,22 @@ struct TrackMeanOccTableProducer {
16991691
{
17001692
occupancyQA.fill(HIST("occTrackQA/") + HIST(OccDire[occMode]) + HIST(OccNames[occName]), occValue);
17011693
if (fillQA1) {
1702-
occupancyQA.fill(HIST("occTrackQA/LogRatio/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), std::log(std::abs(occValue / occRobustValue)));
1694+
float logRatio = std::log(occValue / occRobustValue);
1695+
float weighted = logRatio * std::sqrt(occValue + occRobustValue);
1696+
occupancyQA.fill(HIST("occTrackQA/LogRatio/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), logRatio);
17031697
if (fillQA2) {
17041698
int two = 2, twenty = 20, fifty = 50, twoHundred = 200;
17051699
if (std::abs(std::log(occValue / occRobustValue)) < two) { // conditional filling start
1706-
occupancyQA.fill(HIST("occTrackQA/Condition1/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue));
1700+
occupancyQA.fill(HIST("occTrackQA/Condition1/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted);
17071701
if (std::abs(occRobustValue + occValue) > twoHundred) {
1708-
occupancyQA.fill(HIST("occTrackQA/Condition4/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue));
1709-
occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue));
1710-
occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue));
1702+
occupancyQA.fill(HIST("occTrackQA/Condition4/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted);
1703+
occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted);
1704+
occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted);
17111705
} else if (std::abs(occRobustValue + occValue) > fifty) {
1712-
occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue));
1713-
occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue));
1706+
occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted);
1707+
occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted);
17141708
} else if (std::abs(occRobustValue + occValue) > twenty) {
1715-
occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue));
1709+
occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted);
17161710
}
17171711
} // conditional filling end
17181712
}
@@ -1762,29 +1756,25 @@ struct TrackMeanOccTableProducer {
17621756
return;
17631757
}
17641758

1765-
if (meanTableMode == checkTableMode) {
1759+
if constexpr (meanTableMode == checkTableMode) {
17661760
if (buildFlag00MeanTable) {
17671761
executeTrackOccProducerProcessing<processMode, fillMeanOccTable, weightMeanTableMode, qaMode>(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock);
17681762
} else {
17691763
executeTrackOccProducerProcessing<processMode, doNotFill, weightMeanTableMode, qaMode>(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock);
17701764
}
1771-
}
1772-
if constexpr (meanTableMode == checkTableMode) {
17731765
return;
17741766
}
17751767

1776-
if (weightMeanTableMode == checkTableMode) {
1768+
if constexpr (weightMeanTableMode == checkTableMode) {
17771769
if (buildFlag01WeightMeanTable) {
17781770
executeTrackOccProducerProcessing<processMode, meanTableMode, fillWeightMeanOccTable, qaMode>(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock);
17791771
} else {
17801772
executeTrackOccProducerProcessing<processMode, meanTableMode, doNotFill, qaMode>(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock);
17811773
}
1782-
}
1783-
if constexpr (weightMeanTableMode == checkTableMode) {
17841774
return;
17851775
}
17861776

1787-
if (qaMode == checkQAMode) {
1777+
if constexpr (qaMode == checkQAMode) {
17881778
if (fillQA1 || fillQA2) {
17891779
if (occsRobustT0V0Prim.size() == 0) {
17901780
LOG(error) << "DEBUG :: ERROR ERROR ERROR :: OccsRobustT0V0Prim.size() == 0 :: Check \"occupancy-table-producer\" for \"buildOnlyOccsT0V0Prim == true\" & \"processOnlyOccT0V0PrimUnfm == true\"";
@@ -1794,8 +1784,6 @@ struct TrackMeanOccTableProducer {
17941784
} else {
17951785
executeTrackOccProducerProcessing<processMode, meanTableMode, weightMeanTableMode, doNotFill>(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock);
17961786
}
1797-
}
1798-
if constexpr (qaMode == checkQAMode) {
17991787
return;
18001788
}
18011789

@@ -1972,6 +1960,7 @@ struct TrackMeanOccTableProducer {
19721960
getTimingInfo(bc, lastRun, nBCsPerTF, bcSOR, time, tfIdThis, bcInTF);
19731961
}
19741962

1963+
19751964
if (tfIdThis != oldTFid) {
19761965
oldTFid = tfIdThis;
19771966
auto occsList = occs.iteratorAt(bc.occId());
@@ -2421,7 +2410,6 @@ struct TrackMeanOccTableProducer {
24212410
{
24222411
occupancyQA.fill(HIST("h_DFcount_Lvl0"), kProcessNothing);
24232412
return;
2424-
occupancyQA.fill(HIST("h_DFcount_Lvl1"), kProcessNothing);
24252413
}
24262414
PROCESS_SWITCH(TrackMeanOccTableProducer, processNothing, "process Nothing From Track Mean Occ Table Producer", true);
24272415

0 commit comments

Comments
 (0)