Skip to content

Commit f4c33be

Browse files
committed
adding track occupancy
1 parent 5211022 commit f4c33be

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

PWGJE/TableProducer/slimTablesProducer.cxx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ struct SlimTablesProducer {
108108
Configurable<std::string> trackSelections{"trackSelections", "globalTracks", "set track selections; other option: uniformTracks"};
109109
Configurable<bool> skipMBGapEvents{"skipMBGapEvents", false, "flag to choose to reject min. bias gap events; jet-level rejection can also be applied at the jet finder level for jets only, here rejection is applied for collision and track process functions for the first time, and on jets in case it was set to false at the jet finder level"};
110110
Configurable<bool> applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"};
111-
111+
Configurable<int> trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum track occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"};
112+
Configurable<int> trackOccupancyInTimeRangeMin{"trackOccupancyInTimeRangeMin", -999999, "minimum track occupancy of tracks in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)"};
112113
std::vector<int> eventSelectionBits;
113114
Service<o2::framework::O2DatabasePDG> pdgDatabase;
114115
int trackSelection = -1;
@@ -125,12 +126,14 @@ struct SlimTablesProducer {
125126
auto hColl = histos.get<TH1>(HIST("h_collisions"));
126127
hColl->GetXaxis()->SetBinLabel(1, "All");
127128
hColl->GetXaxis()->SetBinLabel(2, "eventSelection");
129+
hColl->GetXaxis()->SetBinLabel(3, "occupancycut");
128130

129131
histos.add("h_mcCollMCD_counts_weight", "MC event status;event status;weighted entries", {HistType::kTH1F, {{5, 0.0, 5.0}}});
130132
auto hMCD = histos.get<TH1>(HIST("h_mcCollMCD_counts_weight"));
131133
hMCD->GetXaxis()->SetBinLabel(1, "All");
132134
hMCD->GetXaxis()->SetBinLabel(2, "hasMcCollision");
133135
hMCD->GetXaxis()->SetBinLabel(3, "selectCollision");
136+
hMCD->GetXaxis()->SetBinLabel(4, "occupancycut");
134137

135138
histos.add("h_mcCollMCP_counts_weight", "MC event status;event status;weighted entries", {HistType::kTH1F, {{7, 0.0, 7.0}}});
136139
auto hMCP = histos.get<TH1>(HIST("h_mcCollMCP_counts_weight"));
@@ -171,6 +174,10 @@ struct SlimTablesProducer {
171174
return;
172175
}
173176
histos.fill(HIST("h_collisions"), 1.5);
177+
if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) {
178+
return;
179+
}
180+
histos.fill(HIST("h_collisions"), 2.5);
174181
slimCollisions(collision.posZ(), collision.collisionTime(), 1.0);
175182
auto slimCollIndex = slimCollisions.lastIndex();
176183
for (const auto& track : tracks) {
@@ -211,6 +218,11 @@ struct SlimTablesProducer {
211218
continue;
212219
}
213220
histos.fill(HIST("h_mcCollMCD_counts_weight"), 2.5, eventWeightMC);
221+
// occupancy cut only applied to the reconstructed (MCD) collision, not to the mcCollision
222+
if (collision.trackOccupancyInTimeRange() < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange()) {
223+
continue;
224+
}
225+
histos.fill(HIST("h_mcCollMCD_counts_weight"), 3.5, eventWeightMC);
214226
slimCollisions(collision.posZ(), collision.collisionTime(), eventWeight);
215227
auto slimCollIndex = slimCollisions.lastIndex();
216228
auto slicedTracks = tracks.sliceBy(perCollisionTracks, collision.globalIndex()); // tracks associated to the rec collision

0 commit comments

Comments
 (0)