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
19 changes: 14 additions & 5 deletions PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -142,7 +142,7 @@
// CCDB options
struct : ConfigurableGroup {
std::string prefix = "ccdb";
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 145 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"};
Expand Down Expand Up @@ -197,8 +197,8 @@
std::string prefix = "mixingOpts";
Configurable<int> n3bodyMixing{"n3bodyMixing", 0, "Number of decay3bodys to mix: 0 - value set to maximum bin entry in hDecay3BodyRadiusPhi, > 0 - manual setting"};
Configurable<int> mixingType{"mixingType", 0, "0: mix V0 from one event with bachelor from another, 1: mix pion and bachelor from one event with proton from another, 1: mix proton and bachelor from one event with pion from another "};
ConfigurableAxis bins3BodyRadius{"mixingOpts.bins3BodyRadius", {VARIABLE_WIDTH, 0.0f, 2.0f, 4.0f, 7.0f, 10.0f, 14.0f, 18.0f, 22.0f, 30.0f, 40.0f}, "Mixing bins - 3body radius"};

Check failure on line 200 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis bins3BodyPhi{"mixingOpts.bins3BodyPhi", {VARIABLE_WIDTH, -180 * o2::constants::math::Deg2Rad, -120 * o2::constants::math::Deg2Rad, -60 * o2::constants::math::Deg2Rad, 0, 60 * o2::constants::math::Deg2Rad, 120 * o2::constants::math::Deg2Rad, 180 * o2::constants::math::Deg2Rad}, "Mixing bins - 3body phi (rad)"};

Check failure on line 201 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis bins3BodyPhiDegree{"mixingOpts.bins3BodyPhiDegree", {VARIABLE_WIDTH, -180, -120, -60, 0, 60, 120, 180}, "Mixing bins - 3body phi (degree)"};
ConfigurableAxis bins3BodyPosZ{"mixingOpts.bins3BodyPosZ", {VARIABLE_WIDTH, -500.0f, -200.0f, -100.0f, -70.0f, -60.0f, -50.0f, -40.0f, -35.0f, -30.0f, -25.0f, -20.0f, -15.0f, -13.0f, -10.0f, -8.0f, -6.0f, -4.0f, -2.0f, 0.0f, 2.0f, 4.0f, 6.0f, 8.0f, 10.0f, 13.0f, 15.0f, 20.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f, 60.0f, 70.0f, 100.0f, 200.0f, 500.0f}, "3body SV z position"};
Configurable<bool> selectPVPosZ3bodyMixing{"selectPVPosZ3bodyMixing", true, "Select same pvPosZ events in case of 3body mixing"};
Expand Down Expand Up @@ -307,7 +307,7 @@
}
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrTGeo;
}
if (useMatCorrType == 2) {

Check failure on line 310 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGF(info, "LUT correction requested, loading LUT");
lut = o2::base::MatLayerCylSet::rectifyPtrFromFile(ccdb->get<o2::base::MatLayerCylSet>(ccdbConfigurations.lutPath));
matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
Expand Down Expand Up @@ -534,7 +534,7 @@
KFParticle::SetField(d_bz);
#endif

if (useMatCorrType == 2) {

Check failure on line 537 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// setMatLUT only after magfield has been initalized
// (setMatLUT has implicit and problematic init field call if not)
LOG(info) << "Loading material look-up table for timestamp: " << timestamp;
Expand Down Expand Up @@ -594,7 +594,7 @@
helper.fitterV0.setBz(magField);
helper.fitter3body.setBz(magField);

if (useMatCorrType == 2) {

Check failure on line 597 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// setMatLUT only after magfield has been initalized (setMatLUT has implicit and problematic init field call if not)
o2::base::Propagator::Instance()->setMatLUT(lut);
}
Expand Down Expand Up @@ -651,7 +651,7 @@
}

// event selection
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || (collision.posZ() >= 10.0f || collision.posZ() <= -10.0f)) {

Check failure on line 654 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}

Expand Down Expand Up @@ -704,7 +704,7 @@
if (!collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && !disableITSROFCut) { // ITS ROF boarder cut if not disabled
continue;
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || (collision.posZ() >= 10.0f || collision.posZ() <= -10.0f)) {

Check failure on line 707 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
// Zorro
Expand Down Expand Up @@ -806,7 +806,7 @@
if (!doStoreMcBkg) {
continue; // if not storing MC background, skip candidates where at least one daughter is not matched to MC particle
} else {
this3BodyMCInfo.motherLabel = -5; // at least one non-matched daughter
this3BodyMCInfo.motherLabel = -5; // at least one of the daughters not matched to MC particle
// fill analysis table (only McVtx3BodyDatas is filled here)
fillAnalysisTables();
}
Expand Down Expand Up @@ -1053,7 +1053,7 @@
doMixing(collision1, trackProton0, trackPion1, trackDeuteron1, magFieldCol1);
}
// mix pion
if (mixingOpts.mixingType == 2) {

Check failure on line 1056 in PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
doMixing(collision0, trackProton0, trackPion1, trackDeuteron0, magFieldCol0);
doMixing(collision1, trackProton1, trackPion0, trackDeuteron1, magFieldCol1);
}
Expand Down Expand Up @@ -1200,10 +1200,11 @@
// global mother ID: proton, pion, and deuteron have common mother and it's a hypertriton

// first, check identity of MC daughters
if (std::abs(mcParticlePr.pdgCode()) != PDG_t::kProton || std::abs(mcParticleDe.pdgCode()) != o2::constants::physics::Pdg::kDeuteron || (std::abs(mcParticlePi.pdgCode()) != PDG_t::kPiPlus && std::abs(mcParticlePi.pdgCode()) != PDG_t::kMuonMinus)) {
return -4;
if (std::abs(mcParticlePr.pdgCode()) != PDG_t::kProton || (std::abs(mcParticlePi.pdgCode()) != PDG_t::kPiPlus && std::abs(mcParticlePi.pdgCode()) != PDG_t::kMuonMinus)) {
return -4; // at least one of the daughters has wrong identity (in this case it's either proton or pion wrong identity)
}
// check if the pion track is a muon coming from a pi -> mu + vu decay, if yes, take the mother pi
// --> now the proton is a proton and the pion is either a pi+ or a muon
// check if the pion track is a muon coming from a pi -> mu + vu decay, if yes, take the mother pi, if not, fill as background
auto mcParticlePiTmp = mcParticlePi;
if (std::abs(mcParticlePiTmp.pdgCode()) == PDG_t::kMuonMinus) {
bool isMuonReco = false;
Expand All @@ -1216,9 +1217,10 @@
}
// If the track is a muon but none of its mothers is a pi+, treat as wrong identity
if (!isMuonReco) {
return -4;
return -4; // at least one of the daughters has wrong identity (in this case it's pion wrong identity)
}
}
// --> now proton and pion have correct identity

// now first check if the proton and pion have the same mother and it is a Lambda
for (const auto& motherPr : mcParticlePr.template mothers_as<aod::McParticles>()) {
Expand All @@ -1228,6 +1230,13 @@
}
}
}
// --> now proton and pion have correct identity and are not from a common mother Lambda

// now check if deuteron has correct identity
if (std::abs(mcParticleDe.pdgCode()) != o2::constants::physics::Pdg::kDeuteron) {
return -4; // at least one daughter has wrong identity (in this case it's the deuteron)
}
// --> now the deuteron has correct identity

// now check if all three daughters have the same mother
int momID = -1;
Expand Down
Loading