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
42 changes: 38 additions & 4 deletions PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for He3"};
Configurable<bool> cfgCompensatePIDinTracking{"cfgCompensatePIDinTracking", true, "If true, divide tpcInnerParam by the electric charge"};
Configurable<int> cfgMaterialCorrection{"cfgMaterialCorrection", static_cast<int>(o2::base::Propagator::MatCorrType::USEMatCorrNONE), "Type of material correction"};
Configurable<bool> cfgEvSelkNoSameBunchPileup{"cfgEvSelkNoSameBunchPileup", false, "Rejects collisions which are associated with the same found-by-T0 bunch crossing"};
Configurable<bool> cfgEvSelkIsGoodZvtxFT0vsPV{"cfgEvSelkIsGoodZvtxFT0vsPV", false, "Verifies the consistency between the primary vertex z position from tracking and the z position of the PV from FT0 timing"};

// CCDB options
Configurable<double> d_bz_input{"d_bz", -999, "bz field, -999 is automatic"};
Expand Down Expand Up @@ -256,9 +258,11 @@
hH4LMassBefSel = qaRegistry.add<TH1>("hH4LMassBefSel", ";M (GeV/#it{c}^{2}); ", HistType::kTH1D, {{60, 3.76, 3.84}});
hH4LMassTracked = qaRegistry.add<TH1>("hH4LMassTracked", ";M (GeV/#it{c}^{2}); ", HistType::kTH1D, {{60, 3.76, 3.84}});

hEvents = qaRegistry.add<TH1>("hEvents", ";Events; ", HistType::kTH1D, {{2, -0.5, 1.5}});
hEvents = qaRegistry.add<TH1>("hEvents", ";Events; ", HistType::kTH1D, {{4, -0.5, 3.5}});
hEvents->GetXaxis()->SetBinLabel(1, "All");
hEvents->GetXaxis()->SetBinLabel(2, "Selected");
hEvents->GetXaxis()->SetBinLabel(2, "sel8");
hEvents->GetXaxis()->SetBinLabel(3, "kNoSameBunchPileup");
hEvents->GetXaxis()->SetBinLabel(4, "kIsGoodZvtxFT0vsPV");

hEventsZorro = qaRegistry.add<TH1>("hEventsZorro", ";Events; ", HistType::kTH1D, {{2, -0.5, 1.5}});
hEventsZorro->GetXaxis()->SetBinLabel(1, "Zorro before evsel");
Expand Down Expand Up @@ -296,7 +300,7 @@
o2::parameters::GRPMagField* grpmag = 0x0;
if (grpo) {
o2::base::Propagator::initFieldFromGRP(grpo);
if (d_bz_input < -990) {

Check failure on line 303 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
// Fetch magnetic field from ccdb for current collision
d_bz = grpo->getNominalL3Field();
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG";
Expand All @@ -309,7 +313,7 @@
LOG(fatal) << "Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
}
o2::base::Propagator::initFieldFromGRP(grpmag);
if (d_bz_input < -990) {

Check failure on line 316 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
// Fetch magnetic field from ccdb for current collision
d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG";
Expand All @@ -321,7 +325,7 @@
auto he3pid = ccdb->getForTimeStamp<std::array<float, 6>>(pidPath.value + "_He3", run3grp_timestamp);
std::copy(he3pid->begin(), he3pid->end(), mBBparamsHe.begin());
} else {
for (int i = 0; i < 5; i++) {

Check failure on line 328 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
mBBparamsHe[i] = cfgBetheBlochParams->get("He3", Form("p%i", i));
}
mBBparamsHe[5] = cfgBetheBlochParams->get("He3", "resolution");
Expand Down Expand Up @@ -361,16 +365,31 @@
}
}

if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || std::abs(collision.posZ()) > 10) {

Check failure on line 368 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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;
}

hEvents->Fill(1.);

if (zorroSelected) {
hEventsZorro->Fill(1.);
}

if (cfgEvSelkNoSameBunchPileup) {
if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)) {
continue;
}
hEvents->Fill(2.);
}

Check failure on line 383 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.

if (cfgEvSelkIsGoodZvtxFT0vsPV) {
if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) {
continue;
}
hEvents->Fill(3.);
}

goodCollision[collision.globalIndex()] = true;
hEvents->Fill(1.);
hZvtx->Fill(collision.posZ());
hCentFT0A->Fill(collision.centFT0A());
hCentFT0C->Fill(collision.centFT0C());
Expand All @@ -388,14 +407,29 @@
if (collision.has_mcCollision()) {
recoCollisionIds[collision.mcCollisionId()] = collision.globalIndex();
}
if (!collision.selection_bit(aod::evsel::kIsTriggerTVX) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || std::abs(collision.posZ()) > 10)

Check failure on line 410 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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;

Check failure on line 412 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
hEvents->Fill(1.);

Check failure on line 414 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
if (cfgEvSelkNoSameBunchPileup) {
if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)) {
continue;
}
hEvents->Fill(2.);
}

Check failure on line 420 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.

if (cfgEvSelkIsGoodZvtxFT0vsPV) {
if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) {
continue;
}
hEvents->Fill(3.);
}

Check failure on line 428 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
if (collision.has_mcCollision()) {
isSurvEvSelCollision[collision.mcCollisionId()] = true;
}
goodCollision[collision.globalIndex()] = true;
hEvents->Fill(1.);
hZvtx->Fill(collision.posZ());
hCentFT0A->Fill(collision.centFT0A());
hCentFT0C->Fill(collision.centFT0C());
Expand Down Expand Up @@ -448,7 +482,7 @@
hePropTrack.getPxPyPzGlo(hypCand.momHe3);
piPropTrack.getPxPyPzGlo(hypCand.momPi);
// the momentum has to be multiplied by 2 (charge)
for (int i = 0; i < 3; i++) {

Check failure on line 485 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
hypCand.momHe3[i] *= 2;
}
float heP2 = hypCand.momHe3[0] * hypCand.momHe3[0] + hypCand.momHe3[1] * hypCand.momHe3[1] + hypCand.momHe3[2] * hypCand.momHe3[2];
Expand All @@ -460,7 +494,7 @@
float h4lE = he4E + piE;
std::array<float, 3> hypMom;
const auto& vtx = fitter.getPCACandidate();
for (int i = 0; i < 3; i++) {

Check failure on line 497 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
hypCand.decVtx[i] = vtx[i];
hypMom[i] = hypCand.momHe3[i] + hypCand.momPi[i];
}
Expand Down Expand Up @@ -513,7 +547,7 @@

auto collision = collisions.rawIteratorAt(collIDmax);
std::array<float, 3> primVtx = {collision.posX(), collision.posY(), collision.posZ()};
for (int i = 0; i < 3; i++) {

Check failure on line 550 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
hypCand.decVtx[i] = hypCand.decVtx[i] - primVtx[i];
}

Expand Down Expand Up @@ -625,7 +659,7 @@
}
void fillMCinfo(aod::McTrackLabels const& trackLabels, aod::McParticles const&)
{
for (auto& hypCand : hyperCandidates) {

Check failure on line 662 in PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
auto mcLabHe = trackLabels.rawIteratorAt(hypCand.heTrackID);
auto mcLabPi = trackLabels.rawIteratorAt(hypCand.piTrackID);

Expand All @@ -646,7 +680,7 @@
auto secVtx = std::array<float, 3>{mcTrackHe.vx(), mcTrackHe.vy(), mcTrackHe.vz()};
hypCand.gMom = std::array<float, 3>{heMother.px(), heMother.py(), heMother.pz()};
hypCand.gMomHe3 = std::array<float, 3>{mcTrackHe.px(), mcTrackHe.py(), mcTrackHe.pz()};
for (int i = 0; i < 3; i++) {

Check failure on line 683 in PWGLF/TableProducer/Nuspex/hyperRecoTask.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.
hypCand.gDecVtx[i] = secVtx[i] - primVtx[i];
}
hypCand.isSignal = true;
Expand Down
Loading