Skip to content

Commit 175f5d4

Browse files
Merge branch 'AliceO2Group:master' into hInvMassK0Short_fake_improved
2 parents b99ac0b + b0d46ec commit 175f5d4

12 files changed

Lines changed: 297 additions & 280 deletions

File tree

Common/Core/RecoDecay.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,27 @@ struct RecoDecay {
279279
return cos;
280280
}
281281

282+
/// Calculates cosine of pointing angle in the {r, z} plane.
283+
/// \param posPV {x, y, z} position of the primary vertex
284+
/// \param posSV {x, y, z} position of the secondary vertex
285+
/// \param mom {x, y, z} momentum array
286+
/// \return cosine of pointing angle in {r, z}
287+
template <typename T, typename U, typename V>
288+
static double cpaRZ(const T& posPV, const U& posSV, const std::array<V, 3>& mom)
289+
{
290+
// CPARZ = (r . pz)/(|r| |pz|)
291+
auto lineDecay = std::array{sqrtSumOfSquares(posSV[0] - posPV[0], posSV[1] - posPV[1]), static_cast<double>(posSV[2] - posPV[2])};
292+
auto momRZ = std::array{sqrtSumOfSquares(mom[0], mom[1]), static_cast<double>(mom[2])};
293+
auto cos = dotProd(lineDecay, momRZ) / std::sqrt(mag2(lineDecay) * mag2(momRZ));
294+
if (cos < -1.) {
295+
return -1.;
296+
}
297+
if (cos > 1.) {
298+
return 1.;
299+
}
300+
return cos;
301+
}
302+
282303
/// Calculates proper lifetime times c.
283304
/// \note Promotes numbers to double before squaring to avoid precision loss in float multiplication.
284305
/// \param mom 3-momentum array

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ struct HfFilter { // Main struct for HF triggers
249249
std::array<std::shared_ptr<TH1>, kNCharmParticles> hBDTScorePrompt{};
250250
std::array<std::shared_ptr<TH1>, kNCharmParticles> hBDTScoreNonPrompt{};
251251
std::array<std::shared_ptr<TH2>, kNV0> hArmPod{};
252-
std::shared_ptr<TH2> hV0Selected, hMassVsCtCharmBaryonToXiPiPi;
252+
std::shared_ptr<TH2> hV0Selected;
253+
std::array<std::shared_ptr<TH2>, 2> hMassVsCtCharmBaryonToXi{};
253254
std::array<std::shared_ptr<TH2>, 2> hMassXi{}; // not tracked and tracked
254255
std::array<std::shared_ptr<TH2>, kNBeautyParticles> hCpaVsPtB{};
255256
std::array<std::shared_ptr<TH2>, kNBeautyParticles> hDecayLengthVsPtB{};
@@ -390,7 +391,8 @@ struct HfFilter { // Main struct for HF triggers
390391
hMassVsPtC[kNCharmParticles + 15] = registry.add<TH2>("fMassVsPtCharmBaryonToXiPi", "#it{M} vs. #it{p}_{T} distribution of triggered #Xi+#pi candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 15]});
391392
hMassVsPtC[kNCharmParticles + 16] = registry.add<TH2>("fMassVsPtCharmBaryonToXiKa", "#it{M} vs. #it{p}_{T} distribution of triggered #Xi+K candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 16]});
392393
hMassVsPtC[kNCharmParticles + 17] = registry.add<TH2>("fMassVsPtCharmBaryonToXiPiPi", "#it{M} vs. #it{p}_{T} distribution of triggered #Xi+#pi+#pi candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 17]});
393-
hMassVsCtCharmBaryonToXiPiPi = registry.add<TH2>("fMassVsCtCharmBaryonToXiPiPi", "#it{M} vs. ct distribution of triggered #Xi+#pi+#pi candidates;ct (cm);#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ctAxis, massAxisC[kNCharmParticles + 17]});
394+
hMassVsCtCharmBaryonToXi[0] = registry.add<TH2>("fMassVsCtCharmBaryonToXiPi", "#it{M} vs. ct distribution of triggered #Xi+#pi candidates;ct (cm);#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ctAxis, massAxisC[kNCharmParticles + 15]});
395+
hMassVsCtCharmBaryonToXi[1] = registry.add<TH2>("fMassVsCtCharmBaryonToXiPiPi", "#it{M} vs. ct distribution of triggered #Xi+#pi+#pi candidates;ct (cm);#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ctAxis, massAxisC[kNCharmParticles + 17]});
394396
// JPsi
395397
hMassVsPtC[kNCharmParticles + 18] = registry.add<TH2>("fMassVsPtJPsiToMuMu", "#it{M} vs. #it{p}_{T} distribution of triggered J/#psi to #mu#mu candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 18]});
396398
// Lc resonances
@@ -1949,10 +1951,10 @@ struct HfFilter { // Main struct for HF triggers
19491951
bool isSelXiBach{false};
19501952
if (requireStrangenessTracking->get(0u, 0u) > 0) {
19511953
if (hasStrangeTrack) {
1952-
isSelXiBach = helper.isSelectedXiBach(trackParCascTrack, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16]);
1954+
isSelXiBach = helper.isSelectedXiBach(trackParCascTrack, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16], hMassVsCtCharmBaryonToXi[0]);
19531955
}
19541956
} else {
1955-
isSelXiBach = helper.isSelectedXiBach(trackParCasc, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16]);
1957+
isSelXiBach = helper.isSelectedXiBach(trackParCasc, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16], hMassVsCtCharmBaryonToXi[0]);
19561958
}
19571959
if (isSelXiBach) {
19581960
keepEvent[kCharmBarToXiBach] = true;
@@ -1992,10 +1994,10 @@ struct HfFilter { // Main struct for HF triggers
19921994
bool isSelXiBachBach{false};
19931995
if (requireStrangenessTracking->get(0u, 1u) > 0) {
19941996
if (hasStrangeTrack) {
1995-
isSelXiBachBach = helper.isSelectedXiBachBach<3>(trackParCascTrack, {trackParBachelor, trackParBachelorSecond}, collision, dfStrangeness3, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXiPiPi);
1997+
isSelXiBachBach = helper.isSelectedXiBachBach<3>(trackParCascTrack, {trackParBachelor, trackParBachelorSecond}, collision, dfStrangeness3, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXi[1]);
19961998
}
19971999
} else { // vertex with only the two bachelors
1998-
isSelXiBachBach = helper.isSelectedXiBachBach<2>(trackParCasc, {trackParBachelor, trackParBachelorSecond}, collision, df2, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXiPiPi);
2000+
isSelXiBachBach = helper.isSelectedXiBachBach<2>(trackParCasc, {trackParBachelor, trackParBachelorSecond}, collision, df2, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXi[1]);
19992001
}
20002002
if (isSelXiBachBach) {
20012003
keepEvent[kCharmBarToXi2Bach] = true;

EventFiltering/PWGHF/HFFilterHelpers.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ constexpr float massDPlus = o2::constants::physics::MassDPlus;
274274
constexpr float massDs = o2::constants::physics::MassDS;
275275
constexpr float massLc = o2::constants::physics::MassLambdaCPlus;
276276
constexpr float massXic = o2::constants::physics::MassXiCPlus;
277+
constexpr float massXic0 = o2::constants::physics::MassXiC0;
277278
constexpr float massDStar = o2::constants::physics::MassDStar;
278279
constexpr float massBPlus = o2::constants::physics::MassBPlus;
279280
constexpr float massB0 = o2::constants::physics::MassB0;
@@ -717,7 +718,7 @@ class HfFilterHelper
717718
template <typename T1>
718719
bool isCharmHadronMassInSbRegions(T1 const& massHypo1, T1 const& massHypo2, const float& lowLimitSB, const float& upLimitSB);
719720
template <typename T, typename C, typename H2>
720-
bool isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa);
721+
bool isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa, H2 hMassVsCtXiPi);
721722
template <int Nprongs, typename T, typename C, typename H2>
722723
bool isSelectedXiBachBach(T const& trackParCasc, std::array<T, 2> const& trackParBachelor, C const& collision, o2::vertexing::DCAFitterN<Nprongs>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPiPi, H2 hMassVsCtXiPiPi);
723724
template <bool is4ThetaC = false, typename T>
@@ -2423,8 +2424,9 @@ inline bool HfFilterHelper::isCharmHadronMassInSbRegions(T1 const& massHypo1, T1
24232424
/// \param activateQA is the flag to activate the QA
24242425
/// \param hMassVsPtXiPi is the 2D histogram with pT vs mass(XiPi)
24252426
/// \param hMassVsPtXiKa is the 2D histogram with pT vs mass(XiKa)
2427+
/// \param hMassVsCtXiPi is the 2D histogram with ct vs mass(XiPi)
24262428
template <typename T, typename C, typename H2>
2427-
inline bool HfFilterHelper::isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa)
2429+
inline bool HfFilterHelper::isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa, H2 hMassVsCtXiPi)
24282430
{
24292431
bool isSelectedXiPi{false}, isSelectedXiKa{false};
24302432

@@ -2483,13 +2485,16 @@ inline bool HfFilterHelper::isSelectedXiBach(T const& trackParCasc, T const& tra
24832485
return false;
24842486
}
24852487

2486-
if (RecoDecay::distance(primVtx, vtx) < mDecLenMinXiBach[0]) {
2488+
auto decLenXiBach = RecoDecay::distance(primVtx, vtx);
2489+
if (decLenXiBach < mDecLenMinXiBach[0]) {
24872490
return false;
24882491
}
24892492

24902493
if (activateQA) {
24912494
if (isSelectedXiPi) {
2495+
auto ctXiBach = RecoDecay::ct(momXiBach, decLenXiBach, massXic0);
24922496
hMassVsPtXiPi->Fill(ptXiBach, massXiPi);
2497+
hMassVsCtXiPi->Fill(ctXiBach, massXiPi);
24932498
}
24942499
if (isSelectedXiKa) {
24952500
hMassVsPtXiKa->Fill(ptXiBach, massXiKa);

PWGCF/Flow/Tasks/flowEventPlane.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ struct SpectatorPlaneTableProducer {
180180
// CCDB
181181
Configurable<std::string> cCcdbUrl{"cCcdbUrl", "http://ccdb-test.cern.ch:8080", "url of ccdb"};
182182
Configurable<std::string> cCcdbPath{"cCcdbPath", "Users/y/ypatley/DFOO", "Path for ccdb-object"};
183+
Configurable<int64_t> nolaterthan{"nolaterthan", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"};
183184

184185
// Tracks
185186
Configurable<float> cTrackMinPt{"cTrackMinPt", 0.1, "p_{T} minimum"};
@@ -238,6 +239,8 @@ struct SpectatorPlaneTableProducer {
238239
// Set CCDB url
239240
ccdbService->setURL(cCcdbUrl.value);
240241
ccdbService->setCaching(true);
242+
ccdbService->setLocalObjectValidityChecking();
243+
ccdbService->setCreatedNotAfter(nolaterthan.value);
241244

242245
// Define axes
243246
const AxisSpec axisZDCEnergy{500, 0, 500, "ZD[AC] Signal"};
@@ -379,7 +382,7 @@ struct SpectatorPlaneTableProducer {
379382
// Load ZDC gain calibration
380383
if (cDoGainCalib) {
381384
std::string ccdbPath = static_cast<std::string>(cCcdbPath) + "/GainCalib" + "/Run" + std::to_string(cRunNum);
382-
auto ccdbObj = ccdbService->getForTimeStamp<TList>(ccdbPath, 1);
385+
auto ccdbObj = ccdbService->getForTimeStamp<TList>(ccdbPath, nolaterthan.value);
383386
CorrectionHistContainer.hGainCalib[0] = reinterpret_cast<TH2F*>(ccdbObj->FindObject("hZNASignal"));
384387
CorrectionHistContainer.hGainCalib[1] = reinterpret_cast<TH2F*>(ccdbObj->FindObject("hZNCSignal"));
385388
}
@@ -407,7 +410,7 @@ struct SpectatorPlaneTableProducer {
407410
std::string ccdbPath = static_cast<std::string>(cCcdbPath) + "/CorrItr_" + std::to_string(i + 1) + "/Run" + std::to_string(cRunNum);
408411

409412
// Get object from CCDB
410-
auto ccdbObject = ccdbService->getForTimeStamp<TList>(ccdbPath, 1);
413+
auto ccdbObject = ccdbService->getForTimeStamp<TList>(ccdbPath, nolaterthan.value);
411414

412415
// Check CCDB Object
413416
if (!ccdbObject) {

PWGCF/Flow/Tasks/flowMc.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "PWGMM/Mult/DataModel/Index.h" // for Particles2Tracks table
2121

2222
#include "Common/CCDB/EventSelectionParams.h"
23+
#include "Common/CCDB/RCTSelectionFlags.h"
2324
#include "Common/Core/RecoDecay.h"
2425
#include "Common/Core/TrackSelection.h"
2526
#include "Common/Core/TrackSelectionDefaults.h"
@@ -63,6 +64,7 @@
6364
using namespace o2;
6465
using namespace o2::framework;
6566
using namespace o2::framework::expressions;
67+
using namespace o2::aod::rctsel;
6668

6769
#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
6870

@@ -113,6 +115,7 @@ struct FlowMc {
113115
O2_DEFINE_CONFIGURABLE(cfgRecoEvSelkNoCollInTimeRangeStandard, bool, false, "no collisions in specified time range")
114116
O2_DEFINE_CONFIGURABLE(cfgRecoEvSelkNoCollInRofStandard, bool, false, "no other collisions in this Readout Frame with per-collision multiplicity above threshold")
115117
O2_DEFINE_CONFIGURABLE(cfgRecoEvSelkNoHighMultCollInPrevRof, bool, false, "veto an event if FT0C amplitude in previous ITS ROF is above threshold")
118+
O2_DEFINE_CONFIGURABLE(cfgEvSelRCTflags, std::string, "", "keep empty to disable, usage: 'CentralBarrelTracking', 'CBT_hadronPID' ")
116119

117120
Configurable<std::vector<double>> cfgTrackDensityP0{"cfgTrackDensityP0", std::vector<double>{0.6003720411, 0.6152630970, 0.6288860646, 0.6360694031, 0.6409494798, 0.6450540203, 0.6482117301, 0.6512592056, 0.6640008690, 0.6862631416, 0.7005738691, 0.7106567432, 0.7170728333}, "parameter 0 for track density efficiency correction"};
118121
Configurable<std::vector<double>> cfgTrackDensityP1{"cfgTrackDensityP1", std::vector<double>{-1.007592e-05, -8.932635e-06, -9.114538e-06, -1.054818e-05, -1.220212e-05, -1.312304e-05, -1.376433e-05, -1.412813e-05, -1.289562e-05, -1.050065e-05, -8.635725e-06, -7.380821e-06, -6.201250e-06}, "parameter 1 for track density efficiency correction"};
@@ -177,6 +180,8 @@ struct FlowMc {
177180
TRandom3* fRndm = new TRandom3(0);
178181
double epsilon = 1e-6;
179182

183+
RCTFlagsChecker rctChecker{"CBT"};
184+
180185
void init(InitContext&)
181186
{
182187
ccdb->setURL(ccdbUrl.value);
@@ -338,6 +343,9 @@ struct FlowMc {
338343
funcV4 = new TF1("funcV4", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
339344
funcV4->SetParameters(0.008845, 0.000259668, -3.24435e-06, 4.54837e-08, -6.01825e-10);
340345
}
346+
if (!cfgEvSelRCTflags.value.empty()) {
347+
rctChecker.init(cfgEvSelRCTflags.value.c_str()); // override initialzation
348+
}
341349
}
342350

343351
void loadCorrections(uint64_t timestamp)
@@ -435,6 +443,8 @@ struct FlowMc {
435443
if (cfgRecoEvSel8 && !collision.sel8()) {
436444
return 0;
437445
}
446+
if (!cfgEvSelRCTflags.value.empty() && !rctChecker(*collision))
447+
return 0;
438448
if (cfgRecoEvkNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
439449
// rejects collisions which are associated with the same "found-by-T0" bunch crossing
440450
// https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ struct FlowTask {
323323
std::unordered_map<int, TH2*> gHadronicRate;
324324
ctpRateFetcher mRateFetcher;
325325
TH2* gCurrentHadronicRate;
326-
RCTFlagsChecker rctChecker{"CentralBarrelTracking"};
326+
RCTFlagsChecker rctChecker{"CBT"};
327327

328328
// phi-EP correction
329329
std::vector<TF1*> funcEff;
@@ -759,7 +759,7 @@ struct FlowTask {
759759
LOGF(info, "DCAz pt-dependence function for Nch: %s", Form("%0.1f * %s", cfgTrackCuts->getData()[kDCAzNSigma][kTrCutNch], cfgFuncParas.cfgDCAzFunc->c_str()));
760760
}
761761
if (!cfgEvSelRCTflags.value.empty()) {
762-
rctChecker.init(cfgEvSelRCTflags.value.c_str(), true); // override initialzation
762+
rctChecker.init(cfgEvSelRCTflags.value.c_str()); // override initialzation
763763
}
764764
}
765765

0 commit comments

Comments
 (0)