Skip to content

Commit 9cf7d18

Browse files
author
Mattia Faggin
committed
Add TF border cut.
1 parent 04426bb commit 9cf7d18

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

DPG/Tasks/AOTTrack/qaEfficiency.cxx

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ struct QaEfficiency {
231231
Configurable<bool> doPtEta{"doPtEta", false, "Flag to produce the efficiency vs pT and Eta"};
232232
Configurable<bool> doPtRadius{"doPtRadius", false, "Flag to produce the efficiency vs pT and Radius"};
233233
Configurable<int> applyEvSel{"applyEvSel", 0, "Flag to apply event selection: 0 -> no event selection, 1 -> Run 2 event selection, 2 -> Run 3 event selection"};
234+
Configurable<bool> applyTimeFrameBorderCut{"applyTimeFrameBorderCut", false, "Flag to apply the TF border cut"};
234235
// Custom track cuts for debug purposes
235236
TrackSelection customTrackCuts;
236237
struct : ConfigurableGroup {
@@ -264,6 +265,7 @@ struct QaEfficiency {
264265
using CollisionCandidatesMC = o2::soa::Join<CollisionCandidates, o2::aod::McCollisionLabels>;
265266
using TrackCandidates = o2::soa::Join<o2::aod::Tracks, o2::aod::TracksExtra, o2::aod::TrackSelection, o2::aod::TrackSelectionExtension, o2::aod::TracksDCA>;
266267
using TrackCandidatesMC = o2::soa::Join<TrackCandidates, o2::aod::McTrackLabels>;
268+
using BCsInfo = soa::Join<aod::BCs, aod::Timestamps, aod::BcSels>;
267269

268270
// Histograms
269271
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
@@ -972,6 +974,7 @@ struct QaEfficiency {
972974

973975
histos.get<TH1>(HIST("eventSelection"))->GetXaxis()->SetBinLabel(3, "Passed Contrib.");
974976
histos.get<TH1>(HIST("eventSelection"))->GetXaxis()->SetBinLabel(4, "Passed Position");
977+
histos.get<TH1>(HIST("eventSelection"))->GetXaxis()->SetBinLabel(5, "Passed Time Frame border cut");
975978

976979
if (doprocessMC) {
977980
histos.add("MC/generatedCollisions", "Generated Collisions", kTH1D, {{10, 0.5, 10.5, "Generated collisions"}});
@@ -1265,7 +1268,7 @@ struct QaEfficiency {
12651268
for (const auto& mother : mothers) {
12661269
for (const auto& pdgToCheck : mothersPDGs.value) {
12671270
if (mother.pdgCode() == pdgToCheck) {
1268-
motherIsAccepted = true; // Mother matches the list of specified PDGs
1271+
motherIsAccepted = true; // Mother matches the list of specified PDGs
12691272
hPtmotherGenerated[histogramIndex]->Fill(mother.pt()); // Fill generated pT for mother
12701273
break;
12711274
}
@@ -1454,6 +1457,12 @@ struct QaEfficiency {
14541457
if constexpr (doFillHistograms) {
14551458
histos.fill(HIST("eventSelection"), 4);
14561459
}
1460+
if (applyTimeFrameBorderCut && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
1461+
return false;
1462+
}
1463+
if constexpr (doFillHistograms) {
1464+
histos.fill(HIST("eventSelection"), 5);
1465+
}
14571466
return true;
14581467
}
14591468

@@ -1743,7 +1752,8 @@ struct QaEfficiency {
17431752
// o2::soa::SmallGroups<CollisionCandidatesMC> const& collisions,
17441753
CollisionCandidatesMC const& collisions,
17451754
TrackCandidatesMC const& tracks,
1746-
o2::aod::McParticles const& mcParticles)
1755+
o2::aod::McParticles const& mcParticles,
1756+
BCsInfo const&)
17471757
{
17481758

17491759
/// loop over generated collisions
@@ -1874,6 +1884,13 @@ struct QaEfficiency {
18741884
continue;
18751885
}
18761886
}
1887+
// apply time-frame border cut also to the generated collision
1888+
if (applyTimeFrameBorderCut) {
1889+
auto bc = mcCollision.bc_as<BCsInfo>();
1890+
if (!bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
1891+
continue;
1892+
}
1893+
}
18771894
}
18781895

18791896
/// only to fill denominator of ITS-TPC matched primary tracks only in MC events with at least 1 reco. vtx
@@ -1922,6 +1939,13 @@ struct QaEfficiency {
19221939
continue;
19231940
}
19241941
}
1942+
// apply time-frame border cut also to the generated collision
1943+
if (applyTimeFrameBorderCut) {
1944+
auto bc = mcCollision.bc_as<BCsInfo>();
1945+
if (!bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
1946+
continue;
1947+
}
1948+
}
19251949

19261950
// Loop on particles to fill the denominator
19271951
float dNdEta = 0; // Multiplicity
@@ -1976,7 +2000,8 @@ struct QaEfficiency {
19762000
void processMCWithoutCollisions(TrackCandidatesMC const& tracks,
19772001
o2::aod::Collisions const&,
19782002
o2::aod::McParticles const& mcParticles,
1979-
o2::aod::McCollisions const&)
2003+
o2::aod::McCollisions const&,
2004+
BCsInfo const&)
19802005
{
19812006
// Track loop
19822007
for (const auto& track : tracks) {
@@ -2028,6 +2053,14 @@ struct QaEfficiency {
20282053
continue;
20292054
}
20302055
}
2056+
// apply time-frame border cut also to the generated collision
2057+
if (applyTimeFrameBorderCut) {
2058+
const auto mcCollision = mcParticle.mcCollision();
2059+
auto bc = mcCollision.bc_as<BCsInfo>();
2060+
if (!bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
2061+
continue;
2062+
}
2063+
}
20312064

20322065
// search for particles from HF decays
20332066
if (keepOnlyHfParticles && !RecoDecay::getCharmHadronOrigin(mcParticles, mcParticle, /*searchUpToQuark*/ true)) {

0 commit comments

Comments
 (0)