Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions PWGCF/Femto/Core/cascadeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ struct ConfOmegaBits : o2::framework::ConfigurableGroup {

#undef CASCADE_DEFAULT_BITS

#define CASCADE_DEFAULT_SELECTION(defaultMassMin, defaultMassMax, defaultPdgCode) \
o2::framework::Configurable<int> pdgCode{"pdgCode", defaultPdgCode, "Track PDG code"}; \
o2::framework::Configurable<int> sign{"sign", 1, "Sign of the charge of the Cascade "}; \
o2::framework::Configurable<float> ptMin{"ptMin", 0.f, "Minimum pT"}; \
o2::framework::Configurable<float> ptMax{"ptMax", 999.f, "Maximum pT"}; \
o2::framework::Configurable<float> etaMin{"etaMin", -10.f, "Minimum eta"}; \
o2::framework::Configurable<float> etaMax{"etaMax", 10.f, "Maximum eta"}; \
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum eta"}; \
o2::framework::Configurable<float> phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \
o2::framework::Configurable<float> massMin{"massMin", defaultMassMin, "Minimum invariant mass for Cascade"}; \
o2::framework::Configurable<float> massMax{"massMax", defaultMassMax, "Maximum invariant mass for Cascade"}; \
#define CASCADE_DEFAULT_SELECTION(defaultMassMin, defaultMassMax, defaultPdgCode) \
o2::framework::Configurable<int> pdgCodeAbs{"pdgCodeAbs", defaultPdgCode, "Cascade PDG code. Set sign to +1 to select antiparticle"}; \
o2::framework::Configurable<int> sign{"sign", -1, "Sign of the charge of the Cascade"}; \
o2::framework::Configurable<float> ptMin{"ptMin", 0.f, "Minimum pT"}; \
o2::framework::Configurable<float> ptMax{"ptMax", 999.f, "Maximum pT"}; \
o2::framework::Configurable<float> etaMin{"etaMin", -10.f, "Minimum eta"}; \
o2::framework::Configurable<float> etaMax{"etaMax", 10.f, "Maximum eta"}; \
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum eta"}; \
o2::framework::Configurable<float> phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \
o2::framework::Configurable<float> massMin{"massMin", defaultMassMin, "Minimum invariant mass for Cascade"}; \
o2::framework::Configurable<float> massMax{"massMax", defaultMassMax, "Maximum invariant mass for Cascade"}; \
o2::framework::Configurable<o2::aod::femtodatatypes::CascadeMaskType> mask{"mask", 0x0, "Bitmask for cascade selection"};

struct ConfXiSelection : o2::framework::ConfigurableGroup {
Expand Down
114 changes: 98 additions & 16 deletions PWGCF/Femto/Core/cascadeHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,41 +173,122 @@ class CascadeHistManager
CascadeHistManager() = default;
~CascadeHistManager() = default;

template <modes::Mode mode>
template <modes::Mode mode, typename T>
void init(o2::framework::HistogramRegistry* registry,
std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const& cascadeSpecs,
T const& ConfCascadeSelection,
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& BachelorSpecs,
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& PosDauSpecs,
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& NegDauSpecs)
{
mHistogramRegistry = registry;
mBachelorManager.template init<mode>(registry, BachelorSpecs, AbsChargeDaughters);
mPosDauManager.template init<mode>(registry, PosDauSpecs, AbsChargeDaughters);
mNegDauManager.template init<mode>(registry, NegDauSpecs, AbsChargeDaughters);
mPdgCode = std::abs(ConfCascadeSelection.pdgCodeAbs.value);

int bachelorPdgCodeAbs = 0;
int posDauPdgCodeAbs = 0;
int negDauPdgCodeAbs = 0;
const int absCharge = 1;
int signBachelor = 0;
const int signPlus = 1;
const int signMinus = -1;

if (mPdgCode == PDG_t::kXiMinus) {
if (ConfCascadeSelection.sign.value < 0) {
bachelorPdgCodeAbs = std::abs(PDG_t::kPiMinus);
signBachelor = -1;
posDauPdgCodeAbs = std::abs(PDG_t::kProton);
negDauPdgCodeAbs = std::abs(PDG_t::kPiMinus);
} else {
mPdgCode = -1 * mPdgCode; // Xi+ has negative pdg code
bachelorPdgCodeAbs = std::abs(PDG_t::kPiPlus);
signBachelor = 1;
posDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
negDauPdgCodeAbs = std::abs(PDG_t::kProtonBar);
}
} else if (mPdgCode == PDG_t::kOmegaMinus) {
if (ConfCascadeSelection.sign.value < 0) {
bachelorPdgCodeAbs = std::abs(PDG_t::kKMinus);
signBachelor = -1;
posDauPdgCodeAbs = std::abs(PDG_t::kProton);
negDauPdgCodeAbs = std::abs(PDG_t::kPiMinus);
} else {
mPdgCode = -1 * mPdgCode; // Omega+ has negative pdg code
bachelorPdgCodeAbs = std::abs(PDG_t::kKPlus);
signBachelor = 1;
posDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
negDauPdgCodeAbs = std::abs(PDG_t::kProtonBar);
}
} else {
LOG(fatal) << "PDG code for Cascade has to be either Xi or Omega";
}

mBachelorManager.template init<mode>(registry, BachelorSpecs, absCharge, signBachelor, bachelorPdgCodeAbs);
mPosDauManager.template init<mode>(registry, PosDauSpecs, absCharge, signPlus, posDauPdgCodeAbs);
mNegDauManager.template init<mode>(registry, NegDauSpecs, absCharge, signMinus, negDauPdgCodeAbs);

if constexpr (modes::isFlagSet(mode, modes::Mode::kAnalysis)) {
initAnalysis(cascadeSpecs);
}
if constexpr (modes::isFlagSet(mode, modes::Mode::kQa)) {
initQa(cascadeSpecs);
}
}

template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4>
template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5>
void init(o2::framework::HistogramRegistry* registry,
std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const& cascadeSpecs,
T1 const& CascadeConfBinningQa,
T1 const& ConfCascadeSelection,
T2 const& ConfCascadeBinningQa,
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& BachelorSpecs,
T2 const& BachelorConfBinningQa,
T3 const& ConfBachelorQaBinning,
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& PosDauSpecs,
T3 const& PosDauConfBinningQa,
T4& ConfPosDauQaBinning,
std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const& NegDauSpecs,
T4 const& NegDauConfBinningQa)
T5& ConfNegDauQaBinning)
{
mHistogramRegistry = registry;
mBachelorManager.template init<mode>(registry, BachelorSpecs, BachelorConfBinningQa, AbsChargeDaughters);
mPosDauManager.template init<mode>(registry, PosDauSpecs, PosDauConfBinningQa, AbsChargeDaughters);
mNegDauManager.template init<mode>(registry, NegDauSpecs, NegDauConfBinningQa, AbsChargeDaughters);
this->enableOptionalHistograms(CascadeConfBinningQa);
mPdgCode = std::abs(ConfCascadeSelection.pdgCodeAbs.value);
this->enableOptionalHistograms(ConfCascadeBinningQa);

int bachelorPdgCodeAbs = 0;
int posDauPdgCodeAbs = 0;
int negDauPdgCodeAbs = 0;
const int absCharge = 1;
int signBachelor = 0;
const int signPlus = 1;
const int signMinus = -1;

if (mPdgCode == PDG_t::kXiMinus) {
if (ConfCascadeSelection.sign.value < 0) {
bachelorPdgCodeAbs = std::abs(PDG_t::kPiMinus);
signBachelor = -1;
posDauPdgCodeAbs = std::abs(PDG_t::kProton);
negDauPdgCodeAbs = std::abs(PDG_t::kPiMinus);
} else {
mPdgCode = -1 * mPdgCode; // Xi+ has negative pdg code
bachelorPdgCodeAbs = std::abs(PDG_t::kPiPlus);
signBachelor = 1;
posDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
negDauPdgCodeAbs = std::abs(PDG_t::kProtonBar);
}
} else if (mPdgCode == PDG_t::kOmegaMinus) {
if (ConfCascadeSelection.sign.value < 0) {
bachelorPdgCodeAbs = std::abs(PDG_t::kKMinus);
signBachelor = -1;
posDauPdgCodeAbs = std::abs(PDG_t::kProton);
negDauPdgCodeAbs = std::abs(PDG_t::kPiMinus);
} else {
mPdgCode = -1 * mPdgCode; // Omega+ has negative pdg code
bachelorPdgCodeAbs = std::abs(PDG_t::kKPlus);
signBachelor = 1;
posDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
negDauPdgCodeAbs = std::abs(PDG_t::kProtonBar);
}
} else {
LOG(fatal) << "PDG code for Cascade has to be either Xi or Omega";
}

mBachelorManager.template init<mode>(registry, BachelorSpecs, absCharge, signBachelor, bachelorPdgCodeAbs, ConfBachelorQaBinning);
mPosDauManager.template init<mode>(registry, PosDauSpecs, absCharge, signPlus, posDauPdgCodeAbs, ConfPosDauQaBinning);
mNegDauManager.template init<mode>(registry, NegDauSpecs, absCharge, signMinus, negDauPdgCodeAbs, ConfNegDauQaBinning);

if constexpr (modes::isFlagSet(mode, modes::Mode::kAnalysis)) {
initAnalysis(cascadeSpecs);
}
Expand Down Expand Up @@ -321,6 +402,7 @@ class CascadeHistManager
trackhistmanager::TrackHistManager<bachelorPrefix> mBachelorManager;
trackhistmanager::TrackHistManager<posDauPrefix> mPosDauManager;
trackhistmanager::TrackHistManager<negDauPrefix> mNegDauManager;
int mPdgCode = 0;
};
}; // namespace cascadehistmanager
}; // namespace o2::analysis::femto
Expand Down
17 changes: 12 additions & 5 deletions PWGCF/Femto/Core/collisionBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ struct ConfCcdb : o2::framework::ConfigurableGroup {
o2::framework::Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "URL to ccdb"};
o2::framework::Configurable<std::string> grpPath{"grpPath", "GLO/Config/GRPMagField", "Path to GRP object (Run3 -> GLO/Config/GRPMagField, Run2 -> GLO/GRP/GRP"};
o2::framework::Configurable<std::string> triggerPath{"triggerPath", "EventFiltering/Zorro/", "CCDB path for trigger information"};
o2::framework::Configurable<int> magFieldForced{"magFieldForced", 0, "Force value for magnetic field (kG). This will skip calls to the ccdb. Deactivate by setting value to 0"};
};

struct ConfCollisionRctFlags : o2::framework::ConfigurableGroup {
Expand Down Expand Up @@ -390,6 +391,7 @@ class CollisionBuilder
mUseRctFlags = true;
mRctFlagsChecker.init(confRct.label.value, confRct.useZdc.value, confRct.treatLimitedAcceptanceAsBad.value);
}
mMagFieldForced = confCcdb.magFieldForced.value;
mGrpPath = confCcdb.grpPath.value;
mSubGeneratorId = confFilter.subGeneratorId.value;

Expand All @@ -403,12 +405,16 @@ class CollisionBuilder
{
if (mRunNumber != bc.runNumber()) {
mRunNumber = bc.runNumber();
static o2::parameters::GRPMagField* grpo = nullptr;
grpo = ccdb->template getForRun<o2::parameters::GRPMagField>(mGrpPath, mRunNumber);
if (grpo == nullptr) {
LOG(fatal) << "GRP object not found for Run " << mRunNumber;
if (mMagFieldForced == 0) {
static o2::parameters::GRPMagField* grpo = nullptr;
grpo = ccdb->template getForRun<o2::parameters::GRPMagField>(mGrpPath, mRunNumber);
if (grpo == nullptr) {
LOG(fatal) << "GRP object not found for Run " << mRunNumber;
}
mMagField = static_cast<int>(grpo->getNominalL3Field()); // get magnetic field in kG
} else {
mMagField = mMagFieldForced;
}
mMagField = static_cast<int>(grpo->getNominalL3Field()); // get magnetic field in kG

if (mUseTrigger) {
mZorro.initCCDB(ccdb.service, mRunNumber, bc.timestamp(), mTriggerNames);
Expand Down Expand Up @@ -534,6 +540,7 @@ class CollisionBuilder
bool mUseTrigger = false;
int mRunNumber = -1;
std::string mGrpPath = std::string("");
int mMagFieldForced = 0;
int mMagField = 0;
aod::rctsel::RCTFlagsChecker mRctFlagsChecker;
bool mUseRctFlags = false;
Expand Down
39 changes: 25 additions & 14 deletions PWGCF/Femto/Core/collisionHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ enum ColHist {
kCentVsSphericity,
kMultVsSphericity,
// mc
kMcCent,
kMcMult,
kTrueCentVsCent,
kTrueMultVsMult,
kColHistLast
};

Expand All @@ -80,8 +80,8 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
{kMultVsSphericity, o2::framework::kTH2F, "hMultVsSphericity", "Multiplicity vs Sphericity; Multiplicity; Sphericity"},
{kCentVsSphericity, o2::framework::kTH2F, "hCentVsSphericity", "Centrality vs Sphericity; Centrality (%); Sphericity"},
// mc
{kMcCent, o2::framework::kTH1F, "hMcCent", "Monte Carlo Centrality; Centrality (%); Entries"},
{kMcMult, o2::framework::kTH1F, "hMcMult", "Monte Carlo Multiplicity; Multiplicity; Entries"},
{kTrueCentVsCent, o2::framework::kTH2F, "hTrueCentVsCent", "True centrality vs centrality; Centrality_{True} (%); Centrality (%)"},
{kTrueMultVsMult, o2::framework::kTH2F, "hTrueMultVsMult", "True multiplicity vs multiplicity; Multiplicity_{True}; Multiplicity"},
}};

#define COL_HIST_ANALYSIS_MAP(conf) \
Expand All @@ -102,9 +102,9 @@ constexpr std::array<histmanager::HistInfo<ColHist>, kColHistLast> HistTable = {
{kMultVsSphericity, {confAnalysis.mult, confQa.sphericity}}, \
{kCentVsSphericity, {confBinningAnalysis.cent, confQa.sphericity}},

#define COL_HIST_MC_QA_MAP(conf) \
{kMcMult, {conf.mult}}, \
{kMcCent, {conf.cent}},
#define COL_HIST_MC_MAP(conf) \
{kTrueMultVsMult, {conf.mult, conf.mult}}, \
{kTrueCentVsCent, {conf.cent, conf.cent}},

template <typename T>
auto makeColHistSpecMap(const T& confBinningAnalysis)
Expand All @@ -113,6 +113,14 @@ auto makeColHistSpecMap(const T& confBinningAnalysis)
COL_HIST_ANALYSIS_MAP(confBinningAnalysis)};
}

template <typename T>
auto makeColMcHistSpecMap(const T& confBinningAnalysis)
{
return std::map<ColHist, std::vector<framework::AxisSpec>>{
COL_HIST_ANALYSIS_MAP(confBinningAnalysis)
COL_HIST_MC_MAP(confBinningAnalysis)};
}

template <typename T1, typename T2>
auto makeColQaHistSpecMap(const T1& confBinningAnalysis, const T2& confBinningQa)
{
Expand All @@ -127,12 +135,12 @@ auto makeColMcQaHistSpecMap(const T1& confBinningAnalysis, const T2& confBinning
return std::map<ColHist, std::vector<framework::AxisSpec>>{
COL_HIST_ANALYSIS_MAP(confBinningAnalysis)
COL_HIST_QA_MAP(confBinningAnalysis, confBinningQa)
COL_HIST_MC_QA_MAP(confBinningAnalysis)};
COL_HIST_MC_MAP(confBinningAnalysis)};
}

#undef COL_HIST_ANALYSIS_MAP
#undef COL_HIST_QA_MAP
#undef COL_HIST_MC_QA_MAP
#undef COL_HIST_MC_MAP

struct ConfCollisionBinning : o2::framework::ConfigurableGroup {
std::string prefix = std::string("CollisionBinning");
Expand Down Expand Up @@ -240,8 +248,8 @@ class CollisionHistManager
void initMc(std::map<ColHist, std::vector<o2::framework::AxisSpec>> const& Specs)
{
std::string mcDir = std::string(ColMcDir);
mHistogramRegistry->add(mcDir + getHistNameV2(kMcMult, HistTable), getHistDesc(kMcMult, HistTable), getHistType(kMcMult, HistTable), {Specs.at(kMcMult)});
mHistogramRegistry->add(mcDir + getHistNameV2(kMcCent, HistTable), getHistDesc(kMcCent, HistTable), getHistType(kMcCent, HistTable), {Specs.at(kMcCent)});
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueMultVsMult, HistTable), getHistDesc(kTrueMultVsMult, HistTable), getHistType(kTrueMultVsMult, HistTable), {Specs.at(kTrueMultVsMult)});
mHistogramRegistry->add(mcDir + getHistNameV2(kTrueCentVsCent, HistTable), getHistDesc(kTrueCentVsCent, HistTable), getHistType(kTrueCentVsCent, HistTable), {Specs.at(kTrueCentVsCent)});
}

template <typename T>
Expand Down Expand Up @@ -273,9 +281,12 @@ class CollisionHistManager
template <typename T1, typename T2>
void fillMc(T1 const& col, T2 const& /*mcCols*/)
{
auto genCol = col.template fMcCol_as<T2>();
mHistogramRegistry->fill(HIST(ColMcDir) + HIST(getHistName(kMcMult, HistTable)), genCol.multMc());
mHistogramRegistry->fill(HIST(ColMcDir) + HIST(getHistName(kMcCent, HistTable)), genCol.centMc());
if (!col.has_fMcCol()) {
return;
}
auto mcCol = col.template fMcCol_as<T2>();
mHistogramRegistry->fill(HIST(ColMcDir) + HIST(getHistName(kTrueMultVsMult, HistTable)), mcCol.mult(), col.mult());
mHistogramRegistry->fill(HIST(ColMcDir) + HIST(getHistName(kTrueCentVsCent, HistTable)), mcCol.cent(), col.cent());
}

o2::framework::HistogramRegistry* mHistogramRegistry = nullptr;
Expand Down
24 changes: 12 additions & 12 deletions PWGCF/Femto/Core/kinkBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ struct ConfSigmaPlusBits : o2::framework::ConfigurableGroup {
#undef KINK_DEFAULT_BITS

// base selection for analysis task for kinks
#define KINK_DEFAULT_SELECTIONS(defaultMassMin, defaultMassMax, defaultPdgCode) \
o2::framework::Configurable<int> pdgCode{"pdgCode", defaultPdgCode, "Kink PDG code"}; \
o2::framework::Configurable<float> ptMin{"ptMin", 0.f, "Minimum pT"}; \
o2::framework::Configurable<float> ptMax{"ptMax", 999.f, "Maximum pT"}; \
o2::framework::Configurable<float> etaMin{"etaMin", -10.f, "Minimum eta"}; \
o2::framework::Configurable<float> etaMax{"etaMax", 10.f, "Maximum eta"}; \
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum phi"}; \
o2::framework::Configurable<float> phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \
o2::framework::Configurable<float> massMin{"massMin", defaultMassMin, "Minimum invariant mass for Sigma"}; \
o2::framework::Configurable<float> massMax{"massMax", defaultMassMax, "Maximum invariant mass for Sigma"}; \
#define KINK_DEFAULT_SELECTIONS(defaultMassMin, defaultMassMax, defaultPdgCode) \
o2::framework::Configurable<int> pdgCodeAbs{"pdgCodeAbs", defaultPdgCode, "PDG code. Select antipartilce via sign"}; \
o2::framework::Configurable<float> ptMin{"ptMin", 0.f, "Minimum pT"}; \
o2::framework::Configurable<float> ptMax{"ptMax", 999.f, "Maximum pT"}; \
o2::framework::Configurable<float> etaMin{"etaMin", -10.f, "Minimum eta"}; \
o2::framework::Configurable<float> etaMax{"etaMax", 10.f, "Maximum eta"}; \
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum phi"}; \
o2::framework::Configurable<float> phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \
o2::framework::Configurable<float> massMin{"massMin", defaultMassMin, "Minimum invariant mass for Sigma"}; \
o2::framework::Configurable<float> massMax{"massMax", defaultMassMax, "Maximum invariant mass for Sigma"}; \
o2::framework::Configurable<o2::aod::femtodatatypes::KinkMaskType> mask{"mask", 0x0, "Bitmask for kink selection"};

// base selection for analysis task for sigmas
Expand Down Expand Up @@ -498,11 +498,11 @@ class KinkBuilder

if constexpr (modes::isEqual(kinkType, modes::Kink::kSigma)) {
fillSigma(collisionProducts, kinkProducts, kink, daughterIndex);
mcBuilder.template fillMcSigmaWithLabel<system>(col, mcCols, kink, daughter, mcParticles, mcProducts);
mcBuilder.template fillMcSigmaWithLabel<system>(col, mcCols, daughter, mcParticles, mcProducts);
}
if constexpr (modes::isEqual(kinkType, modes::Kink::kSigmaPlus)) {
fillSigmaPlus(collisionProducts, kinkProducts, kink, daughterIndex);
mcBuilder.template fillMcSigmaPlusWithLabel<system>(col, mcCols, kink, daughter, mcParticles, mcProducts);
mcBuilder.template fillMcSigmaPlusWithLabel<system>(col, mcCols, daughter, mcParticles, mcProducts);
}
}
}
Expand Down
Loading
Loading