Skip to content

Commit d1e8667

Browse files
vkuceraalibuild
andauthored
[PWGHF] Add self-contained derived-data format for B+ (AliceO2Group#8485)
Co-authored-by: ALICE Builder <[email protected]>
1 parent c620a21 commit d1e8667

File tree

9 files changed

+974
-131
lines changed

9 files changed

+974
-131
lines changed

PWGHF/D2H/Tasks/taskBplus.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
/// \author Antonio Palasciano <[email protected]>, Università degli Studi di Bari & INFN, Sezione di Bari
1919
/// \author Deepa Thomas <[email protected]>, UT Austin
2020

21+
#include <vector>
22+
2123
#include "CommonConstants/PhysicsConstants.h"
2224
#include "Framework/AnalysisTask.h"
2325
#include "Framework/HistogramRegistry.h"
@@ -263,7 +265,7 @@ struct HfTaskBplus {
263265

264266
float ptProngs[2], yProngs[2], etaProngs[2];
265267
int counter = 0;
266-
for (const auto& daught : particle.daughters_as<aod::McParticles>()) {
268+
for (const auto& daught : particle.daughters_as<soa::Join<aod::McParticles, aod::HfCandBplusMcGen>>()) {
267269
ptProngs[counter] = daught.pt();
268270
etaProngs[counter] = daught.eta();
269271
yProngs[counter] = RecoDecay::y(daught.pVector(), pdg->Mass(daught.pdgCode()));

PWGHF/DataModel/DerivedTables.h

Lines changed: 311 additions & 41 deletions
Large diffs are not rendered by default.

PWGHF/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ o2physics_add_dpl_workflow(tree-creator-dstar-to-d0-pi
276276

277277
# Derived-data creators
278278

279+
o2physics_add_dpl_workflow(derived-data-creator-bplus-to-d0-pi
280+
SOURCES derivedDataCreatorBplusToD0Pi.cxx
281+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
282+
COMPONENT_NAME Analysis)
283+
279284
o2physics_add_dpl_workflow(derived-data-creator-d0-to-k-pi
280285
SOURCES derivedDataCreatorD0ToKPi.cxx
281286
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

PWGHF/TableProducer/candidateCreatorBplus.cxx

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
/// \author Deepa Thomas <[email protected]>, UT Austin
1919
/// \author Antonio Palasciano <[email protected]>, Università degli Studi di Bari & INFN, Sezione di Bari
2020

21+
#include <memory>
22+
#include <string>
23+
#include <vector>
24+
2125
#include "CommonConstants/PhysicsConstants.h"
2226
#include "DCAFitter/DCAFitterN.h"
2327
#include "Framework/AnalysisTask.h"
@@ -79,9 +83,6 @@ struct HfCandidateCreatorBplus {
7983
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
8084
int runNumber;
8185

82-
double massPi{0.};
83-
double massD0{0.};
84-
double massBplus{0.};
8586
double invMass2D0PiMin{0.};
8687
double invMass2D0PiMax{0.};
8788
double bz{0.};
@@ -110,11 +111,8 @@ struct HfCandidateCreatorBplus {
110111
void init(InitContext const&)
111112
{
112113
// invariant-mass window cut
113-
massPi = MassPiPlus;
114-
massD0 = MassD0;
115-
massBplus = MassBPlus;
116-
invMass2D0PiMin = (massBplus - invMassWindowBplus) * (massBplus - invMassWindowBplus);
117-
invMass2D0PiMax = (massBplus + invMassWindowBplus) * (massBplus + invMassWindowBplus);
114+
invMass2D0PiMin = (MassBPlus - invMassWindowBplus) * (MassBPlus - invMassWindowBplus);
115+
invMass2D0PiMax = (MassBPlus + invMassWindowBplus) * (MassBPlus + invMassWindowBplus);
118116

119117
// Initialise fitter for B vertex
120118
dfB.setPropagateToPCA(propagateToPCA);
@@ -173,16 +171,8 @@ struct HfCandidateCreatorBplus {
173171
aod::BCsWithTimestamps const&)
174172
{
175173

176-
static int nCol = 0;
177-
178174
for (const auto& collision : collisions) {
179175
auto primaryVertex = getPrimaryVertex(collision);
180-
181-
if (nCol % 10000 == 0) {
182-
LOG(debug) << nCol << " collisions parsed";
183-
}
184-
nCol++;
185-
186176
/// Set the magnetic field from ccdb.
187177
/// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator,
188178
/// but this is not true when running on Run2 data/MC already converted into AO2Ds.
@@ -294,7 +284,6 @@ struct HfCandidateCreatorBplus {
294284
auto trackParCovPi = getTrackParCov(trackPion);
295285
std::array<float, 3> pVecD0 = {0., 0., 0.};
296286
std::array<float, 3> pVecBach = {0., 0., 0.};
297-
std::array<float, 3> pVecBCand = {0., 0., 0.};
298287

299288
// find the DCA between the D0 and the bachelor track, for B+
300289
hCandidatesB->Fill(SVFitting::BeforeFit);
@@ -318,8 +307,6 @@ struct HfCandidateCreatorBplus {
318307
auto covMatrixPCA = dfB.calcPCACovMatrixFlat();
319308
hCovSVXX->Fill(covMatrixPCA[0]); // FIXME: Calculation of errorDecayLength(XY) gives wrong values without this line.
320309

321-
pVecBCand = RecoDecay::pVec(pVecD0, pVecBach);
322-
323310
// get track impact parameters
324311
// This modifies track momenta!
325312
auto covMatrixPV = primaryVertex.getCov();
@@ -336,7 +323,7 @@ struct HfCandidateCreatorBplus {
336323
auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.));
337324

338325
// compute invariant mass square and apply selection
339-
auto invMass2D0Pi = RecoDecay::m2(std::array{pVecD0, pVecBach}, std::array{massD0, massPi});
326+
auto invMass2D0Pi = RecoDecay::m2(std::array{pVecD0, pVecBach}, std::array{MassD0, MassPiPlus});
340327
if ((invMass2D0Pi < invMass2D0PiMin) || (invMass2D0Pi > invMass2D0PiMax)) {
341328
continue;
342329
}

0 commit comments

Comments
 (0)