Skip to content

Commit e9b6f88

Browse files
committed
fix linter and add configurable for PV contributors
1 parent f900a8c commit e9b6f88

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

PWGHF/Tasks/taskMcInjection.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct HfTaskMcInjection {
9696
Produces<o2::aod::TracksInjection> tracksInj;
9797

9898
Configurable<double> centMaxForCollDelta{"centMaxForCollDelta", 20., "max. cent. for gen-rec collision position histograms"};
99+
Configurable<int> nPvContribMaxForCollDelta{"nPvContribMaxForCollDelta", 2000, "max. PV contrib. for gen-rec collision position histograms"};
99100

100101
std::shared_ptr<TH1> hCharmPerCollImpPar, hCollisions;
101102

@@ -122,13 +123,13 @@ struct HfTaskMcInjection {
122123
registry.add("hDeltaY", ";#DeltaY (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
123124
registry.add("hDeltaZ", ";#DeltaZ (cm);Counts", {HistType::kTH1F, {{deltaZbins}}});
124125

125-
registry.add("hDeltaX_NPV_lt2000", ";#DeltaX (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
126-
registry.add("hDeltaY_NPV_lt2000", ";#DeltaY (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
127-
registry.add("hDeltaZ_NPV_lt2000", ";#DeltaZ (cm);Counts", {HistType::kTH1F, {{deltaZbins}}});
126+
registry.add("hDeltaX_NPV_lt", ";#DeltaX (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
127+
registry.add("hDeltaY_NPV_lt", ";#DeltaY (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
128+
registry.add("hDeltaZ_NPV_lt", ";#DeltaZ (cm);Counts", {HistType::kTH1F, {{deltaZbins}}});
128129

129-
registry.add("hDeltaX_NPV_gt2000", ";#DeltaX (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
130-
registry.add("hDeltaY_NPV_gt2000", ";#DeltaY (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
131-
registry.add("hDeltaZ_NPV_gt2000", ";#DeltaZ (cm);Counts", {HistType::kTH1F, {{deltaZbins}}});
130+
registry.add("hDeltaX_NPV_gt", ";#DeltaX (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
131+
registry.add("hDeltaY_NPV_gt", ";#DeltaY (cm);Counts", {HistType::kTH1F, {{deltaXYbins}}});
132+
registry.add("hDeltaZ_NPV_gt", ";#DeltaZ (cm);Counts", {HistType::kTH1F, {{deltaZbins}}});
132133

133134
registry.add("hDeltaXSngBkg", ";#DeltaX (signal/bkg) (cm);Counts", {HistType::kTH1F, {{200, -10, 10}}});
134135
registry.add("hDeltaYSngBkg", ";#DeltaY (signal/bkg) (cm);Counts", {HistType::kTH1F, {{200, -10, 10}}});
@@ -141,18 +142,18 @@ struct HfTaskMcInjection {
141142

142143
bool isCharm(int pdg)
143144
{
144-
if (std::abs(pdg) / 1000 == PDG_t::kCharm)
145+
if (std::abs(pdg) / 1000 == PDG_t::kCharm) // o2-linter: disable=magic-number (get thousands digit)
145146
return true;
146-
if (std::abs(pdg) / 100 == PDG_t::kCharm)
147+
if (std::abs(pdg) / 100 == PDG_t::kCharm) // o2-linter: disable=magic-number (get hundreds digit)
147148
return true;
148149
return false;
149150
}
150151

151152
bool isBeauty(int pdg) // if needed in the future
152153
{
153-
if (std::abs(pdg) / 1000 == PDG_t::kBottom)
154+
if (std::abs(pdg) / 1000 == PDG_t::kBottom) // o2-linter: disable=magic-number (get thousands digit)
154155
return true;
155-
if (std::abs(pdg) / 100 == PDG_t::kBottom)
156+
if (std::abs(pdg) / 100 == PDG_t::kBottom) // o2-linter: disable=magic-number (get hundreds digit)
156157
return true;
157158
return false;
158159
}
@@ -201,15 +202,14 @@ struct HfTaskMcInjection {
201202
registry.fill(HIST("hDeltaY"), collision.posY() - collision.mcCollision().posY());
202203
registry.fill(HIST("hDeltaZ"), collision.posZ() - collision.mcCollision().posZ());
203204

204-
constexpr unsigned maxNcontrib{2000};
205-
if (collision.numContrib() > maxNcontrib) {
206-
registry.fill(HIST("hDeltaX_NPV_gt2000"), collision.posX() - collision.mcCollision().posX());
207-
registry.fill(HIST("hDeltaY_NPV_gt2000"), collision.posY() - collision.mcCollision().posY());
208-
registry.fill(HIST("hDeltaZ_NPV_gt2000"), collision.posZ() - collision.mcCollision().posZ());
205+
if (collision.numContrib() > nPvContribMaxForCollDelta) {
206+
registry.fill(HIST("hDeltaX_NPV_gt"), collision.posX() - collision.mcCollision().posX());
207+
registry.fill(HIST("hDeltaY_NPV_gt"), collision.posY() - collision.mcCollision().posY());
208+
registry.fill(HIST("hDeltaZ_NPV_gt"), collision.posZ() - collision.mcCollision().posZ());
209209
} else {
210-
registry.fill(HIST("hDeltaX_NPV_lt2000"), collision.posX() - collision.mcCollision().posX());
211-
registry.fill(HIST("hDeltaY_NPV_lt2000"), collision.posY() - collision.mcCollision().posY());
212-
registry.fill(HIST("hDeltaZ_NPV_lt2000"), collision.posZ() - collision.mcCollision().posZ());
210+
registry.fill(HIST("hDeltaX_NPV_lt"), collision.posX() - collision.mcCollision().posX());
211+
registry.fill(HIST("hDeltaY_NPV_lt"), collision.posY() - collision.mcCollision().posY());
212+
registry.fill(HIST("hDeltaZ_NPV_lt"), collision.posZ() - collision.mcCollision().posZ());
213213
}
214214
}
215215
std::unordered_set<int> charmIds{};

0 commit comments

Comments
 (0)