Skip to content

Commit c714963

Browse files
authored
[PWGJE] Add event count histograms (#11139)
1 parent d86e06e commit c714963

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

PWGJE/Tasks/dijetFinderQA.cxx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct DijetFinderQATask {
7777
{
7878
eventSelection = jetderiveddatautilities::initialiseEventSelectionBits(static_cast<std::string>(eventSelections));
7979
trackSelection = jetderiveddatautilities::initialiseTrackSelection(static_cast<std::string>(trackSelections));
80+
// Add histogram for event counts
8081

8182
auto dijetMassTemp = 0.0;
8283
while (dijetMassTemp <= 2 * jetPtMax) {
@@ -85,17 +86,21 @@ struct DijetFinderQATask {
8586
}
8687

8788
AxisSpec dijetMassAxis = {dijetMassBins, "M_{jj} (GeV/#it{c}^2)"};
89+
AxisSpec eventCountAxis = {{0.5, 1.5}, "events"};
8890

8991
if (doprocessDijetMCP) {
9092
registry.add("h_part_dijet_mass", "Dijet invariant mass;;entries", {HistType::kTH1F, {dijetMassAxis}});
93+
registry.add("hColCounterFinal_MCP", "Event count;;entries", {HistType::kTH1F, {eventCountAxis}});
9194
}
9295

9396
if (doprocessDijetMCD) {
9497
registry.add("h_detec_dijet_mass", "Dijet invariant mass;;entries", {HistType::kTH1F, {dijetMassAxis}});
98+
registry.add("hColCounterFinal_MCD", "Event count;;entries", {HistType::kTH1F, {eventCountAxis}});
9599
}
96100

97101
if (doprocessDijetData) {
98102
registry.add("h_data_dijet_mass", "Dijet invariant mass;;entries", {HistType::kTH1F, {dijetMassAxis}});
103+
registry.add("hColCounterFinal_Data", "Event count;;entries", {HistType::kTH1F, {eventCountAxis}});
99104
}
100105

101106
if (doprocessDijetMCMatched) {
@@ -175,8 +180,18 @@ struct DijetFinderQATask {
175180
}
176181
PROCESS_SWITCH(DijetFinderQATask, processDummy, "dummy", false);
177182

178-
void processDijetMCP(soa::Filtered<aod::JetMcCollisions>::iterator const&, soa::Filtered<aod::ChargedMCParticleLevelJets> const& jets)
183+
void processDijetMCP(soa::Filtered<aod::JetMcCollisions>::iterator const&, soa::Filtered<aod::ChargedMCParticleLevelJets> const& jets, soa::SmallGroups<aod::JetCollisionsMCD> const& collisions)
179184
{
185+
if (collisions.size() == 0) {
186+
return;
187+
}
188+
for (auto& collision : collisions) {
189+
if (fabs(collision.posZ()) > vertexZCut || !jetderiveddatautilities::selectCollision(collision, eventSelection))
190+
return;
191+
}
192+
193+
registry.fill(HIST("hColCounterFinal_MCP"), 1);
194+
180195
std::vector<std::array<double, 3>> jetPtcuts;
181196
for (auto& jet : jets) {
182197
jetPtcuts.push_back({jet.pt(), jet.eta(), jet.phi()});
@@ -209,6 +224,9 @@ struct DijetFinderQATask {
209224
if (!jetderiveddatautilities::selectCollision(collision, eventSelection)) {
210225
return;
211226
}
227+
228+
registry.fill(HIST("hColCounterFinal_MCD"), 1);
229+
212230
std::vector<std::array<double, 3>> jetPtcuts;
213231
for (auto& jet : jets) {
214232
jetPtcuts.push_back({jet.pt(), jet.eta(), jet.phi()});
@@ -242,6 +260,9 @@ struct DijetFinderQATask {
242260
return;
243261
}
244262

263+
// Fill event count histogram
264+
registry.fill(HIST("hColCounterFinal_Data"), 1);
265+
245266
std::vector<std::array<double, 3>> jetPtcuts;
246267
for (auto& jet : jets) {
247268
jetPtcuts.push_back({jet.pt(), jet.eta(), jet.phi()});

0 commit comments

Comments
 (0)