Skip to content

Commit c219cbb

Browse files
authored
Removing unused variables and editing event rejection mask
1 parent 6629a3a commit c219cbb

1 file changed

Lines changed: 24 additions & 40 deletions

File tree

PWGHF/D2H/Tasks/taskFlattenicityD0Lc.cxx

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ enum CandTypeSel {
6464
static const int nCellsFV0 = 48;
6565
static const int nInnerCellsFV0 = 32;
6666
std::array<float, nCellsFV0> rhoLatticeFV0{};
67-
std::array<float, nCellsFV0> fv0AmplitudeWoCalib{};
67+
std::array<float, nCellsFV0> rhoLatticeFV0Calibrated{};
6868
std::array<float, nCellsFV0> calib = {1.01697, 1.122, 1.03854, 1.108, 1.11634, 1.14971, 1.19321, 1.06866, 0.954675, 0.952695, 0.969853, 0.957557, 0.989784, 1.01549, 1.02182, 0.976005, 1.01865, 1.06871, 1.06264, 1.02969, 1.07378, 1.06622, 1.15057, 1.0433, 0.83654, 0.847178, 0.890027, 0.920814, 0.888271, 1.04662, 0.8869, 0.856348, 0.863181, 0.906312, 0.902166, 1.00122, 1.03303, 0.887866, 0.892437, 0.906278, 0.884976, 0.864251, 0.917221, 1.10618, 1.04028, 0.893184, 0.915734, 0.892676};
6969
std::map<int, int> channelsToRings = {{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 7}, {5, 6}, {6, 5}, {7, 4}, {8, 8}, {9, 9}, {10, 10}, {11, 11}, {12, 15}, {13, 14}, {14, 13}, {15, 12}, {16, 16}, {17, 17}, {18, 18}, {19, 19}, {20, 23}, {21, 22}, {22, 21}, {23, 20}, {24, 24}, {25, 25}, {26, 26}, {27, 27}, {28, 31}, {29, 30}, {30, 29}, {31, 28}, {32, 32}, {33, 34}, {34, 36}, {35, 38}, {36, 47}, {37, 45}, {38, 43}, {39, 41}, {40, 33}, {41, 35}, {42, 37}, {43, 39}, {44, 46}, {45, 44}, {46, 42}, {47, 40}};
7070

@@ -124,8 +124,6 @@ struct HfTaskFlattenicityD0Lc {
124124

125125
void init(InitContext const&)
126126
{
127-
std::array<bool, 3> doprocess{doprocessData, doprocessMCD0, doprocessMCLc};
128-
129127
hfEvSel.addHistograms(registry);
130128
registry.add("Flattenicity", "Number of events; 1-#rho; Counter", {kTH1F, {{100, 0, 1}}});
131129
registry.add("Flattenicity_calibrated", "Number of events; 1-#rho; Counter", {kTH1F, {{100, 0, 1}}});
@@ -462,25 +460,23 @@ struct HfTaskFlattenicityD0Lc {
462460
}
463461
PROCESS_SWITCH(HfTaskFlattenicityD0Lc, processMCLc, "Process MC Lc with DCAFitter", false);
464462

465-
template <typename CollType, typename CandTypeD0, typename CandTypeLc, typename BCsType>
463+
template <typename CollType, typename CandTypeD0, typename CandTypeLc>
466464
void runAnalysisData(CollType const& collisions,
467465
CandTypeD0 const& candidatesD0,
468466
CandTypeLc const& candidatesLc,
469-
BCsType const& bcs,
470-
TracksWPid const& tracks)
467+
aod::BcFullInfos const&,
468+
TracksWPid const&)
471469
{
472470
for (const auto& collision : collisions) {
473471

474472
float centrality{-1.f};
475-
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, BCsType>(collision, centrality, ccdb, registry);
473+
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BcFullInfos>(collision, centrality, ccdb, registry);
476474
hfEvSel.fillHistograms(collision, rejectionMask, centrality);
477475
if (rejectionMask != 0) {
478476
continue;
479477
}
480478

481-
const float flat = fillFlat<true>(collision, 0);
482-
const float flatCalibrated = fillFlat<true>(collision, 1);
483-
479+
const float flat = fillFlat<true>(collision);
484480
const auto thisCollId = collision.globalIndex();
485481

486482
// D0
@@ -557,7 +553,6 @@ struct HfTaskFlattenicityD0Lc {
557553
const auto ptProng2 = candidate.ptProng2();
558554
const auto decayLength = candidate.decayLength();
559555
const auto decayLengthXY = candidate.decayLengthXY();
560-
const auto chi2PCA = candidate.chi2PCA();
561556
const auto cpa = candidate.cpa();
562557
const auto cpaXY = candidate.cpaXY();
563558

@@ -619,13 +614,13 @@ struct HfTaskFlattenicityD0Lc {
619614
}
620615
}
621616

622-
template <int ReconstructionType, typename CandTypeD0, typename CollType, typename BCsType>
617+
template <int ReconstructionType, typename CandTypeD0, typename CollType>
623618
void runAnalysisMCD0(CandTypeD0 const& candidatesD0,
624619
soa::Join<aod::McParticles, aod::HfCand2ProngMcGen> const& mcParticles2prong,
625620
TracksSelQuality const&,
626621
CollType const& collisions,
627622
aod::McCollisions const&,
628-
BCsType const&)
623+
aod::BcFullInfos const&)
629624
{
630625
// MC rec.
631626
for (const auto& candidate : candidatesD0) {
@@ -638,8 +633,7 @@ struct HfTaskFlattenicityD0Lc {
638633

639634
auto collision = candidate.template collision_as<CollType>();
640635

641-
const float flat = fillFlat<false>(collision, 0);
642-
const float flatCalibrated = fillFlat<false>(collision, 1);
636+
const float flat = fillFlat<false>(collision);
643637

644638
float massD0{0.f}, massD0bar{0.f};
645639
massD0 = HfHelper::invMassD0ToPiK(candidate);
@@ -737,8 +731,6 @@ struct HfTaskFlattenicityD0Lc {
737731
auto ctCandidate = HfHelper::ctD0(candidate);
738732
auto cpaCandidate = candidate.cpa();
739733
auto cpaxyCandidate = candidate.cpaXY();
740-
int const minItsClustersOfProngs = std::min(trackPos.itsNCls(), trackNeg.itsNCls());
741-
int const minTpcCrossedRowsOfProngs = std::min(trackPos.tpcNClsCrossedRows(), trackNeg.tpcNClsCrossedRows());
742734
if (candidate.isSelD0() >= selectionFlagD0) {
743735
registry.fill(HIST("MC/D0/hMassSigBkgD0"), massD0, ptCandidate, rapidityCandidate);
744736
if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) {
@@ -812,7 +804,7 @@ struct HfTaskFlattenicityD0Lc {
812804
float flat{-1.f};
813805
const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollision, particle.mcCollision().globalIndex());
814806
for (const auto& recCol : recoCollsPerMcColl) {
815-
flat = fillFlat<false>(recCol, 0);
807+
flat = fillFlat<false>(recCol);
816808
}
817809

818810
float ptGenB = -1;
@@ -838,21 +830,20 @@ struct HfTaskFlattenicityD0Lc {
838830
}
839831
}
840832

841-
template <int ReconstructionType, typename CandTypeLc, typename CollType, typename BCsType>
833+
template <int ReconstructionType, typename CandTypeLc, typename CollType>
842834
void runAnalysisMCLc(CandTypeLc const& candidatesLc,
843835
soa::Join<aod::McParticles, aod::HfCand3ProngMcGen> const& mcParticles3prong,
844836
TracksSelQuality const&,
845837
CollType const& collisions,
846838
aod::McCollisions const&,
847-
BCsType const&)
839+
aod::BcFullInfos const&)
848840
{
849841
for (const auto& collision : collisions) {
850842
// MC Rec.
851843
const auto thisCollId = collision.globalIndex();
852844
const auto& groupedLcCandidates = candidatesLc.sliceBy(candLcPerCollision, thisCollId);
853845

854-
const float flat = fillFlat<true>(collision, 0);
855-
const float flatCalibrated = fillFlat<true>(collision, 1);
846+
const float flat = fillFlat<true>(collision);
856847

857848
for (const auto& candidate : groupedLcCandidates) {
858849
if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) {
@@ -870,12 +861,6 @@ struct HfTaskFlattenicityD0Lc {
870861
registry.fill(HIST("MC/Lc/hPtGenSig"), particleMother.pt());
871862

872863
const auto pt = candidate.pt();
873-
const auto ptProng0 = candidate.ptProng0();
874-
const auto ptProng1 = candidate.ptProng1();
875-
const auto ptProng2 = candidate.ptProng2();
876-
const auto decayLength = candidate.decayLength();
877-
const auto chi2PCA = candidate.chi2PCA();
878-
const auto cpa = candidate.cpa();
879864
const auto originType = candidate.originMcRec();
880865
const auto ptRecB = candidate.ptBhadMotherPart();
881866

@@ -1005,7 +990,7 @@ struct HfTaskFlattenicityD0Lc {
1005990
float flat{-1.f};
1006991
const auto& recoCollsPerMcColl = collisions.sliceBy(colPerMcCollisionLc, particle.mcCollision().globalIndex());
1007992
for (const auto& recCol : recoCollsPerMcColl) {
1008-
flat = fillFlat<false>(recCol, 0);
993+
flat = fillFlat<false>(recCol);
1009994
}
1010995

1011996
const auto ptGen = particle.pt();
@@ -1050,39 +1035,38 @@ struct HfTaskFlattenicityD0Lc {
10501035
}
10511036

10521037
template <bool fillHist = true, typename CollType>
1053-
float fillFlat(CollType const& collision, bool const& ifCalib)
1038+
float fillFlat(CollType const& collision)
10541039
{
10551040
rhoLatticeFV0.fill(0);
1056-
fv0AmplitudeWoCalib.fill(0);
1041+
rhoLatticeFV0Calibrated.fill(0);
10571042
if (collision.has_foundFV0()) {
10581043
auto fv0 = collision.foundFV0();
10591044
std::bitset<8> fV0Triggers = fv0.triggerMask();
10601045
bool isOkFV0OrA = fV0Triggers[o2::fit::Triggers::bitA];
10611046
if (isOkFV0OrA) {
10621047
for (std::size_t ich = 0; ich < fv0.channel().size(); ich++) {
10631048
float amplCh = fv0.amplitude()[ich];
1049+
float amplChCalibrated = fv0.amplitude()[ich];
10641050
int chv0 = fv0.channel()[ich];
10651051
int chv0phi = channelsToRings.at(chv0);
10661052
if (amplCh > 0.0) {
10671053
if (chv0phi > 0.0) {
1068-
fv0AmplitudeWoCalib[chv0phi] = amplCh;
1069-
if (ifCalib) {
1070-
amplCh *= calib[chv0phi];
1071-
}
1054+
amplChCalibrated *= calib[chv0phi];
10721055
if (chv0 < nInnerCellsFV0) {
10731056
rhoLatticeFV0[chv0phi] += amplCh;
1057+
rhoLatticeFV0Calibrated[chv0phi] += amplChCalibrated;
10741058
} else {
10751059
rhoLatticeFV0[chv0phi] += amplCh / 2.;
1060+
rhoLatticeFV0Calibrated[chv0phi] += amplChCalibrated / 2.;
10761061
}
10771062
}
10781063
}
10791064
}
10801065
float flattenicityFV0 = calcFlatenicity(rhoLatticeFV0);
1066+
float flattenicityFV0Calibrated = calcFlatenicity(rhoLatticeFV0Calibrated);
10811067
if constexpr (fillHist) {
1082-
if (ifCalib)
1083-
registry.fill(HIST("Flattenicity_calibrated"), 1 - flattenicityFV0);
1084-
else
1085-
registry.fill(HIST("Flattenicity"), 1 - flattenicityFV0);
1068+
registry.fill(HIST("Flattenicity_calibrated"), 1 - flattenicityFV0Calibrated);
1069+
registry.fill(HIST("Flattenicity"), 1 - flattenicityFV0);
10861070
}
10871071
return 1. - flattenicityFV0;
10881072
} else {
@@ -1131,4 +1115,4 @@ struct HfTaskFlattenicityD0Lc {
11311115
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
11321116
{
11331117
return WorkflowSpec{adaptAnalysisTask<HfTaskFlattenicityD0Lc>(cfgc)};
1134-
}
1118+
}

0 commit comments

Comments
 (0)