Skip to content

Commit 032744c

Browse files
authored
[PWGCF] Add new process function in femto producer (#17388)
1 parent eba681b commit 032744c

4 files changed

Lines changed: 50 additions & 13 deletions

File tree

PWGCF/Femto/Core/collisionBuilder.h

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#include <Framework/HistogramRegistry.h>
3535
#include <Framework/Logger.h>
3636

37-
#include <sys/stat.h>
38-
39-
#include <Rtypes.h>
40-
4137
#include <algorithm>
4238
#include <cmath>
4339
#include <cstddef>
@@ -86,7 +82,7 @@ struct ConfCollisionBits : o2::framework::ConfigurableGroup {
8682
o2::framework::Configurable<std::vector<float>> sphericityMax{"sphericityMax", {}, "Maximum sphericity"};
8783
o2::framework::Configurable<std::vector<std::string>> triggers{"triggers", {}, "List of all triggers to be used"};
8884
o2::framework::Configurable<datatypes::QvecDetectorType> qvecDetector{"qvecDetector", 0, "Detector used to estimate the Q-vector: 0 -> FT0C, 1 -> FT0A"};
89-
o2::framework::Configurable<datatypes::QvecHarmonicType> qvecHarmonic{"qvecHarmonic", 2, "Harmonic n of the Q-vector and event plane angle Psi_n: 1 -> direct, 2 -> elliptic, 3 -> triangular"};
85+
o2::framework::Configurable<datatypes::QvecHarmonicType> qvecHarmonic{"qvecHarmonic", 2, "Harmonic n of the Q-vector and event plane angle Psi_n: 2 -> elliptic, 3 -> triangular"};
9086
};
9187

9288
struct ConfCcdb : o2::framework::ConfigurableGroup {
@@ -249,7 +245,13 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
249245

250246
// event shape
251247
mQvecDetector = static_cast<modes::QvecDetector>(config.qvecDetector.value);
248+
if (mQvecDetector >= modes::QvecDetector::kQvecDetectorLast) {
249+
LOG(fatal) << "Qvector Detector is not supported";
250+
}
252251
mQvecHarmonic = static_cast<modes::QvecHarmonic>(config.qvecHarmonic.value);
252+
if (mQvecHarmonic < modes::QvecHarmonic::kN2 || mQvecHarmonic >= modes::QvecHarmonic::kQvecHarmonicLast) {
253+
LOG(fatal) << "Qvector Harmonic is not supported";
254+
}
253255

254256
this->addSelection(kSel8, collisionSelectionNames.at(kSel8), config.sel8.value);
255257
this->addSelection(kNoSameBunchPileUp, collisionSelectionNames.at(kNoSameBunchPileUp), config.noSameBunchPileup.value);
@@ -366,20 +368,33 @@ class CollisionSelection : public baseselection::BaseSelection<float, o2::analys
366368
case modes::QvecDetector::kFT0A:
367369
mQvec = std::hypot(col.qvecFT0AReVec()[0], col.qvecFT0AImVec()[0]) * std::sqrt(col.sumAmplFT0A());
368370
break;
371+
case modes::QvecDetector::kQvecDetectorLast:
372+
LOG(fatal) << "Invalid Q-vector detector";
373+
break;
374+
default:
375+
LOG(fatal) << "Invalid Q-vector detector";
376+
break;
369377
}
370378
}
371379
[[nodiscard]] float getQvector() const { return mQvec; }
372380

373381
template <modes::System system, typename T>
374382
void setEventPlane(T const& col)
375383
{
376-
float harmonic = static_cast<float>(mQvecHarmonic);
384+
auto harmonic = static_cast<float>(mQvecHarmonic);
385+
int index = static_cast<int>(mQvecHarmonic) - 2; // get index in the qvector vector
377386
switch (mQvecDetector) {
378387
case modes::QvecDetector::kFT0C:
379-
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0CImVec()[0], col.qvecFT0CReVec()[0])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
388+
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0CImVec()[index], col.qvecFT0CReVec()[index])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
380389
break;
381390
case modes::QvecDetector::kFT0A:
382-
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0AImVec()[0], col.qvecFT0AReVec()[0])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
391+
mEventPlane = RecoDecay::constrainAngle((std::atan2(col.qvecFT0AImVec()[index], col.qvecFT0AReVec()[index])) / harmonic, 0, harmonic); // constrain between 0 and 2pi/harmonic
392+
break;
393+
case modes::QvecDetector::kQvecDetectorLast:
394+
LOG(fatal) << "Invalid Q-vector detector";
395+
break;
396+
default:
397+
LOG(fatal) << "Invalid Q-vector detector";
383398
break;
384399
}
385400
}

PWGCF/Femto/Core/modes.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,14 @@ enum class CharmHadron : o2::analysis::femto::datatypes::CharmHadronType {
180180

181181
enum class QvecDetector : o2::analysis::femto::datatypes::QvecDetectorType {
182182
kFT0C = 0,
183-
kFT0A = 1
183+
kFT0A = 1,
184+
kQvecDetectorLast = 2
184185
};
185186

186187
enum class QvecHarmonic : o2::analysis::femto::datatypes::QvecHarmonicType {
187-
kN1 = 1,
188188
kN2 = 2,
189-
kN3 = 3
189+
kN3 = 3,
190+
kQvecHarmonicLast = 4
190191
};
191192

192193
}; // namespace o2::analysis::femto::modes

PWGCF/Femto/Core/v0HistManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ constexpr std::array<histmanager::HistInfo<V0Hist>, kV0HistLast> HistTable = {
165165
{kCosPa, o2::framework::HistType::kTH1F, "hCosPa", "Cosine of pointing angle; cos(#alpha); Entries"},
166166
{kDecayDauDca, o2::framework::HistType::kTH1F, "hDauDca", "Daughter DCA at decay vertex ; DCA_{Decay vertex} (cm); Entries"},
167167
{kStrangeTofPosDau, o2::framework::HistType::kTH1F, "hStrangeTofPosDau", "Strange TOF of positive Daughter ; n#sigma_{TOF, strange}; Entries"},
168-
{kStrangeTofNegDau, o2::framework::HistType::kTH1F, "hStrangeTofNegDau", "Strange TOF of negative Daughter ; n#sigma+{TOF, strange}; Entries"},
168+
{kStrangeTofNegDau, o2::framework::HistType::kTH1F, "hStrangeTofNegDau", "Strange TOF of negative Daughter ; n#sigma_{TOF, strange}; Entries"},
169169
{kDecayVtxX, o2::framework::HistType::kTH1F, "hDecayVtxX", "X coordinate of decay vertex ; DV_{X} (cm); Entries"},
170170
{kDecayVtxY, o2::framework::HistType::kTH1F, "hDecayVtxY", "Y coordinate of decay vertex ; DV_{Y} (cm); Entries"},
171171
{kDecayVtxZ, o2::framework::HistType::kTH1F, "hDecayVtxZ", "Z coordinate of decay vertex ; DV_{Z} (cm); Entries"},

PWGCF/Femto/TableProducer/femtoProducer.cxx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "Common/DataModel/PIDResponseITS.h"
3535
#include "Common/DataModel/PIDResponseTOF.h"
3636
#include "Common/DataModel/PIDResponseTPC.h"
37+
#include "Common/DataModel/Qvectors.h"
3738
#include "Common/DataModel/TrackSelectionTables.h"
3839

3940
#include <CCDB/BasicCCDBManager.h>
@@ -77,7 +78,7 @@ using Run3FullPidTracks =
7778
o2::aod::pidTOFbeta, o2::aod::pidTOFmass>;
7879
using Run3McRecoTracks = soa::Join<Run3FullPidTracks, o2::aod::McTrackLabels>;
7980

80-
using Run3Vzeros = o2::soa::Join<o2::aod::V0Datas, o2::aod::V0TOFPIDs, o2::aod::V0TOFNSigmas>;
81+
using Run3Vzeros = o2::soa::Join<o2::aod::V0Datas, o2::aod::V0TOFNSigmas>;
8182
using Run3RecoVzeros = o2::soa::Join<Run3Vzeros, o2::aod::McV0Labels>;
8283

8384
using Run3D0s = soa::Join<aod::HfCand2Prong, aod::HfSelD0, aod::HfMlD0>;
@@ -204,13 +205,15 @@ struct FemtoProducer {
204205
// ---- guard: enabled tables vs. enabled process function ------------------
205206
if ((xiBuilder.fillAnyTable() || omegaBuilder.fillAnyTable()) &&
206207
(!doprocessTracksV0sCascadesRun3pp && !doprocessTracksV0sCascadesRun3PbPb &&
208+
!doprocessTracksV0sCascadesRun3PbPbWithEventShape &&
207209
!doprocessTracksV0sCascadesKinksRun3pp && !doprocessTracksV0sCascadesRun3ppMc &&
208210
!doprocessTracksV0sCascadesRun3PbPbMc)) {
209211
LOG(fatal) << "At least one cascade table is enabled, but wrong process function is enabled. Breaking...";
210212
}
211213
if ((lambdaBuilder.fillAnyTable() || antilambdaBuilder.fillAnyTable() || k0shortBuilder.fillAnyTable()) &&
212214
(!doprocessTracksV0sCascadesRun3pp && !doprocessTracksV0sCascadesRun3PbPb &&
213215
!doprocessTracksV0sRun3pp && !doprocessTracksV0sCascadesKinksRun3pp &&
216+
!doprocessTracksV0sCascadesRun3PbPbWithEventShape &&
214217
!doprocessTracksV0sRun3ppMc && !doprocessTracksV0sRun3PbPb && !doprocessTracksV0sRun3PbPbMc &&
215218
!doprocessTracksV0sCascadesRun3ppMc && !doprocessTracksV0sCascadesRun3PbPbMc &&
216219
!doprocessTracksV0sKinksRun3ppMc)) {
@@ -285,6 +288,7 @@ struct FemtoProducer {
285288
static_cast<int>(doprocessTracksV0sRun3PbPb) +
286289
static_cast<int>(doprocessTracksV0sCascadesRun3pp) +
287290
static_cast<int>(doprocessTracksV0sCascadesRun3PbPb) +
291+
static_cast<int>(doprocessTracksV0sCascadesRun3PbPbWithEventShape) +
288292
static_cast<int>(doprocessTracksKinksRun3pp) +
289293
static_cast<int>(doprocessTracksV0sCascadesKinksRun3pp) +
290294
static_cast<int>(doprocessTracksD0sRun3pp) +
@@ -531,6 +535,23 @@ struct FemtoProducer {
531535
}
532536
PROCESS_SWITCH(FemtoProducer, processTracksV0sCascadesRun3PbPb, "Provide tracks, v0s and cascades in PbPb collisions", false);
533537

538+
void processTracksV0sCascadesRun3PbPbWithEventShape(rawinputs::Run3PbPbCollisionsWithEventShape::iterator const& col,
539+
o2::aod::BCsWithTimestamps const& bcs,
540+
rawinputs::Run3FullPidTracks const& tracks,
541+
rawinputs::Run3Vzeros const& v0s,
542+
rawinputs::Run3Cascades const& cascades)
543+
{
544+
if (!processCollisions<modes::System::kPbPb_Run3>(col, bcs, tracks)) {
545+
return;
546+
}
547+
auto tracksWithItsPid = o2::soa::Attach<rawinputs::Run3FullPidTracks, o2::aod::pidits::ITSNSigmaEl, o2::aod::pidits::ITSNSigmaPi, o2::aod::pidits::ITSNSigmaKa,
548+
o2::aod::pidits::ITSNSigmaPr, o2::aod::pidits::ITSNSigmaDe, o2::aod::pidits::ITSNSigmaTr, o2::aod::pidits::ITSNSigmaHe>(tracks);
549+
processTracks<modes::System::kPbPb_Run3>(col, tracksWithItsPid);
550+
processV0s<modes::System::kPbPb_Run3>(col, tracks, v0s);
551+
processCascades<modes::System::kPbPb_Run3>(col, tracks, cascades);
552+
}
553+
PROCESS_SWITCH(FemtoProducer, processTracksV0sCascadesRun3PbPbWithEventShape, "Provide tracks, v0s and cascades in PbPb collisions with event shape information", false);
554+
534555
void processTracksKinksRun3pp(rawinputs::Run3PpCollisions::iterator const& col,
535556
o2::aod::BCsWithTimestamps const& bcs,
536557
rawinputs::Run3FullPidTracks const& tracks,

0 commit comments

Comments
 (0)