Skip to content

Commit

Permalink
PWGHF: addressing comments, adding init protection and enabling defau…
Browse files Browse the repository at this point in the history
…lt process function
  • Loading branch information
stefanopolitano committed Jul 24, 2024
1 parent 05991d3 commit 6906bd5
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 9 deletions.
7 changes: 6 additions & 1 deletion PWGHF/TableProducer/candidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,11 @@ struct HfCandidateCreator2ProngExpressions {
// inspect for which zPvPosMax cut was set for reconstructed
void init(InitContext& initContext)
{
std::array<bool, 3> procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M};
if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) {
LOGP(fatal, "At most one process function for collision study can be enabled at a time.");
}

const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-2prong") == 0) {
Expand Down Expand Up @@ -818,7 +823,7 @@ struct HfCandidateCreator2ProngExpressions {
{
runCreator2ProngMc<CentralityEstimator::None>(tracks, mcParticles, collInfos, mcCollisions, BCsInfo);
}
PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMc, "Process MC - no centrality", false);
PROCESS_SWITCH(HfCandidateCreator2ProngExpressions, processMc, "Process MC - no centrality", true);

void processMcCentFT0C(aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles,
Expand Down
6 changes: 5 additions & 1 deletion PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,10 @@ struct HfCandidateCreator3ProngExpressions {

void init(InitContext& initContext)
{
std::array<bool, 3> procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M};
if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) {
LOGP(fatal, "At most one process function for collision study can be enabled at a time.");
}

// inspect for which particle species the candidates were created and which zPvPosMax cut was set for reconstructed
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
Expand Down Expand Up @@ -753,7 +757,7 @@ struct HfCandidateCreator3ProngExpressions {
{
runCreator3ProngMc<CentralityEstimator::None>(tracks, mcParticles, collInfos, mcCollisions, BCsInfo);
}
PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMc, "Process MC - no centrality", false);
PROCESS_SWITCH(HfCandidateCreator3ProngExpressions, processMc, "Process MC - no centrality", true);

void processMcCentFT0C(aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles,
Expand Down
7 changes: 6 additions & 1 deletion PWGHF/TableProducer/candidateCreatorCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ struct HfCandidateCreatorCascadeMc {
// inspect for which zPvPosMax cut was set for reconstructed
void init(InitContext& initContext)
{
std::array<bool, 3> procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M};
if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) {
LOGP(fatal, "At most one process function for collision study can be enabled at a time.");
}

const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-cascade") == 0) {
Expand Down Expand Up @@ -586,7 +591,7 @@ struct HfCandidateCreatorCascadeMc {
{
runCreatorCascMc<CentralityEstimator::None>(tracks, mcParticles, collInfos, mcCollisions, BCsInfo);
}
PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMc, "Process MC - no centrality", false);
PROCESS_SWITCH(HfCandidateCreatorCascadeMc, processMc, "Process MC - no centrality", true);

void processMcCentFT0C(MyTracksWMc const& tracks,
aod::McParticles const& mcParticles,
Expand Down
7 changes: 6 additions & 1 deletion PWGHF/TableProducer/candidateCreatorDstar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,11 @@ struct HfCandidateCreatorDstarExpressions {
// inspect for which zPvPosMax cut was set for reconstructed
void init(InitContext& initContext)
{
std::array<bool, 3> procCollisions = {doprocessMc, doprocessMcCentFT0C, doprocessMcCentFT0M};
if (std::accumulate(procCollisions.begin(), procCollisions.end(), 0) > 1) {
LOGP(fatal, "At most one process function for collision study can be enabled at a time.");
}

const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-dstar") == 0) {
Expand Down Expand Up @@ -670,7 +675,7 @@ struct HfCandidateCreatorDstarExpressions {
{
runCreatorDstarMc<CentralityEstimator::None>(tracks, mcParticles, collInfos, mcCollisions, BCsInfo);
}
PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMc, "Process MC - no centrality", false);
PROCESS_SWITCH(HfCandidateCreatorDstarExpressions, processMc, "Process MC - no centrality", true);

void processMcCentFT0C(aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles,
Expand Down
28 changes: 23 additions & 5 deletions PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,24 @@ struct HfCandidateCreatorXic0Omegac0Mc {
// inspect for which zPvPosMax cut was set for reconstructed
void init(InitContext& initContext)
{
std::array<bool, 3> procCollisionsXicToXiPi{doprocessMcXicToXiPi, doprocessMcXicToXiPiFT0m, doprocessMcXicToXiPiFT0c};
if (std::accumulate(procCollisionsXicToXiPi.begin(), procCollisionsXicToXiPi.end(), 0) > 1) {
LOGP(fatal, "At most one process function for XicToXiPi collision study can be enabled at a time.");
}
std::array<bool, 3> procCollisionsOmegacToXiPi{doprocessMcOmegacToXiPi, doprocessMcOmegacToXiPiFT0m, doprocessMcOmegacToXiPiFT0c};
if (std::accumulate(procCollisionsOmegacToXiPi.begin(), procCollisionsOmegacToXiPi.end(), 0) > 1) {
LOGP(fatal, "At most one process function for OmegacToXiPi collision study can be enabled at a time.");
}
std::array<bool, 3> procCollisionsOmegacToOmegaPi{doprocessMcOmegacToOmegaPi, doprocessMcOmegacToOmegaPiFT0m, doprocessMcOmegacToOmegaPiFT0c};
if (std::accumulate(procCollisionsOmegacToOmegaPi.begin(), procCollisionsOmegacToOmegaPi.end(), 0) > 1) {
LOGP(fatal, "At most one process function for OmegacToOmegaPi collision study can be enabled at a time.");
}
std::array<bool, 3> procCollisionsOmegacToOmegaK{doprocessMcOmegacToOmegaK, doprocessMcOmegacToOmegaKFT0m, doprocessMcOmegacToOmegaKFT0c};
if (std::accumulate(procCollisionsOmegacToOmegaK.begin(), procCollisionsOmegacToOmegaK.end(), 0) > 1) {
LOGP(fatal, "At most one process function for OmegacToOmegaK collision study can be enabled at a time.");
}


const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-xic0-omegac0") == 0) {
Expand Down Expand Up @@ -1126,7 +1144,7 @@ struct HfCandidateCreatorXic0Omegac0Mc {
{
runXic0Omegac0Mc<CentralityEstimator::None, aod::hf_cand_xic0_omegac0::DecayType::XiczeroToXiPi>(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs);
}
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPi, "Run Xic0 to xi pi MC process function - no centrality", false);
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcXicToXiPi, "Run Xic0 to xi pi MC process function - no centrality", true);

void processMcXicToXiPiFT0m(aod::HfCandToXiPi const& candidates,
aod::TracksWMc const& tracks,
Expand Down Expand Up @@ -1162,7 +1180,7 @@ struct HfCandidateCreatorXic0Omegac0Mc {
{
runXic0Omegac0Mc<CentralityEstimator::None, aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToXiPi>(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs);
}
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToXiPi, "Run Omegac0 to xi pi MC process function - FT0M", false);
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToXiPi, "Run Omegac0 to xi pi MC process function - FT0M", true);

void processMcOmegacToXiPiFT0m(aod::HfCandToXiPi const& candidates,
aod::TracksWMc const& tracks,
Expand Down Expand Up @@ -1198,7 +1216,7 @@ struct HfCandidateCreatorXic0Omegac0Mc {
{
runXic0Omegac0Mc<CentralityEstimator::None, aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaPi>(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs);
}
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPi, "Run Omegac0 to omega pi MC process function - no centrality", false);
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPi, "Run Omegac0 to omega pi MC process function - no centrality", true);

void processMcOmegacToOmegaPiFT0m(aod::HfCandToOmegaPi const& candidates,
aod::TracksWMc const& tracks,
Expand All @@ -1224,7 +1242,7 @@ struct HfCandidateCreatorXic0Omegac0Mc {
}
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaPiFT0c, "Run Omegac0 to omega pi MC process function - FT0C", false);

void processMcOmegacToOmegaKF(aod::HfCandToOmegaK const& candidates,
void processMcOmegacToOmegaK(aod::HfCandToOmegaK const& candidates,
aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles,
aod::McCollisions const& mcColls,
Expand All @@ -1234,7 +1252,7 @@ struct HfCandidateCreatorXic0Omegac0Mc {
{
runXic0Omegac0Mc<CentralityEstimator::None, aod::hf_cand_xic0_omegac0::DecayType::OmegaczeroToOmegaK>(candidates, tracks, mcParticles, collInfos, mcColls, mcLabels, bcs);
}
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaKF, "Run Omegac0 to omega K MC process function - no centrality", false);
PROCESS_SWITCH(HfCandidateCreatorXic0Omegac0Mc, processMcOmegacToOmegaK, "Run Omegac0 to omega K MC process function - no centrality", true);

void processMcOmegacToOmegaKFT0m(aod::HfCandToOmegaK const& candidates,
aod::TracksWMc const& tracks,
Expand Down

0 comments on commit 6906bd5

Please sign in to comment.