@@ -45,10 +45,6 @@ using namespace o2::constants::math;
4545using namespace o2 ::framework;
4646using namespace o2 ::framework::expressions;
4747
48- // simple checkers
49- #define BIT_SET (var, nbit ) ((var) |= (1 << (nbit)))
50- #define BIT_CHECK (var, nbit ) ((var) & (1 << (nbit)))
51-
5248using TracksComplete = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA>;
5349using V0DatasWithoutTrackX = soa::Join<aod::V0Indices, aod::V0Cores>;
5450
@@ -251,7 +247,7 @@ struct HStrangeCorrelation {
251247 if (track.tpcNClsShared () > systCuts.triggerMaxTPCSharedClusters ) {
252248 return false ; // skip, has shared clusters
253249 }
254- if (!(BIT_CHECK (track.itsClusterMap (), 0 )) && systCuts.triggerRequireL0 ) {
250+ if (!(TESTBIT (track.itsClusterMap (), 0 )) && systCuts.triggerRequireL0 ) {
255251 return false ; // skip, doesn't have cluster in ITS L0
256252 }
257253 // systematic variations: trigger DCAxy
@@ -342,7 +338,7 @@ struct HStrangeCorrelation {
342338 }
343339
344340 float weight = (applyEfficiencyCorrection || applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
345- if (BIT_CHECK (doCorrelation, Index) && (!applyEfficiencyCorrection || efficiency != 0 )) {
341+ if (TESTBIT (doCorrelation, Index) && (!applyEfficiencyCorrection || efficiency != 0 )) {
346342 if (assocCandidate.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || assocCandidate.mcTrue (Index)) && (!doAssocPhysicalPrimary || assocCandidate.mcPhysicalPrimary ()) && !mixing && -massWindowConfigurations.maxBgNSigma < assocCandidate.invMassNSigma (Index) && assocCandidate.invMassNSigma (Index) < -massWindowConfigurations.minBgNSigma )
347343 histos.fill (HIST (" sameEvent/LeftBg/" ) + HIST (kV0names [Index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult, weight);
348344 if (assocCandidate.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || assocCandidate.mcTrue (Index)) && (!doAssocPhysicalPrimary || assocCandidate.mcPhysicalPrimary ()) && !mixing && -massWindowConfigurations.maxPeakNSigma < assocCandidate.invMassNSigma (Index) && assocCandidate.invMassNSigma (Index) < +massWindowConfigurations.maxPeakNSigma ) {
@@ -455,7 +451,7 @@ struct HStrangeCorrelation {
455451 efficiency = efficiency * hEfficiencyTrigger->Interpolate (pttrigger, trigg.eta ());
456452 }
457453 float weight = (applyEfficiencyCorrection || applyEfficiencyForTrigger) ? 1 . / efficiency : 1 .0f ;
458- if (BIT_CHECK (doCorrelation, Index + 3 ) && (!applyEfficiencyCorrection || efficiency != 0 )) {
454+ if (TESTBIT (doCorrelation, Index + 3 ) && (!applyEfficiencyCorrection || efficiency != 0 )) {
459455 if (assocCandidate.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || assocCandidate.mcTrue (Index)) && (!doAssocPhysicalPrimary || assocCandidate.mcPhysicalPrimary ()) && !mixing && -massWindowConfigurations.maxBgNSigma < assocCandidate.invMassNSigma (Index) && assocCandidate.invMassNSigma (Index) < -massWindowConfigurations.minBgNSigma )
460456 histos.fill (HIST (" sameEvent/LeftBg/" ) + HIST (kCascadenames [Index]), deltaphi, deltaeta, ptassoc, pttrigger, pvz, mult, weight);
461457 if (assocCandidate.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || assocCandidate.mcTrue (Index)) && (!doAssocPhysicalPrimary || assocCandidate.mcPhysicalPrimary ()) && !mixing && -massWindowConfigurations.maxPeakNSigma < assocCandidate.invMassNSigma (Index) && assocCandidate.invMassNSigma (Index) < +massWindowConfigurations.maxPeakNSigma )
@@ -575,23 +571,23 @@ struct HStrangeCorrelation {
575571 // set bitmap for convenience
576572 doCorrelation = 0 ;
577573 if (doCorrelationK0Short)
578- BIT_SET (doCorrelation, 0 );
574+ SETBIT (doCorrelation, 0 );
579575 if (doCorrelationLambda)
580- BIT_SET (doCorrelation, 1 );
576+ SETBIT (doCorrelation, 1 );
581577 if (doCorrelationAntiLambda)
582- BIT_SET (doCorrelation, 2 );
578+ SETBIT (doCorrelation, 2 );
583579 if (doCorrelationXiMinus)
584- BIT_SET (doCorrelation, 3 );
580+ SETBIT (doCorrelation, 3 );
585581 if (doCorrelationXiPlus)
586- BIT_SET (doCorrelation, 4 );
582+ SETBIT (doCorrelation, 4 );
587583 if (doCorrelationOmegaMinus)
588- BIT_SET (doCorrelation, 5 );
584+ SETBIT (doCorrelation, 5 );
589585 if (doCorrelationOmegaPlus)
590- BIT_SET (doCorrelation, 6 );
586+ SETBIT (doCorrelation, 6 );
591587 if (doCorrelationPion)
592- BIT_SET (doCorrelation, 7 );
588+ SETBIT (doCorrelation, 7 );
593589 if (doCorrelationHadron)
594- BIT_SET (doCorrelation, 8 );
590+ SETBIT (doCorrelation, 8 );
595591
596592 // Store axis ranges to prevent spurious filling
597593 // axis status:
@@ -778,7 +774,7 @@ struct HStrangeCorrelation {
778774
779775 bool hStrange = false ;
780776 for (int i = 0 ; i < 9 ; i++) {
781- if (BIT_CHECK (doCorrelation, i)) {
777+ if (TESTBIT (doCorrelation, i)) {
782778 histos.add (fmt::format (" h{}EtaVsPtVsPhi" , kParticlenames [i]).c_str (), " " , kTH3F , {axisPtQA, axisEta, axisPhi});
783779 histos.add (fmt::format (" h3d{}Spectrum" , kParticlenames [i]).c_str (), fmt::format (" h3d{}Spectrum" , kParticlenames [i]).c_str (), kTH3F , {axisPtQA, axisMult, axisMassNSigma});
784780 histos.add (fmt::format (" h3d{}SpectrumY" , kParticlenames [i]).c_str (), fmt::format (" h3d{}SpectrumY" , kParticlenames [i]).c_str (), kTH3F , {axisPtQA, axisMult, axisMassNSigma});
@@ -828,9 +824,9 @@ struct HStrangeCorrelation {
828824 }
829825 if (doprocessClosureTest) {
830826 for (int i = 0 ; i < 8 ; i++) {
831- if (BIT_CHECK (doCorrelation, i))
827+ if (TESTBIT (doCorrelation, i))
832828 histos.add (fmt::format (" ClosureTest/sameEvent/{}" , kParticlenames [i]).c_str (), " " , kTHnF , {axisDeltaPhiNDim, axisDeltaEtaNDim, axisPtAssocNDim, axisPtTriggerNDim, axisVtxZNDim, axisMultNDim});
833- if (BIT_CHECK (doCorrelation, i))
829+ if (TESTBIT (doCorrelation, i))
834830 histos.add (fmt::format (" ClosureTest/h{}" , kParticlenames [i]).c_str (), " " , kTH3F , {axisPtQA, axisEta, axisPhi});
835831 }
836832 histos.add (" ClosureTest/hTrigger" , " Trigger Tracks" , kTH3F , {axisPtQA, axisEta, axisMult});
@@ -908,7 +904,7 @@ struct HStrangeCorrelation {
908904 continue ;
909905 }
910906 auto binNumber = histos.get <TH1>(HIST (" axes/hPtTriggerAxis" ))->FindFixBin (track.pt ()) - 1 ;
911- BIT_SET (triggerPresenceMap[collision.globalIndex ()], binNumber);
907+ SETBIT (triggerPresenceMap[collision.globalIndex ()], binNumber);
912908 }
913909 }
914910 }
@@ -919,10 +915,15 @@ struct HStrangeCorrelation {
919915 {
920916 // ________________________________________________
921917 // skip if desired trigger not found
922- if (triggerPresenceMap.size () > 0 && !BIT_CHECK (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
918+ if (triggerPresenceMap.size () > 0 && !TESTBIT (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
923919 return ;
924920 }
925921
922+ if (applyEfficiencyCorrection) {
923+ auto bc = collision.bc_as <aod::BCsWithTimestamps>();
924+ initEfficiencyFromCCDB (bc);
925+ }
926+
926927 // ________________________________________________
927928 // Perform basic event selection
928929 if (!isCollisionSelected (collision)) {
@@ -965,7 +966,7 @@ struct HStrangeCorrelation {
965966 {
966967 // ________________________________________________
967968 // skip if desired trigger not found
968- if (triggerPresenceMap.size () > 0 && !BIT_CHECK (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
969+ if (triggerPresenceMap.size () > 0 && !TESTBIT (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
969970 return ;
970971 }
971972
@@ -1015,7 +1016,7 @@ struct HStrangeCorrelation {
10151016 }
10161017 float weight = applyEfficiencyCorrection ? 1 . / efficiency : 1 .0f ;
10171018 if (v0.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || v0.mcTrue (Index)) && (!doAssocPhysicalPrimary || v0.mcPhysicalPrimary ()) && (!applyEfficiencyCorrection || efficiency != 0 )) {
1018- if (BIT_CHECK (doCorrelation, Index)) {
1019+ if (TESTBIT (doCorrelation, Index)) {
10191020 histos.fill (HIST (" h3d" ) + HIST (kV0names [Index]) + HIST (" Spectrum" ), v0Data.pt (), collision.centFT0M (), v0.invMassNSigma (Index), weight);
10201021 if (std::abs (v0Data.rapidity (Index)) < 0.5 ) {
10211022 histos.fill (HIST (" h3d" ) + HIST (kV0names [Index]) + HIST (" SpectrumY" ), v0Data.pt (), collision.centFT0M (), v0.invMassNSigma (Index), weight);
@@ -1055,7 +1056,7 @@ struct HStrangeCorrelation {
10551056 {
10561057 // ________________________________________________
10571058 // skip if desired trigger not found
1058- if (triggerPresenceMap.size () > 0 && !BIT_CHECK (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
1059+ if (triggerPresenceMap.size () > 0 && !TESTBIT (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
10591060 return ;
10601061 }
10611062
@@ -1110,7 +1111,7 @@ struct HStrangeCorrelation {
11101111 }
11111112 float weight = applyEfficiencyCorrection ? 1 . / efficiency : 1 .0f ;
11121113 if (casc.compatible (Index, systCuts.dEdxCompatibility ) && (!doMCassociation || casc.mcTrue (Index)) && (!doAssocPhysicalPrimary || casc.mcPhysicalPrimary ()) && (!applyEfficiencyCorrection || efficiency != 0 )) {
1113- if (BIT_CHECK (doCorrelation, Index + 3 )) {
1114+ if (TESTBIT (doCorrelation, Index + 3 )) {
11141115 histos.fill (HIST (" h3d" ) + HIST (kCascadenames [Index]) + HIST (" Spectrum" ), cascData.pt (), collision.centFT0M (), casc.invMassNSigma (Index), weight);
11151116 if (std::abs (cascData.rapidity (Index)) < 0.5 ) {
11161117 histos.fill (HIST (" h3d" ) + HIST (kCascadenames [Index]) + HIST (" SpectrumY" ), cascData.pt (), collision.centFT0M (), casc.invMassNSigma (Index), weight);
@@ -1147,10 +1148,15 @@ struct HStrangeCorrelation {
11471148 {
11481149 // ________________________________________________
11491150 // skip if desired trigger not found
1150- if (triggerPresenceMap.size () > 0 && !BIT_CHECK (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
1151+ if (triggerPresenceMap.size () > 0 && !TESTBIT (triggerPresenceMap[collision.globalIndex ()], triggerBinToSelect)) {
11511152 return ;
11521153 }
11531154
1155+ if (applyEfficiencyCorrection) {
1156+ auto bc = collision.bc_as <aod::BCsWithTimestamps>();
1157+ initEfficiencyFromCCDB (bc);
1158+ }
1159+
11541160 // ________________________________________________
11551161 // Perform basic event selection
11561162 if (!isCollisionSelected (collision)) {
@@ -1188,13 +1194,17 @@ struct HStrangeCorrelation {
11881194
11891195 void processMixedEventHHadrons (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::PVMults> const & collisions,
11901196 aod::AssocHadrons const & assocHadrons, aod::TriggerTracks const & triggerTracks,
1191- TracksComplete const &)
1197+ TracksComplete const &, aod::BCsWithTimestamps const & )
11921198 {
11931199 for (auto const & [collision1, collision2] : soa::selfCombinations (colBinning, mixingParameter, -1 , collisions, collisions)) {
1194-
1200+ // ________________________________________________
1201+ if (applyEfficiencyCorrection) {
1202+ auto bc = collision1.bc_as <aod::BCsWithTimestamps>();
1203+ initEfficiencyFromCCDB (bc);
1204+ }
11951205 // ________________________________________________
11961206 // skip if desired trigger not found
1197- if (triggerPresenceMap.size () > 0 && (!BIT_CHECK (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !BIT_CHECK (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
1207+ if (triggerPresenceMap.size () > 0 && (!TESTBIT (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !TESTBIT (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
11981208 return ;
11991209 }
12001210
@@ -1237,7 +1247,7 @@ struct HStrangeCorrelation {
12371247 }
12381248 // ________________________________________________
12391249 // skip if desired trigger not found
1240- if (triggerPresenceMap.size () > 0 && (!BIT_CHECK (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !BIT_CHECK (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
1250+ if (triggerPresenceMap.size () > 0 && (!TESTBIT (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !TESTBIT (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
12411251 continue ;
12421252 }
12431253
@@ -1279,7 +1289,7 @@ struct HStrangeCorrelation {
12791289 }
12801290 // ________________________________________________
12811291 // skip if desired trigger not found
1282- if (triggerPresenceMap.size () > 0 && (!BIT_CHECK (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !BIT_CHECK (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
1292+ if (triggerPresenceMap.size () > 0 && (!TESTBIT (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !TESTBIT (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
12831293 continue ;
12841294 }
12851295
@@ -1310,13 +1320,17 @@ struct HStrangeCorrelation {
13101320 }
13111321 void processMixedEventHPions (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::PVMults> const & collisions,
13121322 soa::Join<aod::AssocHadrons, aod::AssocPID> const & assocPions, soa::Join<aod::TriggerTracks, aod::TriggerTrackExtras> const & triggerTracks,
1313- TracksComplete const &)
1323+ TracksComplete const &, aod::BCsWithTimestamps const & )
13141324 {
13151325 for (auto const & [collision1, collision2] : soa::selfCombinations (colBinning, mixingParameter, -1 , collisions, collisions)) {
1316-
1326+ // ________________________________________________
1327+ if (applyEfficiencyCorrection) {
1328+ auto bc = collision1.bc_as <aod::BCsWithTimestamps>();
1329+ initEfficiencyFromCCDB (bc);
1330+ }
13171331 // ________________________________________________
13181332 // skip if desired trigger not found
1319- if (triggerPresenceMap.size () > 0 && (!BIT_CHECK (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !BIT_CHECK (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
1333+ if (triggerPresenceMap.size () > 0 && (!TESTBIT (triggerPresenceMap[collision1.globalIndex ()], triggerBinToSelect) || !TESTBIT (triggerPresenceMap[collision2.globalIndex ()], triggerBinToSelect))) {
13201334 continue ;
13211335 }
13221336
@@ -1432,7 +1446,7 @@ struct HStrangeCorrelation {
14321446
14331447 // ________________________________________________
14341448 // skip if desired trigger not found
1435- if (triggerPresenceMap.size () > 0 && !BIT_CHECK (bestCollisionTriggerPresenceMap, triggerBinToSelect)) {
1449+ if (triggerPresenceMap.size () > 0 && !TESTBIT (bestCollisionTriggerPresenceMap, triggerBinToSelect)) {
14361450 return ;
14371451 }
14381452 if (!bestCollisionSel8)
@@ -1545,7 +1559,7 @@ struct HStrangeCorrelation {
15451559 }
15461560 // ________________________________________________
15471561 // skip if desired trigger not found
1548- if (triggerPresenceMap.size () > 0 && !BIT_CHECK (bestCollisionTriggerPresenceMap, triggerBinToSelect)) {
1562+ if (triggerPresenceMap.size () > 0 && !TESTBIT (bestCollisionTriggerPresenceMap, triggerBinToSelect)) {
15491563 return ;
15501564 }
15511565
@@ -1671,7 +1685,7 @@ struct HStrangeCorrelation {
16711685 continue ;
16721686 if (ptassoc < axisRanges[2 ][0 ] || ptassoc > axisRanges[2 ][1 ])
16731687 continue ;
1674- if (BIT_CHECK (doCorrelation, i))
1688+ if (TESTBIT (doCorrelation, i))
16751689 histos.fill (HIST (" ClosureTest/sameEvent/" ) + HIST (kParticlenames [Index]), computeDeltaPhi (gphitrigger, gphiassoc), deltaeta, ptassoc, pttrigger, bestCollisionVtxZ, bestCollisionFT0Mpercentile);
16761690 }
16771691 }
0 commit comments