Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions PWGLF/Tasks/Resonances/deltaAnalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ struct DeltaAnalysis {

struct : ConfigurableGroup {
Configurable<bool> enableRotationalBackground{"enableRotationalBackground", true, "Compute rotational background by rotating pion phi near PI"};
Configurable<int> numberOfRotations{"numberOfRotations", 10, "Number of pion-phi rotations for background"};
Configurable<float> rotationAngleWindow{"rotationAngleWindow", 6.f, "Pion rotated by angles within PI +/- PI/rotationAngleWindow"};
Configurable<int> numberOfRotations{"numberOfRotations", 5, "Number of pion-phi rotations for background"};
Configurable<float> rotationAngleWindow{"rotationAngleWindow", 1.f, "Pion rotated by angles within PI +/- PI/rotationAngleWindow"};
Configurable<bool> applyRotationWeight{"applyRotationWeight", false, "Weight rotated pairs by 1/numberOfRotations"};
} rotBkg;

struct : ConfigurableGroup {
Expand All @@ -202,6 +203,7 @@ struct DeltaAnalysis {
ConfigurableAxis cfgMassAxis{"cfgMassAxis", {120, 1.0, 6.0}, "M_{inv} (GeV/#it{c}^{2})"};
ConfigurableAxis cfgMomentumAxis{"cfgMomentumAxis", {50, 0.0, 12.0}, "p (GeV/#it{c})"};
ConfigurableAxis cfgCentAxis{"cfgCentAxis", {VARIABLE_WIDTH, 0.f, 10.f, 20.f, 30.f, 40.f, 50.f, 60.f, 70.f, 80.f, 90.f, 100.f}, "Centrality (%)"};
ConfigurableAxis cfgCentAxisMixing{"cfgCentAxisMixing", {VARIABLE_WIDTH, 0.f, 10.f, 20.f, 30.f, 40.f, 50.f, 60.f, 70.f, 80.f, 90.f, 100.f}, "Centrality for mixing (%)"};
ConfigurableAxis cfgVtxAxis{"cfgVtxAxis", {VARIABLE_WIDTH, -12.f, -10.f, -9.f, -8.f, -7.f, -6.f, -5.f, -4.f, -3.f, -2.f, -1.f, 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f, 10.f, 12.f}, "Vertex z [cm]"};
ConfigurableAxis cfgRapAxis{"cfgRapAxis", {20, -1.0, 1.0}, "Rapidity y"};
} axes;
Expand Down Expand Up @@ -1211,15 +1213,15 @@ struct DeltaAnalysis {
}

// Rotational background: rotate the pion phi by PI +/- PI/rotationAngleWindow (numberOfRotations
// steps), keep proton, pion pT and pion pz fixed. Default template argument keeps the DATA call
// evenly spaced steps, window ends excluded), keep proton, pion pT and pion pz fixed. Default template argument keeps the DATA call
// site (fillInvariantMassHistogramsFromPools) unchanged; processMC calls fillRotationalBackground<true>.
template <bool isMCReco = false>
void fillRotationalBackground(int protonSign, int pionSign, float pxProton, float pyProton, float pzProton, float pionPhi, float pionPt, float pzPion, float centrality)
{
if (rotBkg.numberOfRotations <= 0) {
return;
}
const float weight = 1.f / static_cast<float>(rotBkg.numberOfRotations);
const float weight = rotBkg.applyRotationWeight ? 1.f / static_cast<float>(rotBkg.numberOfRotations) : 1.f;
const float rotWindowHalf = o2::constants::math::PI / static_cast<float>(rotBkg.rotationAngleWindow);

for (int iRot = 0; iRot < rotBkg.numberOfRotations; ++iRot) {
Expand All @@ -1228,7 +1230,7 @@ struct DeltaAnalysis {
rotAngle = o2::constants::math::PI;
} else {
rotAngle = (o2::constants::math::PI - rotWindowHalf) +
static_cast<float>(iRot) * (2.f * rotWindowHalf / static_cast<float>(rotBkg.numberOfRotations - 1));
static_cast<float>(iRot + 1) * (2.f * rotWindowHalf / static_cast<float>(rotBkg.numberOfRotations + 1));
}
const float newPhi = RecoDecay::constrainAngle(pionPhi + rotAngle, 0.f);
const float pxPionRot = pionPt * std::cos(newPhi);
Expand Down Expand Up @@ -1598,7 +1600,7 @@ struct DeltaAnalysis {
template <typename BinningType>
void runMixingWithBinning(EventCandidates const& collisions, TrackCandidates const& tracks, bool isMC)
{
BinningType binning{{axes.cfgVtxAxis, axes.cfgCentAxis}, true};
BinningType binning{{axes.cfgVtxAxis, axes.cfgCentAxisMixing}, true};
const int nMixedEvents = mixingCfg.cfgNoMixedEvents;
auto tracksTuple = std::make_tuple(tracks);
SameKindPair<EventCandidates, TrackCandidates, BinningType> mixingPair{binning, nMixedEvents, -1, collisions, tracksTuple, &cache};
Expand Down
Loading