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
44 changes: 22 additions & 22 deletions PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -405,19 +405,19 @@

float getMassSigmaK0Short(float pt)
{
return preSelectOpts.massCutK0->get("constant") + pt * preSelectOpts.massCutK0->get("linear") + preSelectOpts.massCutK0->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutK0->get("expoRelax"));

Check failure on line 408 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
float getMassSigmaLambda(float pt)
{
return preSelectOpts.massCutLambda->get("constant") + pt * preSelectOpts.massCutLambda->get("linear") + preSelectOpts.massCutLambda->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutLambda->get("expoRelax"));

Check failure on line 412 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
float getMassSigmaXi(float pt)
{
return preSelectOpts.massCutXi->get("constant") + pt * preSelectOpts.massCutXi->get("linear") + preSelectOpts.massCutXi->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutXi->get("expoRelax"));

Check failure on line 416 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
float getMassSigmaOmega(float pt)
{
return preSelectOpts.massCutOm->get("constant") + pt * preSelectOpts.massCutOm->get("linear") + preSelectOpts.massCutOm->get("expoConstant") * TMath::Exp(-pt / preSelectOpts.massCutOm->get("expoRelax"));

Check failure on line 420 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}

o2::ccdb::CcdbApi ccdbApi;
Expand Down Expand Up @@ -1022,10 +1022,10 @@

bool trackIsInteresting = false;
if (
(originParticle.pdgCode() == 310 && v0BuilderOpts.mc_addGeneratedK0Short.value > 0) ||

Check failure on line 1025 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == 3122 && v0BuilderOpts.mc_addGeneratedLambda.value > 0) ||

Check failure on line 1026 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == -3122 && v0BuilderOpts.mc_addGeneratedAntiLambda.value > 0) ||

Check failure on line 1027 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == 22 && v0BuilderOpts.mc_addGeneratedGamma.value > 0)) {

Check failure on line 1028 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
trackIsInteresting = true;
}
if (!trackIsInteresting) {
Expand Down Expand Up @@ -1075,7 +1075,7 @@
currentV0Entry.pdgCode = positiveTrackIndex.pdgCode;
currentV0Entry.particleId = positiveTrackIndex.originId;
currentV0Entry.isCollinearV0 = false;
if (v0BuilderOpts.mc_addGeneratedGammaMakeCollinear.value && currentV0Entry.pdgCode == 22) {

Check failure on line 1078 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
currentV0Entry.isCollinearV0 = true;
}
currentV0Entry.found = false;
Expand Down Expand Up @@ -1520,7 +1520,7 @@
straHelper.v0.daughterDCA,
straHelper.v0.positiveDCAxy,
straHelper.v0.negativeDCAxy,
TMath::Cos(straHelper.v0.pointingAngle),

Check failure on line 1523 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
straHelper.v0.dcaToPV,
v0.v0Type);
products.v0dataLink(products.v0cores.lastIndex(), -1);
Expand Down Expand Up @@ -2650,68 +2650,68 @@
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
auto strangenessBuilderTask = adaptAnalysisTask<StrangenessBuilder>(cfgc);
bool isRun3 = true, hasRunInfo = false;
bool isRun3 = true, hasRunInfo = false;
bool isMC = false, hasDataTypeInfo = false;
if(cfgc.options().hasOption("aod-metadata-Run") == true){
if (cfgc.options().hasOption("aod-metadata-Run") == true) {
hasRunInfo = true;
if(cfgc.options().get<std::string>("aod-metadata-Run") == "2"){
if (cfgc.options().get<std::string>("aod-metadata-Run") == "2") {
isRun3 = false;
}
}
if(cfgc.options().hasOption("aod-metadata-DataType") == true){
if (cfgc.options().hasOption("aod-metadata-DataType") == true) {
hasDataTypeInfo = true;
if(cfgc.options().get<std::string>("aod-metadata-DataType") == "MC"){
if (cfgc.options().get<std::string>("aod-metadata-DataType") == "MC") {
isMC = true;
}
}

int idxSwitches[8]; //8 switches (real / real r2 / MC / MC r2 + PID)
int idxSwitches[8]; // 8 switches (real / real r2 / MC / MC r2 + PID)
bool autoConfigureProcessConfig = true;
bool withPID = false;

for(size_t ipar = 0; ipar<strangenessBuilderTask.options.size(); ipar++){
for (size_t ipar = 0; ipar < strangenessBuilderTask.options.size(); ipar++) {
auto option = strangenessBuilderTask.options[ipar];
if(option.name == "processRealData"){
if (option.name == "processRealData") {
idxSwitches[0] = ipar;
}
if(option.name == "processRealDataRun2"){
if (option.name == "processRealDataRun2") {
idxSwitches[1] = ipar;
}
if(option.name == "processMonteCarlo"){
if (option.name == "processMonteCarlo") {
idxSwitches[2] = ipar;
}
if(option.name == "processMonteCarloRun2"){
if (option.name == "processMonteCarloRun2") {
idxSwitches[3] = ipar;
}
if(option.name == "processRealDataWithPID"){
if (option.name == "processRealDataWithPID") {
idxSwitches[4] = ipar;
}
if(option.name == "processRealDataRun2WithPID"){
if (option.name == "processRealDataRun2WithPID") {
idxSwitches[5] = ipar;
}
if(option.name == "processMonteCarloWithPID"){
if (option.name == "processMonteCarloWithPID") {
idxSwitches[6] = ipar;
}
if(option.name == "processMonteCarloRun2WithPID"){
if (option.name == "processMonteCarloRun2WithPID") {
idxSwitches[7] = ipar;
}
if(option.name == "autoConfigureProcess"){
if (option.name == "autoConfigureProcess") {
autoConfigureProcessConfig = option.defaultValue.get<bool>(); // check if autoconfig requested
}
// use withPID in case preselection is requested
if(option.name == "preSelectOpts.preselectOnlyDesiredV0s" || option.name == "preSelectOpts.preselectOnlyDesiredCascades" ){
if (option.name == "preSelectOpts.preselectOnlyDesiredV0s" || option.name == "preSelectOpts.preselectOnlyDesiredCascades") {
withPID = withPID || option.defaultValue.get<bool>();
}
}
if((!hasRunInfo || !hasDataTypeInfo) && autoConfigureProcessConfig){
if ((!hasRunInfo || !hasDataTypeInfo) && autoConfigureProcessConfig) {
throw std::runtime_error("Autoconfigure requested but no metadata information found! Please check if --aod-file <file> was used in the last workflow added in the execution and if the AO2D in question has metadata saved in it.");
}

// positions of switches are known. Next: flip if asked for
if(autoConfigureProcessConfig){
int relevantProcess = static_cast<int>(!isRun3) + 2*static_cast<int>(isMC) + 4*static_cast<int>(withPID);
// positions of switches are known. Next: flip if asked for
if (autoConfigureProcessConfig) {
int relevantProcess = static_cast<int>(!isRun3) + 2 * static_cast<int>(isMC) + 4 * static_cast<int>(withPID);
LOGF(info, "Automatic configuration of process switches requested! Autodetected settings: isRun3? %i, isMC? %i, withPID? %i (switch #%i)", hasRunInfo, hasDataTypeInfo, isRun3, isMC, withPID, relevantProcess);
for(size_t idx = 0; idx < 8; idx ++){
for (size_t idx = 0; idx < 8; idx++) {
auto option = strangenessBuilderTask.options[idxSwitches[idx]];
option.defaultValue = false; // switch all off
}
Expand Down
Loading